diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2d28d19f8c..0380b02e1e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -47,6 +47,8 @@ /types/aframe/ @devpaul @bertoritger @twastvedt /types/agenda/ @meirgottlieb @princjef /types/aggregate-error/ @BendingBender +/types/agora-rtc-sdk/ @menthays +/types/ajv-errors/ @afshawnlotfi /types/alertify/ @jjeffery /types/alexa-sdk/ @petebeegle @hoo29 @pascalwhoop @blforce @rk-7 @alexmalcoci /types/alexa-voice-service/ @dolanmiu @@ -64,11 +66,12 @@ /types/amplify-deferred/ @joeriks @laurentiustamate94 /types/amplitude-js/ @Asido /types/amqp/ @seikho @jonnysparkplugs +/types/amqp-connection-manager/ @rogierschouten /types/amqp-rpc/ @wokim /types/amqplib/ @mnahkies @abreits @nfantone @zelein /types/analytics-node/ @fongandrew @thomasthiebaud /types/anchor-js/ @xt0rted -/types/angular/ @diegovilar @thorn0 @calebstdenis @leonard-thieu +/types/angular/ @diegovilar @thorn0 @calebstdenis @leonard-thieu @scipper /types/angular-agility/ @rolandzwaga /types/angular-animate/ @michelsalib @adidahiya @rasch @codyschaaf /types/angular-block-ui/ @lassebn @sclassen @@ -146,6 +149,7 @@ /types/ansi-regex/ @mvachhar /types/ansi-styles/ @brynbellomy @plylrnsdy /types/ansicolors/ @rogierschouten +/types/antlr4/ @mcchatman8009 /types/any-db/ @rogierschouten /types/any-db-transaction/ @rogierschouten /types/anybar/ @khoomeister @@ -155,7 +159,8 @@ /types/api-error-handler/ @tkrotoff /types/apicache/ @danielsogl /types/apigee-access/ @CasperSkydt -/types/apollo-codegen/ @bradleyayers +/types/apollo-codegen/ @bradleyayers @kostspielig +/types/apollo-upload-client/ @Slessi /types/app-root-dir/ @chenyang-biu /types/app-root-path/ @shantmarouti /types/appdmg/ @unindented @@ -174,7 +179,7 @@ /types/archy/ @vvakame /types/are-we-there-yet/ @brianloveswords /types/argon2-browser/ @ivangabriele -/types/argparse/ @arcticwaters @tlaziuk +/types/argparse/ @arcticwaters @tlaziuk @eps1lon /types/args/ @Slessi /types/argv/ @hookclaw /types/arr-union/ @mrmlnc @@ -185,6 +190,7 @@ /types/arrify/ @wanganjun /types/artillery/ @kmccoan-allocadia /types/asana/ @tkqubo +/types/asap/ @fpascutti /types/ascii2mathml/ @RagibHasin /types/asenv/ @remisery /types/asn1js/ @microshine @@ -205,6 +211,7 @@ /types/atlaskit__inline-edit/ @lstanden /types/atlaskit__layer/ @lstanden /types/atlaskit__single-select/ @lstanden +/types/atlassian-crowd-client/ @mtgto /types/atmosphere.js/ @toedter @Mory1879 @Scipion /types/atob/ @johngeorgewright /types/atom/ @GlenCFL @smhxx @lierdakil @@ -227,10 +234,12 @@ /types/autosuggest-highlight/ @senukartur /types/awesomplete/ @webbiesdk @bmdixon @tbekolay @chrislopresto /types/aws-iot-device-sdk/ @niik @mlamp -/types/aws-lambda/ @skarum @tobyhede @buggy @y13i @wwwy3y3 @OrthoDex @MichaelMarner @daniel-cottone @kostya-misura @coderbyheart @palmithor @daniloraisi @simonbuchan @Haydabase @repl-chris @aneilbaboo +/types/aws-lambda/ @skarum @tobyhede @buggy @y13i @wwwy3y3 @OrthoDex @MichaelMarner @daniel-cottone @kostya-misura @coderbyheart @palmithor @daniloraisi @simonbuchan @Haydabase @repl-chris @aneilbaboo @jeznag /types/aws-serverless-express/ @threesquared @jcaffey @mattmeye @albertovasquez /types/aws4/ @ajcrites +/types/axe-webdriverjs/ @JoshuaKGoldberg /types/axel/ @ruslan-molodyko +/types/axios-token-interceptor/ @innovation-team /types/axon/ @jewbre /types/azure/ @AndrewGaspar @antiveeranna @SomaticIT /types/azure-mobile-services-client/ @dmorosinotto @@ -242,7 +251,7 @@ /types/babel-plugin-react-pug/ @jpap /types/babel-plugin-syntax-jsx/ @marvinhagemeister /types/babel-template/ @yortus @marvinhagemeister -/types/babel-traverse/ @yortus @marvinhagemeister +/types/babel-traverse/ @yortus @marvinhagemeister @rpetrich /types/babel-types/ @yortus @baxtersa @marvinhagemeister @bcherny /types/babel-webpack-plugin/ @j-f1 /types/babel__code-frame/ @mohsen1 @ForbesLindesay @@ -250,7 +259,7 @@ /types/babylon/ @yortus @marvinhagemeister /types/babylon-walk/ @czbuchi /types/babyparse/ @cdiddy77 -/types/backbone/ @borisyankov @nvivo +/types/backbone/ @borisyankov @nvivo @kenjiru /types/backbone-associations/ @craigbrett17 /types/backbone-fetch-cache/ @delphinus35 /types/backbone-relational/ @eirikhm @@ -261,6 +270,7 @@ /types/backbone.radio/ @alphaleonis /types/backgrid/ @jlujan /types/backlog-js/ @vvatanabe +/types/backo2/ @Retsam /types/backoff/ @BendingBender /types/baconjs/ @alexander-matsievsky @gekkio /types/bagpipes/ @micmro @@ -285,6 +295,7 @@ /types/behavior3/ @carrrywu /types/bell/ @SimonSchick /types/bem-cn/ @selkinvitaly +/types/bencode/ @tobenna /types/better-curry/ @pocesar /types/better-sqlite3/ @Morfent @matrumz /types/bezier-easing/ @ptlis @@ -296,6 +307,7 @@ /types/bigint/ @Evgenus /types/bignum/ @Patman64 /types/bigscreen/ @dduugg +/types/bin-pack/ @orentrutner /types/binary-parser/ @riggs @dolanmiu /types/bind-ponyfill/ @skysteve /types/bindings/ @unindented @@ -327,7 +339,7 @@ /types/bluebird-global/ @d-ph /types/bluebird-retry/ @pvomhoff /types/blueimp-md5/ @rmartone @mkohlmyr -/types/bn.js/ @LogvinovLeon +/types/bn.js/ @LogvinovLeon @HenryNguyen5 /types/body-parser/ @santialbo @vilic @dreampulse @blendsdk @tlaziuk @jwalton /types/body-parser-xml/ @tbounsiar /types/bonjour/ @quentin-ol @octo-sniffle @@ -359,6 +371,7 @@ /types/bootstrap3-dialog/ @nakupanda @cnboland /types/bounce.js/ @cherrry /types/box2d/ @jbaldwin +/types/bpmn-moddle/ @haydos89 /types/brace-expansion/ @BendingBender /types/braces/ @vemoo /types/braft-editor/ @me @@ -380,11 +393,13 @@ /types/bucks/ @zaneli /types/buffer-compare/ @chrootsu /types/buffer-equal/ @Bartvds +/types/buffer-from/ @burnnat +/types/buffer-reader/ @nrlquaker /types/buffers/ @rhencke /types/bufferstream/ @Bartvds /types/builtin-modules/ @ajafff /types/bull/v2/ @bgrieder @JProgrammer -/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold @iamolegga +/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold @iamolegga @koblas /types/bump-regex/ @silkentrance /types/bunnymq/ @cyrilschumacher /types/bunyan/ @amikhalev @@ -426,6 +441,7 @@ /types/catbox/ @jasonswearingen @AJamesPhillips @saboya /types/cbor/ @pushplay /types/ccap/ @taoqf +/types/cesium/ @Zuzon @hnipps @szechyjs /types/chai/v2/ @Bartvds @AGBrown /types/chai/ @jedmao @Bartvds @AGBrown @olivr70 @mwistrand @joshuakgoldberg @shaunluttin @Naktibalda @micksatana @ErikSchierboom /types/chai-arrays/ @clementprevot @@ -439,7 +455,7 @@ /types/chai-jquery/ @kazimanzurrashid /types/chai-json-schema/ @ulrichheiniger /types/chai-oequal/ @mizunashi-mana -/types/chai-spies/ @kuzn-ilya +/types/chai-spies/ @kuzn-ilya @harm-less @jounisuo /types/chai-string/ @nmalaguti /types/chai-subset/ @delta62 @AGBrown /types/chai-uuid/ @harm-less @@ -450,14 +466,14 @@ /types/chardet/ @Gebatzens /types/charm/ @Xananax /types/charset/ @cspotcode -/types/chart.js/ @anuti @FabienLavocat @KentarouTakeda @larrybahr @mernen @josefpaij @danmana @guillaume-ro-fr @chicoxyzzy @archy-bold @braincore -/types/chartist/ @mtgibbs @psimonski @clottman @affilnost +/types/chart.js/ @anuti @FabienLavocat @KentarouTakeda @larrybahr @mernen @josefpaij @danmana @guillaume-ro-fr @chicoxyzzy @archy-bold @braincore @gebeto @frabnt @alexdor +/types/chartist/ @mtgibbs @psimonski @clottman @affilnost @sunnyrjuneja /types/chayns/ @HenningKuehl /types/check-sum/ @BendingBender /types/check-types/ @idchlife /types/checkstyle-formatter/ @mhegazy /types/checksum/ @rogierschouten -/types/cheerio/ @blittle @wmaurer @umarniz @LiJinyao +/types/cheerio/ @blittle @wmaurer @umarniz @LiJinyao @chennakrishna8 /types/chessboardjs/ @sliverb @davidmpaz /types/chmodr/ @BendingBender /types/chokidar/ @reppners @felixfbecker @bayssmekanique @@ -466,6 +482,9 @@ /types/chroma-js/v0/ @invliD /types/chroma-js/ @invliD @mpacholec /types/chrome/ @matthewkimber @otiai10 @couven92 @rreverser @sreimer15 +/types/chrome-apps/ @niikoo @AdamLay @pine613 @mzsm @RReverser @pyle @matthewkimber @otiai10 @couven92 @rreverser @sreimer15 +/types/chromecast-caf-receiver/ @craigrbruce +/types/chromecast-caf-sender/ @samuelmaddock /types/chromedriver/ @pe8ter /types/circuit-breaker-js/ @DeTeam /types/circular-json/ @jpevarnek @@ -509,7 +528,7 @@ /types/co-body/ @geoffreak /types/co-views/ @devlee @geoffreak /types/code/ @prashaantt -/types/codemirror/ @mihailik @nrbernard @Pr1st0n +/types/codemirror/ @mihailik @nrbernard @Pr1st0n @rileymiller /types/codependency/ @morphatic /types/coffeeify/ @tkQubo /types/coinbase/ @rogierschouten @@ -525,6 +544,7 @@ /types/color-string/ @BendingBender @danmarshall /types/colorbrewer/ @mtraynham /types/com.darktalker.cordova.screenshot/ @akarienta +/types/com.wikitude.phonegap.wikitudeplugin/ @zbarbuto /types/combine-source-map/ @TeamworkGuy2 /types/combined-stream/ @felixge @tlaziuk /types/combokeys/ @iclanton @@ -536,6 +556,7 @@ /types/commangular/ @hiraash /types/comment-json/ @Jason3S /types/common-errors/ @icopp +/types/common-prefix/ @seangenabe /types/common-tags/ @zuzusik @tzupengwang /types/commonmark/ @nicojs @leonard-thieu /types/compare-version/ @jpevarnek @@ -553,6 +574,7 @@ /types/conf/ @SamVerschueren @BendingBender /types/confidence/ @jppellerin /types/config/ @RWander @forrestbice @jndonald3 @albertovasquez +/types/config-yaml/ @me /types/configstore/ @ArcticLight /types/configurable/ @jewbre /types/confit/ @ethanresnick @@ -564,6 +586,7 @@ /types/connect-livereload/ @SomaticIT /types/connect-modrewrite/ @tinganho /types/connect-mongo/ @Syati +/types/connect-mongodb-session/ @NattapongSiri /types/connect-pg-simple/ @pasieronen /types/connect-redis/ @xstoudi @morcerf /types/connect-slashes/ @samherrmann @@ -585,6 +608,7 @@ /types/cookie-session/ @borislavjivkov /types/cookie-signature/ @lith-light-g /types/cookie_js/ @slawiko +/types/cookiejar/ @paroxp /types/cookies/ @WangZishi @jkeylu @BendingBender /types/copy-paste/ @SrTobi /types/copy-text-to-clipboard/ @BendingBender @@ -615,7 +639,7 @@ /types/correlation-id/ @natemara /types/cors/ @pluma /types/cosmiconfig/v4/ @ozum -/types/cosmiconfig/ @ozum @szeck87 @saadq +/types/cosmiconfig/ @ozum @szeck87 @saadq @jinwoo /types/cote/ @makepost /types/couchbase/ @maouida /types/countdown/ @gjuchault @@ -653,6 +677,7 @@ /types/css-font-loading-module/ @slikts /types/css-modules/ @NeekSandhu /types/cssbeautify/ @rictic +/types/csso/ @screendriver /types/csurf/ @horiuchi /types/csv-parse/ @davidm77 @obi-jan-kenobi /types/csv-stringify/ @rogierschouten @arjenvanderende @@ -732,6 +757,7 @@ /types/datatables.net-fixedheader/ @szechyjs @Silver-Connection /types/datatables.net-rowgroup/ @maixiu /types/datatables.net-rowreorder/ @baywet +/types/datatables.net-scroller/ @RohdeK /types/datatables.net-select/ @szechyjs /types/date-arithmetic/ @HeeL /types/date.format.js/ @balrob @@ -749,7 +775,7 @@ /types/debug/ @swook @galtalmor @zamb3zi /types/decamelize/ @samverschueren /types/decay/ @enaeseth -/types/decompress/ @plantain-00 +/types/decompress/ @plantain-00 @jbethke /types/decompress-response/ @DanielRosenwasser /types/decorum/ @dflor003 /types/dedent/ @douglasduteil @@ -772,6 +798,7 @@ /types/delaunator/ @DenisCarriere /types/delay/ @BendingBender /types/deline/ @iarroyo5 +/types/deluge/ @Diasiare /types/denodeify/ @joaomoreno /types/deoxxa-content-type/ @pine613 /types/depcheck/ @ark120202 @@ -792,6 +819,7 @@ /types/detect-port/ @lith-light-g /types/detect-touch-events/ @thomastilkema /types/detox/ @TareqElMasri +/types/devexpress-aspnetcore-bootstrap/ @devexpress @skubarenko /types/df-visible/ @Litee /types/dhtmlxgantt/ @mkozhukh @chriscamicas /types/dhtmlxscheduler/ @mkozhukh @@ -847,7 +875,7 @@ /types/dropboxjs/ @Steve-Fenton @xperiments /types/dropkickjs/ @VorobeY1326 /types/dropzone/v4/ @nvivo @outring @renuo @Hikariii -/types/dropzone/ @nvivo @outring @renuo @Hikariii @tedbcsgpro +/types/dropzone/ @nvivo @outring @renuo @Hikariii @tedbcsgpro @dwaxweiler /types/dts-generator/ @mtraynham /types/duplexer2/ @Goldsmith42 /types/duplexer3/ @BendingBender @@ -866,6 +894,7 @@ /types/each/ @misak113 /types/earcut/ @NaridaL /types/easeljs/ @evilangelist +/types/eases/ @MathiasPaumgarten /types/easy-api-request/ @DeadAlready /types/easy-jsend/ @DeadAlready /types/easy-session/ @DeadAlready @@ -874,6 +903,7 @@ /types/easy-xapi-utils/ @DeadAlready /types/ebongarde-root/ @Ebongarde /types/echarts/ @xieisabug @AntiMoron @liveangela +/types/ecma-proposal-math-extensions/ @ksm2 /types/ecurve/ @mhegazy /types/ed25519/ @erikma /types/ed2curve/ @ffflorian @@ -893,7 +923,7 @@ /types/electron-json-storage/ @stpettersens @nrlquaker @jbw91 /types/electron-notifications/ @djpereira /types/electron-notify/ @djpereira -/types/electron-packager/ @SomaticIT @cortopy @jkleinsc +/types/electron-packager/ @SomaticIT @cortopy @jkleinsc @shiftkey /types/electron-settings/v2/ @leonard-thieu /types/electron-settings/ @icopp @nrlquaker /types/electron-spellchecker/ @unindented @@ -907,31 +937,34 @@ /types/elm/ @thSoft /types/email-templates/ @cyrilschumacher @gurisko @blankstar85 /types/ember/v1/ @jedmao -/types/ember/ @jedmao @bttf @dwickern @chriskrycho @theroncross @mfeckie @alexlafroscia +/types/ember/ @jedmao @bttf @dwickern @chriskrycho @theroncross @mfeckie @alexlafroscia @mike-north /types/ember-data/ @dwickern @mike-north @chriskrycho /types/ember-feature-flags/ @tansongyang /types/ember-mocha/ @dwickern /types/ember-modal-dialog/ @tansongyang /types/ember-qunit/v2/ @dwickern /types/ember-qunit/ @dwickern +/types/ember-resolver/ @dfreeman /types/ember-test-helpers/ @dwickern /types/ember-testing-helpers/ @chriskrycho +/types/ember__test-helpers/ @dfreeman @jamescdavis /types/emissary/ @vvakame /types/emoji-mart/ @Kovensky +/types/emoji-regex/ @iKBAHT /types/emojione/ @dbrgn /types/empower/ @vvakame /types/emscripten/ @zakki @periklis /types/end-of-stream/ @strax /types/engine.io/ @KentarouTakeda /types/engine.io-client/ @KentarouTakeda -/types/enhanced-resolve/ @e-cloud @onigoetz +/types/enhanced-resolve/ @e-cloud @onigoetz @johnnyreilly /types/enigma.js/ @konne /types/enquire.js/ @screendriver /types/ent/ @rogierschouten /types/entities/ @aliceklipper /types/env-to-object/ @MugeSo /types/envify/ @tkQubo -/types/enzyme/ @MarianPalkus @NoHomey @jwbay @huhuanming @MartynasZilinskas @thovden +/types/enzyme/ @MarianPalkus @NoHomey @jwbay @huhuanming @MartynasZilinskas @thovden @hotell /types/enzyme-adapter-react-15/ @tkrotoff /types/enzyme-adapter-react-15.4/ @nali /types/enzyme-adapter-react-16/ @tkrotoff @@ -965,6 +998,7 @@ /types/estraverse/ @sanex3339 /types/estree/ @RReverser /types/etag/ @BendingBender +/types/ethereum-protocol/ @LogvinovLeon /types/ethereumjs-abi/ @LogvinovLeon /types/ethereumjs-tx/ @LogvinovLeon /types/ethereumjs-util/ @cortopy @@ -979,8 +1013,9 @@ /types/event-stream/ @flcdrg /types/event-to-promise/ @flying-sheep /types/events/ @yasupeke -/types/eventsource/ @scottleedavis +/types/eventsource/ @scottleedavis @afroozeh /types/evernote/ @corps +/types/ex-react-native-i18n/ @maplerichie /types/excel-style-dataformatter/ @SanderDeWaal1992 /types/exceljs/ @rogierschouten @alitaheri /types/execa/ @douglasduteil @BendingBender @borekb @mickdekkers @@ -989,13 +1024,15 @@ /types/exit-hook/ @BendingBender /types/exorcist/ @TeamworkGuy2 /types/expect/ @jmreidy @merrywhether -/types/expect-puppeteer/ @JoshuaKGoldberg +/types/expect-puppeteer/ @JoshuaKGoldberg @tkrotoff /types/expect.js/ @teppeis /types/expectations/ @vvakame /types/expo/v23/ @KonstantinKai /types/expo/v24/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger /types/expo/v25/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov -/types/expo/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov +/types/expo/v26/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @tinaroh +/types/expo/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki +/types/expo__status-bar-height/ @dawnmist /types/expo__vector-icons/ @incleaf /types/express/ @borisyankov /types/express-brute/ @cyrilschumacher @@ -1031,6 +1068,7 @@ /types/express-partials/ @jt000 /types/express-promise-router/ @wanganjun /types/express-rate-limit/ @cyrilschumacher @makepost +/types/express-redis-cache/ @ajliv /types/express-route-fs/ @kripod /types/express-routemap/ @icopp /types/express-sanitized/ @cjbarth @@ -1041,7 +1079,7 @@ /types/express-unless/ @wokim /types/express-winston/ @bricka /types/express-ws/ @ajliv -/types/express-xml-bodyparser/ @noticeMaker +/types/express-xml-bodyparser/ @noticeMaker @macedigital /types/extend/ @reppners /types/extjs/ @brian428 /types/extract-files/ @Slessi @@ -1053,7 +1091,7 @@ /types/f1/ @neolwc /types/fabric/ @oklemencic @joewashear007 @mrand01 @NotWoods @bmartinson @RogerioTeixeira /types/facebook-instant-games/ @menushka @oyvindjam -/types/facebook-js-sdk/ @amritk +/types/facebook-js-sdk/ @amritk @mahmoudzohdi /types/facebook-pixel/ @noctishsu /types/faker/v3/ @Kuniwak /types/faker/ @bensw @basp @Kuniwak @mattbishop @@ -1099,7 +1137,7 @@ /types/fetch-jsonp/ @tkrotoff /types/fetch-mock/ @asvetliakov @tamird @merrywhether @chrissinclair @matttennison @quentinbouygues /types/fetch.io/ @newraina -/types/ffi/ @loyd +/types/ffi/ @loyd @waitingsong /types/ffmpeg-static/ @iamstevetran /types/ffprobe-static/ @iamstevetran /types/fhir-js-client/ @rmchndrng @@ -1348,6 +1386,7 @@ /types/geetest/ @plantain-00 /types/gen-readlines/ @CodeAnimal /types/generate-changelog/ @ffflorian +/types/generate-json-webpack-plugin/ @rynclark /types/generic-functions/ @stpettersens /types/generic-pool/ @jerray @wrboyce /types/gently/ @bonnici @@ -1358,6 +1397,7 @@ /types/geometry-dom/ @nakakura /types/geopattern/ @Gaelan /types/get-caller-file/ @ajafff +/types/get-folder-size/ @mszczepanczyk /types/get-node-dimensions/ @vincekovacs /types/get-stdin/ @DanielRosenwasser /types/get-stream/ @douglasduteil @BendingBender @@ -1369,6 +1409,7 @@ /types/gijgo/ @atatanasov /types/giraffe/ @darthapo /types/git/ @vvakame +/types/git-branch/ @rynclark /types/git-config/ @stpettersens /types/git-remote-origin-url/ @janslow /types/github-username-regex/ @BehindTheMath @@ -1383,6 +1424,7 @@ /types/glob-expand/ @vvakame /types/glob-parent/ @mrmlnc /types/glob-stream/ @Bartvds @mrmlnc +/types/glob-to-regexp/ @whatasoda /types/global-tunnel-ng/ @BendingBender /types/globalize/ @gcastre @afromogli /types/globalize-compiler/ @iclanton @@ -1395,8 +1437,8 @@ /types/google-apps-script/ @motemen @grant /types/google-apps-script-oauth2/ @dhayab /types/google-cloud__datastore/ @beaulac -/types/google-cloud__pubsub/ @pheromonez -/types/google-cloud__storage/ @blove @nbperry +/types/google-cloud__pubsub/ @pheromonez @LunaPg +/types/google-cloud__storage/ @blove @nbperry @welkie /types/google-earth/ @icholy /types/google-images/ @dolanmiu /types/google-libphonenumber/ @leonyu @winfinit @@ -1409,15 +1451,16 @@ /types/google.geolocation/ @vbortone /types/google.picker/ @grapswiz /types/google.visualization/ @danludwig @gmoore-sjcorg @danmana @mlcheng @IvanBisultanov @glebm -/types/googlemaps/ @cgwrench @nertzy @xaolas @mrmcnerd @martincostello @svenkreiss +/types/googlemaps/ @cgwrench @nertzy @xaolas @mrmcnerd @martincostello @svenkreiss @bolatovumar /types/googlemaps.infobubble/ @Dashue /types/googlepay/ @Fluccioni /types/got/ @BendingBender @LinusU @ikokostya /types/graceful-fs/v2/ @Bartvds /types/graceful-fs/ @Bartvds @BendingBender /types/graham_scan/ @hberntsen +/types/gramps__rest-helpers/ @claude /types/graphite-udp/ @EricByers -/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal @tgriesser @dyst5422 @adnsio @divyenduz @bradzacher +/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal @tgriesser @dyst5422 @adnsio @divyenduz @bradzacher @clayne11 /types/graphql-date/ @enaeseth /types/graphql-deduplicator/ @lfades /types/graphql-depth-limit/ @eritikass @@ -1432,7 +1475,7 @@ /types/gravatar-url/ @ivangabriele /types/greasemonkey/ @kotas /types/grecaptcha/v0/ @brentj73 -/types/grecaptcha/ @DethAriel +/types/grecaptcha/ @DethAriel @rafaeltavares /types/gregorian-calendar/ @cwalv /types/grid-styled/ @antonvasin @vittorio @lhache /types/gridfs-stream/ @liorm @@ -1501,6 +1544,7 @@ /types/gulp-shell/ @tkqubo /types/gulp-size/ @tkrotoff @remisery /types/gulp-sort/ @joeskeen +/types/gulp-strip-comments/ @Aqours /types/gulp-strip-debug/ @peterjuras /types/gulp-svg-sprite/ @tkqubo /types/gulp-svgmin/ @Aankhen @@ -1530,6 +1574,7 @@ /types/hapi-decorators/ @kenhowardpdx /types/har-format/ @micmro /types/hard-rejection/ @BendingBender +/types/hard-source-webpack-plugin/ @woitechen /types/harmony-proxy/ @remojansen /types/has-ansi/ @BendingBender /types/hash-file/ @HiromiShikata @@ -1557,9 +1602,10 @@ /types/hexo-bunyan/ @segayuu /types/hexo-fs/ @segayuu /types/hexo-log/ @segayuu +/types/hexo-util/ @segayuu /types/highcharts/ @damianog @baltie @AlbertOzimek @hanssens /types/highcharts-ng/ @scatcher -/types/highland/ @Bartvds @hgwood @iwllyu @alvis +/types/highland/ @Bartvds @hgwood @iwllyu @alvis @notbobthebuilder /types/highlight.js/ @nikeee @sourrust @joshuakgoldberg /types/hiredis/ @titan /types/history/v2/ @sergey-buturlakin @ngbrown @@ -1593,9 +1639,12 @@ /types/http-codes/ @mhegazy /types/http-context/ @mtraynham /types/http-errors/ @tkrotoff @BendingBender +/types/http-graceful-shutdown/ @dlee-nvisia +/types/http-link-header/ @screendriver /types/http-proxy/ @SomaticIT @Raigen @DanielMSchmidt /types/http-proxy-agent/ @mrmlnc /types/http-proxy-middleware/ @zebMcCorkle @BendingBender +/types/http-rx/ @L2jLiga /types/http-server/ @plantain-00 /types/http-status/ @misak113 /types/http-string-parser/ @pine613 @@ -1618,6 +1667,7 @@ /types/i18next-browser-languagedetector/v0/ @cyrilschumacher @GiedriusGrabauskas /types/i18next-browser-languagedetector/ @cyrilschumacher @GiedriusGrabauskas /types/i18next-express-middleware/ @cyrilschumacher +/types/i18next-ko/ @dwaxweiler /types/i18next-node-fs-backend/ @cyrilschumacher /types/i18next-sprintf-postprocessor/ @cyrilschumacher /types/i18next-xhr-backend/ @jamuhl @GiedriusGrabauskas @@ -1646,9 +1696,11 @@ /types/imap/ @psnider /types/imap-simple/ @pushplay /types/imgur-rest-api/ @lukewestby +/types/imperium/ @gaetansenn /types/impress/ @borisyankov /types/in-app-purchase/ @l-jonas /types/in-range/ @DanielRosenwasser +/types/inboxsdk/ @rdoursenaud @amiram /types/incremental-dom/ @basarat @lanthaler @vvakame /types/indent-string/ @mhegazy /types/inert/v4/ @nycdotnet @AJamesPhillips @@ -1660,25 +1712,26 @@ /types/iniparser/ @chrootsu /types/inline-css/ @philipisapain /types/inline-style-prefixer/ @ahz @dpetrezselyova -/types/inquirer/ @tkQubo @ppathan @jouderianjr @bang88 @bitjson @synarque @jrockwood +/types/inquirer/ @tkQubo @ppathan @jouderianjr @bang88 @bitjson @synarque @jrockwood @kwkelly /types/insert-module-globals/ @leonard-thieu /types/insight/ @vvakame /types/integer/ @Morfent /types/interact.js/ @dduugg @adidahiya @thasner -/types/intercom-client/ @jineshshah36 +/types/intercom-client/ @jineshshah36 @peping /types/intercom-web/ @fongandrew @salbahra @onatm /types/intercomjs/ @spencerwi /types/internal-ip/ @BendingBender /types/intl/ @RagibHasin +/types/intl-locales-supported/ @Slessi /types/intl-messageformat/ @mhegazy /types/intl-tel-input/ @fdnhkj @leonard-thieu /types/into-stream/ @BendingBender /types/intro.js/ @anahkiasen /types/invariant/ @bennett000 /types/inversify-devtools/ @inversify -/types/ion.rangeslider/v1/ @dduugg -/types/ion.rangeslider/ @sixinli -/types/ioredis/ @plantain-00 @chrisleck @aliarham11 @br8h @shaharmor +/types/ion-rangeslider/v1/ @dduugg @Karel-van-de-Plassche +/types/ion-rangeslider/ @Karel-van-de-Plassche +/types/ioredis/ @plantain-00 @chrisleck @aliarham11 @br8h @shaharmor @palindrom615 /types/iota.lib.js/ @fogsh /types/ip/ @codeanimal /types/ip-regex/ @unindented @@ -1714,6 +1767,7 @@ /types/is-stream/ @me /types/is-svg/ @BendingBender /types/is-text-path/ @mhegazy +/types/is-touch-device/ @screendriver /types/is-url/ @RyotaMurohoshi /types/is-url-superb/ @kryops /types/is-windows/ @mizunashi-mana @@ -1762,11 +1816,11 @@ /types/jdataview/ @RReverser /types/jdenticon/ @mtr /types/jest/v16/ @NoHomey @jwbay -/types/jest/ @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil @AhnpGit @joshuakgoldberg @bradleyayers +/types/jest/ @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil @ahnpnl @joshuakgoldberg @UselessPickles @r3nya @hotell /types/jest-axe/ @JoshuaKGoldberg /types/jest-diff/ @myabc /types/jest-docblock/ @ikatyang -/types/jest-each/ @theutz +/types/jest-each/ @theutz @nickmccurdy /types/jest-environment-puppeteer/ @joshuakgoldberg /types/jest-get-type/ @myabc /types/jest-image-snapshot/ @dawnmist @@ -1783,9 +1837,10 @@ /types/johnny-five/ @nakakura @ujvzolee @workshop2 /types/joi/v6/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW /types/joi/v10/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @aconanlai -/types/joi/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @dankraus @wanganjun @rafaelkallis @aconanlai +/types/joi/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @dankraus @wanganjun @rafaelkallis @aconanlai @zaphoyd /types/joigoose/ @boothwhack /types/josa/ @vichyssoise +/types/jotform-css.js/ @pandawood /types/jpeg-js/ @DanielRosenwasser /types/jpegtran-bin/ @hikoma /types/jpm/ @github-account-because-they-want-it @@ -1796,6 +1851,7 @@ /types/jquery/ @leonard-thieu @borisyankov @choffmeister @Steve-Fenton @Diullei @tasoili @jasons-novaleaf @seanski @Guuz @ksummerlin @basarat @nwolverson @derekcicerone @AndrewGaspar @seikichi @benjaminjackman @s093294 @JoshStrobl @johnnyreilly @DickvdBrink @King2500 /types/jquery-ajax-chain/ @humana-fragilitas /types/jquery-alertable/ @stever +/types/jquery-animate-scroll/ @AndersonFriaca /types/jquery-awesome-cursor/ @zskovacs /types/jquery-backstretch/ @dkulyk /types/jquery-countdown/ @AndersonFriaca @@ -1809,6 +1865,7 @@ /types/jquery-focusable/ @AndersonFriaca /types/jquery-fullscreen/ @bgrieder /types/jquery-galleria/ @rimig +/types/jquery-gray/ @AndersonFriaca /types/jquery-handsontable/ @intelorca /types/jquery-jcrop/ @joeskeen /types/jquery-jsonrpcclient/ @Ty3uK @@ -1818,7 +1875,8 @@ /types/jquery-mask-plugin/ @avidenic @AndersonFriaca /types/jquery-maskmoney/ @AndersonFriaca /types/jquery-match-height/ @kbytesys -/types/jquery-mockjax/ @laszlojakab @vladeck +/types/jquery-mockjax/ @laszlojakab @vladeck @hasaki +/types/jquery-mouse-exit/ @AndersonFriaca /types/jquery-mousewheel/ @xt0rted /types/jquery-next-id/ @AndersonFriaca /types/jquery-notifier/ @allipierre @@ -1829,6 +1887,7 @@ /types/jquery-sticky/ @maixiu /types/jquery-tags-input/ @AndersonFriaca /types/jquery-timeentry/ @marknadig +/types/jquery-toast-plugin/ @viqashussain /types/jquery-toastmessage-plugin/ @joeskeen /types/jquery-truncate-html/ @abraaoalves /types/jquery-urlparam/ @stpettersens @@ -1852,7 +1911,7 @@ /types/jquery.dropotron/ @cyrilschumacher /types/jquery.dynatree/ @fdecampredon /types/jquery.elang/ @sumegizoltan -/types/jquery.fancytree/ @alphaleonis @abedi-ir @Nitecube +/types/jquery.fancytree/ @alphaleonis @abedi-ir @niikoo @Nitecube /types/jquery.filtertable/ @totpero /types/jquery.finger/ @maxackley /types/jquery.flagstrap/ @felipedgarcia @@ -1865,6 +1924,7 @@ /types/jquery.jsignature/ @pjmagee /types/jquery.leanmodal/ @FinelySliced /types/jquery.livestampjs/ @vbortone +/types/jquery.nicescroll/ @Wkalmar /types/jquery.notify/ @evil-shrike /types/jquery.notifybar/ @zaneli /types/jquery.noty/ @kingdango @thelfensdrfer @@ -1933,7 +1993,7 @@ /types/jsend/ @CaselIT /types/jsesc/ @Bartvds /types/jsfl/ @soywiz -/types/jsforce/ @dolanmiu @netes @amphro @tnoonan-salesforce +/types/jsforce/ @dolanmiu @netes @amphro @tnoonan-salesforce @whiteabelincoln /types/jshamcrest/ @dharkness /types/jsmockito/ @shiver-me-timbers /types/jsnox/ @stkb @DovydasNavickas @@ -1941,6 +2001,7 @@ /types/json-merge-patch/ @senyaarseniy /types/json-parse-better-errors/ @DanielRosenwasser /types/json-patch/ @vvakame +/types/json-patch-gen/ @RohdeK /types/json-pointer/ @Bartvds /types/json-query/ @mtraynham /types/json-rpc-ws/ @npenin @mlamp @@ -1970,6 +2031,7 @@ /types/jsqrcode/ @lordazzi /types/jsrender/ @zakki /types/jsreport-core/ @taoqf +/types/jsreport-html-to-xlsx/v1/ @me /types/jsreport-html-to-xlsx/ @me /types/jsreport-jsrender/ @taoqf /types/jsreport-phantom-pdf/ @taoqf @@ -2004,13 +2066,14 @@ /types/karma-chai/ @JayAndCatchFire /types/karma-chai-sinon/ @vasek17 /types/karma-coverage/ @tkrotoff -/types/karma-fixture/ @evictor +/types/karma-fixture/ @evictor @afshawnlotfi /types/karma-jasmine/ @michelsalib /types/karma-viewport/ @karak /types/karma-webpack/ @mtraynham /types/katex/ @mrand01 /types/kcors/ @Xstoudi @izayoiko /types/kdbush/ @DenisCarriere +/types/keen-tracking/ @rui-ferreira /types/kefir/ @AyaMorisawa @HitoriSensei /types/kendo-ui/ @telerik /types/keyboardjs/ @vbortone @piranha771 @@ -2049,7 +2112,7 @@ /types/ko.plus/ @conficient /types/koa/ @DavidCai1993 @jkeylu @brikou /types/koa-basic-auth/ @Tobias4872 -/types/koa-bodyparser/ @hellopao +/types/koa-bodyparser/ @hellopao @anup-2s /types/koa-cache-control/ @pe8ter /types/koa-compose/ @jkeylu /types/koa-compress/ @hellopao @@ -2074,22 +2137,23 @@ /types/koa-range/ @strax /types/koa-redis/ @nsimmons /types/koa-response-time/ @thorsedeke -/types/koa-route/ @migstopheles -/types/koa-router/ @hellopao @schfkt +/types/koa-route/ @migstopheles @jacogr +/types/koa-router/ @hellopao @schfkt @JounQin /types/koa-send/ @pe8ter @tlaziuk /types/koa-session/ @kerol2r20 @tlaziuk /types/koa-session-minimal/ @longztian /types/koa-sslify/ @wingsbob /types/koa-static/ @hellopao @tlaziuk +/types/koa-static-cache/ @JounQin /types/koa-views/ @brooklyndev -/types/koa-webpack/ @malj -/types/koa-websocket/ @me +/types/koa-webpack/ @malj @leebenson @miZyind @tlaziuk +/types/koa-websocket/ @moimael @jacogr /types/koa-xml-body/ @uwinkelvos /types/koa2-cors/ @xialeistudio /types/koa__cors/ @Xstoudi @izayoiko @stevehipwell /types/kolite/ @borisyankov /types/konami.js/ @mareek -/types/kraken-js/ @darkwebdev +/types/kraken-js/ @darkwebdev @micksatana /types/kramed/ @tonicblue /types/kss/ @giladgray /types/kue/ @drudge @amiram @pc-jedi @deerawan @@ -2137,7 +2201,7 @@ /types/leapmotionts/ @logotype /types/legal-eagle/ @j-f1 /types/lerna-get-packages/ @LogvinovLeon -/types/less/ @thasner @pranaygp +/types/less/ @thasner @pranaygp @dwaxweiler /types/less-middleware/ @federicobond /types/less2sass/ @gatimus /types/lestate/ @thelambdaparty @@ -2147,13 +2211,15 @@ /types/leven/ @jmalonzo /types/levenshtein/ @geoffreak /types/libpq/ @Lodin -/types/libxmljs/ @fdecampredon +/types/libxmljs/ @fdecampredon @ComFreek /types/libxslt/ @alejo90 /types/license-checker/ @rogierschouten @unindented /types/lil-uuid/ @Pr1st0n /types/lime-js/ @arthur-xavier /types/line-by-line/ @etomsen /types/line-reader/ @stpettersens +/types/lingui__core/ @huan086 +/types/lingui__react/ @huan086 /types/linkify-it/ @praxxis /types/listr/ @durad /types/lls/ @borislavjivkov @@ -2515,18 +2581,20 @@ /types/markdown-it-anchor/ @seryl /types/markdown-it-container/ @hronex /types/markdownlint/ @ark120202 -/types/marked/ @worr @BendingBender +/types/marked/ @worr @BendingBender @CrossR /types/marker-animate-unobtrusive/ @viskin /types/markerclustererplus/ @enanox @mxl /types/markitup/ @drillbits +/types/marko/ @darkwebdev /types/maskedinput/ @lokeshpeta /types/masonry-layout/ @m-a-wilson @warriorrocker /types/massive/v3/ @swissspidy @clarenceh /types/massive/ @swissspidy @clarenceh @AmazingTurtle /types/match-media-mock/ @asvetliakov +/types/match-sorter/ @claasahl /types/material-components-web/ @BrentDouglas @ckosti /types/material-design-lite/ @bradzacher -/types/material-ui/ @ngbrown @theigor @alitaheri @herrmanno @DaIgeb @allienna @schlesingermatthias @InsidersByte @artyomsv @dan-j @minodisk @samwalshnz +/types/material-ui/ @ngbrown @theigor @alitaheri @herrmanno @DaIgeb @allienna @schlesingermatthias @InsidersByte @artyomsv @dan-j @minodisk @samwalshnz @reggino /types/material-ui-datatables/ @coding2012 /types/material__animation/ @BrentDouglas @ckosti /types/material__auto-init/ @BrentDouglas @ckosti @@ -2558,7 +2626,7 @@ /types/materialize-css/ @huww98 @MaximBalaganskiy @MonizDave @broccoliarchy /types/math3d/ @laszlojakab @jimsmart /types/mathjax/ @rolandzwaga -/types/mathjs/ @siavol @andnp +/types/mathjs/ @siavol @andnp @bradbesserman /types/matter-js/ @piranha771 @hasparus /types/maxmind/ @geoffreak /types/mcustomscrollbar/ @flurg @@ -2571,7 +2639,7 @@ /types/mem-fs/ @MyFoodBag /types/mem-fs-editor/ @MyFoodBag /types/memcached/ @KentarouTakeda -/types/memoize-one/ @karol-majewski +/types/memoize-one/ @karol-majewski @franklixuefei /types/memoizee/ @juanpicado /types/memory-cache/ @jedigo @thieman /types/memory-fs/ @e-cloud @@ -2581,6 +2649,7 @@ /types/merge-stream/ @k-kagurazaka @daniel-zazula /types/merge2/ @tkrotoff @smac89 /types/merkle/ @kerol2r20 +/types/mermaid/ @ggilmore /types/mersenne-twister/ @KentarouTakeda /types/meshblu/ @fnipo /types/mess/ @Nemo157 @@ -2599,6 +2668,7 @@ /types/metric-suffix/ @davidm77 /types/mfiles/ @avonwyss /types/micro/ @kaoDev +/types/micro-cors/ @CallumDenby /types/micromatch/v2/ @glen-84 /types/micromatch/ @glen-84 @vemoo /types/microrouter/ @mathieudutour @@ -2608,6 +2678,7 @@ /types/microsoftteams/ @WrathOfZombies @jayongg @ydogandjiev /types/microtime/ @vincekovacs /types/milkcocoa/ @odangosan +/types/millisecond/ @xeoneux /types/mime/ @jedigo @dhritzkiv /types/mime-db/ @AJamesPhillips /types/mime-types/ @Perlmint @@ -2617,7 +2688,7 @@ /types/minimatch/ @vvakame @shantmarouti /types/minimist/ @Bartvds @Necroskillz @kamranayub /types/minimist-options/ @ikatyang -/types/minio/ @barinbritva @castorw +/types/minio/ @barinbritva @castorw @loremaps /types/minipass/ @BendingBender /types/mirrorx/ @aaronphy /types/mithril/ @spacejack @andraaspar @isiahmeadows @@ -2631,7 +2702,7 @@ /types/mkpath/ @optical /types/mobx-apollo/ @pselden /types/mobx-devtools-mst/ @pluma -/types/mocha/ @kazimanzurrashid @otiai10 @jt000 @enlight @cspotcode +/types/mocha/ @kazimanzurrashid @otiai10 @jt000 @enlight @cspotcode @1999 /types/mocha-each/ @magnostherobot /types/mocha-phantomjs/ @ErikSchierboom /types/mocha-steps/ @Arylo @@ -2654,13 +2725,16 @@ /types/moment-jalaali/ @alitaheri /types/moment-range/ @Burgov @wilgert @franjuan @MartynasZilinskas /types/moment-round/ @jacobbaskin +/types/moment-shortformat/ @whatasoda /types/moment-strftime2/ @dex4er /types/moment-timezone/ @michelsalib @alanblins /types/mongo-sanitize/ @CedricCazin /types/mongodb/v2/ @CaselIT @alanmarcell @kikar @bitjson @dante-101 @mcortesi -/types/mongodb/ @CaselIT @alanmarcell @kikar @bitjson @dante-101 @mcortesi @EnricoPicci @AJCStriker @julien-c @daprahamian +/types/mongodb/ @CaselIT @alanmarcell @bitjson @dante-101 @mcortesi @EnricoPicci @AJCStriker @julien-c @daprahamian @denys-bushulyak @BastienAr @sindbach +/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 +/types/mongoose/ @horiuchi @sindrenm @lukasz-zak @Alorel @jendrikw @ethanresnick @vologab @jussikinnula /types/mongoose-auto-increment/ @AyaMorisawa /types/mongoose-deep-populate/ @AyaMorisawa /types/mongoose-geojson-schema/ @bondz @@ -2677,6 +2751,8 @@ /types/morgan/ @staticfunction @pscanf /types/morphdom/ @arvitaly /types/morris.js/ @mareek @sindilevich +/types/mosca/ @GabrielGouv +/types/motor-hat/ @muntyan /types/mousetrap/ @qcz /types/move-concurrently/ @mgroenhoff /types/moviedb/ @basarat @0x6368656174 @@ -2690,7 +2766,7 @@ /types/msgpack5/ @wokim @heycalmdown /types/msnodesql/ @borisyankov @SomaticIT /types/msportalfx-test/ @julioct -/types/mssql/ @jaminfarr @buzinas @mrrichar @elhaard @pkeuter +/types/mssql/ @jaminfarr @buzinas @mrrichar @elhaard @pkeuter @mcdado /types/mu2/ @jedigo /types/muicss/ @samuelneff /types/multer/ @jt000 @DavidBR-SW @mxl @hyunseob @@ -2708,14 +2784,16 @@ /types/murmurhash-js/ @cvle /types/murmurhash3js/ @dlee-nvisia /types/musicmetadata/ @Xstoudi -/types/mustache/ @markashleybell +/types/mustache/ @markashleybell @manuth /types/mv/ @nenadalm /types/mysql/ @wjohnsto @kacepe @kpping @jdmunro /types/mz/ @ThomasHickman /types/n3/ @phreed /types/named-regexp-groups/ @jewbre +/types/named-routes/ @qqilihq /types/nano/ @timjacobi @vincekovacs /types/nanoajax/ @nathancahill +/types/nanographql/ @cdaringe /types/nanoid/ @bash /types/nanomsg/ @titan /types/nanoscroller/ @zihark17 @@ -2746,9 +2824,10 @@ /types/network-interfaces/ @anderswestberg /types/new-relic-browser/ @renehamburger @piotrkubisa /types/newline-remove/ @OpenByteDev +/types/newman/ @LogvinovLeon /types/newrelic/ @mastermatt /types/nexpect/ @vvakame -/types/next/ @dru89 @brikou +/types/next/ @dru89 @brikou @jthegedus @resir014 @scottdj92 @joaovieira /types/next-redux-wrapper/ @stevegeek /types/ng-command/ @stephenlautier /types/ng-cordova/ @ksachdeva @@ -2776,20 +2855,21 @@ /types/nightwatch/ @rkavalap @schlesiger /types/nivo-slider/ @AndersonFriaca /types/noble/ @swook @shantanubhadoria @lukel99 @bioball @keton @thegecko -/types/nock/ @bonnici @horiuchi @afharo @mastermatt @damour +/types/nock/ @bonnici @horiuchi @afharo @mastermatt @damour @paambaati /types/nodal/ @charrondev -/types/node/v4/ @eps1lon -/types/node/v6/ @WilcoBakker @inlined @eps1lon @Alorel @KSXGitHub -/types/node/v7/ @parambirs @tellnes @WilcoBakker @eps1lon @KSXGitHub -/types/node/v8/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @hoo29 @n-e @brunoscheufler @KSXGitHub @islishude -/types/node/v9/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 @n-e @brunoscheufler @mohsen1 @KSXGitHub @a-tarasyuk @islishude -/types/node/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 @n-e @brunoscheufler @mohsen1 @KSXGitHub @a-tarasyuk @islishude +/types/node/v4/ @eps1lon @Archcry +/types/node/v6/ @WilcoBakker @inlined @eps1lon @Alorel @KSXGitHub @Archcry +/types/node/v7/ @parambirs @tellnes @WilcoBakker @eps1lon @KSXGitHub @Archcry +/types/node/v8/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @hoo29 @n-e @brunoscheufler @KSXGitHub @islishude @r3nya +/types/node/v9/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 @n-e @brunoscheufler @mohsen1 @KSXGitHub @a-tarasyuk @islishude @r3nya +/types/node/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 @n-e @brunoscheufler @mohsen1 @KSXGitHub @a-tarasyuk @islishude @r3nya @ZaneHannanAU /types/node-7z/ @erkie /types/node-array-ext/ @Beng89 /types/node-cache/ @chrootsu @dthunell @useltmann /types/node-calendar/ @luzianz /types/node-cleanup/ @agadar /types/node-cron/ @maximelkin +/types/node-dijkstra/ @nokutu /types/node-dir/ @panuhorsmalahti /types/node-dogstatsd/ @chrisbobo /types/node-emoji/ @jonestristand @styu @@ -2803,9 +2883,10 @@ /types/node-horseman/ @apratheek /types/node-hue-api/ @fjmorel /types/node-int64/ @x3cion @kevin-greene-ck -/types/node-ipc/ @arvitaly +/types/node-ipc/ @arvitaly @gjurgens /types/node-jsfl-runner/ @mrand01 /types/node-json-db/ @kuzn-ilya +/types/node-memwatch/ @Kroisse /types/node-mysql-wrapper/ @kataras /types/node-notifier/ @tkQubo /types/node-polyglot/ @timjk @@ -2818,9 +2899,10 @@ /types/node-slack/ @tkQubo /types/node-snap7/ @heilingbrunner /types/node-sprite-generator/ @Perlmint +/types/node-ssdp/ @OrionNebula /types/node-static/ @Morfent /types/node-statsd/ @alexturek @convoyinc -/types/node-telegram-bot-api/ @ammuench @agadar @Dabolus @Kallu609 +/types/node-telegram-bot-api/ @ammuench @agadar @Dabolus @Kallu609 @XC-Zhang /types/node-uuid/ @jeffmay /types/node-validator/ @kengorab /types/node-vault/ @YuJianrong @@ -2828,11 +2910,12 @@ /types/node-xmpp-client/ @PJakcson /types/node-xmpp-core/ @PJakcson /types/node-zookeeper-client/ @plantain-00 @jessezhang91 +/types/node-zopfli/ @Alorel /types/node_redis/ @borisyankov /types/nodecredstash/ @migstopheles -/types/nodegit/ @dolanmiu +/types/nodegit/ @dolanmiu @tniessen /types/nodemailer/v3/ @rogierschouten -/types/nodemailer/ @rogierschouten @dex4er +/types/nodemailer/ @rogierschouten @dex4er @bioball /types/nodemailer-direct-transport/ @rogierschouten /types/nodemailer-mailgun-transport/ @otociulis /types/nodemailer-pickup-transport/ @psnider @@ -2862,6 +2945,7 @@ /types/ns-api/ @Archcry /types/nslog/ @unindented /types/nsqjs/ @cezaryrk +/types/nuka-carousel/ @Romic /types/number-is-nan/ @mhegazy /types/number-to-words/ @frederickfogerty /types/numeral/ @vbortone @@ -2877,6 +2961,7 @@ /types/oauth2-server/ @vangorra @cirick /types/oauth2orize/ @wokim @heycalmdown @stevehipwell /types/obelisk.js/ @bdrupieski +/types/obj-file-parser/ @benc-uk /types/object-assign/ @chbrown /types/object-diff/ @rogierschouten /types/object-hash/ @misak113 @@ -2891,7 +2976,7 @@ /types/oclazyload/ @rolandzwaga /types/odata/ @janhommes @jcchalte /types/ofe/ @Morfent -/types/office-js/ @OfficeDev @LanceEA @Zlatkovsky @kbrandl @Rick-Kirkham +/types/office-js/ @OfficeDev @LanceEA @Zlatkovsky @kbrandl @Rick-Kirkham @AlexJerabek @ElizabethSamuel-MSFT /types/offline-js/ @cgwrench /types/oibackoff/ @geoffreak /types/oidc-token-manager/ @rosieks @@ -2912,6 +2997,7 @@ /types/openlayers/v2/ @bolhovsky /types/openlayers/v3/ @osechet @matthiasdailey-ccri /types/openlayers/ @osechet @wb14123 @ailrun @mylen @iamthechad @danmana @yairtawil @pierremarc @hauke96 +/types/openpgp/ @errietta /types/openstack-wrapper/ @sanjaymadane /types/opentok/ @westy92 @CatGuardian /types/opentype.js/ @danmarshall @edzis @@ -2934,12 +3020,14 @@ /types/osmtogeojson/ @tkqubo /types/osrm/ @DenisCarriere /types/otplib/ @renjfk +/types/overwatch-api/ @JoshuaHall /types/owasp-password-strength-test/ @stephtr /types/owl.carousel/ @igorissen @KennethanCeyer /types/owlcarousel/ @dpiatkowski /types/p-all/ @BendingBender /types/p-any/ @BendingBender /types/p-cancelable/ @BendingBender +/types/p-catch-if/ @LinusU /types/p-debounce/ @BendingBender /types/p-defer/ @SamVerschueren /types/p-do-whilst/ @BendingBender @@ -2947,7 +3035,7 @@ /types/p-event/ @BendingBender /types/p-every/ @BendingBender /types/p-lazy/ @BendingBender -/types/p-limit/ @BendingBender +/types/p-limit/ @BendingBender @LinusU /types/p-loading/ @renjfk /types/p-locate/ @BendingBender /types/p-log/ @BendingBender @@ -2966,7 +3054,7 @@ /types/p-tap/ @BendingBender /types/p-throttle/ @BendingBender /types/p-timeout/ @BendingBender -/types/p-try/ @BendingBender +/types/p-try/ @BendingBender @LinusU /types/p-wait-for/ @BendingBender /types/p-whilst/ @BendingBender /types/p2/ @clark-stevenson @@ -2976,8 +3064,8 @@ /types/paho-mqtt/ @amikhalev /types/pako/ @cappellin @calebegg /types/pangu/ @plantain-00 -/types/papaparse/ @torpedro @rainshen49 @jfloff @johnnyreilly -/types/paper/ @clark-stevenson @Xakaloz +/types/papaparse/ @torpedro @rainshen49 @jfloff @johnnyreilly @albertorestifo +/types/paper/ @clark-stevenson @Xakaloz @sebaswebdev /types/paralleljs/ @jbaldwin /types/parcel-env/ @fathyb /types/parent-package-json/ @sgmccli @@ -2994,8 +3082,15 @@ /types/parse-torrent/ @niieani @tlaziuk /types/parse-torrent-file/ @tlaziuk /types/parse-unit/ @Jack-Works +/types/parse5/v4/ @inikulin @andnp +/types/parse5/ @inikulin +/types/parse5-htmlparser2-tree-adapter/ @inikulin +/types/parse5-parser-stream/ @inikulin +/types/parse5-plain-text-conversion-stream/ @inikulin +/types/parse5-sax-parser/ @inikulin +/types/parse5-serializer-stream/ @inikulin /types/parseurl/ @bomret -/types/parsimmon/ @Bartvds @mizunashi-mana @bcherny @bvanreeven @leonard-thieu +/types/parsimmon/ @Bartvds @mizunashi-mana @bcherny @bvanreeven @leonard-thieu @MrJohz /types/passport/ @horiuchi @enaeseth @theigor @tlaziuk @danielpa9708 /types/passport-anonymous/ @0x6368656174 /types/passport-beam/ @AtlasDev @@ -3003,7 +3098,7 @@ /types/passport-facebook/ @staticfunction @lucasmacosta /types/passport-facebook-token/ @rmartone @mrand01 /types/passport-github/ @yasupeke -/types/passport-github2/ @yasupeke @mthmulders +/types/passport-github2/ @yasupeke @mthmulders @codepunkt /types/passport-google-oauth/ @staticfunction /types/passport-google-oauth2/ @bluehatbrit /types/passport-http/ @krizalys @tlaziuk @cjbarth @@ -3044,6 +3139,7 @@ /types/peerjs/ @nakakura /types/pegjs/ @vvakame @SrTobi @siegebell /types/pem/ @tony19 @DethAriel +/types/pem-jwk/ @alessiopcc /types/persona/ @Nycto /types/pet-finder-api/ @me /types/pg/v6/ @pspeter3 @@ -3085,6 +3181,7 @@ /types/pinyin/ @wanganjun /types/piwik-tracker/ @lbguilherme /types/pixelmatch/ @iamolegga +/types/pixi.js/ @clark-stevenson /types/pkg-dir/ @NK-WEB-Git /types/pkijs/ @microshine /types/platform/ @JakeH @@ -3096,13 +3193,14 @@ /types/plugapi/ @BNedry /types/plugin-error/ @rogierschouten /types/plupload/ @patrickbussmann -/types/pluralize/ @ukyo +/types/pluralize/ @ukyo @karol-majewski /types/png-async/ @kanreisa /types/pngjs/ @jason0x43 /types/pngquant-bin/ @hikoma /types/podcast/ @nikeee /types/podium/ @AJamesPhillips /types/point-in-polygon/ @dyst5422 @kogai +/types/polyfill-service/ @Alorel /types/polylabel/ @DenisCarriere /types/polyline/ @Kern0 /types/polymer/ @lgrignon @laco0416 @@ -3124,7 +3222,7 @@ /types/pouchdb-adapter-websql/ @spaulg @geppy @fredgalvao /types/pouchdb-browser/ @spaulg @geppy @fredgalvao /types/pouchdb-core/ @spaulg @trubit @geppy @fredgalvao @TobiasBales @tiangolo -/types/pouchdb-find/ @trubit +/types/pouchdb-find/ @trubit @tiangolo /types/pouchdb-http/ @spaulg @geppy @fredgalvao /types/pouchdb-mapreduce/ @spaulg @geppy @fredgalvao /types/pouchdb-node/ @spaulg @geppy @fredgalvao @@ -3138,12 +3236,13 @@ /types/preloadjs/ @endel /types/prelude-ls/ @AyaMorisawa /types/prettier/ @ikatyang -/types/pretty-bytes/ @plantain-00 +/types/pretty-bytes/v4/ @plantain-00 +/types/pretty-bytes/ @plantain-00 @danielasy /types/pretty-format/ @ikatyang /types/pretty-ms/ @BendingBender /types/printf/ @AluisioASG /types/priorityqueuejs/ @geoffreak -/types/prismic-dom/ @nickw444 +/types/prismic-dom/ @nickw444 @sbilstein /types/prismjs/ @eriklieben @andrewiggins @mmiszy /types/private-ip/ @coderslagoon /types/procfs-stats/ @cyrilschumacher @@ -3154,12 +3253,15 @@ /types/proj4leaflet/ @BendingBender /types/project-oxford/ @scsouthw /types/promise-dag/ @OSjoerdWie +/types/promise-ftp/ @coolreader18 +/types/promise-ftp-common/ @coolreader18 /types/promise-map-limit/ @kohlmannj /types/promise-pg/ @coldacid /types/promise-polyfill/ @skysteve /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-temp/ @rokadias @@ -3207,7 +3309,7 @@ /types/pumpify/ @JustinBeckwith @aoberoi /types/pupa/ @nju33 /types/puppeteer/v0/ @marvinhagemeister @cdeutsch -/types/puppeteer/ @marvinhagemeister @cdeutsch @jwbay +/types/puppeteer/ @marvinhagemeister @cdeutsch @ksm2 /types/pure-render-decorator/ @seansfkelley /types/purl/ @danfma /types/pusher-js/ @tkqubo @cainlevy @@ -3222,12 +3324,14 @@ /types/qlik-engineapi/ @konne /types/qlik-visualizationextensions/ @konne /types/qr-image/ @taoqf +/types/qrcode/ @plantain-00 /types/qrcode.react/ @mleko /types/qs/ @RWander @leonyu @tehbelinda @zyml @artursvonda @CarlosBonetti /types/qtip2/ @Seltzer @leonard-thieu -/types/query-string/ @SamVerschueren @tkrotoff @huhuanming @MadaraUchiha +/types/query-string/ @SamVerschueren @tkrotoff @huhuanming @MadaraUchiha @shssoichiro +/types/querystringify/ @ilich /types/quick-lru/ @BendingBender -/types/quill/ @sumitkm @guillaume-ro-fr @43081j +/types/quill/ @sumitkm @guillaume-ro-fr @43081j @AnielloFalcone /types/quixote/ @greybax /types/qunit/v1/ @diullei /types/qunit/ @waratuman @@ -3238,7 +3342,7 @@ /types/rabbit.js/ @wokim /types/radium/ @alexgorbatchev @nupplaphil @asvetliakov @mihe /types/radius/ @codeanimal -/types/ramda/ @donnut @tycho01 @mdekrey @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg @charlespwd @samsonkeung @angeloocana @raynerd @googol @moshensky @ethanresnick @leighman @CaptJakk @deftomat @deptno @blimusiek @biern +/types/ramda/ @donnut @tycho01 @mdekrey @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg @charlespwd @samsonkeung @angeloocana @raynerd @googol @moshensky @ethanresnick @leighman @CaptJakk @deftomat @deptno @blimusiek @biern @rayhaneh /types/random-js/ @pistacchio /types/random-number/ @OpenByteDev /types/random-seed/ @endel @@ -3271,41 +3375,46 @@ /types/rcloader/ @panuhorsmalahti /types/rdf-data-model/ @rubensworks /types/rdf-js/ @rubensworks +/types/re-base/ @jordandrako +/types/reach__router/ @kingdaro /types/react/v15/ @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz -/types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa +/types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa @pascaloliv @hotell /types/react-alert/ @ssyrell /types/react-alice-carousel/ @endigo +/types/react-amplitude/ @rayzor65 /types/react-animate-on-scroll/ @ralbuque /types/react-app/ @prakarshpandey /types/react-aria-menubutton/ @forabi @crohlfs /types/react-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 -/types/react-big-calendar/ @piotrwitek @paustint @pikpok +/types/react-beautiful-dnd/ @varHarrie @bradleyayers @paustint @marknelissen +/types/react-big-calendar/ @piotrwitek @paustint @pikpok @eps1lon /types/react-body-classname/ @mhegazy -/types/react-bootstrap/ @walkerburgin @vsiao @danilojrr @Batbold-Gansukh @octatone @chengsieuly @mretolaza @katbusch @vitosamson @LKay @aaronbeall @jrakotoharisoa +/types/react-bootstrap/ @walkerburgin @vsiao @danilojrr @Batbold-Gansukh @octatone @chengsieuly @mretolaza @katbusch @vitosamson @LKay @aaronbeall @jrakotoharisoa @r3nya /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 +/types/react-bootstrap-typeahead/ @Guymestef @radziksh @PaitoAnderson /types/react-breadcrumbs/ @KostyaEsmukov /types/react-breadcrumbs-dynamic/ @mitsuruog /types/react-broadcast/ @kandros /types/react-burger-menu/ @radziksh /types/react-calendar-heatmap/ @9renpoto -/types/react-calendar-timeline/ @radziksh +/types/react-calendar-timeline/ @radziksh @acemac /types/react-cartographer/ @trevonmckay /types/react-circular-progressbar/ @lstanden /types/react-click-outside/ @screendriver /types/react-codemirror/ @velveret @rudi-c +/types/react-coinhive/ @sktbcbbs /types/react-collapse/ @Kimahriman /types/react-collapsible/ @knegusen /types/react-color/ @LKay @markspolakovs @mntdn /types/react-confirm/ @santiagodoldan /types/react-content-loader/ @alaatm @samwalshnz /types/react-copy-to-clipboard/ @mabels @BernabeFelix +/types/react-copy-write/ @samhh @davej /types/react-credit-cards/ @vstrimaitis /types/react-cropper/ @stepancar /types/react-css-modules/ @KostyaEsmukov @skirsdeda @@ -3316,9 +3425,9 @@ /types/react-data-grid/ @SupernaviX @KieranPeat @martinnov92 /types/react-datagrid/ @stephenjelfs /types/react-date-range/ @Junbong -/types/react-datepicker/ @radziksh @andrewBalekha @smrq @Rogach @royxue @KoalaHuman +/types/react-datepicker/ @radziksh @andrewBalekha @smrq @Rogach @royxue @KoalaHuman @seansfkelley /types/react-daterange-picker/ @uncovertruth @MartynasZilinskas -/types/react-dates/ @Artur-A +/types/react-dates/ @ArturAmpilogov @NathanNZ /types/react-daum-postcode/ @Sa-ryong /types/react-dnd-html5-backend/ @oizie /types/react-dnd-multi-backend/ @dawnmist @@ -3347,6 +3456,7 @@ /types/react-form/v1/ @cameron-mcateer /types/react-form/ @cameron-mcateer @TiuSh /types/react-foundation/ @danielearwicker +/types/react-gateway/ @jsonunger /types/react-geosuggest/ @brmenchl /types/react-google-maps-loader/ @vasilysn /types/react-google-places-suggest/ @vasilysn @@ -3354,17 +3464,18 @@ /types/react-gravatar/ @invliD /types/react-grid-layout/ @abirkholz @alitaheri @ZheyangSong @andrewhathaway /types/react-hamburger-menu/ @grzesie2k +/types/react-hammerjs/ @jsonunger /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-highlight-words/ @mhegazy +/types/react-highlight-words/ @mhegazy @diogodca /types/react-highlighter/ @oizie /types/react-holder/ @isman-usoh /types/react-hot-loader/ @jacekjagiello @MartynasZilinskas @DovydasNavickas /types/react-hyperscript/ @tock203 /types/react-i18next/v1/ @KostyaEsmukov /types/react-i18next/v4/ @GiedriusGrabauskas -/types/react-i18next/ @GiedriusGrabauskas @chnoch +/types/react-i18next/ @GiedriusGrabauskas @chnoch @beheh /types/react-icon-base/ @apare @LKay /types/react-icons/ @apare @johnnyreilly @LKay /types/react-image-crop/ @danielasy @@ -3372,6 +3483,7 @@ /types/react-imageloader/ @stephenjelfs /types/react-infinite/ @rhysd /types/react-infinite-calendar/ @christianchown +/types/react-infinite-scroll-component/ @sroy3 /types/react-infinite-scroller/ @Lapanti @psrebniak /types/react-input-calendar/ @stepancar /types/react-input-mask/ @apare @@ -3381,11 +3493,13 @@ /types/react-is/ @AviVahl /types/react-is-deprecated/ @seansfkelley /types/react-joyride/ @DanielRosenwasser @bendxn +/types/react-js-pagination/ @netoisc /types/react-json/ @spielc /types/react-json-pretty/ @LKay /types/react-json-tree/ @gnestor -/types/react-jsonschema-form/ @iamdanfox @iplus26 @KurtPreston +/types/react-jsonschema-form/ @iamdanfox @sirreal @iplus26 @KurtPreston @phbou72 @LucianBuzzo /types/react-lazyload/ @m0a +/types/react-lazylog/ @benjaminRomano /types/react-leaflet/ @danzel @davschne @yuit /types/react-list/ @buptyyf @tomshen /types/react-loadable/ @Kovensky @odensc @ianks @tlaziuk @iMobs @@ -3400,13 +3514,17 @@ /types/react-modal/ @radziksh @drewnoakes @homburg @ttamminen @hallowatcher @peterblazejewicz /types/react-motion/ @stepancar @asvetliakov @dimitarnestorov /types/react-motion-slider/ @asvetliakov -/types/react-native/ @alloy @huhuanming @iRoachie @timwangdev @kamal @nelyousfi @alexdunne @swissmanu @bm-software @tkrotoff +/types/react-motion-ui-pack/ @jsonunger +/types/react-native/ @alloy @huhuanming @iRoachie @timwangdev @kamal @nelyousfi @alexdunne @swissmanu @bm-software @tkrotoff @a-tarasyuk /types/react-native-android-taskdescription/ @christianchown /types/react-native-auth0/ @ascariandrea /types/react-native-autocomplete-input/ @ifiokjr +/types/react-native-background-timer/ @chillkroeteTTS /types/react-native-bluetooth-serial/ @RodrigoAWeber /types/react-native-communications/ @huhuanming @PaitoAnderson +/types/react-native-custom-tabs/ @philnova /types/react-native-datepicker/ @jacobbaskin +/types/react-native-dialog/ @MrLuje /types/react-native-doc-viewer/ @iRoachie /types/react-native-document-picker/ @plantain-00 /types/react-native-drawer/ @jnbt @suniahk @@ -3426,39 +3544,43 @@ /types/react-native-loading-spinner-overlay/ @fhelwanger /types/react-native-material-design-searchbar/ @iRoachie /types/react-native-material-kit/ @iRoachie @timwangdev -/types/react-native-material-textfield/ @mindhivefi +/types/react-native-material-textfield/ @mindhivefi @iRoachie /types/react-native-material-ui/ @iRoachie /types/react-native-mixpanel/ @r3nya /types/react-native-modalbox/ @iRoachie /types/react-native-multi-slider/ @Slessi -/types/react-native-navigation/ @egorshulga /types/react-native-orientation/ @MoLow /types/react-native-permissions/ @vincentlanglet /types/react-native-photo-view/ @christianchown -/types/react-native-popup-dialog/ @PaitoAnderson @connectdotz +/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-safari-view/ @mrand01 /types/react-native-scrollable-tab-view/ @CaiHuan @egorshulga /types/react-native-sensor-manager/ @SahinVardar +/types/react-native-settings-list/ @MrLuje +/types/react-native-share/ @marknelissen /types/react-native-snap-carousel/ @jnbt @j-fro @gazaret /types/react-native-sortable-grid/ @j-fro /types/react-native-sortable-list/ @sivolobov @RookY2K -/types/react-native-sqlite-storage/ @dryganets +/types/react-native-sqlite-storage/ @dryganets @cavarzan /types/react-native-star-rating/ @iRoachie +/types/react-native-svg-charts/ @krzysztof-miemiec /types/react-native-svg-uri/ @iRoachie /types/react-native-swiper/ @CaiHuan @huhuanming @mhcgrq /types/react-native-tab-navigator/ @iRoachie -/types/react-native-tab-view/ @kaoDev +/types/react-native-tab-view/ @kaoDev @iRoachie @timwangdev /types/react-native-text-input-mask/ @RodrigoAWeber -/types/react-native-touch-id/ @huhuanming @gazaret +/types/react-native-toast-native/ @bm-software +/types/react-native-touch-id/ @huhuanming @gazaret @jinshin1013 /types/react-native-vector-icons/ @iRoachie @timwangdev /types/react-native-version-number/ @VincentLanglet /types/react-native-video/ @huhuanming /types/react-navigation/v1/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @robertohuertasm @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi -/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @robertohuertasm @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi @magrinj +/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @robertohuertasm @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi @magrinj @TizioFittizio @stigi /types/react-notification-system/ @GiedriusGrabauskas @DeividasBakanas @LKay @sztobar /types/react-notification-system-redux/ @LKay +/types/react-notify-toast/ @klaascuvelier /types/react-numeric-input/ @heatherbooker /types/react-onclickoutside/v5/ @LKay /types/react-onclickoutside/ @LKay @@ -3466,10 +3588,11 @@ /types/react-overlays/ @aaronbeall @vitosamson /types/react-owl-carousel/ @tbounsiar @igorissen @KennethanCeyer /types/react-paginate/ @deevus @wouterhardeman @pegel03 @archy-bold -/types/react-places-autocomplete/ @guilhermehubner +/types/react-places-autocomplete/ @guilhermehubner @r3nya /types/react-pointable/ @istefo @mdibyo /types/react-popover/ @jacoporicare /types/react-portal/ @shuntksh +/types/react-primitives/ @aghoneim92 /types/react-props-decorators/ @tkqubo /types/react-radio-group/ @jsonunger /types/react-recaptcha/ @mhegazy @zzanol @@ -3483,10 +3606,10 @@ /types/react-resolver/ @forabi /types/react-responsive/v1/ @asvetliakov /types/react-responsive/ @asvetliakov @alechill @xaviergonz -/types/react-rnd/ @Ragg- +/types/react-rnd/ @Ragg- @fsubal /types/react-router/v2/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov /types/react-router/v3/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @ssorallen -/types/react-router/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @tkrotoff @huy-nguyen @grmiade @DaIgeb @egorshulga @neuoy @rraina @pret-a-porter +/types/react-router/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @tkrotoff @huy-nguyen @grmiade @DaIgeb @egorshulga @neuoy @rraina @pret-a-porter @t49tran /types/react-router-bootstrap/ @vlesierse @LKay @olmobrutall /types/react-router-config/ @lith-light-g /types/react-router-dom/ @tkrotoff @huy-nguyen @p-jackson @@ -3502,10 +3625,12 @@ /types/react-scrollbar/ @stephenjelfs /types/react-select/ @Hesquibet @giladgray @iebaker @skirsdeda @vujevits @devrelm @MartynasZilinskas @onatm @ninjaferret @tehbi4 @misantronic @darkartur /types/react-share/ @icopp +/types/react-show-more/ @naortor /types/react-side-effect/ @remojansen /types/react-sidebar/ @jeroenvervaeke /types/react-sketchapp/ @ricokahler @DomiR /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 @@ -3513,9 +3638,11 @@ /types/react-spinkit/v1/ @tkqubo @mleko @pelotom /types/react-spinkit/ @tkqubo @mleko @pelotom @zzanol /types/react-sticky/ @curtisw0 +/types/react-sticky-el/ @jbraithwaite /types/react-stickynode/ @tstirrat /types/react-stripe-elements/ @dan-j @santiagodoldan @sonnysangha @9y5 @thchia /types/react-svg/ @viccrubs @chrisgarber +/types/react-svg-inline/ @kiyopikko /types/react-svg-pan-zoom/ @huy-nguyen /types/react-swf/ @stepancar /types/react-swipe/ @DeividasBakanas @@ -3524,7 +3651,7 @@ /types/react-syntax-highlighter/ @NoHomey /types/react-table/ @royxue @psakalo @Havret /types/react-tabs/ @danez -/types/react-tag-input/ @Ogglas @jankarres +/types/react-tag-input/ @Ogglas @jankarres @matthewberryman /types/react-tagcloud/ @wassname /types/react-tagsinput/ @mykter /types/react-tap-event-plugin/ @mxl @@ -3542,7 +3669,7 @@ /types/react-touch/ @grzesie2k /types/react-tracking/ @alloy /types/react-transition-group/v1/ @LKay -/types/react-transition-group/ @LKay +/types/react-transition-group/ @LKay @Epskampie /types/react-treeview/ @janslow /types/react-truncate/ @mattvperry /types/react-twitter-auth/ @paulfasola @@ -3552,7 +3679,7 @@ /types/react-virtualized-select/ @seansfkelley /types/react-webcam/ @squat /types/react-weui/ @tairan -/types/react-widgets/ @rogierschouten @sanyatuning @frodehansen2 @r3nya +/types/react-widgets/ @rogierschouten @sanyatuning @frodehansen2 @r3nya @MBillemaz /types/react-widgets-moment/ @dawnmist /types/react-youtube/ @kgtkr /types/react-youtube-embed/ @charles-salmon @@ -3572,7 +3699,7 @@ /types/reapop/ @Barrokgl /types/recaptcha2/ @l-jonas /types/recase/ @18steps -/types/recharts/ @mthmulders @rapmue @royxue @ZheyangSong @richbai90 @caspeco-dan +/types/recharts/ @mthmulders @rapmue @royxue @ZheyangSong @richbai90 @caspeco-dan @pkeuter @jrsaunde @paulmelnikow /types/recluster/ @dex4er /types/recompose/ @iskandersierra @mrapogee @clayne11 @Pajn @lucasterra /types/reconnectingwebsocket/ @nguarracino @@ -3598,12 +3725,13 @@ /types/redux-devtools-dock-monitor/ @mc-petry /types/redux-devtools-log-monitor/ @mc-petry /types/redux-doghouse/ @BendingBender -/types/redux-first-router/ @Valbrand @viggyfresh @janb87 @corydeppen +/types/redux-first-router/ @Valbrand @viggyfresh @janb87 @corydeppen @jscinoz /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 +/types/redux-form/ @carsonf @aikoven @LKay @bancek @alsiola @tehbi4 @huwmartin @reggino @maddijoyce /types/redux-immutable/ @oizie @sebald @gavingregory /types/redux-immutable-state-invariant/ @remojansen @highflying /types/redux-infinite-scroll/ @silkyfray @@ -3613,8 +3741,10 @@ /types/redux-localstorage-debounce/ @LKay /types/redux-localstorage-filter/ @LKay /types/redux-logger/ @arusakov @kgroat +/types/redux-mock-store/v0/ @MarianPalkus /types/redux-mock-store/ @MarianPalkus /types/redux-optimistic-ui/ @asvetliakov +/types/redux-orm/ @keenondrums /types/redux-pack/ @tansongyang @quicksnap @no-stack-dub-sack /types/redux-persist-transform-encrypt/ @LKay @dante-101 /types/redux-persist-transform-filter/ @LKay @@ -3628,21 +3758,23 @@ /types/redux-storage-engine-jsurl/ @screendriver /types/redux-storage-engine-localstorage/ @screendriver /types/redux-test-utils/ @huwmartin +/types/redux-testkit/ @Bookler96 /types/redux-ui/ @andyshuxin /types/ref/ @loyd /types/ref-array/ @loyd /types/ref-struct/ @loyd /types/ref-union/ @loyd -/types/reflux/ @mauricedb +/types/reflux/v0/ @mauricedb +/types/reflux/ @mauricedb @LiangZugeng /types/relateurl/ @tkrotoff /types/relaxed-json/ @18steps /types/relay-runtime/ @voxmatt @alloy /types/remarkable/ @makepost -/types/remote-redux-devtools/ @ColinEberhardt @unindented +/types/remote-redux-devtools/ @ColinEberhardt @unindented @mamodom @colindekker /types/remove-markdown/ @RagibHasin /types/rename/ @Aankhen /types/replace-ext/ @DeividasBakanas -/types/request/ @soywiz @bonnici @Bartvds @joeskeen @ccurrens @lookfirst @mastermatt +/types/request/ @soywiz @bonnici @Bartvds @joeskeen @ccurrens @lookfirst @mastermatt @josecolella /types/request-as-curl/ @atd-schubert /types/request-ip/ @mrhen /types/request-promise/ @cglantschnig @joeskeen @AyaMorisawa @mastermatt @@ -3664,7 +3796,8 @@ /types/restangular/ @borisyankov /types/restful.js/ @tkqubo /types/restify/v4/ @blittle @stevehipwell -/types/restify/ @blittle @stevehipwell @leanazulyoro +/types/restify/v5/ @blittle @stevehipwell @leanazulyoro +/types/restify/ @blittle @stevehipwell @leanazulyoro @mgebundy /types/restify-cookies/ @weekens /types/restify-cors-middleware/ @dthunell /types/restify-errors/ @stevehipwell @@ -3697,6 +3830,7 @@ /types/roads/ @dancespiele /types/roads-server/ @dancespiele /types/roll/ @icopp +/types/rolling-rate-limiter/ @l-jonas /types/rollup-plugin-json/ @asmockler /types/ronomon__crypto-async/ @BendingBender /types/rosie/ @abner @subvertallchris @abukurov @@ -3714,7 +3848,9 @@ /types/rsync/ @philippstucki /types/rtree/ @oefirouz /types/run-parallel/ @mrmlnc +/types/run-parallel-limit/ @mrmlnc /types/run-sequence/ @k-kagurazaka +/types/runes/ @viralpickaxe /types/rword/ @icopp /types/rx/ @Igorbek /types/rx-angular/ @mickdelaney @@ -3759,6 +3895,7 @@ /types/scalike/ @ryoppy /types/schema-registry/ @bonzzy /types/schwifty/ @ozum +/types/scoped-http-client/ @mattvperry @rianadon /types/screenfull/ @icholy @lionelb @joelshepherd /types/screeps/ @MarkoSulamagi @NhanHo @bryanbecker @resir014 @Arcath @apemanzilla /types/screeps-profiler/ @ramblurr @@ -3780,6 +3917,7 @@ /types/select2/ @borisyankov @denisname /types/selectables/ @renjfk /types/selectize/ @adidahiya @naBausch +/types/selenium-standalone/ @SanderDeWaal1992 /types/selenium-webdriver/v2/ @BillArmstrong @Kuniwak @cnishina /types/selenium-webdriver/ @BillArmstrong @Kuniwak @cnishina @SupernaviX @bendxn /types/semantic-ui/ @leonard-thieu @@ -3812,10 +3950,11 @@ /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 +/types/sequelize/ @samuelneff @codeanimal @drinchev @babolivier @kukoo1 @oktapodia @morpheusxaut @TitaneBoy @zjy01 @nidzov @Raigen @todd @nrschultz @thomas-b /types/sequelize-fixtures/ @cschwarz /types/sequencify/ @npenin /types/sequester/ @Strate +/types/serialize-error/ @thomasthiebaud /types/serialize-javascript/ @lith-light-g /types/serialport/v4/ @codefoster /types/serialport/ @codefoster @apearson @@ -3823,6 +3962,7 @@ /types/serve-index/ @tkrotoff /types/serve-static/ @urossmolnik @LinusU /types/server-destroy/ @gyszalai +/types/servicenow/ @bryceg /types/session-file-store/ @blendsdk @rokt33r /types/set-cookie-parser/ @nickp10 /types/set-value/ @DanielRosenwasser @@ -3841,7 +3981,7 @@ /types/shimmer/ @kjin /types/shipit/ @cyrilschumacher /types/shipit-utils/ @cyrilschumacher -/types/shopify-buy/ @openminder +/types/shopify-buy/ @openminder @straiforos /types/shortid/ @stpettersens @despairblue /types/shot/ @AJamesPhillips /types/should-sinon/ @Arylo @@ -3851,10 +3991,11 @@ /types/siesta/ @bquarmby /types/sigmajs/ @qinfchen /types/sigmund/ @BendingBender +/types/signale/ @resir014 @kingdaro @rjoydip /types/signalr/ @borisyankov @keesey @GiedriusGrabauskas /types/signalr-no-jquery/ @gjoshevski /types/signals/ @diullei -/types/signature_pad/ @AbubakerB @jrmihalick +/types/signature_pad/ @AbubakerB @jrmihalick @leejaedus /types/simple-assign/ @NoHomey /types/simple-cw-node/ @vvakame /types/simple-lru/ @NN--- @@ -3872,7 +4013,8 @@ /types/single-line-log/ @ffflorian /types/sinon/ @mrbigdog2u @rationull @lumaxis @nicojs @43081j @joshuakgoldberg /types/sinon-as-promised/ @igrayson -/types/sinon-chai/ @kazimanzurrashid @jedmao +/types/sinon-chai/v2/ @kazimanzurrashid @jedmao +/types/sinon-chai/ @kazimanzurrashid @jedmao @elpdpt /types/sinon-chrome/ @pimterry @crimx @kobanyan /types/sinon-express-mock/ @jpchip @tlaziuk /types/sinon-mongoose/ @stevehipwell @@ -3881,6 +4023,7 @@ /types/sip.js/ @decyrus /types/sipml/ @chookies /types/sitemap2/ @shundy +/types/six-runtime/ @493636333 /types/sizzle/ @leonard-thieu /types/sjcl/ @Evgenus /types/skatejs/ @Hotell @@ -3890,7 +4033,12 @@ /types/slack-winston/ @BlueHatbRit /types/slackdown/ @nju33 /types/slackify-html/ @hypexr +/types/slate/ @andykent @majelbstoat @JanLoebel @YangusKhan +/types/slate-base64-serializer/ @YangusKhan +/types/slate-html-serializer/ @YangusKhan /types/slate-irc/ @elisee +/types/slate-plain-serializer/ @YangusKhan +/types/slate-react/ @andykent @majelbstoat @JanLoebel @PatrickSachs @YangusKhan /types/sleep/ @rajarz /types/slickgrid/ @jbaldwin /types/slideout/ @ToastHawaii @@ -3904,20 +4052,21 @@ /types/smtpapi/ @a-morales /types/snapsvg/ @lhk @mattanja @kant2002 /types/snazzy-info-window/ @milosd92 -/types/snekfetch/ @DarkerTV @ShayBox @Dev-Yukine +/types/snekfetch/ @ANekoIsFineToo @ShayBox @Dev-Yukine /types/snoowrap/ @vitosamson @TheAppleFreak /types/snowboy/ @dolanmiu -/types/socket.io/ @progre @divillysausages @florentpoujol @KentarouTakeda @gigi +/types/socket.io/ @progre @divillysausages @florentpoujol @KentarouTakeda @gigi @BrainMaestro /types/socket.io-client/ @progre @divillysausages @florentpoujol /types/socket.io-parser/ @plantain-00 /types/socket.io-redis/ @nupplaphil @seeLuck /types/socket.io.users/ @kataras +/types/socketio-jwt/ @ehallander9591 /types/socketio-jwt-auth/ @codeanimal /types/socketio-wildcard/ @BendingBender /types/socketty/ @Nax /types/sockjs/ @pmccloghrylaing /types/sockjs-client/ @vladev @arusakov @BendingBender @renjfk -/types/solidity-parser-antlr/ @LogvinovLeon +/types/solidity-parser-antlr/ @LogvinovLeon @albrow /types/solr-client/ @liul85 /types/solution-center-communicator/ @dami-gg /types/sort-array/ @mrmlnc @@ -3943,6 +4092,8 @@ /types/split/ @marcinporebski /types/split.js/ @icholy /types/split2/ @mugeso +/types/splunk-bunyan-logger/ @bricka +/types/splunk-logging/ @bricka /types/spotify-api/ @skovmand /types/spotify-web-playback-sdk/ @Festify @mraerino @NeoLegends /types/sprintf/ @soywiz @BendingBender @@ -3964,8 +4115,9 @@ /types/stacktrace-js/ @exceptionless @pilagod /types/stale-lru-cache/ @cxcorp /types/stampit/v2/ @koresar -/types/stampit/ @koresar +/types/stampit/ @koresar @lummish /types/stamplay-js-sdk/ @ridermansb +/types/starwars-names/ @claasahl /types/stat-mode/ @BendingBender /types/stats.js/ @gregolai @hberntsen @danvk /types/statsd-client/ @peterkooijmans @chrisleck @@ -3976,7 +4128,7 @@ /types/steam-totp/ @phenomax /types/steamid/ @Slessi /types/steed/ @Paul-Isache -/types/stellar-sdk/ @carl-foster @tristonj +/types/stellar-sdk/ @carl-foster @tristonj @pselden /types/stemmer/ @will-ockmore /types/sticky-cluster/ @paustint /types/stompjs/ @jimic @Dr4k4n @@ -3988,12 +4140,16 @@ /types/storybook__addon-info/ @mkornblum @fyrkant /types/storybook__addon-knobs/ @joscha @martynaskadisa /types/storybook__addon-links/ @joscha @jessepinho -/types/storybook__addon-notes/ @joscha -/types/storybook__addon-options/ @joscha @simonhn +/types/storybook__addon-notes/ @joscha @amacleay +/types/storybook__addon-options/ @joscha @simonhn @amacleay /types/storybook__addon-storyshots/ @bradleyayers /types/storybook__react/ @joscha @wapgear +/types/storybook__react-native/ @joscha @wapgear @alechill /types/storybook__vue/ @pntgupta /types/stream-buffers/ @Jason3S +/types/stream-chain/ @uhop +/types/stream-csv-as-json/ @uhop +/types/stream-json/ @uhop /types/stream-meter/ @mugeso /types/stream-series/ @k-kagurazaka /types/stream-to-array/v0/ @Bartvds @@ -4001,18 +4157,20 @@ /types/stream-to-promise/ @Alorel /types/streaming-json-stringify/ @BendingBender /types/streamjs/ @erosb +/types/streamtest/ @lummish /types/strftime/ @cyrilschumacher /types/strict-uri-encode/ @hoishin /types/string/ @basp /types/string-hash/ @ethanrubio /types/string-similarity/ @ragtime /types/string-template/ @TonyPythoneer +/types/string-width/ @jacobbubu /types/string_score/ @marcinporebski /types/stringify-object/ @khoomeister /types/strip-ansi/ @mhegazy /types/strip-bom/ @mhegazy /types/strip-json-comments/ @dmoonfire -/types/stripe/ @wjohnsto @codeanimal @sampsonjoliver @LinusU @brannon @kkamperschroer @starhoshi @bruun +/types/stripe/ @wjohnsto @codeanimal @sampsonjoliver @LinusU @brannon @kkamperschroer @starhoshi @bruun @galtalmor @htunnicliff @squirly /types/stripe-checkout/ @cgwrench /types/stripe-v2/ @ejsmith @amritk @adamcmiel @jleider @galuszkak /types/stripe-v3/ @ejsmith @amritk @adamcmiel @jleider @galuszkak @@ -4022,6 +4180,7 @@ /types/strophe/ @DavidKDeutsch /types/structured-source/ @azu /types/styled-jsx/ @R1ZZU +/types/styled-system/ @maxdeviant @phobon @zephraph @damassi @alloy @maoueh /types/stylelint/ @alan-agius4 /types/stylelint-webpack-plugin/ @bahlo /types/stylus/ @SomaticIT @@ -4030,7 +4189,9 @@ /types/succinct/ @EnableSoftware /types/sudo-block/ @BendingBender /types/suitescript/ @darrenhillconsulting +/types/summernote/ @wstaelens @nusantara-cloud /types/sumo-logger/ @forabi @clementallen +/types/suncalc/ @horiuchi /types/superagent/v2/ @varju @NicoZelaya @mxl /types/superagent/ @NicoZelaya @mxl @paplorinc @shreyjain1994 @zopf /types/superagent-no-cache/ @mxl @@ -4044,6 +4205,7 @@ /types/svg-parser/ @mrmlnc /types/svg-path-bounding-box/ @NotWoods /types/svg-sprite/ @tkqubo +/types/svg-sprite-loader/ @rynclark /types/svg2png/ @hansrwindhoff @sccgithub /types/svg4everybody/ @BendingBender /types/svgjs.draggable/ @LiFeleSs @@ -4063,6 +4225,8 @@ /types/swagger-sails-hook/ @micmro /types/swagger-schema-official/ @mohsen1 @bsouthga @nimerritt /types/swagger-tools/ @bricka +/types/swagger-ui-dist/ @haowen737 +/types/swagger-ui-express/ @dmitryrogozhny /types/swaggerize-express/ @mugeso @nickmorton /types/swe-validation/ @hjalmers /types/swfobject/ @rou @@ -4086,13 +4250,13 @@ /types/tabulator/ @euginio /types/tail/ @spacejack /types/tapable/v0/ @e-cloud -/types/tapable/ @e-cloud +/types/tapable/ @e-cloud @johnnyreilly /types/tape/ @Bartvds @sodatea @DennisSchwartz @mikehenrty /types/tar/ @SomaticIT @connor4312 /types/tar-fs/ @Umoxfo /types/tar-stream/ @glicht /types/tcp-ping/ @stegano -/types/tedious/ @rogierschouten @cjthompson +/types/tedious/ @rogierschouten @cjthompson @v-suhame /types/tedious-connection-pool/ @sandorfr /types/telebot/ @mariotsi /types/temp/ @DanielRosenwasser @@ -4100,20 +4264,23 @@ /types/tempfile/ @SamVerschueren @BendingBender /types/tempy/ @douglasduteil /types/terminal-menu/ @aravindarun +/types/test-listen/ @stephenmathieson /types/testingbot-api/ @timbru31 /types/tether/ @adidahiya /types/tether-drop/ @adidahiya /types/tether-shepherd/ @mtgibbs /types/text-buffer/ @GlenCFL -/types/text-encoding/ @pine613 +/types/text-encoding/ @pine613 @mohsen1 /types/text-encoding-utf-8/ @trxcllnt /types/text-table/ @saadq /types/textarea-caret/ @shiftkey +/types/textversionjs/ @aaronosher +/types/tgfancy/ @Dabolus /types/three/ @gyohk @florentpoujol @SereznoKot @omni360 @ivoisbelongtous @piranha771 @qszhusightp @nakakura @s093294 @Pro @efokschaner @PsychoSTS @dhritzkiv @apurvaojas @NotWoods @sethk /types/thrift/ @kamek-pf @kevin-greene-ck @jessezhang91 /types/throng/ @cyrilschumacher @tatethurston /types/throttle/ @BendingBender -/types/throttle-debounce/ @czbuchi +/types/throttle-debounce/ @czbuchi @franklixuefei /types/through/ @AndrewGaspar /types/through2/v0/ @Bartvds @jedmao /types/through2/ @Bartvds @jedmao @valotas @TeamworkGuy2 @@ -4125,18 +4292,22 @@ /types/timelinejs3/ @MikeMatusz /types/timer-machine/ @dolanmiu /types/timezone-js/ @bonnici +/types/tinajs__tina/ @Jimexist /types/tinder/ @pingec /types/tiny-slider-react/ @screendriver /types/tinycolor2/ @M-Zuber @geertjansen @nvh +/types/tinycon/ @dwaxweiler /types/tinycopy/ @vvatanabe /types/tinymce/ @martinduparc @ipoul @nicohartto /types/titanium/ @appcelerator @janvennemann /types/title/ @fa7ad /types/tldjs/ @geoffreak +/types/tlds/ @ajshres /types/tmp/ @optical @Perlmint /types/to-absolute-glob/ @ajafff /types/to-camel-case/ @j-f1 /types/to-markdown/ @SuperPaintman +/types/to-snake-case/ @LogvinovLeon /types/to-title-case-gouch/ @stpettersens /types/toastr/ @borisyankov /types/tocktimer/ @evanshortiss @@ -4163,6 +4334,7 @@ /types/trayballoon/ @korve /types/tress/ @sindilevich /types/trim/ @skysteve +/types/triplesec/ @threesquared /types/trunk8/ @niemyjski /types/tryer/ @bengry /types/tspromise/ @soywiz @@ -4174,7 +4346,7 @@ /types/tweezer.js/ @praxxis /types/twig/ @soywiz @enko /types/twilio/ @nickiannone @ashleybrener -/types/twit/ @Volox @lostfictions @sapphiredev +/types/twit/ @Volox @lostfictions @sapphiredev @abraham /types/twitter/ @chitoku-k /types/twitter-stream-channels/ @adrianbardan /types/twitter-text/ @rhysd @@ -4192,7 +4364,7 @@ /types/tz-format/ @samverschueren /types/ua-parser-js/ @superduper @legendecas @MeLlamoPablo /types/uglify-js/v2/ @tkrotoff -/types/uglify-js/ @alan-agius4 @tkrotoff +/types/uglify-js/ @alan-agius4 @tkrotoff @johnnyreilly /types/uglifycss/ @blendsdk /types/uglifyjs-webpack-plugin/ @vajkayrene /types/ui-grid/ @btesser @joeskeen @pbojanczyk @@ -4217,12 +4389,12 @@ /types/unist/ @bizen241 /types/unity-webapi/ @jmvrbanac /types/universal-analytics/ @Bartvds @DarkerTV -/types/universal-router/ @jtmthf +/types/universal-router/ @jtmthf @tlaziuk @Lodin /types/unorm/ @chbrown /types/untildify/ @BendingBender /types/unused-filename/ @BendingBender /types/unzip/ @coding2012 -/types/unzipper/ @s73obrien @natemara +/types/unzipper/ @s73obrien @natemara @bartje321 /types/update-notifier/v1/ @vvakame @nchen63 /types/update-notifier/ @vvakame @nchen63 @bitjson /types/upng-js/ @plantain-00 @@ -4235,7 +4407,7 @@ /types/url-join/ @rogierschouten @devrelm /types/url-metadata/ @mrkmg /types/url-params/ @danielsogl -/types/url-parse/ @ChernenkoPaul +/types/url-parse/ @ChernenkoPaul @harisiva /types/url-regex/ @unindented /types/url-safe-base64/ @johngeorgewright /types/url-search-params/ @nick121212 @nrathi @@ -4256,6 +4428,7 @@ /types/uuid/ @iamolivinius @felipeochoa @cjbarth /types/uuid-1345/ @mugeso /types/uuid-js/ @mhegazy +/types/uuid-parse/ @screendriver /types/uuid-validate/ @HiromiShikata /types/uws/ @plantain-00 @orblazer /types/valdr/ @ilbertz @@ -4276,11 +4449,12 @@ /types/verror/ @svi3c @max4t /types/vertx3-eventbus-client/ @oddeirik /types/vex-js/ @gdcohan +/types/vexdb/ @MayorMonty /types/vexflow/ @rquiring @sebastianhaas @bohoffi /types/vfile/ @bizen241 @rokt33r /types/vfile-location/ @ikatyang -/types/victory/ @asvetliakov @snerks @Havret -/types/video.js/ @vbortone @scleriot @SWBennett06 @IgelCampus @giofreitas +/types/victory/ @asvetliakov @snerks @Havret @alredyExist +/types/video.js/ @vbortone @scleriot @SWBennett06 @IgelCampus @giofreitas @gjanblaszczyk @sroucheray /types/viewability-helper/ @lironzluf /types/viewerjs/ @lrh3321 /types/viewporter/ @borisyankov @@ -4293,7 +4467,7 @@ /types/vinyl-paths/ @tkQubo /types/virtual-dom/ @chbrown /types/virtual-keyboard/ @bsurai -/types/vis/ @MichaelBitard @macleodbroad-wf @adripanico @seveves @kaktus40 @mmaitre314 @supercargo @takato1314 +/types/vis/ @MichaelBitard @macleodbroad-wf @adripanico @seveves @kaktus40 @mmaitre314 @supercargo @takato1314 @alex-kachura /types/vision/v4/ @jasonswearingen @AJamesPhillips /types/vision/ @jasonswearingen @AJamesPhillips @lenovouser /types/vitalsigns/ @cyrilschumacher @@ -4305,10 +4479,12 @@ /types/voronoi-diagram/ @michaelneu /types/vortex-web-client/ @Pro /types/voximplant-websdk/ @aylarov +/types/vue-color/ @me /types/vue-markdown/ @neodon /types/vue-resource/ @kaorun343 /types/vue-scrollto/ @vincekovacs -/types/vuex-i18n/ @jaeggerr +/types/vue2-datepicker/ @ChristianStornowski +/types/vuex-i18n/ @jaeggerr @noamkfir /types/w2ui/ @Ptival /types/w3c-generic-sensor/ @kenchris /types/w3c-image-capture/ @cosium @@ -4332,6 +4508,8 @@ /types/weapp-api/ @vargeek /types/web-animations-js/ @kritollm /types/web-bluetooth/ @urish +/types/web3/ @simon-jentzsch @nitzantomer @zurbo @yxliang01 @phra @naddison36 @icaroharry @linusnorton @jpeletier @anneau @matrushka @andrevmatos @levino +/types/web3-eth-abi/ @LogvinovLeon /types/webappsec-credential-management/ @iainmcgin /types/webassembly-js-api/ @periklis /types/webcl/ @NCARalph @@ -4344,27 +4522,33 @@ /types/webidl2/ @saschanaz /types/webmidi/ @lostfictions /types/webpack/v3/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @ahmed-taj @alan-agius4 @elliottsj @jason0x43 @christophehurpeau -/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @ahmed-taj @alan-agius4 @elliottsj @jason0x43 @dennispg @christophehurpeau +/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @ahmed-taj @alan-agius4 @elliottsj @jason0x43 @dennispg @christophehurpeau @ZSkycat @johnnyreilly /types/webpack-bundle-analyzer/ @kryops /types/webpack-chain/ @eirikurn @psachs21 /types/webpack-chunk-hash/ @mtraynham /types/webpack-cleanup-plugin/ @malj +/types/webpack-config-utils/ @hotell /types/webpack-dev-middleware/v1/ @bumbleblym @reduckted -/types/webpack-dev-middleware/ @bumbleblym @reduckted -/types/webpack-dev-server/ @maestroh @daveparslow @ZheyangSong @alan-agius4 +/types/webpack-dev-middleware/ @bumbleblym @reduckted @chrisabrams +/types/webpack-dev-server/ @maestroh @daveparslow @ZheyangSong @alan-agius4 @arturovt /types/webpack-dotenv-plugin/ @kryops /types/webpack-env/ @use-strict @rhonsby /types/webpack-fail-plugin/ @deevus -/types/webpack-hot-middleware/ @bumbleblym @icylace +/types/webpack-hot-client/ @rynclark @ZSkycat +/types/webpack-hot-middleware/ @bumbleblym @icylace @chrisabrams /types/webpack-manifest-plugin/ @r3nya /types/webpack-merge/v0/ @deevus /types/webpack-merge/ @deevus @mtraynham /types/webpack-node-externals/ @mtraynham /types/webpack-notifier/ @bumbleblym +/types/webpack-serve/v1/ @rynclark @Jokcy @ZSkycat +/types/webpack-serve/ @rynclark @Jokcy @ZSkycat /types/webpack-sources/ @e-cloud @chriseppstein /types/webpack-stream/ @iclanton @bumbleblym /types/webpack-validator/ @deevus +/types/webpackbar/ @rynclark /types/webrtc/ @nakakura +/types/website-scraper/ @screendriver /types/websocket/ @loyd @flynetworks @zhaoleimxd @jdneo /types/webspeechapi/ @saschanaz /types/websql/ @TeamworkGuy2 @@ -4374,8 +4558,10 @@ /types/weighted/ @ccitro /types/weixin-app/ @taoqf @AlexStacker /types/wellknown/ @yairtawil +/types/wepy/ @Jimexist +/types/wepy-redux/ @Jimexist /types/whatwg-mimetype/ @petejohanson -/types/whatwg-streams/ @saschanaz @ksm2 +/types/whatwg-streams/ @saschanaz @ksm2 @MattiasBuelens /types/whatwg-url/ @aomarks /types/wheel/ @BTOdell /types/when/ @derekcicerone @Nemo157 @@ -4392,8 +4578,8 @@ /types/winjs/ @adamhewitt627 @craigktreasure @xirzec /types/winreg/ @RX14 @BobBuehler /types/winrt-uwp/ @saschanaz @taylor224 -/types/winston/ @bonnici @codeanimal @DABH /types/winston-dynamodb/ @nickiannone +/types/winston-mail/ @idono87 /types/winston-syslog/ @cjbarth /types/wiring-pi/ @NoHomey /types/wnumb/ @acoreyj @@ -4401,6 +4587,8 @@ /types/word-list-json/ @dovidm /types/wordcloud/ @joeskeen /types/words-to-numbers/ @James-Frowen +/types/workbox-sw/ @wessberg +/types/workerpool/ @Alorel /types/wpapi/ @guoyunhe /types/wrap-ansi/v2/ @kayahr /types/wrap-ansi/ @kayahr @@ -4422,7 +4610,7 @@ /types/xdg-basedir/ @tlaziuk /types/xml/ @YuJianrong /types/xml-parser/ @mhfrantz -/types/xml2js/ @michelsalib @jasonrm @ccurrens @edwardhinkle @BehindTheMath +/types/xml2js/ @michelsalib @jasonrm @ccurrens @edwardhinkle @BehindTheMath @claasahl /types/xml2json/ @dolanmiu /types/xmlbuilder/ @wallymathieu /types/xmldoc/ @Xstoudi @ajsheehan @notlaforge @@ -4444,12 +4632,15 @@ /types/yargs/v8/ @poelstra @mizunashi-mana @pushplay @jeffkenney /types/yargs/v10/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC /types/yargs/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC +/types/yargs-interactive/ @szeck87 /types/yauzl/ @ffflorian +/types/yauzl-promise/ @dlee-nvisia /types/yayson/ @Codesleuth /types/yazl/ @taoqf /types/ydn-db/ @yathit @gabrielmaldi /types/yeoman-generator/ @armorik83 @janslow @ikatyang /types/yeoman-test/ @ikatyang +/types/yesql/ @Sumolari /types/yog-bigpipe/ @ssddi456 /types/yog-log/ @ssddi456 /types/yog2-kernel/ @ssddi456 @@ -4461,13 +4652,14 @@ /types/z-schema/ @pgonzal /types/zapier-platform-core/ @bradleyayers /types/zeit__next-typescript/ @icopp -/types/zen-observable/ @aicest +/types/zen-observable/ @aicest @JounQin @itomtom /types/zen-push/ @daprahamian /types/zenscroll/ @HamedFathi /types/zepto/ @jbaldwin /types/zeroclipboard/v1/ @ejsmith @niemyjski @balassy @leonyu /types/zeroclipboard/ @ejsmith @niemyjski @balassy @leonyu /types/zeromq/ @davemckeown @erikma @TitaneBoy +/types/zip-webpack-plugin/ @blaise-io /types/zip.js/ @lgrignon /types/zipcodes/ @headdetect /types/zipkin-context-cls/ @plantain-00 diff --git a/notNeededPackages.json b/notNeededPackages.json index f3dc9ef37f..b3ac153770 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1194,6 +1194,12 @@ "sourceRepoURL": "https://github.com/react-native-community/react-native-modal", "asOfVersion": "4.1.1" }, + { + "libraryName": "react-native-navigation", + "typingsPackageName": "react-native-navigation", + "sourceRepoURL": "https://github.com/wix/react-native-navigation", + "asOfVersion": "2.0.0" + }, { "libraryName": "react-split-pane", "typingsPackageName": "react-split-pane", @@ -1219,7 +1225,7 @@ "asOfVersion": "0.1.5" }, { - "libraryName": "react-bootstrap", + "libraryName": "redux-bootstrap", "typingsPackageName": "redux-bootstrap", "sourceRepoURL": "https://github.com/remojansen/redux-bootstrap", "asOfVersion": "1.1.0" @@ -1584,6 +1590,12 @@ "sourceRepoURL": "http://webix.com", "asOfVersion": "5.1.1" }, + { + "libraryName": "winston", + "typingsPackageName": "winston", + "sourceRepoURL": "https://github.com/winstonjs/winston.git", + "asOfVersion": "2.4.4" + }, { "libraryName": "wolfy87-eventemitter", "typingsPackageName": "wolfy87-eventemitter", diff --git a/types/acl/index.d.ts b/types/acl/index.d.ts index 43de3f5369..3f4df31aa2 100644 --- a/types/acl/index.d.ts +++ b/types/acl/index.d.ts @@ -2,9 +2,8 @@ // Project: https://github.com/optimalbits/node_acl // Definitions by: Qubo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 -/// /// /// diff --git a/types/agora-rtc-sdk/agora-rtc-sdk-tests.ts b/types/agora-rtc-sdk/agora-rtc-sdk-tests.ts new file mode 100644 index 0000000000..bfa00378db --- /dev/null +++ b/types/agora-rtc-sdk/agora-rtc-sdk-tests.ts @@ -0,0 +1,27 @@ +let client = AgoraRTC.createClient({ + mode: 'live', + codec: 'vp8' +}); + +let stream = AgoraRTC.createStream({ + video: true, + audio: true, + streamID: 21230, + screen: false +}); + +client.init('74a0b7bb5d3e47c7abca0533d17b0afa', () => { + client.join('74a0b7bb5d3e47c7abca0533d17b0afa', 'testyy', 21230, uid => { + stream.init(() => { + client.publish(stream, err => { + throw(err); + }); + }, err => { + throw(err); + }); + }, err => { + throw(err); + }); +}, err => { + throw(err); +}); diff --git a/types/agora-rtc-sdk/index.d.ts b/types/agora-rtc-sdk/index.d.ts new file mode 100644 index 0000000000..d70385d639 --- /dev/null +++ b/types/agora-rtc-sdk/index.d.ts @@ -0,0 +1,314 @@ +// Type definitions for agora-rtc-sdk 2.3 +// Project: https://github.com/AgoraIO/web-archive#readme +// Definitions by: Menthays +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/*~ If this module is a UMD module that exposes a global variable 'myLib' when + *~ loaded outside a module loader environment, declare that global here. + *~ Otherwise, delete this declaration. + */ +export as namespace AgoraRTC; + +/*~ If this module has methods, declare them as functions like so. + */ +export function createClient(config: ClientConfig): Client; +export function createStream(spec: StreamSpec): Stream; +export function checkSystemRequirements(): boolean; +export function getDevices(callback: (devices: any[]) => void): void; + +/*~ You can declare types that are available via importing the module */ +export interface ClientConfig { + mode: 'live' | 'rtc'; + codec: 'vp8' | 'h264'; + proxyServer?: string; + turnServer?: { + turnServerURL: string; + username: string; + password: string; + udpport: string; + tcpport: string; + forceturn: boolean; + }; +} + +export interface StreamSpec { + streamID: number; + audio: boolean; + video: boolean; + screen: boolean; + cameraId?: string; + microphoneId?: string; + mirror?: boolean; + extensionid?: string; + mediaSource?: 'screen' | 'application' | 'window'; + audioProcessing?: { + AGC: boolean; + }; + attributes?: { + resolution: string; + minFrameRate: number; + maxFrameRate: number; + }; +} + +export interface LocalStreamStats { + audioSendBytes: string; + audioSendPackets: string; + videoSendBytes: string; + videoSendPackets: string; + videoSendPacketsLost: string; + videoSendFrameRate: string; + videoSendBandwidth: string; + videoSendResolutionWidth?: string; + videoSendResolutionHeight?: string; + audioCodecName: string; + videoCodecName: string; + timestamp: string; + startTime: string; + duration: string; +} + +export interface RemoteStreamStats { + audioReceiveBytes: string; + audioReceivePackets: string; + audioReceivePacketsLost: string; + videoReceiveBytes: string; + videoReceivePackets: string; + videoReceivePacketsLost: string; + videoReceiveFrameRate?: string; + videoReceiveDecodeFrameRate?: string; + videoReceiveBandwidth?: string; + videoReceivedResolutionWidth?: string; + videoReceivedResolutionHeight?: string; + timestamp: string; + startTime: string; + duration: string; +} + +export type VideoProfile = + | '120p' + | '120p_1' + | '120p_3' + | '180p' + | '180p_1' + | '180p_3' + | '180p_4' + | '240p' + | '240p_1' + | '240p_3' + | '240p_4' + | '360p' + | '360p_1' + | '360p_3' + | '360p_4' + | '360p_6' + | '360p_7' + | '360p_8' + | '360p_9' + | '360p_10' + | '360p_11' + | '480p' + | '480p_1' + | '480p_2' + | '480p_3' + | '480p_4' + | '480p_6' + | '480p_8' + | '480p_9' + | '480p_10' + | '720p' + | '720p_1' + | '720p_2' + | '720p_3' + | '720p_5' + | '720p_6' + | '1080p' + | '1080p_1' + | '1080p_2' + | '1080p_3' + | '1080p_5' + | '1440p' + | '1440p_1' + | '1440p_2' + | '4K' + | '4K_1' + | '4K_3'; + +export type FirefoxVideoProfile = + | '480p' + | '480p_1' + | '480p_2' + | '480p_3' + | '480p_4' + | '480p_6' + | '480p_8' + | '480p_9' + | '480p_10' + | '720p' + | '720p_1' + | '720p_2' + | '720p_3' + | '720p_5' + | '720p_6'; + +export type SafariVideoProfile = + | '480p' + | '480p_1' + | '480p_2' + | '480p_3' + | '480p_4' + | '480p_6' + | '480p_8' + | '480p_9' + | '480p_10' + | '720p' + | '720p_1' + | '720p_2' + | '720p_3' + | '720p_5' + | '720p_6' + | '1080p' + | '1080p_1' + | '1080p_2' + | '1080p_3' + | '1080p_5' + | '1440p' + | '1440p_1' + | '1440p_2' + | '4K' + | '4K_1' + | '4K_3'; + +export type ScreenSharingProfile = + | '480p_1' + | '480p_2' + | '720p_1' + | '720p_2' + | '1080p_1' + | '1080p_2'; + +export type ClientEvent = + | 'stream-published' + | 'stream-added' + | 'stream-removed' + | 'stream-subscribed' + | 'peer-leave' + | 'mute-audio' + | 'unmute-audio' + | 'mute-video' + | 'unmute-video' + | 'client-banned' + | 'active-speaker' + | 'error'; + +export interface Stream { + getStats( + callback: (stats: LocalStreamStats | RemoteStreamStats) => void + ): void; + init(onSuccess: () => void, onFailure: (err: any) => void): void; + getId(): number; + getAttributes(): any; + getAudioLevel(): number; + hasVideo(): boolean; + hasAudio(): boolean; + enableVideo(): void; + disableVideo(): void; + enableAudio(): void; + disableAudio(): void; + setVideoProfile( + profile: + | VideoProfile + | FirefoxVideoProfile + | SafariVideoProfile + | ScreenSharingProfile + ): void; + play(HTMLElementID: string): void; + stop(): void; + close(): void; +} + +export interface Client { + on(eventName: ClientEvent, callback: (evt: any) => void): void; + init( + appId: string, + onSuccess: () => void, + onFailure: (err: any) => void + ): void; + join( + tokenOrKey: string, + channel: string, + uid: number, + onSuccess: (uid: number) => void, + onFailure: (err: any) => void + ): void; + renewChannelKey( + key: string, + onSuccess: () => void, + onFailure: (err: any) => void + ): void; + enableDualStream( + onSuccess: () => void, + onFailure: (err: any) => void + ): void; + setRemoteVideoStreamType(stream: Stream, streamType: 0 | 1): void; + setLowStreamParameter(param: { + width: number; + height: number; + framerate: number; + birate: number; + }): void; + disableDualStream( + onSuccess: () => void, + onFailure: (err: any) => void + ): void; + leave(onSuccess: () => void, onFailure: (err: any) => void): void; + publish(stream: Stream, onFailure: (err: any) => void): void; + unpublish(stream: Stream, onFailure: (err: any) => void): void; + subscribe(stream: Stream, onFailure: (err: any) => void): void; + unsubscribe(stream: Stream, onFailure: (err: any) => void): void; + setProxyServer(proxyServer: ClientConfig['proxyServer']): void; + setTurnServer(turnServer: ClientConfig['turnServer']): void; + setEncryptionSecret(password: string): void; + setEncryptionMode( + encryptionMode: 'aes-128-xts' | 'aes-256-xts' | 'aes-128-ecb' + ): void; +} + +/*~ You can declare properties of the module using const, let, or var */ +export const VERSION: string; + +export const AUDIO_SAMPLE_RATE_32000: 32000; +export const AUDIO_SAMPLE_RATE_44100: 44100; +export const AUDIO_SAMPLE_RATE_48000: 48000; + +export const VIDEO_CODEC_PROFILE_BASELINE: 66; +export const VIDEO_CODEC_PROFILE_MAIN: 77; +export const VIDEO_CODEC_PROFILE_HIGH: 100; + +export const REMOTE_VIDEO_STREAM_HIGH: 0; +export const REMOTE_VIDEO_STREAM_LOW: 1; +export const REMOTE_VIDEO_STREAM_MEDIUM: 2; +/*~ If there are types, properties, or methods inside dotted names + *~ of the module, declare them inside a 'namespace'. + */ +export namespace Logger { + /*~ For example, given this definition, someone could write: + *~ import { subProp } from 'yourModule'; + *~ subProp.foo(); + *~ or + *~ import * as yourMod from 'yourModule'; + *~ yourMod.subProp.foo(); + */ + type DEBUG = 0; + type INFO = 1; + type WARNING = 2; + type ERROR = 3; + type NONE = 4; + function setLogLevel(level: DEBUG|INFO|WARNING|NONE): void; + function log(args: any): void; + function debug(args: any): void; + function info(args: any): void; + function warning(args: any): void; + function error(args: any): void; +} diff --git a/types/agora-rtc-sdk/tsconfig.json b/types/agora-rtc-sdk/tsconfig.json new file mode 100644 index 0000000000..8d3d2c118b --- /dev/null +++ b/types/agora-rtc-sdk/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", + "agora-rtc-sdk-tests.ts" + ] +} diff --git a/types/agora-rtc-sdk/tslint.json b/types/agora-rtc-sdk/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/agora-rtc-sdk/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index b2890573ce..5a49eaea18 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -764,6 +764,11 @@ declare namespace algoliasearch { * https://github.com/algolia/algoliasearch-client-js#client-options */ hosts?: { read?: string[]; write?: string[] }; + /** + * enable the experimental feature: caching requests instead of responses + * see https://github.com/algolia/algoliasearch-client-javascript/pull/694 + */ + _useRequestCache?: boolean } /** * Interface describing options available for gettings the logs diff --git a/types/algoliasearch/lite/index.d.ts b/types/algoliasearch/lite/index.d.ts index a567a917a8..acd2b30988 100644 --- a/types/algoliasearch/lite/index.d.ts +++ b/types/algoliasearch/lite/index.d.ts @@ -180,6 +180,11 @@ declare namespace algoliasearch { * https://github.com/algolia/algoliasearch-client-js#client-options */ hosts?: { read?: string[]; write?: string[] }; + /** + * enable the experimental feature: caching requests instead of responses + * see https://github.com/algolia/algoliasearch-client-javascript/pull/694 + */ + _useRequestCache?: boolean } interface BrowseResponse { cursor?: string; diff --git a/types/amqp-connection-manager/amqp-connection-manager-tests.ts b/types/amqp-connection-manager/amqp-connection-manager-tests.ts new file mode 100644 index 0000000000..0ee1aeaf95 --- /dev/null +++ b/types/amqp-connection-manager/amqp-connection-manager-tests.ts @@ -0,0 +1,20 @@ +import * as amqp from "amqplib"; +import * as amqpConMgr from 'amqp-connection-manager'; + +// from README.md +const connection = amqpConMgr.connect(['amqp://localhost']); +const channelWrapper: amqpConMgr.ChannelWrapper = connection.createChannel({ + json: true, + setup: async (channel: amqp.ConfirmChannel): Promise => { + // `channel` here is a regular amqplib `ConfirmChannel`. Unfortunately its typings make it return a bluebird-specific promise + // tslint:disable-next-line:await-promise + await channel.assertQueue('rxQueueName', {durable: true}); + } +}); + +connection.on("connect", (_arg: { connection: amqp.Connection, url: string }): void => undefined); +connection.on("disconnect", (_arg: { err: Error }): void => undefined); + +channelWrapper.on("close", () => undefined); +channelWrapper.on("connect", () => undefined); +channelWrapper.on("error", (_error: Error) => undefined); diff --git a/types/amqp-connection-manager/index.d.ts b/types/amqp-connection-manager/index.d.ts new file mode 100644 index 0000000000..e8683a4ed6 --- /dev/null +++ b/types/amqp-connection-manager/index.d.ts @@ -0,0 +1,184 @@ +// Type definitions for amqp-connection-manager 2.0 +// Project: https://github.com/benbria/node-amqp-connection-manager +// Definitions by: rogierschouten +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { ConfirmChannel, Connection, Message, Options, Replies } from "amqplib"; +import { EventEmitter } from "events"; +import { SecureContextOptions } from "tls"; + +/** + * connect() options + */ +export interface AmqpConnectionManagerOptions { + /** + * Interval to send heartbeats to broker. Defaults to 5 seconds. + */ + heartbeatIntervalInSeconds?: number; + + /** + * The time to wait before trying to reconnect. If not specified, defaults to heartbeatIntervalInSeconds + */ + reconnectTimeInSeconds?: number; + + /** + * is a function which returns one or more servers to connect to. This should return either a single URL or an array of URLs. + * This is handy when you're using a service discovery mechanism such as Consul or etcd. Instead of taking a callback, this can also + * return a Promise. Note that if this is supplied, then urls is ignored. + */ + findServers?: ((callback: (urls: string | string[]) => void) => void) | (() => Promise); + + /** + * TLS options + */ + connectionOptions?: SecureContextOptions; +} + +/** + * Creates a new AmqpConnectionManager, which will connect to one of the URLs provided in urls. + * If a broker is unreachable or dies, then AmqpConnectionManager will try the next available broker, round-robin. + * @param urls + * @param options + */ +export function connect(urls: string[], options?: AmqpConnectionManagerOptions): AmqpConnectionManager; + +export type SetupFunc = ((channel: ConfirmChannel, callback: (error?: Error) => void) => void) | ((channel: ConfirmChannel) => Promise); + +export interface CreateChannelOpts { + /** + * Name for this channel. Used for debugging. + */ + name?: string; + /** + * A function to call whenever we reconnect to the broker (and therefore create a new underlying channel.) + * This function should either accept a callback, or return a Promise. See addSetup below + */ + setup?: SetupFunc; + /** + * if true, then ChannelWrapper assumes all messages passed to publish() and sendToQueue() are plain JSON objects. + * These will be encoded automatically before being sent. + */ + json?: boolean; +} + +export interface AmqpConnectionManager extends EventEmitter { + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "connect", listener: (arg: { connection: Connection, url: string }) => void): this; + addListener(event: "disconnect", listener: (arg: {err: Error}) => void): this; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "connect", listener: (arg: { connection: Connection, url: string }) => void): this; + on(event: "disconnect", listener: (arg: {err: Error}) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "connect", listener: (arg: { connection: Connection, url: string }) => void): this; + once(event: "disconnect", listener: (arg: {err: Error}) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "connect", listener: (arg: { connection: Connection, url: string }) => void): this; + prependListener(event: "disconnect", listener: (arg: {err: Error}) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "connect", listener: (arg: { connection: Connection, url: string }) => void): this; + prependOnceListener(event: "disconnect", listener: (arg: {err: Error}) => void): this; + + /** + * Create a new ChannelWrapper. This is a proxy for the actual channel (which may or may not exist at any moment, depending on whether or not we are currently connected.) + * @param opts + */ + createChannel(opts: CreateChannelOpts): ChannelWrapper; + + /** + * Returns true if the AmqpConnectionManager is connected to a broker, false otherwise. + */ + isConnected(): boolean; + + /** + * Close this AmqpConnectionManager and free all associated resources. + */ + close(): Promise; +} + +export interface ChannelWrapper extends EventEmitter { + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "connect", listener: () => void): this; + addListener(event: "error", listener: (err: Error, info: { name: string }) => void): this; + addListener(event: "close", listener: () => void): this; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "connect", listener: () => void): this; + on(event: "error", listener: (err: Error, info: { name: string }) => void): this; + on(event: "close", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "connect", listener: () => void): this; + once(event: "error", listener: (err: Error, info: { name: string }) => void): this; + once(event: "close", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "connect", listener: () => void): this; + prependListener(event: "error", listener: (err: Error, info: { name: string }) => void): this; + prependListener(event: "close", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "connect", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error, info: { name: string }) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + + /** + * Adds a new 'setup handler'. setup(channel, [cb]) is a function to call when a new underlying channel is created - + * handy for asserting exchanges and queues exists, and whatnot. The channel object here is a ConfirmChannel from amqplib. + * The setup function should return a Promise (or optionally take a callback) - no messages will be sent until this Promise resolves. + * If there is a connection, setup() will be run immediately, and the addSetup Promise/callback won't resolve until setup is complete. + * Note that in this case, if the setup throws an error, no 'error' event will be emitted, since you can just handle the error here + * (although the setup will still be added for future reconnects, even if it throws an error.) + * Setup functions should, ideally, not throw errors, but if they do then the ChannelWrapper will emit an 'error' event. + * @param func + */ + addSetup(func: SetupFunc): Promise; + + /** + * @see amqplib + * @param exchange + * @param routingKey + * @param content + * @param options + * @param callback + */ + publish(exchange: string, routingKey: string, content: Buffer, options?: Options.Publish, callback?: (err: any, ok: Replies.Empty) => void): boolean; + + /** + * @see amqplib + * @param queue + * @param content + * @param options + * @param callback + */ + sendToQueue(queue: string, content: Buffer, options?: Options.Publish, callback?: (err: any, ok: Replies.Empty) => void): boolean; + + /** + * @see amqplib + * @param message + * @param allUpTo + */ + ack(message: Message, allUpTo?: boolean): void; + + /** + * @see amqplib + * @param message + * @param allUpTo + * @param requeue + */ + nack(message: Message, allUpTo?: boolean, requeue?: boolean): void; + + /** + * Returns a count of messages currently waiting to be sent to the underlying channel. + */ + queueLength(): number; + + /** + * Close a channel, clean up resources associated with it. + */ + close(): Promise; +} diff --git a/types/amqp-connection-manager/tsconfig.json b/types/amqp-connection-manager/tsconfig.json new file mode 100644 index 0000000000..d707bd5a65 --- /dev/null +++ b/types/amqp-connection-manager/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", + "amqp-connection-manager-tests.ts" + ] +} diff --git a/types/amqp-connection-manager/tslint.json b/types/amqp-connection-manager/tslint.json new file mode 100644 index 0000000000..d57642e30f --- /dev/null +++ b/types/amqp-connection-manager/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "strict-export-declare-modifiers": false, + "unified-signatures": false, + "void-return": false + } +} diff --git a/types/amqplib/index.d.ts b/types/amqplib/index.d.ts index 269ed0112e..9ad6d9ceda 100644 --- a/types/amqplib/index.d.ts +++ b/types/amqplib/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/squaremo/amqp.node // Definitions by: Michael Nahkies , Ab Reitsma , Nicolás Fantone , Nick Zelei // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/angular/angular-tests.ts b/types/angular/angular-tests.ts index 1dff1a0451..5d7dd7cbb8 100644 --- a/types/angular/angular-tests.ts +++ b/types/angular/angular-tests.ts @@ -214,11 +214,18 @@ mod.factory({ name1(foo: any) {}, name2: ['foo', (foo: any) => {}] }); -mod.filter('name', ($scope: ng.IScope) => {}); -mod.filter('name', ['$scope', ($scope: ng.IScope) => {}]); +mod.filter('name', ($scope: ng.IScope) => () => {}); +mod.filter('name', ['$scope', ($scope: ng.IScope) => () => {}]); mod.filter({ - name1(foo: any) {}, - name2: ['foo', (foo: any) => {}] + name1(foo: any) { return () => {}; }, + name2: ['foo', (foo: any) => () => {}], +}); +const customStatefulFilter: ng.IFilterFunction = (s) => 1; +mod.filter('name', () => customStatefulFilter); +mod.filter('name', ['$scope', () => customStatefulFilter]); +mod.filter({ + name1: () => customStatefulFilter, + name2: ['foo', () => customStatefulFilter], }); mod.provider('name', ($scope: ng.IScope) => ({ $get: () => { } })); mod.provider('name', TestProvider); diff --git a/types/angular/index.d.ts b/types/angular/index.d.ts index 6b82a2bcb4..c05ee388a8 100644 --- a/types/angular/index.d.ts +++ b/types/angular/index.d.ts @@ -250,8 +250,8 @@ declare namespace angular { */ factory(name: string, $getFn: Injectable): IModule; factory(object: {[name: string]: Injectable}): IModule; - filter(name: string, filterFactoryFunction: Injectable): IModule; - filter(object: {[name: string]: Injectable}): IModule; + filter(name: string, filterFactoryFunction: Injectable): IModule; + filter(object: {[name: string]: Injectable}): IModule; provider(name: string, serviceProviderFactory: IServiceProviderFactory): IModule; provider(name: string, serviceProviderConstructor: IServiceProviderClass): IModule; provider(name: string, inlineAnnotatedConstructor: any[]): IModule; @@ -2237,4 +2237,13 @@ declare namespace angular { interface IHttpParamSerializer { (obj: Object): string; } + + interface IFilterFunction extends Function { + /** + * By default, filters are only run once the input value changes. By marking the filter as `$stateful`, the filter will be run on every `$digest` to update the output. **This is strongly discouraged.** + * See https://docs.angularjs.org/guide/filter#stateful-filters + */ + $stateful?: boolean; + } + type FilterFactory = (...I: any[]) => IFilterFunction; } diff --git a/types/antlr4/BufferedTokenStream.d.ts b/types/antlr4/BufferedTokenStream.d.ts new file mode 100644 index 0000000000..0efc73da2f --- /dev/null +++ b/types/antlr4/BufferedTokenStream.d.ts @@ -0,0 +1,53 @@ +import { Token } from './Token'; +import { Interval } from './IntervalSet'; + +export class BufferedTokenStream { + tokenSource: any; + tokens: Token[]; + index: number; + fetchEOF: boolean; + + mark(): number; + + release(marker: number): number; + + reset(): void; + + seek(index: number): void; + + get(index: number): Token; + + consume(): void; + + sync(i: number): boolean; + + fetch(n: number): number; + + getTokens(start: number, stop: number, types: any): Token[]; + + LA(i: number): any; + + LB(k: number): Token; + + LT(k: number): Token; + + adjustSeekIndex(i: number): number; + + lazyInit(): void; + + setup(): void; + + setTokenSource(tokenSource: any): void; + + nextTokenOnChannel(i: number, channel: any): number; + + previousTokenOnChannel(i: number, channel: any): number; + + getHiddenTokensToRight(tokenIndex: number, channel: any): Token[]; + + getSourceName(): any; + + getText(interval: Interval): any; + + fill(): void; +} diff --git a/types/antlr4/CommonTokenStream.d.ts b/types/antlr4/CommonTokenStream.d.ts new file mode 100644 index 0000000000..bc15162518 --- /dev/null +++ b/types/antlr4/CommonTokenStream.d.ts @@ -0,0 +1,15 @@ +import { BufferedTokenStream } from './BufferedTokenStream'; +import { Token } from './Token'; +import { Lexer } from './Lexer'; + +export class CommonTokenStream extends BufferedTokenStream { + constructor(lexer: Lexer, channel?: any); + + adjustSeekIndex(i: number): any; + + LB(k: number): Token; + + LT(k: number): Token; + + getNumberOfOnChannelTokens(): number; +} diff --git a/types/antlr4/InputStream.d.ts b/types/antlr4/InputStream.d.ts new file mode 100644 index 0000000000..79a05490a0 --- /dev/null +++ b/types/antlr4/InputStream.d.ts @@ -0,0 +1,24 @@ +export class InputStream { + readonly index: number; + readonly size: number; + + constructor(data: string, decodeToUnicodeCodePoints?: boolean); + + reset(): void; + + consume(): void; + + LA(offset: number): string; + + LT(offset: number): string; + + mark(): number; + + release(marker: any): number; + + seek(index: number): void; + + getText(start: number, stop: number): string; + + toString(): string; +} diff --git a/types/antlr4/IntervalSet.d.ts b/types/antlr4/IntervalSet.d.ts new file mode 100644 index 0000000000..cd477700f1 --- /dev/null +++ b/types/antlr4/IntervalSet.d.ts @@ -0,0 +1,49 @@ +import { Token } from './Token'; + +export class Interval { + readonly length: number; + readonly start: number; + readonly stop: number; + + constructor(start: number, stop: number); + + contains(item: number): boolean; + + toString(): string; +} + +export class IntervalSet { + readonly readOnly: boolean; + readonly intervals: Interval[]; + readonly length: boolean; + + first(): number; + + addOne(v: number): void; + + addRange(l: number, h: number): void; + + addInterval(interval: Interval): void; + + addSet(other: IntervalSet): void; + + reduce(k: number): void; + + complement(start: number, stop: number): IntervalSet; + + contains(item: number): boolean; + + removeRange(interval: Interval): boolean; + + removeOne(v: number): boolean; + + toString(literalNames?: string[], symbolicNames?: string[], elemsAreChar?: boolean): string; + + toCharString(): string; + + toIndexString(): string; + + toTokenString(literalNames: string[], symbolicNames: string[]): string; + + elementName(literalNames: string[], symbolicNames: string[], token: Token): string; +} diff --git a/types/antlr4/Lexer.d.ts b/types/antlr4/Lexer.d.ts new file mode 100644 index 0000000000..bb66859402 --- /dev/null +++ b/types/antlr4/Lexer.d.ts @@ -0,0 +1,52 @@ +import { Recognizer } from './Recognizer'; +import { Token } from './Token'; +import { RecognitionException } from './error/Errors'; + +export class Lexer extends Recognizer { + inputStream: any; + sourceName: any; + type: any; + line: any; + column: any; + text: string; + + reset(): void; + + nextToken(): Token; + + skip(): void; + + more(): void; + + pushMode(mode: any): void; + + popMode(): any; + + emitToken(): void; + + emit(): Token; + + emitEOF(): Token; + + charIndex(): number; + + getAllTokens(): Token[]; + + notifyListeners(e: RecognitionException): void; + + getErrorDisplay(s: string): string; + + getErrorDisplayForChar(c: string): string; + + getCharErrorDisplay(c: string): string; + + recover(re: RecognitionException): void; + + static readonly DEFAULT_MODE: number; + static readonly MORE: number; + static readonly SKIP: number; + static readonly DEFAULT_TOKEN_CHANNEL: any; + static readonly HIDDEN: any; + static readonly MIN_CHAR_VALUE: number; + static readonly MAX_CHAR_VALUE: number; +} diff --git a/types/antlr4/Parser.d.ts b/types/antlr4/Parser.d.ts new file mode 100644 index 0000000000..b43e50bc50 --- /dev/null +++ b/types/antlr4/Parser.d.ts @@ -0,0 +1,90 @@ +import { CommonTokenStream } from './CommonTokenStream'; +import { Recognizer } from './Recognizer'; +import { Token } from './Token'; +import { ParseTreeListener } from './tree/Tree'; +import { Lexer } from './Lexer'; +import { InputStream } from './InputStream'; +import { ParserRuleContext } from './ParserRuleContext'; +import { ErrorStrategy } from './error/ErrorStrategy'; + +export class Parser extends Recognizer { + constructor(input: CommonTokenStream); + + buildParseTrees: boolean; + + _errHandler: ErrorStrategy; + + reset(): void; + + match(): Token; + + matchWildcard(): Token; + + getParseListeners(): ParseTreeListener[]; + + addParseListener(lister: ParseTreeListener): void; + + removeParseListener(lister: ParseTreeListener): void; + + removeParseListeners(): void; + + triggerEnterRuleEvent(): void; + + triggerExitRuleEvent(): void; + + getTokenFactory(): any; + + setTokenFactory(factory: any): void; + + getATNWithBypassAlts(): any; + + compileParseTreePattern(pattern: any, patternRuleIndex: any, lexer: Lexer): any; + + getInputStream(): InputStream; + + getTokenStream(): any; + + setTokenStream(stream: any): any; + + getCurrentToken(): Token; + + notifyErrorListeners(msg: string, offendingToken: Token, err: any): void; + + consume(): any; + + addContextToParseTree(): any; + + enterRule(localCtx: ParserRuleContext, state: any, ruleIndex: number): void; + + exitRule(): void; + + enterOuterAlt(): void; + + getPrecedence(): any; + + enterRecursionRule(localCtx: ParserRuleContext, state: any, ruleIndex: any, precedence: any): void; + + pushNewRecursionContext(localCtx: ParserRuleContext, state: any, ruleIndex: any, precedence: any): void; + + unrollRecursionContexts(parentCtx: ParserRuleContext): void; + + getInvokingContext(ruleIndex: number): any; + + isExpectedToken(symbol: Token): boolean; + + getExpectedTokens(): Token[]; + + getExpectedTokensWithinCurrentRule(): Token[]; + + getRuleIndex(ruleName: string): number; + + getRuleInvocationStack(p: any): any; + + getDFAStrings(): any; + + dumpDFA(): void; + + getSourceName(): any; + + setTrace(trace: boolean): void; +} diff --git a/types/antlr4/ParserRuleContext.d.ts b/types/antlr4/ParserRuleContext.d.ts new file mode 100644 index 0000000000..c9bb873dcb --- /dev/null +++ b/types/antlr4/ParserRuleContext.d.ts @@ -0,0 +1,44 @@ +import { RuleContext } from './RuleContext'; +import { Token } from './Token'; +import { ErrorNode, ParseTreeListener } from './tree/Tree'; +import { Interval } from './IntervalSet'; +import { RecognitionException } from './error/Errors'; + +export class ParserRuleContext extends RuleContext { + readonly start: Token; + readonly stop: Token; + readonly ruleIndex: number; + readonly exception: RecognitionException; + + constructor(parent: any, invokingState: number); + + copyFrom(ctx: any): void; + + enterRule(listener: ParseTreeListener): void; + + exitRule(listener: ParseTreeListener): void; + + addChild(child: any): any; + + removeLastChild(): void; + + addTokenNode(token: Token): Token; + + addErrorNode(badToken: Token): ErrorNode; + + getChild(i: number, type?: any): any; + + getToken(ttype: number, i: number): Token; + + getTokens(ttype: number): Token[]; + + getTypedRuleContext(cxtType: any, i: number): any; + + getTypedRuleContexts(cxtType: any): any[]; + + getChildCount(): number; + + getSourceInterval(): Interval; + + static readonly EMPTY: ParserRuleContext; +} diff --git a/types/antlr4/Recognizer.d.ts b/types/antlr4/Recognizer.d.ts new file mode 100644 index 0000000000..bbe1752cba --- /dev/null +++ b/types/antlr4/Recognizer.d.ts @@ -0,0 +1,29 @@ +import { ErrorListener, ProxyErrorListener } from './error/ErrorListener'; +import { Token } from './Token'; +import { ParserRuleContext } from './ParserRuleContext'; + +export class Recognizer { + state: number; + + checkVersion(toolVersion: number): void; + + addErrorListener(listener: ErrorListener): void; + + removeErrorListeners(): void; + + getTokenTypeMap(): any; + + getRuleIndexMap(): any; + + getTokenType(tokenName: string): any; + + getErrorHeader(e: any): string; + + getTokenErrorDisplay(t: Token): string; + + getErrorListenerDispatch(): ProxyErrorListener; + + sempred(localCtx: ParserRuleContext, ruleIndex: number, actionIndex: number): boolean; + + precpred(localCtx: ParserRuleContext, precedence: any): boolean; +} diff --git a/types/antlr4/RuleContext.d.ts b/types/antlr4/RuleContext.d.ts new file mode 100644 index 0000000000..992b8c4c25 --- /dev/null +++ b/types/antlr4/RuleContext.d.ts @@ -0,0 +1,34 @@ +import { ParseTreeVisitor, RuleNode } from './tree/Tree'; +import { Interval } from './IntervalSet'; +import { ParserRuleContext } from './ParserRuleContext'; + +export class RuleContext extends RuleNode { + readonly invokingState: number; + readonly parentCtx: ParserRuleContext; + + constructor(parent: any, invokingState: number); + + depth(): number; + + isEmpty(): boolean; + + getSourceInterval(): Interval; + + getRuleContext(): RuleContext; + + getPayload(): RuleContext; + + getText(): string; + + getAltNumber(): number; + + setAltNumber(altNumber: number): void; + + getChild(i: number): any; + + getChildCount(): number; + + accept(visitor: ParseTreeVisitor): void; + + toStringTree(ruleNames: string[], recog: any): string; +} diff --git a/types/antlr4/Token.d.ts b/types/antlr4/Token.d.ts new file mode 100644 index 0000000000..fecf9f7d5c --- /dev/null +++ b/types/antlr4/Token.d.ts @@ -0,0 +1,31 @@ +export class Token { + readonly text: string; + source: any; + type: any; + channel: any; + start: number; + stop: number; + tokenIndex: number; + line: number; + column: number; + + getTokenSource(): any; + + getInputStream(): any; + + static readonly INVALID_TYPE: number; + static readonly EPSILON: number; + static readonly MIN_USER_TOKEN_TYPE: number; + static readonly EOF: number; + static readonly HIDDEN_CHANNEL: number; +} + +export class CommonToken extends Token { + constructor(source: any, type: any, channel: any, start: number, stop: number); + + clone(): Token; + + toString(): string; + + static readonly EMPTY_SOURCE: any; +} diff --git a/types/antlr4/antlr4-tests.ts b/types/antlr4/antlr4-tests.ts new file mode 100644 index 0000000000..f7d75865df --- /dev/null +++ b/types/antlr4/antlr4-tests.ts @@ -0,0 +1,2158 @@ +import { InputStream, CommonTokenStream, Lexer, Parser, ParserRuleContext } from 'antlr4'; +import { TerminalNode } from 'antlr4/tree/Tree'; + +export declare class CLexer extends Lexer { + readonly channelNames: string[]; + readonly modeNames: string[]; + readonly symbolicNames: string[]; + readonly grammarFileName: string; + + constructor(input: InputStream); +} + +export interface PrimaryExpressionContext extends ParserRuleContext { + Identifier(): TerminalNode; + + Constant(): TerminalNode; + + expression(): ExpressionContext; + + genericSelection(): GenericSelectionContext; + + compoundStatement(): CompoundStatementContext; + + unaryExpression(): UnaryExpressionContext; + + typeName(): TypeNameContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +interface GenericSelectionContext extends ParserRuleContext { + assignmentExpression(): AssignmentExpressionContext; + + genericAssocList(): GenericAssocListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface GenericAssocListContext extends ParserRuleContext { + genericAssociation(): GenericAssociationContext; + + genericAssocList(): GenericAssocListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface GenericAssociationContext extends ParserRuleContext { + typeName(): TypeNameContext; + + assignmentExpression(): AssignmentExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface PostfixExpressionContext extends ParserRuleContext { + primaryExpression(): PrimaryExpressionContext; + + typeName(): TypeNameContext; + + initializerList(): InitializerListContext; + + postfixExpression(): PostfixExpressionContext; + + expression(): ExpressionContext; + + argumentExpressionList(): ArgumentExpressionListContext; + + Identifier(): TerminalNode; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ArgumentExpressionListContext extends ParserRuleContext { + assignmentExpression(): AssignmentExpressionContext; + + argumentExpressionList(): ArgumentExpressionListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface UnaryExpressionContext extends ParserRuleContext { + postfixExpression(): PostfixExpressionContext; + + unaryExpression(): UnaryExpressionContext; + + unaryOperator(): UnaryOperatorContext; + + castExpression(): CastExpressionContext; + + typeName(): TypeNameContext; + + Identifier(): TerminalNode; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface UnaryOperatorContext extends ParserRuleContext { + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface CastExpressionContext extends ParserRuleContext { + typeName(): TypeNameContext; + + castExpression(): CastExpressionContext; + + unaryExpression(): UnaryExpressionContext; + + DigitSequence(): TerminalNode; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface MultiplicativeExpressionContext extends ParserRuleContext { + castExpression(): CastExpressionContext; + + multiplicativeExpression(): MultiplicativeExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface AdditiveExpressionContext extends ParserRuleContext { + multiplicativeExpression(): MultiplicativeExpressionContext; + + additiveExpression(): AdditiveExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ShiftExpressionContext extends ParserRuleContext { + additiveExpression(): AdditiveExpressionContext; + + shiftExpression(): ShiftExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface RelationalExpressionContext extends ParserRuleContext { + shiftExpression(): ShiftExpressionContext; + + relationalExpression(): RelationalExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface EqualityExpressionContext extends ParserRuleContext { + relationalExpression(): RelationalExpressionContext; + + equalityExpression(): EqualityExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface AndExpressionContext extends ParserRuleContext { + equalityExpression(): EqualityExpressionContext; + + andExpression(): AndExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ExclusiveOrExpressionContext extends ParserRuleContext { + andExpression(): AndExpressionContext; + + exclusiveOrExpression(): ExclusiveOrExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface InclusiveOrExpressionContext extends ParserRuleContext { + exclusiveOrExpression(): ExclusiveOrExpressionContext; + + inclusiveOrExpression(): InclusiveOrExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface LogicalAndExpressionContext extends ParserRuleContext { + inclusiveOrExpression(): InclusiveOrExpressionContext; + + logicalAndExpression(): LogicalAndExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface LogicalOrExpressionContext extends ParserRuleContext { + logicalAndExpression(): LogicalAndExpressionContext; + + logicalOrExpression(): LogicalOrExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ConditionalExpressionContext extends ParserRuleContext { + logicalOrExpression(): LogicalOrExpressionContext; + + expression(): ExpressionContext; + + conditionalExpression(): ConditionalExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface AssignmentExpressionContext extends ParserRuleContext { + conditionalExpression(): ConditionalExpressionContext; + + unaryExpression(): UnaryExpressionContext; + + assignmentOperator(): AssignmentOperatorContext; + + assignmentExpression(): AssignmentExpressionContext; + + DigitSequence(): TerminalNode; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface AssignmentOperatorContext extends ParserRuleContext { + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ExpressionContext extends ParserRuleContext { + assignmentExpression(): AssignmentExpressionContext; + + expression(): ExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ConstantExpressionContext extends ParserRuleContext { + conditionalExpression(): ConditionalExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface DeclarationContext extends ParserRuleContext { + declarationSpecifiers(): DeclarationSpecifiersContext; + + initDeclaratorList(): InitDeclaratorListContext; + + staticAssertDeclaration(): StaticAssertDeclarationContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface DeclarationSpecifiersContext extends ParserRuleContext { + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface DeclarationSpecifiers2Context extends ParserRuleContext { + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface DeclarationSpecifierContext extends ParserRuleContext { + storageClassSpecifier(): StorageClassSpecifierContext; + + typeSpecifier(): TypeSpecifierContext; + + typeQualifier(): TypeQualifierContext; + + functionSpecifier(): FunctionSpecifierContext; + + alignmentSpecifier(): AlignmentSpecifierContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface InitDeclaratorListContext extends ParserRuleContext { + initDeclarator(): InitDeclaratorContext; + + initDeclaratorList(): InitDeclaratorListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface InitDeclaratorContext extends ParserRuleContext { + declarator(): DeclaratorContext; + + initializer(): InitializerContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface StorageClassSpecifierContext extends ParserRuleContext { + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface TypeSpecifierContext extends ParserRuleContext { + atomicTypeSpecifier(): AtomicTypeSpecifierContext; + + structOrUnionSpecifier(): StructOrUnionSpecifierContext; + + enumSpecifier(): EnumSpecifierContext; + + typedefName(): TypedefNameContext; + + constantExpression(): ConstantExpressionContext; + + typeSpecifier(): TypeSpecifierContext; + + pointer(): PointerContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface StructOrUnionSpecifierContext extends ParserRuleContext { + structOrUnion(): StructOrUnionContext; + + structDeclarationList(): StructDeclarationListContext; + + Identifier(): TerminalNode; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface StructOrUnionContext extends ParserRuleContext { + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface StructDeclarationListContext extends ParserRuleContext { + structDeclaration(): StructDeclarationContext; + + structDeclarationList(): StructDeclarationListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface StructDeclarationContext extends ParserRuleContext { + specifierQualifierList(): SpecifierQualifierListContext; + + structDeclaratorList(): StructDeclaratorListContext; + + staticAssertDeclaration(): StaticAssertDeclarationContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface SpecifierQualifierListContext extends ParserRuleContext { + typeSpecifier(): TypeSpecifierContext; + + specifierQualifierList(): SpecifierQualifierListContext; + + typeQualifier(): TypeQualifierContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface StructDeclaratorListContext extends ParserRuleContext { + structDeclarator(): StructDeclaratorContext; + + structDeclaratorList(): StructDeclaratorListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface StructDeclaratorContext extends ParserRuleContext { + declarator(): DeclaratorContext; + + constantExpression(): ConstantExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface EnumSpecifierContext extends ParserRuleContext { + enumeratorList(): EnumeratorListContext; + + Identifier(): TerminalNode; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface EnumeratorListContext extends ParserRuleContext { + enumerator(): EnumeratorContext; + + enumeratorList(): EnumeratorListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface EnumeratorContext extends ParserRuleContext { + enumerationConstant(): EnumerationConstantContext; + + constantExpression(): ConstantExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface EnumerationConstantContext extends ParserRuleContext { + Identifier(): TerminalNode; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface AtomicTypeSpecifierContext extends ParserRuleContext { + typeName(): TypeNameContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface TypeQualifierContext extends ParserRuleContext { + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface FunctionSpecifierContext extends ParserRuleContext { + gccAttributeSpecifier(): GccAttributeSpecifierContext; + + Identifier(): TerminalNode; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface AlignmentSpecifierContext extends ParserRuleContext { + typeName(): TypeNameContext; + + constantExpression(): ConstantExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface DeclaratorContext extends ParserRuleContext { + directDeclarator(): DirectDeclaratorContext; + + pointer(): PointerContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface DirectDeclaratorContext extends ParserRuleContext { + Identifier(): TerminalNode; + + declarator(): DeclaratorContext; + + DigitSequence(): TerminalNode; + + pointer(): PointerContext; + + directDeclarator(): DirectDeclaratorContext; + + typeSpecifier(): TypeSpecifierContext; + + typeQualifierList(): TypeQualifierListContext; + + assignmentExpression(): AssignmentExpressionContext; + + parameterTypeList(): ParameterTypeListContext; + + identifierList(): IdentifierListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface GccDeclaratorExtensionContext extends ParserRuleContext { + gccAttributeSpecifier(): GccAttributeSpecifierContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface GccAttributeSpecifierContext extends ParserRuleContext { + gccAttributeList(): GccAttributeListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface GccAttributeListContext extends ParserRuleContext { + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface GccAttributeContext extends ParserRuleContext { + argumentExpressionList(): ArgumentExpressionListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface NestedParenthesesBlockContext extends ParserRuleContext { + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface PointerContext extends ParserRuleContext { + typeQualifierList(): TypeQualifierListContext; + + pointer(): PointerContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface TypeQualifierListContext extends ParserRuleContext { + typeQualifier(): TypeQualifierContext; + + typeQualifierList(): TypeQualifierListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ParameterTypeListContext extends ParserRuleContext { + parameterList(): ParameterListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ParameterListContext extends ParserRuleContext { + parameterDeclaration(): ParameterDeclarationContext; + + parameterList(): ParameterListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ParameterDeclarationContext extends ParserRuleContext { + declarationSpecifiers(): DeclarationSpecifiersContext; + + declarator(): DeclaratorContext; + + declarationSpecifiers2(): DeclarationSpecifiers2Context; + + abstractDeclarator(): AbstractDeclaratorContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface IdentifierListContext extends ParserRuleContext { + Identifier(): TerminalNode; + + identifierList(): IdentifierListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface TypeNameContext extends ParserRuleContext { + specifierQualifierList(): SpecifierQualifierListContext; + + abstractDeclarator(): AbstractDeclaratorContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface AbstractDeclaratorContext extends ParserRuleContext { + pointer(): PointerContext; + + directAbstractDeclarator(): DirectAbstractDeclaratorContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface DirectAbstractDeclaratorContext extends ParserRuleContext { + abstractDeclarator(): AbstractDeclaratorContext; + + typeQualifierList(): TypeQualifierListContext; + + assignmentExpression(): AssignmentExpressionContext; + + parameterTypeList(): ParameterTypeListContext; + + directAbstractDeclarator(): DirectAbstractDeclaratorContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface TypedefNameContext extends ParserRuleContext { + Identifier(): TerminalNode; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface InitializerContext extends ParserRuleContext { + assignmentExpression(): AssignmentExpressionContext; + + initializerList(): InitializerListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface InitializerListContext extends ParserRuleContext { + initializer(): InitializerContext; + + designation(): DesignationContext; + + initializerList(): InitializerListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface DesignationContext extends ParserRuleContext { + designatorList(): DesignatorListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface DesignatorListContext extends ParserRuleContext { + designator(): DesignatorContext; + + designatorList(): DesignatorListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface DesignatorContext extends ParserRuleContext { + constantExpression(): ConstantExpressionContext; + + Identifier(): TerminalNode; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface StaticAssertDeclarationContext extends ParserRuleContext { + constantExpression(): ConstantExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface StatementContext extends ParserRuleContext { + labeledStatement(): LabeledStatementContext; + + compoundStatement(): CompoundStatementContext; + + expressionStatement(): ExpressionStatementContext; + + selectionStatement(): SelectionStatementContext; + + iterationStatement(): IterationStatementContext; + + jumpStatement(): JumpStatementContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface LabeledStatementContext extends ParserRuleContext { + Identifier(): TerminalNode; + + statement(): StatementContext; + + constantExpression(): ConstantExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface CompoundStatementContext extends ParserRuleContext { + blockItemList(): BlockItemListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface BlockItemListContext extends ParserRuleContext { + blockItem(): BlockItemContext; + + blockItemList(): BlockItemListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface BlockItemContext extends ParserRuleContext { + statement(): StatementContext; + + declaration(): DeclarationContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ExpressionStatementContext extends ParserRuleContext { + expression(): ExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface SelectionStatementContext extends ParserRuleContext { + expression(): ExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface IterationStatementContext extends ParserRuleContext { + While(): TerminalNode; + + expression(): ExpressionContext; + + statement(): StatementContext; + + Do(): TerminalNode; + + For(): TerminalNode; + + forCondition(): ForConditionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ForConditionContext extends ParserRuleContext { + forDeclaration(): ForDeclarationContext; + + expression(): ExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ForDeclarationContext extends ParserRuleContext { + declarationSpecifiers(): DeclarationSpecifiersContext; + + initDeclaratorList(): InitDeclaratorListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ForExpressionContext extends ParserRuleContext { + assignmentExpression(): AssignmentExpressionContext; + + forExpression(): ForExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface JumpStatementContext extends ParserRuleContext { + Identifier(): TerminalNode; + + expression(): ExpressionContext; + + unaryExpression(): UnaryExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface CompilationUnitContext extends ParserRuleContext { + EOF(): any; + + translationUnit(): TranslationUnitContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface TranslationUnitContext extends ParserRuleContext { + externalDeclaration(): ExternalDeclarationContext; + + translationUnit(): TranslationUnitContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ExternalDeclarationContext extends ParserRuleContext { + functionDefinition(): FunctionDefinitionContext; + + declaration(): DeclarationContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface FunctionDefinitionContext extends ParserRuleContext { + declarator(): DeclaratorContext; + + compoundStatement(): CompoundStatementContext; + + declarationSpecifiers(): DeclarationSpecifiersContext; + + declarationList(): DeclarationListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface DeclarationListContext extends ParserRuleContext { + declaration(): DeclarationContext; + + declarationList(): DeclarationListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export declare class CParser extends Parser { + readonly ruleNames: string[]; + readonly literalNames: string[]; + readonly symbolicNames: string[]; + + constructor(input: CommonTokenStream); + + primaryExpression(): PrimaryExpressionContext; + + genericSelection(): GenericSelectionContext; + + genericAssociation(): GenericAssociationContext; + + unaryExpression(): UnaryExpressionContext; + + unaryOperator(): UnaryOperatorContext; + + castExpression(): CastExpressionContext; + + conditionalExpression(): ConditionalExpressionContext; + + assignmentExpression(): AssignmentExpressionContext; + + assignmentOperator(): AssignmentOperatorContext; + + constantExpression(): ConstantExpressionContext; + + declaration(): DeclarationContext; + + declarationSpecifiers(): DeclarationSpecifiersContext; + + declarationSpecifiers2(): DeclarationSpecifiers2Context; + + declarationSpecifier(): DeclarationSpecifierContext; + + initDeclarator(): InitDeclaratorContext; + + storageClassSpecifier(): StorageClassSpecifierContext; + + structOrUnionSpecifier(): StructOrUnionSpecifierContext; + + structOrUnion(): StructOrUnionContext; + + structDeclaration(): StructDeclarationContext; + + specifierQualifierList(): SpecifierQualifierListContext; + + structDeclarator(): StructDeclaratorContext; + + enumSpecifier(): EnumSpecifierContext; + + enumerator(): EnumeratorContext; + + enumerationConstant(): EnumerationConstantContext; + + atomicTypeSpecifier(): AtomicTypeSpecifierContext; + + typeQualifier(): TypeQualifierContext; + + functionSpecifier(): FunctionSpecifierContext; + + alignmentSpecifier(): AlignmentSpecifierContext; + + declarator(): DeclaratorContext; + + gccDeclaratorExtension(): GccDeclaratorExtensionContext; + + gccAttributeSpecifier(): GccAttributeSpecifierContext; + + gccAttributeList(): GccAttributeListContext; + + gccAttribute(): GccAttributeContext; + + nestedParenthesesBlock(): NestedParenthesesBlockContext; + + pointer(): PointerContext; + + parameterTypeList(): ParameterTypeListContext; + + parameterDeclaration(): ParameterDeclarationContext; + + typeName(): TypeNameContext; + + abstractDeclarator(): AbstractDeclaratorContext; + + typedefName(): TypedefNameContext; + + initializer(): InitializerContext; + + designation(): DesignationContext; + + designator(): DesignatorContext; + + staticAssertDeclaration(): StaticAssertDeclarationContext; + + statement(): StatementContext; + + labeledStatement(): LabeledStatementContext; + + compoundStatement(): CompoundStatementContext; + + blockItem(): BlockItemContext; + + expressionStatement(): ExpressionStatementContext; + + selectionStatement(): SelectionStatementContext; + + iterationStatement(): IterationStatementContext; + + forCondition(): ForConditionContext; + + forDeclaration(): ForDeclarationContext; + + jumpStatement(): JumpStatementContext; + + compilationUnit(): CompilationUnitContext; + + externalDeclaration(): ExternalDeclarationContext; + + functionDefinition(): FunctionDefinitionContext; + + reset(): any; + + matchWildcard(): any; + + getParseListeners(): any; + + removeParseListeners(): any; + + triggerEnterRuleEvent(): any; + + triggerExitRuleEvent(): any; + + getTokenFactory(): any; + + getATNWithBypassAlts(): any; + + getInputStream(): any; + + getTokenStream(): any; + + getCurrentToken(): any; + + consume(): any; + + addContextToParseTree(): any; + + exitRule(): any; + + getPrecedence(): any; + + getExpectedTokens(): any; + + getExpectedTokensWithinCurrentRule(): any; + + getDFAStrings(): any; + + dumpDFA(): any; + + getSourceName(): any; + + removeErrorListeners(): any; + + getTokenTypeMap(): any; + + getRuleIndexMap(): any; + + getErrorListenerDispatch(): any; +} + +const inputStream = new InputStream('int x = 10;'); +const lexer = new CLexer(inputStream); +const tokenStream = new CommonTokenStream(lexer); +const parser = new CParser(tokenStream); + +// execute the parse, and generate the parse tree +const tree = parser.compilationUnit(); +console.log(tree); diff --git a/types/antlr4/error/ErrorListener.d.ts b/types/antlr4/error/ErrorListener.d.ts new file mode 100644 index 0000000000..be03bef912 --- /dev/null +++ b/types/antlr4/error/ErrorListener.d.ts @@ -0,0 +1,15 @@ +import { Recognizer } from '../Recognizer'; +import { Token } from '../Token'; + +export class ErrorListener { + syntaxError(recognizer: Recognizer, offendingSymbol: Token, line: number, column: number, msg: string, e: any): void; + reportAmbiguity(recognizer: Recognizer, dfa: any, startIndex: number, stopIndex: number, exact: any, ambigAlts: any, configs: any): void; + reportAttemptingFullContext(recognizer: Recognizer, dfa: any, startIndex: number, stopIndex: number, conflictingAlts: any, configs: any): void; + reportContextSensitivity(recognizer: Recognizer, dfa: any, startIndex: number, stopIndex: number, conflictingAlts: any, configs: any): void; +} + +export class ConsoleErrorListener extends ErrorListener { +} + +export class ProxyErrorListener extends ErrorListener { +} diff --git a/types/antlr4/error/ErrorStrategy.d.ts b/types/antlr4/error/ErrorStrategy.d.ts new file mode 100644 index 0000000000..5b11bcbe6a --- /dev/null +++ b/types/antlr4/error/ErrorStrategy.d.ts @@ -0,0 +1,21 @@ +import { Recognizer } from '../Recognizer'; + +export class ErrorStrategy { + reset(recognizer: Recognizer): void; + + recoverInline(recognizer: Recognizer): void; + + recover(recognizer: Recognizer, e: Error): void; + + sync(recognizer: Recognizer): void; + + inErrorRecoveryMode(recognizer: Recognizer): void; + + reportError(recognizer: Recognizer): void; +} + +export class DefaultErrorStrategy extends ErrorStrategy { +} + +export class BailErrorStrategy extends ErrorStrategy { +} diff --git a/types/antlr4/error/Errors.d.ts b/types/antlr4/error/Errors.d.ts new file mode 100644 index 0000000000..11e348dace --- /dev/null +++ b/types/antlr4/error/Errors.d.ts @@ -0,0 +1,30 @@ +import { ParserRuleContext } from '../ParserRuleContext'; +import { Recognizer } from '../Recognizer'; +import { InputStream } from '../InputStream'; +import { Token } from '../Token'; + +export class RecognitionException extends Error { + message: string; + ctx: ParserRuleContext; + recognizer: Recognizer; + input: InputStream; + offendingToken: Token; + offendingState: -1; + getExpectedTokens(): Token[]; + toString(): string; +} + +export class LexerNoViableAltException extends RecognitionException { +} + +export class NoViableAltException extends RecognitionException { +} + +export class InputMismatchException extends RecognitionException { +} + +export class FailedPredicateException extends RecognitionException { +} + +export class ParseCancellationException extends RecognitionException { +} diff --git a/types/antlr4/error/index.d.ts b/types/antlr4/error/index.d.ts new file mode 100644 index 0000000000..3ef46979d3 --- /dev/null +++ b/types/antlr4/error/index.d.ts @@ -0,0 +1,3 @@ +export * from './ErrorListener'; +export * from './ErrorStrategy'; +export * from './Errors'; diff --git a/types/antlr4/index.d.ts b/types/antlr4/index.d.ts new file mode 100644 index 0000000000..1d6fc4c003 --- /dev/null +++ b/types/antlr4/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for antlr4 4.7 +// Project: https://github.com/antlr/antlr4 +// Definitions by: Marlon Chatman +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export * from './Lexer'; +export * from './Parser'; +export * from './Recognizer'; +export * from './ParserRuleContext'; +export * from './IntervalSet'; +export * from './CommonTokenStream'; +export * from './InputStream'; +export * from './Token'; +import { ParserRuleContext } from './ParserRuleContext'; + +export type AntlrRule = ParserRuleContext; diff --git a/types/antlr4/tree/Tree.d.ts b/types/antlr4/tree/Tree.d.ts new file mode 100644 index 0000000000..45a91a3bfa --- /dev/null +++ b/types/antlr4/tree/Tree.d.ts @@ -0,0 +1,80 @@ +import { Interval } from '../IntervalSet'; +import { Token } from '../Token'; +import { ParserRuleContext } from '../ParserRuleContext'; + +export const INVALID_INTERVAL: Interval; + +export class ParseTree { +} + +export class RuleNode extends ParseTree { +} + +export class TerminalNode implements ParseTree { + constructor(symbol: Token); + + getChild(i: number): any; + + getSymbol(): Token; + + getParent(): any; + + getPayload(): Token; + + getSourceInterval(): Interval; + + getChildCount(): number; + + accept(visitor: ParseTreeVisitor): any; + + getText(): string; + + toString(): string; + + readonly parentCtx: any; + readonly symbol: Token; +} + +export class ErrorNode extends TerminalNode { +} + +export class ParseTreeVisitor { + visit(ctx: ParserRuleContext): any; + + visitChildren(ctx: ParserRuleContext): any; + + visitTerminal(node: TerminalNode): any; + + visitErrorNode(node: ErrorNode): any; +} + +export interface ParseTreeListener { + visitTerminal(node: TerminalNode): void; + + visitErrorNode(node: ErrorNode): void; + + enterEveryRule(node: ParserRuleContext): void; + + exitEveryRule(node: ParserRuleContext): void; +} + +export class TerminalNodeImpl extends TerminalNode { +} + +export class ErrorNodeImpl extends TerminalNode { + constructor(token: Token); + + isErrorNode(): boolean; + + accept(visitor: ParseTreeVisitor): any; +} + +export class ParseTreeWalker { + static readonly DEFAULT: ParseTreeWalker; + + walk(listener: ParseTreeListener, rule: any): void; + + enterRule(listener: ParseTreeListener, rule: any): void; + + exitRule(listener: ParseTreeListener, rule: any): void; +} diff --git a/types/antlr4/tsconfig.json b/types/antlr4/tsconfig.json new file mode 100644 index 0000000000..32f7586a75 --- /dev/null +++ b/types/antlr4/tsconfig.json @@ -0,0 +1,39 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "error/ErrorListener.d.ts", + "error/Errors.d.ts", + "error/ErrorStrategy.d.ts", + "error/index.d.ts", + "tree/Tree.d.ts", + "antlr4-tests.ts", + "BufferedTokenStream.d.ts", + "CommonTokenStream.d.ts", + "index.d.ts", + "InputStream.d.ts", + "IntervalSet.d.ts", + "Lexer.d.ts", + "Parser.d.ts", + "ParserRuleContext.d.ts", + "Recognizer.d.ts", + "RuleContext.d.ts", + "Token.d.ts" + ] +} diff --git a/types/antlr4/tslint.json b/types/antlr4/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/antlr4/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/apollo-upload-client/apollo-upload-client-tests.ts b/types/apollo-upload-client/apollo-upload-client-tests.ts new file mode 100644 index 0000000000..4db60bfaf3 --- /dev/null +++ b/types/apollo-upload-client/apollo-upload-client-tests.ts @@ -0,0 +1,16 @@ +import { createUploadLink, ReactNativeFile } from "apollo-upload-client"; + +new ReactNativeFile({ + name: "its coming home", + type: "its coming", + uri: "football's coming home", +}); + +createUploadLink({ + fetch: (uri, options) => fetch(`http://localhost/${uri}`, options), + fetchOptions: { method: "GET" }, + headers: { special: "Special header value" }, + includeExtensions: true, + uri: "http://localhost", + credentials: "beepboop", +}); diff --git a/types/apollo-upload-client/index.d.ts b/types/apollo-upload-client/index.d.ts new file mode 100644 index 0000000000..7c1e3cb7b6 --- /dev/null +++ b/types/apollo-upload-client/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for apollo-upload-client 8.1 +// Project: https://github.com/jaydenseric/apollo-upload-client#readme +// Definitions by: Edward Sammut Alessi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import { ApolloLink } from "apollo-link"; +import { HttpOptions } from "apollo-link-http-common"; + +export { ReactNativeFile } from "extract-files"; + +/** + * `createUploadLink` options match `createHttpLink` options + * @param linkOptions `HttpOptions` + */ +export function createUploadLink(linkOptions?: HttpOptions): ApolloLink; diff --git a/types/apollo-upload-client/package.json b/types/apollo-upload-client/package.json new file mode 100644 index 0000000000..580aaf19c4 --- /dev/null +++ b/types/apollo-upload-client/package.json @@ -0,0 +1,7 @@ +{ + "private": true, + "dependencies": { + "apollo-link": "^1.0.0", + "apollo-link-http-common": "^0.2.4" + } +} diff --git a/types/apollo-upload-client/tsconfig.json b/types/apollo-upload-client/tsconfig.json new file mode 100644 index 0000000000..2a023ff111 --- /dev/null +++ b/types/apollo-upload-client/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", + "apollo-upload-client-tests.ts" + ] +} diff --git a/types/apollo-upload-client/tslint.json b/types/apollo-upload-client/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/apollo-upload-client/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/arcgis-js-api/index.d.ts b/types/arcgis-js-api/index.d.ts index 4944b00bf2..baf6145ff9 100644 --- a/types/arcgis-js-api/index.d.ts +++ b/types/arcgis-js-api/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ArcGIS API for JavaScript 4.7 +// Type definitions for ArcGIS API for JavaScript 4.8 // Project: http://js.arcgis.com // Definitions by: Esri // Bjorn Svensson @@ -156,6 +156,10 @@ declare namespace __esri { export type BaseTileLayerLayerviewDestroyEventHandler = (event: BaseTileLayerLayerviewDestroyEvent) => void; + export type BingMapsLayerLayerviewCreateEventHandler = (event: BingMapsLayerLayerviewCreateEvent) => void; + + export type BingMapsLayerLayerviewDestroyEventHandler = (event: BingMapsLayerLayerviewDestroyEvent) => void; + export type CSVLayerLayerviewCreateEventHandler = (event: CSVLayerLayerviewCreateEvent) => void; export type CSVLayerLayerviewDestroyEventHandler = (event: CSVLayerLayerviewDestroyEvent) => void; @@ -620,6 +624,14 @@ declare namespace __esri { * [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 with 2D WebGL enabled [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html). To use your own hosted fonts, make sure to follow our naming conventions (e.g. "arial-unicode-ms-bold"). + * + * [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. * @@ -668,6 +680,10 @@ declare namespace __esri { export const config: config; + export type AfterInterceptorCallback = (response: RequestResponse) => void; + + export type BeforeInterceptorCallback = (params: any, requestOptions: RequestOptions) => any; + export interface configRequest extends Object { /** @@ -685,42 +701,7 @@ declare namespace __esri { */ corsDetectionTimeout?: number; /** - * A list of servers known to support CORS specification. Out of the box, this list includes many Esri hosted servers that are known to support CORS and is updated at every release as the list grows. The library is capable of automatically detecting CORS support for servers used in an application (see `corsDetection`), but if you are already aware that a server supports CORS, then it should be added to this list. Since the API includes some servers by default it's important to add items onto this array rather than overwriting it. The following servers are enabled by default: - * * `basemaps.arcgis.com` (added in 4.3) - * * `demographics1.arcgis.com` (added in 4.4) - * * `demographics2.arcgis.com` (added in 4.4) - * * `demographics3.arcgis.com` (added in 4.4) - * * `demographics4.arcgis.com` (added in 4.4) - * * `demographics5.arcgis.com` (added in 4.4) - * * `demographics6.arcgis.com` (added in 4.4) - * * `elevation3d.arcgis.com` - * * `geocode.arcgis.com` - * * `geoenrich.arcgis.com` - * * `js.arcgis.com` - * * `server.arcgisonline.com` - * * `services.arcgis.com` - * * `services.arcgisonline.com` - * * `services1.arcgis.com` - * * `services2.arcgis.com` - * * `services3.arcgis.com` - * * `services4.arcgis.com` - * * `services5.arcgis.com` - * * `services6.arcgis.com` - * * `services7.arcgis.com` - * * `services8.arcgis.com` - * * `services9.arcgis.com` - * * `static.arcgis.com` - * * `tiles.arcgis.com` - * * `tiles1.arcgis.com` - * * `tiles2.arcgis.com` - * * `tiles3.arcgis.com` - * * `tiles4.arcgis.com` - * * `utility.arcgis.com` (added in 4.4) - * * `utility.arcgisonline.com` - * * `www.arcgis.com` - * - * - * Example: + * A list of servers known to support CORS specification. By default, this list includes many Esri hosted servers that are known to support CORS and is updated at every release as the list grows. The API is capable of automatically detecting CORS support for servers used in an application (see `corsDetection`). If you are aware that a server supports CORS, add it to this list. Since the API includes some servers by default it's important to add items onto this array rather than overwriting it. Example: * ```js * // Add a known server to the list. * require(["esri/config"], function(esriConfig) { @@ -749,6 +730,37 @@ declare namespace __esri { * [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. An array of interceptors that will return the first one that matches. If no urls are specified, will apply to all relevant requests. 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 + * urls: featureLayerUrl, + * // use the BeforeInterceptorCallback to check if the query of the + * // FeatureLayer has a maxAllowableOffset property set. + * // if so, then set the maxAllowableOffset to 0 + * before: function(params) { + * if (params.requestOptions.query.maxAllowableOffset) { + * params.requestOptions.query.maxAllowableOffset = 0; + * } + * }, + * // use the AfterInterceptorCallback to check if `ssl` is set to 'true' + * // on the response to the request, if it's set to 'false', change + * // the value to 'true' before returning the response + * after: function(response) { + * if (!response.ssl) { + * response.ssl = true; + * } + * } + * }); + * ``` + * + * [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. * @@ -807,7 +819,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) */ - host?: string; + host?: string | RegExp; /** * Indicates whether requests made to the associated server should include credentials such as cookies and authorization headers. * @@ -884,6 +896,50 @@ declare namespace __esri { packages?: any[]; } + /** + * 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; + /** + * Callback function that can make changes to the 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`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) + */ + headers?: any; + /** + * Appends a query statement to the request in the Query String Parameters of the header. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) + */ + query?: any; + /** + * Hardcodes the response. The request will not be sent. This is resolved as the response `data`. + * + * [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 undefined, interceptors will apply to all relevant requests. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) + */ + urls?: string | RegExp | any[]; + } + export type WatchCallback = (newValue: any, oldValue: any, propertyName: string, target: Accessor) => void; @@ -1179,7 +1235,7 @@ declare namespace __esri { interface JSONSupport { /** - * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. + * 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) * @@ -1254,15 +1310,6 @@ declare namespace __esri { */ readonly loadWarnings: any[]; - /** - * **Deprecated at 4.7.** `always()` may be used to execute a function if creating an instance of the class is rejected or resolved. The input function will always execute no matter the response. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#always) - * - * @param callbackOrErrback The function to execute when creating an instance of the class is rejected or resolved. - * - */ - always(callbackOrErrback?: Function): IPromise; /** * Cancels a [load()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#load) operation if it is already in progress. * @@ -1303,15 +1350,6 @@ declare namespace __esri { * */ load(): IPromise; - /** - * **Deprecated at 4.7.** Use `otherwise()` to call a function once creating an instance of the class is rejected. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#otherwise) - * - * @param errback The function to execute when creating an instance of the class fails. - * - */ - otherwise(errback?: Function): 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. * @@ -1337,15 +1375,6 @@ declare namespace __esri { } interface corePromise { - /** - * **Deprecated at 4.7.** `always()` may be used to execute a function if creating an instance of the class is rejected or resolved. The input function will always execute no matter the response. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Promise.html#always) - * - * @param callbackOrErrback The function to execute when creating an instance of the class is rejected or resolved. - * - */ - always(callbackOrErrback?: Function): IPromise; /** * `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. * @@ -1370,15 +1399,6 @@ declare namespace __esri { * */ isResolved(): boolean; - /** - * **Deprecated at 4.7.** Use `otherwise()` to call a function once creating an instance of the class is rejected. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Promise.html#otherwise) - * - * @param errback The function to execute when creating an instance of the class fails. - * - */ - otherwise(errback?: Function): 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. * @@ -2136,7 +2156,7 @@ declare namespace __esri { * * @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. **Known values**: automatic | new-180-in-zone-01 | new-180-in-zone-60 | old-180-in-zone-01 | old-180-in-zone-60 + * @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; @@ -2162,7 +2182,7 @@ declare namespace __esri { * * @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. **Known values**: latitude-band-indicators | north-south-indicators + * @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; @@ -2212,7 +2232,7 @@ declare namespace __esri { * [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. **Known values**: dd | ddm | dms + * @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. * */ @@ -2239,7 +2259,7 @@ declare namespace __esri { * [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. **Known values**: automatic | new-180-in-zone-01 | new-180-in-zone-60 | old-180-in-zone-01 | old-180-in-zone-60 + * @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. * @@ -2289,7 +2309,7 @@ declare namespace __esri { * [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. **Known values**: latitude-band-indicators | north-south-indicators + * @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. * */ @@ -2569,7 +2589,7 @@ declare namespace __esri { */ readonly cache: any; /** - * The extent of the geometry. For points, the extent is null. + * 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) */ @@ -4602,7 +4622,7 @@ declare namespace __esri { * @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, 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** @@ -4616,7 +4636,7 @@ declare namespace __esri { * @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, extent?: Extent): GeographicTransformation[]; + getTransformations(inSpatialReference: SpatialReference | SpatialReferenceProperties, outSpatialReference: SpatialReference | SpatialReferenceProperties, extent?: Extent): GeographicTransformation[]; /** * Indicates if all dependencies of this module have been loaded. * @@ -5289,7 +5309,7 @@ declare namespace __esri { */ layer: Layer; /** - * The template for displaying content in a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when the graphic is selected. The [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) may be used to access a graphic's [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes) and display their values in the view's default popup. See the documentation for [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) for details on how to display attribute values in the popup. As of version 4.5, if the `popupTemplate` is not defined on the `Graphic`, it will use the graphic [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#layer) popupTemplate. + * 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) */ @@ -5326,6 +5346,14 @@ declare namespace __esri { * */ 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. * @@ -5373,7 +5401,7 @@ declare namespace __esri { */ layer?: LayerProperties; /** - * The template for displaying content in a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when the graphic is selected. The [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) may be used to access a graphic's [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes) and display their values in the view's default popup. See the documentation for [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) for details on how to display attribute values in the popup. As of version 4.5, if the `popupTemplate` is not defined on the `Graphic`, it will use the graphic [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#layer) popupTemplate. + * 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) */ @@ -5409,6 +5437,28 @@ declare namespace __esri { * @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. @@ -5464,6 +5514,28 @@ declare namespace __esri { * [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; } /** @@ -5505,6 +5577,39 @@ declare namespace __esri { } + export interface GroundNavigationConstraintProperties extends Object { + /** + * 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 GroundNavigationConstraint extends AnonymousAccessor { + /** + * 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. @@ -6614,12 +6719,12 @@ declare namespace __esri { * * @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 col The column (x) position of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param options Optional settings for the tile request. The options have the following properties. * @param options.allowImageDataAccess Indicates if access to pixels of the image is allowed. This value must be set to `true` if the layer will be drawn in 3D and [WebGL textures](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Getting_started_with_WebGL) are required to display the layer. Loading of WebGL textures is dependent on [cross-domain access](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Using_textures_in_WebGL#Cross-domain_textures) controls. This option allows cross-domain access to create WebGL textures. * */ - fetchTile(level: number, row: number, column: number, options?: BaseTileLayerFetchTileOptions): IPromise; + fetchTile(level: number, row: number, col: number, options?: BaseTileLayerFetchTileOptions): IPromise; /** * Returns the bounds of the tile as an array of four numbers that be readily converted to an [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) object. The value for each item in the array is described in the following table: * @@ -6647,10 +6752,10 @@ declare namespace __esri { * * @param level Level of detail. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param row Tile row. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). - * @param column Tile column. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). + * @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, column: number): string | IPromise; + getTileUrl(level: number, row: number, col: number): string | IPromise; on(name: "layerview-create", eventHandler: BaseTileLayerLayerviewCreateEventHandler): IHandle; @@ -6711,6 +6816,119 @@ declare namespace __esri { view: View; } + 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; + /** + * 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; + } + + 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; + } + + export const BingMapsLayer: BingMapsLayerConstructor; + + 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 CSVLayer extends Layer { /** * Copyright information for the layer. @@ -6758,19 +6976,24 @@ declare namespace __esri { */ fields: Field[]; /** - * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) property of this layer must be set to `true`. - * > **Known Limitations** There is no support for labeling in 2D. Labeling is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Each graphic can have only one label. Multiple [Label classes](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) with different [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#where) clauses can be used to have different label styles on different features that belong to the same layer (for example blue labels for lakes and green labels for parks). + * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) property of this layer must be set to `true`. Multiple Label classes with different `where` clauses can be used to define several labels with varying styles on the same feature. Likewise, multiple label classes may be used to label different types of features (for example blue labels for lakes and green labels for parks). + * > **Known Limitations** + * * WebGL must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. + * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelingInfo) */ labelingInfo: LabelClass[]; /** * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelingInfo) property. - * > **Known Limitations** There is no support for labeling in 2D. Labeling is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** + * * WebGL must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. + * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * * Currently the `labelsVisible` property must be explicitly set to `true` for labels to be printed. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) * - * @default false + * @default true */ labelsVisible: boolean; /** @@ -6860,17 +7083,23 @@ declare namespace __esri { */ 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. - * > **Capabilities and Limitations** The following lists capabilities with some limitations when executing a query: - * * Use [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where) to query based on a SQL where clause. - * * You can perform spatial queries using the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) parameters with the following limitations: - * * The `geometry` parameter only supports [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) and [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries. - * * The only supported `spatialRelationship` is `intersects`. - * * The `distance` and `units` parameters are not supported. - * * You can query fields for statistics using onStatisticField. However, - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param). - * * The `orderByField` param is not supported. + * > **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) * @@ -6880,15 +7109,13 @@ declare namespace __esri { queryExtent(params?: Query | QueryProperties): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against 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. - * > **Capabilities and Limitations** The following lists capabilities with some limitations when executing a query: - * * Use [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where) to query based on a SQL where clause. - * * You can perform spatial queries using the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) parameters with the following limitations: - * * The `geometry` parameter only supports [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) and [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries. - * * The only supported `spatialRelationship` is `intersects`. - * * The `distance` and `units` parameters are not supported. - * * You can query fields for statistics using onStatisticField. However, - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param). - * * The `orderByField` param is not supported. + * > **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) * @@ -6898,15 +7125,13 @@ declare namespace __esri { queryFeatureCount(params?: Query | QueryProperties): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against 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. - * > **Capabilities and Limitations** The following lists capabilities with some limitations when executing a query: - * * Use [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where) to query based on a SQL where clause. - * * You can perform spatial queries using the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) parameters with the following limitations: - * * The `geometry` parameter only supports [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) and [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries. - * * The only supported `spatialRelationship` is `intersects`. - * * The `distance` and `units` parameters are not supported. - * * You can query fields for statistics using onStatisticField. However, - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param). - * * The `orderByField` param is not supported. + * > **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) * @@ -6916,15 +7141,13 @@ declare namespace __esri { queryFeatures(params?: Query | QueryProperties): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against 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. - * > **Capabilities and Limitations** The following lists capabilities with some limitations when executing a query: - * * Use [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where) to query based on a SQL where clause. - * * You can perform spatial queries using the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) parameters with the following limitations: - * * The `geometry` parameter only supports [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) and [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries. - * * The only supported `spatialRelationship` is `intersects`. - * * The `distance` and `units` parameters are not supported. - * * You can query fields for statistics using onStatisticField. However, - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param). - * * The `orderByField` param is not supported. + * > **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) * @@ -6998,19 +7221,24 @@ declare namespace __esri { */ fields?: FieldProperties[]; /** - * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) property of this layer must be set to `true`. - * > **Known Limitations** There is no support for labeling in 2D. Labeling is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Each graphic can have only one label. Multiple [Label classes](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) with different [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#where) clauses can be used to have different label styles on different features that belong to the same layer (for example blue labels for lakes and green labels for parks). + * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) property of this layer must be set to `true`. Multiple Label classes with different `where` clauses can be used to define several labels with varying styles on the same feature. Likewise, multiple label classes may be used to label different types of features (for example blue labels for lakes and green labels for parks). + * > **Known Limitations** + * * WebGL must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. + * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelingInfo) */ labelingInfo?: LabelClassProperties[]; /** * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelingInfo) property. - * > **Known Limitations** There is no support for labeling in 2D. Labeling is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** + * * WebGL must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. + * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * * Currently the `labelsVisible` property must be explicitly set to `true` for labels to be printed. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) * - * @default false + * @default true */ labelsVisible?: boolean; /** @@ -7277,7 +7505,7 @@ declare namespace __esri { rotation?: number; } - interface ElevationLayer extends Layer, ArcGISMapService, ArcGISCachedService, PortalLayer, TiledLayer { + interface ElevationLayer extends Layer, ArcGISCachedService, PortalLayer { /** * URL pointing to the Elevation layer resource on an ArcGIS Image Server. * @@ -7317,6 +7545,17 @@ declare namespace __esri { * */ 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. * @@ -7358,7 +7597,7 @@ declare namespace __esri { export const ElevationLayer: ElevationLayerConstructor; - interface ElevationLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISCachedServiceProperties, PortalLayerProperties, TiledLayerProperties { + interface ElevationLayerProperties extends LayerProperties, ArcGISCachedServiceProperties, PortalLayerProperties { /** * URL pointing to the Elevation layer resource on an ArcGIS Image Server. * @@ -7517,7 +7756,7 @@ declare namespace __esri { */ featureReduction: FeatureLayerFeatureReduction; /** - * An array of fields in the layer. Each field represents an attribute that may contain a value for each feature in the layer. For example, a field named `POP_2015`, stores information about total population as a numeric value for each feature; this value represents the total number of people living within the geographic bounds of the feature. This property must be set in the constructor when creating a FeatureLayer from client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). To create FeatureLayers from client-side graphics you must also set the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties. + * An array of fields in the layer. Each field represents an attribute that may contain a value for each feature in the layer. For example, a field named `POP_2015`, stores information about total population as a numeric value for each feature; this value represents the total number of people living within the geographic bounds of the feature. This property must be set in the constructor when creating a FeatureLayer from client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). To create FeatureLayers from client-side graphics you must also set the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) */ @@ -7529,7 +7768,7 @@ declare namespace __esri { */ readonly gdbVersion: string; /** - * The geometry type of features in the layer. All features must be of the same type. This property is read-only when the layer is created from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url). However, when creating a FeatureLayer from client-side graphics, this property must be specified in the layer's constructor along with the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), and [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField) properties. **Possible Values:** point | mulitpoint | polyline | polygon | extent | mesh + * The geometry type of features in the layer. All features must be of the same type. This property is read-only when the layer is created from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url). However, when creating a FeatureLayer from client-side graphics, this property must be specified in the layer's constructor along with the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties. **Possible Values:** point | mulitpoint | polyline | polygon | extent | mesh * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) */ @@ -7565,19 +7804,26 @@ declare namespace __esri { */ historicMoment: Date; /** - * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer such as label expression, placement, and size. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelsVisible) property of this layer must be set to `true`. - * > **Known Limitations** There is no support for labeling in 2D. Labeling is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Each graphic can have only one label. Multiple [Label classes](esri-layers-support-LabelClass.html) with different [where](esri-layers-support-LabelClass.html#where) clauses can be used to have different label styles on different features that belong to the same layer (for example blue labels for lakes and green labels for parks). + * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer such as label expression, placement, and size. The [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelsVisible) property of this layer must be set to `true` for labels to display in the view. Multiple Label classes with different `where` clauses can be used to define several labels with varying styles on the same feature. Likewise, multiple label classes may be used to label different types of features (for example blue labels for lakes and green labels for parks). + * > **Known Limitations** + * * [WebGL](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-rendering) must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. Be sure to review the [WebGL limitations](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-limitations). + * * Currently only FeatureLayers with point and polygon geometries are supported. + * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo) */ labelingInfo: LabelClass[]; /** * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo) property. - * > **Known Limitations** There is no support for labeling in 2D. Labeling is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** + * * [WebGL](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-rendering) must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. Be sure to review the [WebGL limitations](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-limitations). + * * Currently only FeatureLayers with point and polygon geometries are supported. + * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * * Currently 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 false + * @default true */ labelsVisible: boolean; /** @@ -7600,7 +7846,7 @@ declare namespace __esri { */ legendEnabled: boolean; /** - * The name of one of the provided [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) for each graphic containing a unique value or identifier for that graphic. This is required when constructing a FeatureLayer from a collection of client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). When creating a FeatureLayer from client-side graphics, the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties must also be set. + * The name of one of the provided [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) for each graphic containing a unique value or identifier for that graphic. This is required when constructing a FeatureLayer from a collection of client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). When creating a FeatureLayer from client-side graphics, the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties must also be set. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField) */ @@ -7626,25 +7872,25 @@ declare namespace __esri { */ popupTemplate: PopupTemplate; /** - * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. + * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. However, when creating a FeatureLayer from client-side graphics, this property must be specified in the layer's constructor along with the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties. * * [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 `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 false + * @default undefined */ returnM: boolean; /** - * When `true`, indicates that Z values will be returned. + * 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 false + * @default undefined */ returnZ: boolean; /** @@ -7657,13 +7903,13 @@ declare namespace __esri { */ screenSizePerspectiveEnabled: boolean; /** - * A collection of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) objects used to create a FeatureLayer. This property should only used when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties must also be set. + * A collection of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) objects used to create a FeatureLayer. This property should only used when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties must also be set. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source) */ source: Collection; /** - * The spatial reference of the layer. When creating the layer from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url), the spatial reference is read from the service. This property should be set explicitly when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties must also be set. + * The spatial reference of the layer. When creating the layer from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url), the spatial reference is read from the service. This property should be set explicitly when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties must also be set. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference) */ @@ -7854,13 +8100,13 @@ declare namespace __esri { */ featureReduction?: FeatureLayerFeatureReduction; /** - * An array of fields in the layer. Each field represents an attribute that may contain a value for each feature in the layer. For example, a field named `POP_2015`, stores information about total population as a numeric value for each feature; this value represents the total number of people living within the geographic bounds of the feature. This property must be set in the constructor when creating a FeatureLayer from client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). To create FeatureLayers from client-side graphics you must also set the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties. + * An array of fields in the layer. Each field represents an attribute that may contain a value for each feature in the layer. For example, a field named `POP_2015`, stores information about total population as a numeric value for each feature; this value represents the total number of people living within the geographic bounds of the feature. This property must be set in the constructor when creating a FeatureLayer from client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). To create FeatureLayers from client-side graphics you must also set the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) */ fields?: FieldProperties[]; /** - * The geometry type of features in the layer. All features must be of the same type. This property is read-only when the layer is created from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url). However, when creating a FeatureLayer from client-side graphics, this property must be specified in the layer's constructor along with the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), and [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField) properties. **Possible Values:** point | mulitpoint | polyline | polygon | extent | mesh + * The geometry type of features in the layer. All features must be of the same type. This property is read-only when the layer is created from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url). However, when creating a FeatureLayer from client-side graphics, this property must be specified in the layer's constructor along with the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties. **Possible Values:** point | mulitpoint | polyline | polygon | extent | mesh * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) */ @@ -7872,19 +8118,26 @@ declare namespace __esri { */ historicMoment?: DateProperties; /** - * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer such as label expression, placement, and size. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelsVisible) property of this layer must be set to `true`. - * > **Known Limitations** There is no support for labeling in 2D. Labeling is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Each graphic can have only one label. Multiple [Label classes](esri-layers-support-LabelClass.html) with different [where](esri-layers-support-LabelClass.html#where) clauses can be used to have different label styles on different features that belong to the same layer (for example blue labels for lakes and green labels for parks). + * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer such as label expression, placement, and size. The [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelsVisible) property of this layer must be set to `true` for labels to display in the view. Multiple Label classes with different `where` clauses can be used to define several labels with varying styles on the same feature. Likewise, multiple label classes may be used to label different types of features (for example blue labels for lakes and green labels for parks). + * > **Known Limitations** + * * [WebGL](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-rendering) must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. Be sure to review the [WebGL limitations](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-limitations). + * * Currently only FeatureLayers with point and polygon geometries are supported. + * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo) */ labelingInfo?: LabelClassProperties[]; /** * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo) property. - * > **Known Limitations** There is no support for labeling in 2D. Labeling is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** + * * [WebGL](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-rendering) must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. Be sure to review the [WebGL limitations](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-limitations). + * * Currently only FeatureLayers with point and polygon geometries are supported. + * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * * Currently 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 false + * @default true */ labelsVisible?: boolean; /** @@ -7907,7 +8160,7 @@ declare namespace __esri { */ legendEnabled?: boolean; /** - * The name of one of the provided [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) for each graphic containing a unique value or identifier for that graphic. This is required when constructing a FeatureLayer from a collection of client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). When creating a FeatureLayer from client-side graphics, the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties must also be set. + * The name of one of the provided [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) for each graphic containing a unique value or identifier for that graphic. This is required when constructing a FeatureLayer from a collection of client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). When creating a FeatureLayer from client-side graphics, the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties must also be set. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField) */ @@ -7933,25 +8186,25 @@ declare namespace __esri { */ popupTemplate?: PopupTemplateProperties; /** - * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. + * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. However, when creating a FeatureLayer from client-side graphics, this property must be specified in the layer's constructor along with the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties. * * [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 `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 false + * @default undefined */ returnM?: boolean; /** - * When `true`, indicates that Z values will be returned. + * 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 false + * @default undefined */ returnZ?: boolean; /** @@ -7964,13 +8217,13 @@ declare namespace __esri { */ screenSizePerspectiveEnabled?: boolean; /** - * A collection of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) objects used to create a FeatureLayer. This property should only used when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties must also be set. + * A collection of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) objects used to create a FeatureLayer. This property should only used when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties must also be set. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source) */ source?: CollectionProperties; /** - * The spatial reference of the layer. When creating the layer from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url), the spatial reference is read from the service. This property should be set explicitly when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties must also be set. + * The spatial reference of the layer. When creating the layer from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url), the spatial reference is read from the service. This property should be set explicitly when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties must also be set. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference) */ @@ -8356,7 +8609,7 @@ declare namespace __esri { export interface FeatureLayerElevationInfo extends Object { /** - * Defines how the graphic is placed with respect to the terrain surface. [returnZ](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#returnZ) must be set to `true` if z-values of the features should be considered for the elevation mode. If the geometry consists of multiple points (e.g. lines or polygons), the elevation is evaluated separately for each point. See the table below for a list of possible values. + * 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 * ------|------------ @@ -8556,6 +8809,12 @@ declare namespace __esri { * @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. @@ -9021,7 +9280,7 @@ declare namespace __esri { */ id: string; /** - * Indicates how the layer should display in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget. The known values are listed below. + * 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 * ------|------------ @@ -9131,7 +9390,7 @@ declare namespace __esri { */ id?: string; /** - * Indicates how the layer should display in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget. The known values are listed below. + * 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 * ------|------------ @@ -9274,30 +9533,24 @@ 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; - - /** - * Creates a new instance of [this class]() and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input `json` parameter often comes from a response to a query operation in the REST API or a [toJSON()](http://pro.arcgis.com/en/pro-app/tool-reference/conversion/features-to-json.htm) method from another ArcGIS product. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for details and examples of when and how to use this function. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISCachedService.html#fromJSON) - * - * @param json A JSON representation of the instance in the ArcGIS format. See the [ArcGIS REST API documentation](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; - /** - * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISCachedService.html#toJSON) - * - * - */ - toJSON(): any; } interface ArcGISCachedServiceConstructor { @@ -9311,6 +9564,12 @@ declare namespace __esri { export const ArcGISCachedService: ArcGISCachedServiceConstructor; 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. * @@ -9341,7 +9600,7 @@ declare namespace __esri { */ gdbVersion: string; /** - * The output image type. **Known Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg | pngjpg + * 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) * @@ -9379,6 +9638,19 @@ declare namespace __esri { */ 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-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; /** * 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. * @@ -9396,19 +9668,6 @@ declare namespace __esri { * */ findSublayerById(id: number): Sublayer; - /** - * 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#getExportImageParameters) - * - * @param extent The extent of the exported image - * @param width The width of the exported image - * @param height The height of the exported image - * @param options The parameter options is an object with the following properties. - * @param options.rotation The rotation in degrees of the exported image. Available since ArcGIS Server 10.3. - * - */ - getExportImageParameters(extent: Extent, width: number, height: number, options?: ArcGISDynamicMapServiceGetExportImageParametersOptions): any; } interface ArcGISDynamicMapServiceConstructor { @@ -9435,7 +9694,7 @@ declare namespace __esri { */ gdbVersion?: string; /** - * The output image type. **Known Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg | pngjpg + * 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) * @@ -9475,11 +9734,11 @@ declare namespace __esri { } - export interface ArcGISDynamicMapServiceGetExportImageParametersOptions extends Object { + 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#getExportImageParameters) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#createExportImageParameters) */ rotation?: number; } @@ -9524,7 +9783,7 @@ declare namespace __esri { */ fields: Field[]; /** - * The output image type. The default value is `lerc` if a [pixelFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#pixelFilter) is set on the layer. **Known Values:** png | png8 | png24 | png32 | jpg | bmp | gif | jpgpng | lerc + * 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) * @@ -9578,7 +9837,7 @@ declare namespace __esri { */ multidimensionalInfo: any; /** - * The pixel type. **Known Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 + * 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) */ @@ -9697,7 +9956,7 @@ declare namespace __esri { */ fields?: FieldProperties[]; /** - * The output image type. The default value is `lerc` if a [pixelFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#pixelFilter) is set on the layer. **Known Values:** png | png8 | png24 | png32 | jpg | bmp | gif | jpgpng | lerc + * 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) * @@ -9751,7 +10010,7 @@ declare namespace __esri { */ multidimensionalInfo?: any; /** - * The pixel type. **Known Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 + * 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) */ @@ -9798,7 +10057,13 @@ declare namespace __esri { interface ArcGISMapService { /** - * The copyright text as defined by the map service. + * 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) */ @@ -9810,7 +10075,15 @@ declare namespace __esri { */ fullExtent: Extent; /** - * The spatial reference of the layer as defined by the map service. + * 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) */ @@ -9821,6 +10094,12 @@ declare namespace __esri { * [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 { @@ -9835,7 +10114,7 @@ declare namespace __esri { interface ArcGISMapServiceProperties { /** - * The copyright text as defined by the map service. + * The copyright text as defined by the service. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#copyright) */ @@ -9846,6 +10125,96 @@ declare namespace __esri { * [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 rendering can be modifyied 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; } interface PortalLayer { @@ -10080,8 +10449,6 @@ declare namespace __esri { new(properties?: OpenStreetMapLayerProperties): OpenStreetMapLayer; - - fromJSON(json: any): OpenStreetMapLayer; } export const OpenStreetMapLayer: OpenStreetMapLayerConstructor; @@ -10240,7 +10607,8 @@ declare namespace __esri { */ elevationInfo: SceneLayerElevationInfo; /** - * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. This property is only supported for point scene layers with non-draped [Icon](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. [![declutter](https://developers.arcgis.com/javascript/latest/assets/img/samples/city-points-declutter.gif)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-point-styles/index.html) + * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. This property is only supported for point scene layers with non-draped [Icon](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. [![declutter](https://developers.arcgis.com/javascript/latest/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) */ @@ -10269,7 +10637,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelsVisible) * - * @default false + * @default true */ labelsVisible: boolean; /** @@ -10412,7 +10780,8 @@ declare namespace __esri { */ elevationInfo?: SceneLayerElevationInfo; /** - * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. This property is only supported for point scene layers with non-draped [Icon](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. [![declutter](https://developers.arcgis.com/javascript/latest/assets/img/samples/city-points-declutter.gif)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-point-styles/index.html) + * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. This property is only supported for point scene layers with non-draped [Icon](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. [![declutter](https://developers.arcgis.com/javascript/latest/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) */ @@ -10441,7 +10810,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelsVisible) * - * @default false + * @default true */ labelsVisible?: boolean; /** @@ -10887,7 +11256,7 @@ declare namespace __esri { */ description: string; /** - * Name of the default drawing tool defined for the template to create a feature. **Known Values:** auto-complete-polygon | circle | ellipse | freehand | line | none | point | polygon | rectangle | arrow | triangle | left-arrow | right-arrow | up-arrow | down-arrow + * 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) */ @@ -10930,7 +11299,7 @@ declare namespace __esri { */ description?: string; /** - * Name of the default drawing tool defined for the template to create a feature. **Known Values:** auto-complete-polygon | circle | ellipse | freehand | line | none | point | polygon | rectangle | arrow | triangle | left-arrow | right-arrow | up-arrow | down-arrow + * 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) */ @@ -10958,7 +11327,7 @@ declare namespace __esri { export interface FeatureTemplateThumbnail extends Object { /** - * The MIME type of the image. **Known Values:** image | png | jpg | jpeg + * 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) */ @@ -11163,7 +11532,7 @@ declare namespace __esri { */ extent: Extent; /** - * Map image format. **Known Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg + * 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) * @@ -11195,7 +11564,7 @@ declare namespace __esri { */ layerIds: number[]; /** - * The option for displaying or hiding the layer. **Known Values:** show | hide | include | exclude + * 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) */ @@ -11249,7 +11618,7 @@ declare namespace __esri { */ extent?: ExtentProperties; /** - * Map image format. **Known Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg + * 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) * @@ -11281,7 +11650,7 @@ declare namespace __esri { */ layerIds?: number[]; /** - * The option for displaying or hiding the layer. **Known Values:** show | hide | include | exclude + * 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) */ @@ -11427,20 +11796,21 @@ declare namespace __esri { */ labelExpression: string; /** - * Defines the content of label text for [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). If working with [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html), use [labelExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) instead. Attribute values may be included in label expressions. To include an attribute value in a label, wrap the name of the field in curly braces. See the example snippet below. + * 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. Known values are based on the feature type. This property requires a value for labels to be visible. **Known Values (Points):** above-center | above-left | above-right | below-center | below-left | below-right | center-center | center-left | center-right **Known Values (Polylines):** above-after | above-along | above-before | above-start | above-end | below-after | below-along | below-before | below-start | below-end | center-after | center-along | center-before | center-start | center-end **Known Values (Polygons):** always-horizontal + * 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) then only "above-center" is supported. - * * 3D layers only support label placement for [Points](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). - * - * + * * Currently, if the label has a [line callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html) in a 3D SceneView, then only `above-center` is supported. + * * Label placement only applies to [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) layers in 3D SceneViews. + * * FeatureLayers only support labeling for [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) and [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries rendered with WebGL. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelPlacement) + * + * @default null */ labelPlacement: string; /** @@ -11472,7 +11842,8 @@ declare namespace __esri { */ 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. + * 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) */ @@ -11490,7 +11861,7 @@ declare namespace __esri { interface LabelClassConstructor { /** - * Defines label expressions, symbols, scale ranges, label priorities, and sets of label placement options for different groups of labels on a layer. + * 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) */ @@ -11510,20 +11881,21 @@ declare namespace __esri { */ labelExpression?: string; /** - * Defines the content of label text for [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). If working with [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html), use [labelExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) instead. Attribute values may be included in label expressions. To include an attribute value in a label, wrap the name of the field in curly braces. See the example snippet below. + * 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. Known values are based on the feature type. This property requires a value for labels to be visible. **Known Values (Points):** above-center | above-left | above-right | below-center | below-left | below-right | center-center | center-left | center-right **Known Values (Polylines):** above-after | above-along | above-before | above-start | above-end | below-after | below-along | below-before | below-start | below-end | center-after | center-along | center-before | center-start | center-end **Known Values (Polygons):** always-horizontal + * 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) then only "above-center" is supported. - * * 3D layers only support label placement for [Points](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). - * - * + * * Currently, if the label has a [line callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html) in a 3D SceneView, then only `above-center` is supported. + * * Label placement only applies to [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) layers in 3D SceneViews. + * * FeatureLayers only support labeling for [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) and [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries rendered with WebGL. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelPlacement) + * + * @default null */ labelPlacement?: string; /** @@ -11555,7 +11927,8 @@ declare namespace __esri { */ 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. + * 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) */ @@ -11565,13 +11938,13 @@ declare namespace __esri { export interface LabelClassLabelExpressionInfo extends Object { /** - * The expression defining the content of the label text. **Deprecated as of v4.5. Use `expression` instead.** + * 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. `IIF($feature.POPULATION > 10000, $feature.NAME + ' city', $feature.NAME + ' town')` + * 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) */ @@ -11656,7 +12029,7 @@ declare namespace __esri { */ height: number; /** - * URL to the returned image. The image format must be of a type supported by the HTML `` tag. **Known Values:** gif | jpg | png | bmp + * 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) */ @@ -11715,7 +12088,7 @@ declare namespace __esri { */ height?: number; /** - * URL to the returned image. The image format must be of a type supported by the HTML `` tag. **Known Values:** gif | jpg | png | bmp + * 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) */ @@ -11766,7 +12139,7 @@ declare namespace __esri { */ lockRasterIds: number[]; /** - * The mosaic method determines how the selected rasters are ordered. **Known Values:** none | center | nadir | viewpoint | attribute | lock-raster | northwest | seamline + * 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) */ @@ -11784,7 +12157,7 @@ declare namespace __esri { */ objectIds: number[]; /** - * Defines the mosaic operation used to resolve overlapping pixels. **Known Values:** first | last | min | max | mean | blend + * 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) */ @@ -11845,7 +12218,7 @@ declare namespace __esri { */ lockRasterIds?: number[]; /** - * The mosaic method determines how the selected rasters are ordered. **Known Values:** none | center | nadir | viewpoint | attribute | lock-raster | northwest | seamline + * 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) */ @@ -11863,7 +12236,7 @@ declare namespace __esri { */ objectIds?: number[]; /** - * Defines the mosaic operation used to resolve overlapping pixels. **Known Values:** first | last | min | max | mean | blend + * 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) */ @@ -11914,7 +12287,7 @@ declare namespace __esri { */ pixels: number[][]; /** - * The pixel type. **Known Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 + * 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) */ @@ -11931,42 +12304,6 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#width) */ width: number; - - /** - * Adds another plane to the PixelBlock. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#addData) - * - * @param planeData The data to add to the PixelBlock. - * @param planeData.pixels A two dimensional array representing the pixels to add. - * @param planeData.statistics An array of objects containing numeric statistical properties. See [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#statistics) for details on the specifications of each object. - * - */ - addData(planeData: PixelBlockAddDataPlaneData): void; - /** - * Returns pixels and masks using a single array in bip format (e.g. [p_00_r, p_00_g, p_00_b, p_00_a, p_10_r, p_10_g, p_10_b, p_10_a, .....]). Use this method to get an unsigned 8 bit pixel array. The result can be used to create a webgl texture. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#getAsRGBA) - * - * - */ - getAsRGBA(): number[]; - /** - * Similar to [getAsRGBA](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#getAsRGBA), but returns floating point data. The result can be used to create a webgl texture (OES_texture_float). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#getAsRGBAFloat) - * - * - */ - getAsRGBAFloat(): number[]; - /** - * Returns the plane band count of the PixelBlock. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#getPlaneCount) - * - * - */ - getPlaneCount(): number; } interface PixelBlockConstructor { @@ -11997,7 +12334,7 @@ declare namespace __esri { */ pixels?: number[][]; /** - * The pixel type. **Known Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 + * 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) */ @@ -12017,22 +12354,6 @@ declare namespace __esri { } - export interface PixelBlockAddDataPlaneData extends Object { - /** - * A two dimensional array representing the pixels to add. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#addData) - */ - pixels: number[][]; - /** - * An array of objects containing numeric statistical properties. See [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#statistics) for details on the specifications of each object. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#addData) - */ - statistics: any[]; - } - - export interface PixelBlockStatistics extends Object { /** * The maximum pixel value in the [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) array. @@ -12108,7 +12429,7 @@ declare namespace __esri { */ functionName: string; /** - * Defines the pixel type of the output image. **Known Values:** c128 | c64 | f32 | f64 | s16 | s32 | s8 | u1 | u16 | u2 | u32 | u4 | u8 | unknown + * 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) * @@ -12151,7 +12472,7 @@ declare namespace __esri { */ functionName?: string; /** - * Defines the pixel type of the output image. **Known Values:** c128 | c64 | f32 | f64 | s16 | s32 | s8 | u1 | u16 | u2 | u32 | u4 | u8 | unknown + * 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) * @@ -12296,7 +12617,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelsVisible) * - * @default false + * @default true */ labelsVisible: boolean; /** @@ -12366,7 +12687,7 @@ declare namespace __esri { /** * The popup template for the sublayer. When set, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when the user clicks the image. Sublayers with a [RasterDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) cannot be queried and therefore do not support [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). * > **Known Limitations** - * * [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions are not supported in PopupTemplates set on MapImageLayer sublayers unless they reference ArcGIS Enterprise 10.6.1 map services (or later) created from ArcGIS Pro. + * * [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions are not supported in PopupTemplates set on MapImageLayer sublayers 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) */ @@ -12374,8 +12695,8 @@ declare namespace __esri { /** * The renderer to apply to the sublayer. This value overrides the renderer read from the map service. * > **Known Limitations** - * * [3D symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html) are not supported in renderers set on MapImageLayer 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.1 map services (or later) created from ArcGIS Pro. + * * [3D symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html) are not currently supported in renderers set on MapImageLayer 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) */ @@ -12482,7 +12803,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelsVisible) * - * @default false + * @default true */ labelsVisible?: boolean; /** @@ -12552,7 +12873,7 @@ declare namespace __esri { /** * The popup template for the sublayer. When set, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when the user clicks the image. Sublayers with a [RasterDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) cannot be queried and therefore do not support [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). * > **Known Limitations** - * * [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions are not supported in PopupTemplates set on MapImageLayer sublayers unless they reference ArcGIS Enterprise 10.6.1 map services (or later) created from ArcGIS Pro. + * * [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions are not supported in PopupTemplates set on MapImageLayer sublayers 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) */ @@ -12560,8 +12881,8 @@ declare namespace __esri { /** * The renderer to apply to the sublayer. This value overrides the renderer read from the map service. * > **Known Limitations** - * * [3D symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html) are not supported in renderers set on MapImageLayer 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.1 map services (or later) created from ArcGIS Pro. + * * [3D symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html) are not currently supported in renderers set on MapImageLayer 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) */ @@ -13481,61 +13802,25 @@ declare namespace __esri { title?: string; } - interface TiledLayer { - /** - * The tiling scheme information for the layer. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TiledLayer.html#tileInfo) - */ - tileInfo: TileInfo; - } - - interface TiledLayerConstructor { - - - new(properties?: TiledLayerProperties): TiledLayer; - - fromJSON(json: any): TiledLayer; - } - - export const TiledLayer: TiledLayerConstructor; - - interface TiledLayerProperties { - /** - * The tiling scheme information for the layer. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TiledLayer.html#tileInfo) - */ - tileInfo?: TileInfoProperties; - } - - interface TileLayer extends Layer, ArcGISMapService, ArcGISCachedService, RefreshableLayer, ScaleRangeLayer, PortalLayer, TiledLayer { + interface TileLayer extends Layer, ArcGISMapService, ArcGISCachedService, RefreshableLayer, ScaleRangeLayer, PortalLayer { /** * The URL that points to the location of the layer's attribution data. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#attributionDataUrl) */ readonly attributionDataUrl: string; - /** - * Indicates if the layer has attribution data. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#hasAttributionData) - */ - readonly hasAttributionData: boolean; - /** - * Indicates whether the layer will be included in the legend. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#legendEnabled) - * - * @default true - */ - legendEnabled: boolean; /** * An array of tile servers used for changing map tiles. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#tileServers) */ tileServers: string[]; + /** + * 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. * @@ -13550,12 +13835,13 @@ declare namespace __esri { * * @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 col The column(x) position of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param options Optional settings for the tile request. The options have the following properties. * @param options.allowImageDataAccess Indicates if the access to pixels of the image is allowed. + * @param options.timestamp Number to append to the tile request to prevent fetching the tile from the browser cache. * */ - fetchTile(level: number, row: number, column: number, options?: TileLayerFetchTileOptions): IPromise; + 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. * @@ -13588,15 +13874,7 @@ declare namespace __esri { export const TileLayer: TileLayerConstructor; - interface TileLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISCachedServiceProperties, RefreshableLayerProperties, ScaleRangeLayerProperties, PortalLayerProperties, TiledLayerProperties { - /** - * Indicates whether the layer will be included in the legend. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#legendEnabled) - * - * @default true - */ - legendEnabled?: boolean; + interface TileLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISCachedServiceProperties, RefreshableLayerProperties, ScaleRangeLayerProperties, PortalLayerProperties { /** * An array of tile servers used for changing map tiles. * @@ -13633,6 +13911,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#fetchTile) */ allowImageDataAccess?: boolean; + /** + * Number to append to the tile request to prevent fetching the tile from the browser cache. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#fetchTile) + */ + timestamp?: boolean; } interface UnknownLayer extends Layer { @@ -13705,19 +13989,31 @@ declare namespace __esri { view: View; } - interface VectorTileLayer extends Layer, PortalLayer, ScaleRangeLayer, TiledLayer { + 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. * @@ -13730,6 +14026,12 @@ declare namespace __esri { * [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). * @@ -13744,7 +14046,7 @@ declare namespace __esri { url: string; /** - * Loads a style to render a layer from the specified URL to a style resource or style JSON object. It is equivalent of changing the entire CSS style sheet for web page. + * 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) * @@ -13773,7 +14075,13 @@ declare namespace __esri { export const VectorTileLayer: VectorTileLayerConstructor; - interface VectorTileLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties, TiledLayerProperties { + 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. * @@ -13786,6 +14094,12 @@ declare namespace __esri { * [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. * @@ -13809,27 +14123,71 @@ declare namespace __esri { } + 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; + + 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 { /** - * The URL of a vector tile service. + * Absolute URL for a vector tile service. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) */ serviceUrl: string; /** - * The URL of a style for vector tiles. + * Absolute URL for vector tile service style. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) */ styleUrl: string; /** - * The sprite URL included in a style. + * Asbolute URL for sprites included in a style. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) */ spriteUrl: string; /** - * The template URL of font sets for vector tiles. The URL includes `{fontstack}` and `{range}` tokens. + * 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) */ @@ -13848,7 +14206,7 @@ declare namespace __esri { layerDefinition: any; } - interface WebTileLayer extends Layer, TiledLayer, ScaleRangeLayer, RefreshableLayer { + interface WebTileLayer extends Layer, ScaleRangeLayer, RefreshableLayer { /** * The attribution information for the layer. * @@ -13870,11 +14228,23 @@ declare namespace __esri { */ subDomains: string[]; /** - * The tile server names for the layer. + * 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) */ - tileServers: string[]; + 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. * @@ -13882,6 +14252,32 @@ declare namespace __esri { */ 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.allowImageDataAccess Indicates if the access to pixels of the image is allowed. + * @param options.timestamp A timestamp to append to the tile url to avoid loading a cached version of the tile. + * + */ + 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; @@ -13896,13 +14292,11 @@ declare namespace __esri { */ new(properties?: WebTileLayerProperties): WebTileLayer; - - fromJSON(json: any): WebTileLayer; } export const WebTileLayer: WebTileLayerConstructor; - interface WebTileLayerProperties extends LayerProperties, TiledLayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { + interface WebTileLayerProperties extends LayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { /** * The attribution information for the layer. * @@ -13916,11 +14310,11 @@ declare namespace __esri { */ subDomains?: string[]; /** - * The tile server names for the layer. + * The tiling scheme information for the layer. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#tileServers) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#tileInfo) */ - tileServers?: string[]; + 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. * @@ -13943,6 +14337,22 @@ declare namespace __esri { view: View; } + + export interface WebTileLayerFetchTileOptions extends Object { + /** + * Indicates if the access to pixels of the image is allowed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#fetchTile) + */ + allowImageDataAccess?: boolean; + /** + * A timestamp to append to the tile url to avoid loading a cached version of the tile. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#fetchTile) + */ + timestamp?: boolean; + } + 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. @@ -14480,13 +14890,23 @@ declare namespace __esri { ground?: GroundProperties | string; } + /** + * 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 { + } + + export const pointCloudRenderers: pointCloudRenderers; + 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-Action.html) objects. Each object represents an action or function that may be executed by clicking the icon or image symbolizing them in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). By default, every [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. PopupTemplates do not have default actions. To override actions on the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) using PopupTemplate see [overwriteActions](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#overwriteActions). Actions defined in a PopupTemplate will only appear in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) for features or layers that apply that particular PopupTemplate. The order of each action in the popup is the same order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event in [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the PopupTemplate that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [Action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html) class. + * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) objects. Each object represents an action or function that may be executed by clicking the icon or image symbolizing them in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). By default, every [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. PopupTemplates do not have default actions. To override actions on the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) using PopupTemplate see [overwriteActions](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#overwriteActions). Actions defined in a PopupTemplate will only appear in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) for features or layers that apply that particular PopupTemplate. The order of each action in the popup is the same order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event in [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the PopupTemplate that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#actions) */ - actions: Collection; + 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. @@ -14565,11 +14985,11 @@ 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-Action.html) objects. Each object represents an action or function that may be executed by clicking the icon or image symbolizing them in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). By default, every [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. PopupTemplates do not have default actions. To override actions on the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) using PopupTemplate see [overwriteActions](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#overwriteActions). Actions defined in a PopupTemplate will only appear in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) for features or layers that apply that particular PopupTemplate. The order of each action in the popup is the same order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event in [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the PopupTemplate that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [Action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html) class. + * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) objects. Each object represents an action or function that may be executed by clicking the icon or image symbolizing them in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). By default, every [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. PopupTemplates do not have default actions. To override actions on the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) using PopupTemplate see [overwriteActions](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#overwriteActions). Actions defined in a PopupTemplate will only appear in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) for features or layers that apply that particular PopupTemplate. The order of each action in the popup is the same order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event in [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the PopupTemplate that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#actions) */ - actions?: CollectionProperties; + 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. @@ -14707,7 +15127,7 @@ declare namespace __esri { */ expression: string; /** - * Indicates the return type of the Arcade expression. This is an optional property. **Known Values:** string | number + * 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) */ @@ -14735,7 +15155,7 @@ declare namespace __esri { */ label?: string; /** - * For editable popups, defines the text box format. **Known Values:** rich-text | text-area | text-box + * 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) */ @@ -14757,7 +15177,7 @@ declare namespace __esri { export interface PopupTemplateFieldInfosFormat extends Object { /** - * Used only with Date fields. Specifies how the date should appear in a popup. **Known Values:** short-date | short-date-le | long-date | day-short-month-year | long-month-day-year | short-date-long-time | short-date-le-long-time | short-date-short-time | short-date-le-short-time | short-date-short-time-24 | short-date-le-short-time-24 | short-date-short-time-24 | short-date-le-short-time-24 | long-month-year | short-month-year | year + * 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) */ @@ -14876,7 +15296,7 @@ declare namespace __esri { interface Portal extends Accessor, Loadable { /** - * The access level of the organization. When public, anonymous users can access the organization. When private, access is restricted to only members of the organization. **Known Values:** public | private + * 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) */ @@ -15064,6 +15484,14 @@ declare namespace __esri { * [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. * @@ -15157,7 +15585,7 @@ declare namespace __esri { */ portalHostname: string; /** - * The portal mode. **Known Values:** multitenant | singletenant + * The portal mode. **Possible Values:** multitenant | singletenant * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#portalMode) */ @@ -15219,7 +15647,7 @@ declare namespace __esri { */ readonly thumbnailUrl: string; /** - * Sets the units of measure for the organization's users. The user default is derived from the organization's [region](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#region). **Known Values:** english | metric + * 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) */ @@ -15272,6 +15700,14 @@ declare namespace __esri { * */ 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. * @@ -15280,6 +15716,14 @@ declare namespace __esri { * */ 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. * @@ -15333,7 +15777,7 @@ 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. **Known Values:** public | private + * 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) */ @@ -15521,6 +15965,14 @@ declare namespace __esri { * [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. * @@ -15600,7 +16052,7 @@ declare namespace __esri { */ portalHostname?: string; /** - * The portal mode. **Known Values:** multitenant | singletenant + * The portal mode. **Possible Values:** multitenant | singletenant * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#portalMode) */ @@ -15650,7 +16102,7 @@ declare namespace __esri { */ 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). **Known Values:** english | metric + * 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) */ @@ -15781,7 +16233,7 @@ declare namespace __esri { interface PortalGroup extends Accessor { /** - * The access privileges on the group which determines who can see and access the group. **Known Values:** private | org | public + * 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) */ @@ -15861,6 +16313,14 @@ declare namespace __esri { */ 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. * @@ -15899,7 +16359,7 @@ declare namespace __esri { interface PortalGroupProperties { /** - * The access privileges on the group which determines who can see and access the group. **Known Values:** private | org | public + * 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) */ @@ -15981,12 +16441,24 @@ declare namespace __esri { * [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. * @@ -16011,6 +16483,12 @@ declare namespace __esri { * [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. * @@ -16098,6 +16576,14 @@ declare namespace __esri { * [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). * @@ -16169,7 +16655,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#fetchData) * - * @param responseType The format of the response. **Known Values:** json | xml | text | blob | array-buffer | document + * @param responseType The format of the response. **Possible Values:** json | xml | text | blob | array-buffer | document * */ fetchData(responseType?: string): IPromise; @@ -16252,6 +16738,12 @@ declare namespace __esri { * [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. * @@ -16276,6 +16768,12 @@ declare namespace __esri { * [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. * @@ -16330,6 +16828,14 @@ declare namespace __esri { * [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). * @@ -16375,6 +16881,28 @@ declare namespace __esri { } + 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. @@ -16411,6 +16939,18 @@ declare namespace __esri { } interface PortalQueryParams extends Accessor { + /** + * 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: + * > 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). * @@ -16494,6 +17034,18 @@ declare namespace __esri { export const PortalQueryParams: PortalQueryParamsConstructor; interface PortalQueryParamsProperties { + /** + * 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: + * > 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). * @@ -16661,7 +17213,7 @@ 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. **Known Values:** private | org | public + * 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) */ @@ -16727,7 +17279,7 @@ declare namespace __esri { */ region: string; /** - * Defines the user's role in the organization. See [roleId](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#roleId) for more details about when user has a custom role. **Known Values:** org_admin | org_publisher | org_user + * 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) */ @@ -16745,7 +17297,7 @@ declare namespace __esri { */ readonly thumbnailUrl: string; /** - * The user's personal units of measure setting. **Known Values:** english | metric + * 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) */ @@ -16784,6 +17336,15 @@ declare namespace __esri { * */ 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. * @@ -16842,7 +17403,7 @@ 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. **Known Values:** private | org | public + * 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) */ @@ -16908,7 +17469,7 @@ declare namespace __esri { */ region?: string; /** - * Defines the user's role in the organization. See [roleId](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#roleId) for more details about when user has a custom role. **Known Values:** org_admin | org_publisher | org_user + * 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) */ @@ -16920,7 +17481,7 @@ declare namespace __esri { */ roleId?: string; /** - * The user's personal units of measure setting. **Known Values:** english | metric + * 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) */ @@ -16981,6 +17542,16 @@ declare namespace __esri { start?: number; } + /** + * 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 { + } + + export const renderers: renderers; + interface ClassBreaksRenderer extends Renderer, VisualVariablesMixin { /** * When symbolizing polygon features with graduated symbols, set a [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) on this property to visualize the boundaries of each feature. Use a [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) of varying sizes in the [classBreakInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) to indicate the quantity. @@ -17238,6 +17809,127 @@ declare namespace __esri { title: string; } + interface HeatmapRenderer extends Renderer { + /** + * The area of influence for each point in the layer. This is defined as a radius in pixels. The default is `10`, which means the pixels within a 10-pixel radius of the point's location are assigned an intensity value corresponding to their distance from the nearby point. Increasing this value creates a larger heatmap with more hotspots. Decreasing it makes a smaller heatmap with fewer hotspots. + * + * [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: + * ```js + * [ + * { ratio: 0, color: "rgba(255, 140, 0, 0)" }, + * { ratio: 0.75, color: "rgba(255, 140, 0, 1)" }, + * { 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; + } + + 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; + + fromJSON(json: any): HeatmapRenderer; + } + + export const HeatmapRenderer: HeatmapRendererConstructor; + + 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: + * ```js + * [ + * { ratio: 0, color: "rgba(255, 140, 0, 0)" }, + * { ratio: 0.75, color: "rgba(255, 140, 0, 1)" }, + * { 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 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: @@ -17384,6 +18076,12 @@ declare namespace __esri { * @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. @@ -17482,12 +18180,6 @@ declare namespace __esri { * @default 1 */ scaleFactor?: number; - /** - * Minimum screen space size in points. Applies to `splat` only. **Deprecated since version 4.5** - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointSizeAlgorithm) - */ - minSize?: number; } interface PointCloudRGBRenderer extends PointCloudRenderer { @@ -17782,6 +18474,12 @@ declare namespace __esri { * [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; } interface RendererConstructor { @@ -18106,7 +18804,7 @@ declare namespace __esri { /** * The **rotation** visual variable defines how features rendered with [marker symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html) or [text symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html) in a MapView or [3D object symbol layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html) in a SceneView are rotated. The rotation value is determined by mapping the values to data in a field, or by other arithmetic means with a function. This object may be used to depict variables such as wind direction, vehicle heading, etc. [![renderer-vv-rotation](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/renderer-vv-rotation.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-vv-rotation/index.html) - * > **Known Limitations** In a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) rotation visual variables are not supported with [marker symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html), [text symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html), [3D icon symbol layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) and [3D text symbol layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html). + * > **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) */ @@ -18658,7 +19356,7 @@ declare namespace __esri { * @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. Known 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 | * | ----- | ----------- | @@ -18687,7 +19385,7 @@ declare namespace __esri { * @param params.normalizationField The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. * @param params.theme - * Determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * Determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. * * | Value | Description | Example | * | ----- | ----------- | ------- | @@ -18707,7 +19405,7 @@ declare namespace __esri { * @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. Known 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 | * | ----- | ----------- | @@ -18764,7 +19462,7 @@ declare namespace __esri { * @param params.normalizationField The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. * @param params.theme - * Determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * Determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. * * | Value | Description | Example | * | ----- | ----------- | ------- | @@ -18967,11 +19665,11 @@ declare namespace __esri { /** * 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...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) + * [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. Known 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 | * | ----- | ----------- | @@ -19041,7 +19739,7 @@ declare namespace __esri { */ basemap?: string | Basemap; /** - * Determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * Determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. * * | Value | Description | Example | * | ----- | ----------- | ------- | @@ -19119,11 +19817,11 @@ declare namespace __esri { /** * 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...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) + * [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. Known 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 | * | ----- | ----------- | @@ -19277,7 +19975,7 @@ declare namespace __esri { */ basemap?: string | Basemap; /** - * Determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * Determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. * * | Value | Description | Example | * | ----- | ----------- | ------- | @@ -19347,7 +20045,7 @@ declare namespace __esri { /** * 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...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) + * [Read more...](global.html) */ view?: View; /** @@ -19531,7 +20229,7 @@ declare namespace __esri { * @param params.locationScheme In authoring apps, the user may select a pre-defined location scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. * @param params.view The SceneView instance in which the visualization will be rendered. This parameter is required if `symbolType = "3d-volumetric"`, except for layers with a `mesh` geometryType. * @param params.symbolType - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Known values are described below. + * 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 | * | ----- | ----------- | @@ -19578,11 +20276,11 @@ declare namespace __esri { /** * The SceneView instance in which the visualization will be rendered. This parameter is required if `symbolType = "3d-volumetric"`, except for layers with a `mesh` geometryType. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) + * [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. Known 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 | * | ----- | ----------- | @@ -19741,7 +20439,7 @@ declare namespace __esri { /** * 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...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) + * [Read more...](global.html) */ view?: View; } @@ -19836,7 +20534,7 @@ declare namespace __esri { * @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. Known 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 | * | ----- | ----------- | @@ -19869,7 +20567,7 @@ declare namespace __esri { * @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. Known 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 | * | ----- | ----------- | @@ -20130,11 +20828,11 @@ declare namespace __esri { /** * 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...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) + * [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. Known 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 | * | ----- | ----------- | @@ -20254,11 +20952,11 @@ declare namespace __esri { /** * 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...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) + * [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. Known 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 | * | ----- | ----------- | @@ -20376,7 +21074,7 @@ declare namespace __esri { /** * 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...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) + * [Read more...](global.html) */ view?: View; /** @@ -20494,7 +21192,7 @@ declare namespace __esri { * count | Unique values/types will be sorted from highest to lowest based on the count of features that fall in each category. * value | Unique values/types will be sorted in alphabetical order. * - * **Known Values:** count | value + * **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. * @param params.valueExpressionTitle Text describing the value returned from the `valueExpression`. This is used by the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. @@ -20502,7 +21200,7 @@ declare namespace __esri { * @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. Known 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 | * | ----- | ----------- | @@ -20660,7 +21358,7 @@ declare namespace __esri { * count | Unique values/types will be sorted from highest to lowest based on the count of features that fall in each category. * value | Unique values/types will be sorted in alphabetical order. * - * **Known Values:** count | value + * **Possible Values:** count | value * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) @@ -20701,11 +21399,11 @@ declare namespace __esri { /** * 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...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) + * [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. Known 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 | * | ----- | ----------- | @@ -20809,7 +21507,7 @@ declare namespace __esri { * @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. Known 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 | * | ----- | ----------- | @@ -20983,11 +21681,11 @@ declare namespace __esri { /** * 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...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) + * [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. Known 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 | * | ----- | ----------- | @@ -21007,7 +21705,7 @@ declare namespace __esri { export interface univariateColorSizeCreateContinuousRendererParamsColorOptions extends Object { /** - * Determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * Determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. * * | Value | Description | Example | * | ----- | ----------- | ------- | @@ -21155,7 +21853,7 @@ declare namespace __esri { /** * 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...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) + * [Read more...](global.html) */ view?: View; /** @@ -21169,7 +21867,7 @@ declare namespace __esri { export interface univariateColorSizeCreateVisualVariablesParamsColorOptions extends Object { /** - * Determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * Determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. * * | Value | Description | Example | * | ----- | ----------- | ------- | @@ -21469,7 +22167,7 @@ declare namespace __esri { /** * 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...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) + * [Read more...](global.html) */ view?: View; /** @@ -21657,7 +22355,7 @@ declare namespace __esri { /** * 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...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) + * [Read more...](global.html) */ view?: View; /** @@ -21850,7 +22548,7 @@ declare namespace __esri { /** * 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...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) + * [Read more...](global.html) */ view?: View; /** @@ -21945,7 +22643,7 @@ declare namespace __esri { /** * 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...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) + * [Read more...](global.html) */ view?: View; /** @@ -21999,9 +22697,9 @@ declare namespace __esri { * * @param params See the table below for details of each parameter that may be passed to this function. * @param params.basemap The basemap to pair with the visualization. This value indicates the best symbol colors for visualizing features against the given basemap. - * @param params.geometryType The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon | mesh + * @param params.geometryType The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh * @param params.theme - * The theme determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * The theme determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. * * | Value | Description | Example | * | ----- | ----------- | ------- | @@ -22036,13 +22734,13 @@ declare namespace __esri { */ basemap: string | Basemap; /** - * The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon | mesh + * The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getSchemes) */ geometryType: string; /** - * The theme determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * The theme determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. * * | Value | Description | Example | * | ----- | ----------- | ------- | @@ -22058,7 +22756,7 @@ declare namespace __esri { /** * The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getSchemes) + * [Read more...](global.html) */ view?: SceneView; /** @@ -22082,7 +22780,7 @@ declare namespace __esri { */ id: string; /** - * Indicates which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * Indicates which values will be emphasized in the continuous ramp and the map. Possible values are listed below. * * | Value | Description | Example | * | ----- | ----------- | ------- | @@ -22189,7 +22887,7 @@ declare namespace __esri { * * @param params See the table below for details of each parameter that may be passed to this function. * @param params.basemap The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features on top of the given basemap. - * @param params.geometryType The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon | mesh + * @param params.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`. * @@ -22208,7 +22906,7 @@ declare namespace __esri { */ basemap: string | Basemap; /** - * The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon | mesh + * The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#getSchemes) */ @@ -22216,7 +22914,7 @@ declare namespace __esri { /** * The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#getSchemes) + * [Read more...](global.html) */ view?: SceneView; /** @@ -22361,7 +23059,7 @@ declare namespace __esri { * * @param params See the table below for details of each parameter that may be passed to this function. * @param params.basemap The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features against the given basemap. - * @param params.geometryType The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon + * @param params.geometryType The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon * @param params.view The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. * @param params.worldScale Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. * @@ -22512,7 +23210,7 @@ declare namespace __esri { */ basemap: string | Basemap; /** - * The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon + * The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#getSchemes) */ @@ -22520,7 +23218,7 @@ declare namespace __esri { /** * The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#getSchemes) + * [Read more...](global.html) */ view?: SceneView; /** @@ -22597,8 +23295,8 @@ declare namespace __esri { * * @param params See the table below for details of each parameter that may be passed to this function. * @param params.basemap The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features against the given basemap. - * @param params.geometryType The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon | mesh - * @param params.theme Determines whether to return a standardized unique value scheme for point cloud class renderers (i.e. when the `CLASS_CODE` field is driving the visualization in a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html)), or to return the other default primary schemes used in other unique value renderers generated for non-point cloud layer types. **Known Values:** point-cloud-class | default + * @param params.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. * @@ -22745,13 +23443,13 @@ declare namespace __esri { */ basemap: string | Basemap; /** - * The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon | mesh + * The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#getSchemes) */ geometryType: string; /** - * Determines whether to return a standardized unique value scheme for point cloud class renderers (i.e. when the `CLASS_CODE` field is driving the visualization in a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html)), or to return the other default primary schemes used in other unique value renderers generated for non-point cloud layer types. **Known Values:** point-cloud-class | default + * 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) * @@ -22767,7 +23465,7 @@ declare namespace __esri { /** * The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#getSchemes) + * [Read more...](global.html) */ view?: SceneView; } @@ -22806,11 +23504,23 @@ 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. **Known Values:** equal-interval | manual | natural-breaks | quantile | standard-deviation + * 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; + /** + * field for relationship. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field1) + */ + field1: any; + /** + * field for relationship. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field2) + */ + field2: any; /** * An array of string values representing field names used for creating predominance renderers. * @@ -22818,19 +23528,31 @@ declare namespace __esri { */ fields: string[]; /** - * **Only applicable to renderer used in web scenes.** Indicates the unit used in real-world sizes. **Known Values:** inches | feet | yards | miles | nautical-miles | millimeters | centimeters | decimeters | meters | kilometers | decimal-degrees + * focus for relationship. + * + * [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; /** - * Indicates the standard deviation interval for each stop in a classed color or classed size renderer that was generated using the `standard-deviation` classification method. **Known Values:** 0.25 | 0.33 | 0.5 | 1 + * numClasses for relationship. + * + * [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. **Known Values:** class-breaks-size | class-breaks-color | predominance | univariate-color-size + * Indicates the renderer type generated from one of the Smart Mapping functions. **Possible Values:** class-breaks-size | class-breaks-color | predominance | univariate-color-size * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#type) */ @@ -22864,11 +23586,23 @@ 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. **Known Values:** equal-interval | manual | natural-breaks | quantile | standard-deviation + * 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; + /** + * field for relationship. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field1) + */ + field1?: any; + /** + * field for relationship. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field2) + */ + field2?: any; /** * An array of string values representing field names used for creating predominance renderers. * @@ -22876,19 +23610,31 @@ declare namespace __esri { */ fields?: string[]; /** - * **Only applicable to renderer used in web scenes.** Indicates the unit used in real-world sizes. **Known Values:** inches | feet | yards | miles | nautical-miles | millimeters | centimeters | decimeters | meters | kilometers | decimal-degrees + * focus for relationship. + * + * [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; /** - * Indicates the standard deviation interval for each stop in a classed color or classed size renderer that was generated using the `standard-deviation` classification method. **Known Values:** 0.25 | 0.33 | 0.5 | 1 + * numClasses for relationship. + * + * [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. **Known Values:** class-breaks-size | class-breaks-color | predominance | univariate-color-size + * Indicates the renderer type generated from one of the Smart Mapping functions. **Possible Values:** class-breaks-size | class-breaks-color | predominance | univariate-color-size * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#type) */ @@ -22933,25 +23679,25 @@ declare namespace __esri { */ startTime: string | number; /** - * If the UI offers the option to display values based on a ratio or percentage, this indicates which selection was made. **Known Values:** percent | percent-of-total | ratio + * 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. **Known Values:** above-and-below | centered-on | extremes | high-to-low + * 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. **Known Values:** color | size | opacity + * 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. **Known Values:** seconds | minutes | hours | days | months | years + * 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) */ @@ -23009,31 +23755,78 @@ declare namespace __esri { */ startTime?: string | number; /** - * If the UI offers the option to display values based on a ratio or percentage, this indicates which selection was made. **Known Values:** percent | percent-of-total | ratio + * 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. **Known Values:** above-and-below | centered-on | extremes | high-to-low + * 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. **Known Values:** color | size | opacity + * 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. **Known Values:** seconds | minutes | hours | days | months | years + * 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; } + 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; + } + + export const HeatmapColorStop: HeatmapColorStopConstructor; + + 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 { /** @@ -23417,28 +24210,9 @@ declare namespace __esri { * * @param url The request URL. * @param options An object with the following properties that describe the request. - * @param options.callbackParamName Name of the callback parameter (a special service parameter) to be specified when requesting data in JSONP format. It is ignored for all other data formats. For ArcGIS services the value is always `callback`. - * @param options.query If the request URL points to a web server that requires parameters, specify them here. - * @param options.responseType Response format. When this value is `image` the `method` and `timeout` options are ignored. **Possible Values:** json | xml | text | blob | array-buffer | document | image - * @param options.headers Headers to use for the request. This is an object whose property names are header names. This is not applicable for non-XHR requests. - * @param options.timeout Indicates the amount of time in milliseconds to wait for a response from the server. Set to `0` to wait for the response indefinitely. This option is ignored when `responseType = "image"`. - * @param options.method Indicates if the request should be made using the HTTP POST method. By default, this is determined automatically based on the request size. This option is ignored when `responseType = "image"`. **Known Values:** auto | post - * @param options.body If uploading a file, specify the form data or element used to submit the file here. If a form element is specified, the parameters of the `query` will be added to the URL. If not specified, then query parameters will only be added to the URL when a GET request is used. If POST is used, then query parameters will be added to the body. - * @param options.useProxy Indicates the request should use the proxy. By default this is determined automatically based on the domain of the request url. - * @param options.cacheBust Indicates whether to send an extra query parameter to ensure the server doesn't supply cached values. - * @param options.allowImageDataAccess Indicates whether apps are allowed to read image data (when used with Canvas) from images hosted on third-party sites. Only applicable when `responseType = "image"`. - * @param options.authMode - * Indicates if and how requests to ArcGIS Services are authenticated. Only applicable when [`esriConfig.request.useIdentity = true`](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request). - * - * | Known Value | Description | - * |-------------|-------------| - * | auto | The user will be signed in when a secure resource is requested. | - * | anonymous | An error will be returned when a secure resource is requested. | - * | immediate | The user will be signed in before the resource is requested. | - * | no-prompt | Checks for whether the user is already signed in. If so, no additional prompts display for sign-in. | * */ - esriRequest(url: string, options?: requestEsriRequestOptions): IPromise; + esriRequest(url: string, options?: RequestOptions): IPromise; } const __requestMapped: request; @@ -23503,78 +24277,70 @@ declare namespace __esri { export type GetHeader = (headerName: string) => string; - - export interface requestEsriRequestOptions extends Object { + /** + * 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 { + /** + * Indicates if the request should be made using the HTTP POST method. By default, this is determined automatically based on the request size. This option is ignored when `responseType = "image"`. **Possible Values:** auto | post + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) + */ + method?: string; /** * Name of the callback parameter (a special service parameter) to be specified when requesting data in JSONP format. It is ignored for all other data formats. For ArcGIS services the value is always `callback`. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ callbackParamName?: string; - /** - * If the request URL points to a web server that requires parameters, specify them here. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) - */ - query?: any; /** * Response format. When this value is `image` the `method` and `timeout` options are ignored. **Possible Values:** json | xml | text | blob | array-buffer | document | image * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) - * - * @default json + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ responseType?: string; /** * Headers to use for the request. This is an object whose property names are header names. This is not applicable for non-XHR requests. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) + * [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#esriRequest) - * - * @default 60000 + * [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. This option is ignored when `responseType = "image"`. **Known Values:** auto | post + * If the request URL points to a web server that requires parameters, specify them here. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) - * - * @default auto + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ - method?: string; + query?: any; /** * If uploading a file, specify the form data or element used to submit the file here. If a form element is specified, the parameters of the `query` will be added to the URL. If not specified, then query parameters will only be added to the URL when a GET request is used. If POST is used, then query parameters will be added to the body. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) + * [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#esriRequest) - * - * @default false + * [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#esriRequest) - * - * @default false + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ cacheBust?: boolean; /** * Indicates whether apps are allowed to read image data (when used with Canvas) from images hosted on third-party sites. Only applicable when `responseType = "image"`. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) - * - * @default false + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ allowImageDataAccess?: boolean; /** @@ -23588,100 +24354,157 @@ declare namespace __esri { * | no-prompt | Checks for whether the user is already signed in. If so, no additional prompts display for sign-in. | * * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) - * - * @default auto + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ authMode?: string; } - interface Action extends Accessor { + /** + * 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; + /** + * If ssl is enabled or not. + * + * [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; + } + + 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-Action.html#className) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#className) */ className: string; /** - * The name of the ID assigned to this action. This is used for differentiating actions when listening to the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#event:trigger-action) event. + * Indicates whether this action is disabled. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#id) + * [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 URL to an image that will be used to represent the action. This property will be used as a background image for the node. It may be used in conjunction with the `className` property or by itself. If neither `image` nor `className` are specified, a default icon ![default icon](https://developers.arcgis.com/javascript/latest/assets/img/guide/whats-new/41/default-action.png) will display. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#image) - */ - image: string; /** * The title of the action. _For popups_: When there are fewer than three actions defined in a popup, this text is displayed to the right of the icon or image representing the action. If there are three or more actions in the popup, then this text is used as a tooltip on the action. _For LayerList_: The first action is displayed in the layerlist with an icon. The layerlist has a menu that will display all actions with their titles * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#title) + * [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-Action.html#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; + } + + export const ActionBase: ActionBaseConstructor; + + interface ActionButton extends ActionBase { + /** + * The URL to an image that will be used to represent the action. This property will be used as a background image for the node. It may be used in conjunction with the `className` property or by itself. If neither `image` nor `className` are specified, a default icon ![default icon](https://developers.arcgis.com/javascript/latest/assets/img/guide/whats-new/41/default-action.png) will display. + * + * [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-Action.html#clone) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html#clone) * * */ - clone(): Action; + clone(): ActionButton; } - interface ActionConstructor { + interface ActionButtonConstructor { - new(properties?: ActionProperties): Action; + + new(properties?: any): ActionButton; } - export const Action: ActionConstructor; + export const ActionButton: ActionButtonConstructor; - interface ActionProperties { + interface ActionToggle extends ActionBase { /** - * 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`. + * Creates a deep clone of this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html#clone) + * * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#className) */ - className?: string; - /** - * The name of the ID assigned to this action. This is used for differentiating actions when listening to the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#event:trigger-action) event. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#id) - */ - id?: string; - /** - * The URL to an image that will be used to represent the action. This property will be used as a background image for the node. It may be used in conjunction with the `className` property or by itself. If neither `image` nor `className` are specified, a default icon ![default icon](https://developers.arcgis.com/javascript/latest/assets/img/guide/whats-new/41/default-action.png) will display. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#image) - */ - image?: string; - /** - * The title of the action. _For popups_: When there are fewer than three actions defined in a popup, this text is displayed to the right of the icon or image representing the action. If there are three or more actions in the popup, then this text is used as a tooltip on the action. _For LayerList_: The first action is displayed in the layerlist with an icon. The layerlist has a menu that will display all actions with their titles - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#title) - */ - title?: string; - /** - * Indicates if the action is visible. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#visible) - * - * @default true - */ - visible?: boolean; + clone(): ActionToggle; } + interface ActionToggleConstructor { + + + + new(properties?: any): ActionToggle; + } + + export const ActionToggle: ActionToggleConstructor; + 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). @@ -23704,11 +24527,11 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#add) * - * @param layer Layer to be added to the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). + * @param 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, index?: number): void; + add(layer: Layer | IPromise, index?: number): void; /** * Adds a layer or an array of layers to the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). * @@ -23792,6 +24615,16 @@ declare namespace __esri { 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 { + } + + export const symbols: symbols; + interface Callout3D extends Accessor, JSONSupport { /** * Creates a deep clone of the callout. @@ -24274,6 +25107,50 @@ declare namespace __esri { } interface Font extends Accessor, JSONSupport { + /** + * 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. + * + * [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`). + * + * [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 WebGL enabled [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html). + * + * [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 WebGL enabled [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html). + * + * [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. * @@ -24285,11 +25162,7 @@ declare namespace __esri { } interface FontConstructor { - /** - * The font used to display [text symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html) added to the [graphics layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html) - */ + new(properties?: FontProperties): Font; @@ -24299,7 +25172,49 @@ declare namespace __esri { export const Font: FontConstructor; interface FontProperties { - + /** + * 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. + * + * [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`). + * + * [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 WebGL enabled [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html). + * + * [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 WebGL enabled [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#weight) + * + * @default normal + */ + weight?: "normal" | "bold" | "bolder" | "lighter"; } interface IconSymbol3DLayer extends Symbol3DLayer { @@ -24705,7 +25620,7 @@ declare namespace __esri { interface MarkerSymbol extends Symbol { /** * The angle of the marker in degrees. - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **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) * @@ -24714,7 +25629,7 @@ declare namespace __esri { angle: number; /** * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **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) * @@ -24723,7 +25638,7 @@ declare namespace __esri { xoffset: number; /** * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **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) * @@ -24749,7 +25664,7 @@ declare namespace __esri { interface MarkerSymbolProperties extends SymbolProperties { /** * The angle of the marker in degrees. - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **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) * @@ -24758,7 +25673,7 @@ declare namespace __esri { angle?: number; /** * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **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) * @@ -24767,7 +25682,7 @@ declare namespace __esri { xoffset?: number | string; /** * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **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) * @@ -24814,11 +25729,17 @@ declare namespace __esri { interface ObjectSymbol3DLayer extends Symbol3DLayer { /** - * The positioning of the object relative to the geometry. `origin` is only valid when an `href` resource is specified and uses the pivot point defined by the 3D model. **Possible Values:** center | top | bottom | origin + * The positioning of the object 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 * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchor) * - * @default center + * @default origin */ anchor: string; /** @@ -24904,11 +25825,17 @@ declare namespace __esri { interface ObjectSymbol3DLayerProperties extends Symbol3DLayerProperties { /** - * The positioning of the object relative to the geometry. `origin` is only valid when an `href` resource is specified and uses the pivot point defined by the 3D model. **Possible Values:** center | top | bottom | origin + * The positioning of the object 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 * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchor) * - * @default center + * @default origin */ anchor?: string; /** @@ -25417,7 +26344,7 @@ declare namespace __esri { */ color: Color; /** - * The fill style. Valid values are listed in the table below: + * The fill style. Possible values are listed in the table below: * * Value | Description * ------|------------- @@ -25430,7 +26357,7 @@ declare namespace __esri { * solid | ![sfs-solid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-solid.png) * vertical | ![sfs-vertical](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-vertical.png) * - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **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) * @@ -25478,7 +26405,7 @@ declare namespace __esri { */ color?: Color | number[] | string; /** - * The fill style. Valid values are listed in the table below: + * The fill style. Possible values are listed in the table below: * * Value | Description * ------|------------- @@ -25491,7 +26418,7 @@ declare namespace __esri { * solid | ![sfs-solid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-solid.png) * vertical | ![sfs-vertical](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-vertical.png) * - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **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) * @@ -25502,28 +26429,42 @@ declare namespace __esri { interface SimpleLineSymbol extends LineSymbol { /** - * Specifies the cap style. The cap is the end of a line segment. **Known Values:** butt | round | square + * 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/latest/assets/img/apiref/symbols/sls-cap-butt.png) + * round | ![sls-cap-round](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-cap-round.png) + * square | ![sls-cap-square](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-cap-square.png) + * * > **Known Limitations** - * * This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * * 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 butt + * @default round */ - cap: string; + cap: "butt" | "round" | "square"; /** - * Specifies the join style. **Known Values:** miter | round | bevel - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * 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/latest/assets/img/apiref/symbols/sls-join-bevel.png) + * miter | ![sls-join-miter](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-join-miter.png) + * round | ![sls-join-round](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-join-round.png) + * + * > **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 miter + * @default round */ - join: string; + 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`). - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **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) * @@ -25531,7 +26472,7 @@ declare namespace __esri { */ miterLimit: number; /** - * Specifies the line style. Valid values are listed in the table below: + * Specifies the line style. Possible values are listed in the table below: * * Value | Description * ------|------------- @@ -25548,7 +26489,7 @@ declare namespace __esri { * short-dot | ![sls-short-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-short-dot.png) * solid | ![sls-solid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-solid.png) * - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **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) * @@ -25588,28 +26529,42 @@ declare namespace __esri { interface SimpleLineSymbolProperties extends LineSymbolProperties { /** - * Specifies the cap style. The cap is the end of a line segment. **Known Values:** butt | round | square + * 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/latest/assets/img/apiref/symbols/sls-cap-butt.png) + * round | ![sls-cap-round](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-cap-round.png) + * square | ![sls-cap-square](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-cap-square.png) + * * > **Known Limitations** - * * This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * * 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 butt + * @default round */ - cap?: string; + cap?: "butt" | "round" | "square"; /** - * Specifies the join style. **Known Values:** miter | round | bevel - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * 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/latest/assets/img/apiref/symbols/sls-join-bevel.png) + * miter | ![sls-join-miter](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-join-miter.png) + * round | ![sls-join-round](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-join-round.png) + * + * > **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 miter + * @default round */ - join?: string; + 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`). - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **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) * @@ -25617,7 +26572,7 @@ declare namespace __esri { */ miterLimit?: number | string; /** - * Specifies the line style. Valid values are listed in the table below: + * Specifies the line style. Possible values are listed in the table below: * * Value | Description * ------|------------- @@ -25634,7 +26589,7 @@ declare namespace __esri { * short-dot | ![sls-short-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-short-dot.png) * solid | ![sls-solid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-solid.png) * - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **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) * @@ -25661,7 +26616,7 @@ declare namespace __esri { outline: SimpleLineSymbol; /** * The SVG path of the icon. - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **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) */ @@ -25740,7 +26695,7 @@ declare namespace __esri { outline?: SimpleLineSymbolProperties; /** * The SVG path of the icon. - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **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) */ @@ -26001,7 +26956,7 @@ declare namespace __esri { interface TextSymbol extends Symbol { /** * The angle of the text. `0` is horizontal and the angle moves clockwise. - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **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) * @@ -26042,9 +26997,7 @@ declare namespace __esri { /** * The color of the text symbol's halo. To include a halo in the TextSymbol, you must also set the size of the halo in [haloSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize). * > **Known Limitations** - * * Not supported in IE 9 or below. * * Sub-pixel halo (i.e. fractional size such as 1.25px) renders inconsistently in various browsers. - * * Not supported in [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html), but will be in a future release. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloColor) */ @@ -26052,16 +27005,14 @@ declare namespace __esri { /** * The size in points of the text symbol's halo. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). To include a halo in the TextSymbol, you must also set the color of the halo in [haloColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloColor). * > **Known Limitations** - * * Not supported in IE 9 or below. * * Sub-pixel halo (i.e. fractional size such as 1.25px) renders inconsistently in various browsers. - * * Not supported in [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html), but will be in a future release. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize) */ haloSize: number; /** - * The horizontal alignment of the text with respect to the graphic. **Possible Values:** left | right | center | justify - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * 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) * @@ -26078,7 +27029,7 @@ declare namespace __esri { kerning: boolean; /** * Determines whether every character in the text string is rotated. - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **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) * @@ -26098,8 +27049,8 @@ declare namespace __esri { */ readonly type: "text"; /** - * The vertical alignment of the text with respect to the graphic. **Possible Values:** baseline | top | middle | bottom - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * 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) * @@ -26108,7 +27059,7 @@ declare namespace __esri { verticalAlignment: string; /** * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **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) * @@ -26117,7 +27068,7 @@ declare namespace __esri { xoffset: number; /** * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **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) * @@ -26137,7 +27088,7 @@ declare namespace __esri { interface TextSymbolConstructor { /** - * Text symbols are used to define the graphic for displaying labels on a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). With this class, you may alter the [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#color), [font](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#font), [halo](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize), and other properties of the label graphic. + * 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. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html) */ @@ -26152,7 +27103,7 @@ declare namespace __esri { interface TextSymbolProperties extends SymbolProperties { /** * The angle of the text. `0` is horizontal and the angle moves clockwise. - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **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) * @@ -26193,26 +27144,22 @@ declare namespace __esri { /** * The color of the text symbol's halo. To include a halo in the TextSymbol, you must also set the size of the halo in [haloSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize). * > **Known Limitations** - * * Not supported in IE 9 or below. * * Sub-pixel halo (i.e. fractional size such as 1.25px) renders inconsistently in various browsers. - * * Not supported in [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html), but will be in a future release. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloColor) */ - haloColor?: Color; + 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** - * * Not supported in IE 9 or below. * * Sub-pixel halo (i.e. fractional size such as 1.25px) renders inconsistently in various browsers. - * * Not supported in [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html), but will be in a future release. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize) */ haloSize?: number | string; /** - * The horizontal alignment of the text with respect to the graphic. **Possible Values:** left | right | center | justify - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * 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) * @@ -26229,7 +27176,7 @@ declare namespace __esri { kerning?: boolean; /** * Determines whether every character in the text string is rotated. - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **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) * @@ -26243,8 +27190,8 @@ declare namespace __esri { */ text?: string; /** - * The vertical alignment of the text with respect to the graphic. **Possible Values:** baseline | top | middle | bottom - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * 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) * @@ -26253,7 +27200,7 @@ declare namespace __esri { verticalAlignment?: string; /** * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **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) * @@ -26262,7 +27209,7 @@ declare namespace __esri { xoffset?: number | string; /** * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **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) * @@ -26277,7 +27224,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#font) */ - font: TextSymbol3DLayerFont; + font: Font; /** * The halo surrounding the text. * @@ -26285,7 +27232,7 @@ declare namespace __esri { */ 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`). + * 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) * @@ -26335,7 +27282,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#font) */ - font?: TextSymbol3DLayerFont; + font?: FontProperties; /** * The halo surrounding the text. * @@ -26343,7 +27290,7 @@ declare namespace __esri { */ 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`). + * 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) * @@ -26359,34 +27306,6 @@ declare namespace __esri { } - export interface TextSymbol3DLayerFont extends Object { - /** - * The font family. See [MDN: font-family](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#font) - * - * @default Arial - */ - family?: string; - /** - * The font weight. **Known Values:** normal | bold - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#font) - * - * @default normal - */ - weight?: string; - /** - * The font style. **Known Values:** normal | italic - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#font) - * - * @default normal - */ - style?: string; - } - - export interface 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. @@ -26679,7 +27598,7 @@ declare namespace __esri { * @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 valid values and their descriptions. + * @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). * */ @@ -26844,7 +27763,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#fromGeoCoordinateString) */ - sr: SpatialReference | string; + sr: SpatialReference | string | number; /** * The conversion type of the input strings. **Possible Values:** mrgs | usng | utm | geo-ref | gars | dms | ddm | dd * @@ -26854,7 +27773,7 @@ declare namespace __esri { */ 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 valid values and their descriptions. + * 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) */ @@ -26868,7 +27787,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) */ - sr: SpatialReference | string; + sr: SpatialReference | string | number; /** * An array of XY-coordinates (in JSON format) to be converted. * @@ -27444,7 +28363,7 @@ declare namespace __esri { interface PrintTask extends Task { /** - * The mode for the print task execution. **Known Values:** async | sync + * 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) * @@ -27934,13 +28853,13 @@ declare namespace __esri { */ directionsLanguage: string; /** - * The length units used when computing driving directions. This parameter applies only when [returnDirections](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) parameter is set to `true`. If not specified the task will use the value defined by the routing network layer is used. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * 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. **Known Values:** complete | complete-no-events | instructions-only | standard | summary-only + * 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) */ @@ -27972,7 +28891,7 @@ declare namespace __esri { */ facilities: DataLayer | FeatureSet; /** - * The network attribute field name used as the impedance attribute during analysis. If not specified the default value defined by the routing network layer. Valid values include any attribute name listed in the Service Directory under Network Dataset > Network Attributes with a Usage Type of `esriNauTCost`. Specify none to indicate that no network attributes should be used for impedance. If you specify an empty string the default value defined by the service will be used. See the [Understanding the network attribute](https://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000) help topic for more details. + * 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) */ @@ -27990,13 +28909,21 @@ declare namespace __esri { */ outputGeometryPrecision: number; /** - * The units of the output geometry precision. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * 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. See NAOutputLine for a list of valid values. + * 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) */ @@ -28032,7 +28959,7 @@ declare namespace __esri { */ restrictionAttributes: string[]; /** - * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your module:"esri/tasks/ClosestFacilityTask". **Known Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections + * 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) */ @@ -28094,19 +29021,25 @@ declare namespace __esri { */ 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.* + * The arrival or departure date and time. For example, if the travelDirection is set to `to-facility` and `timeOfDayUsage` is set to `end` and `timeOfDay` is set to 8:00 a.m., the returned route(s) will be setup to arrive at the facility at 8:00 a.m. local time. *Requires ArcGIS Server service version 10.1 or greater.* * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#timeOfDay) */ timeOfDay: Date; /** - * Defines the way the `timeOfDay` value is used. The default value is defined in the network layer. *Requires ArcGIS Server service version 10.1 or greater.* **Known Values:** start | end + * 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. See NATravelDirection for a list of valid values. + * 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) */ @@ -28174,13 +29107,13 @@ declare namespace __esri { */ directionsLanguage?: string; /** - * The length units used when computing driving directions. This parameter applies only when [returnDirections](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) parameter is set to `true`. If not specified the task will use the value defined by the routing network layer is used. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * 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. **Known Values:** complete | complete-no-events | instructions-only | standard | summary-only + * 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) */ @@ -28212,7 +29145,7 @@ declare namespace __esri { */ facilities?: DataLayerProperties | FeatureSetProperties; /** - * The network attribute field name used as the impedance attribute during analysis. If not specified the default value defined by the routing network layer. Valid values include any attribute name listed in the Service Directory under Network Dataset > Network Attributes with a Usage Type of `esriNauTCost`. Specify none to indicate that no network attributes should be used for impedance. If you specify an empty string the default value defined by the service will be used. See the [Understanding the network attribute](https://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000) help topic for more details. + * 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) */ @@ -28230,13 +29163,21 @@ declare namespace __esri { */ outputGeometryPrecision?: number; /** - * The units of the output geometry precision. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * 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. See NAOutputLine for a list of valid values. + * 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) */ @@ -28272,7 +29213,7 @@ declare namespace __esri { */ restrictionAttributes?: string[]; /** - * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your module:"esri/tasks/ClosestFacilityTask". **Known Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections + * 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) */ @@ -28334,19 +29275,25 @@ declare namespace __esri { */ 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.* + * The arrival or departure date and time. For example, if the travelDirection is set to `to-facility` and `timeOfDayUsage` is set to `end` and `timeOfDay` is set to 8:00 a.m., the returned route(s) will be setup to arrive at the facility at 8:00 a.m. local time. *Requires ArcGIS Server service version 10.1 or greater.* * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#timeOfDay) */ timeOfDay?: DateProperties; /** - * Defines the way the `timeOfDay` value is used. The default value is defined in the network layer. *Requires ArcGIS Server service version 10.1 or greater.* **Known Values:** start | end + * 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. See NATravelDirection for a list of valid values. + * 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) */ @@ -28427,7 +29374,7 @@ declare namespace __esri { */ polylineBarriers: Polyline[]; /** - * The array of routes. Route graphics are returned if `returnRoutes = true` and `outputLines` does not equal `esriNAOutputLineNone`. From version 2.0 to 2.5 the type is an array of Polylines. At version 2.6 the type is an array of Graphics. + * 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) */ @@ -28492,7 +29439,7 @@ declare namespace __esri { */ polylineBarriers?: PolylineProperties[]; /** - * The array of routes. Route graphics are returned if `returnRoutes = true` and `outputLines` does not equal `esriNAOutputLineNone`. From version 2.0 to 2.5 the type is an array of Polylines. At version 2.6 the type is an array of Graphics. + * 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) */ @@ -29312,7 +30259,7 @@ declare namespace __esri { */ description: string; /** - * The geoprocessing message type. **Known Values:** informative | process-definition | process-start | process-stop | warning | error | empty | abort + * 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) */ @@ -29337,7 +30284,7 @@ declare namespace __esri { */ description?: string; /** - * The geoprocessing message type. **Known Values:** informative | process-definition | process-start | process-stop | warning | error | empty | abort + * 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) */ @@ -29920,7 +30867,7 @@ declare namespace __esri { */ jobId: string; /** - * The job status. **Known Values:** job-cancelled | job-cancelling | job-deleted | job-deleting | job-timed-out | job-executing | job-failed | job-new | job-submitted | job-succeeded | job-waiting + * 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) */ @@ -29951,7 +30898,7 @@ declare namespace __esri { */ jobId?: string; /** - * The job status. **Known Values:** job-cancelled | job-cancelling | job-deleted | job-deleting | job-timed-out | job-executing | job-failed | job-new | job-submitted | job-succeeded | job-waiting + * 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) */ @@ -30430,7 +31377,15 @@ declare namespace __esri { */ exportOptions: PrintTemplateExportOptions; /** - * The output format for the printed map. **Known Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz + * 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) * @@ -30514,7 +31469,15 @@ declare namespace __esri { */ exportOptions?: PrintTemplateExportOptions; /** - * The output format for the printed map. **Known Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz + * 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) * @@ -30617,7 +31580,7 @@ declare namespace __esri { */ copyrightText: string; /** - * The unit used for the scalebar. **Known Values:** `Miles` | `Kilometers` | `Meters` | `Feet` + * 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) * @@ -30745,73 +31708,90 @@ declare namespace __esri { */ datumTransformation: number; /** - * Buffer distance for input geometries. The distance unit is specified by [units property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#units). Query results will include features within the distance specified of the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) of the query. This parameter only applies if [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm) is `true`. + * 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; /** - * Specify the geodatabase version to display. + * 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` is applied to this geometry while performing the query. The valid geometry types are [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html), [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), or [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html). + * 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; /** - * Specify the number of decimal places for the geometries returned by the query operation. + * 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; /** - * One or more field names that will be used to group the statistics. This is only valid when `outStatistics` has been defined. Requires ArcGIS Server service version 10.1 or greater. + * One or more field names that will be used to group the statistics. This is only valid when [outStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outStatistics) has been defined. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics) */ groupByFieldsForStatistics: string[]; /** - * The historic moment to query. This parameter applies only if the `supportsQueryWithHistoricMoment` property of the layers being queried is set to `true`. This setting is provided in the layer resource. + * 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 allowable offset used for generalizing geometries returned by the query operation. The offset is in the units of `outSpatialReference`. If `outSpatialReference` is not defined, the spatial reference of the map is used. + * The maximum allowable offset used for generalizing geometries returned by the query operation. The offset is in the units of [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference). If `outSpatialReference` is not defined, the spatial reference of the view is used. + * > **Known Limitations** This property does not apply to layer view or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#maxAllowableOffset) */ maxAllowableOffset: number; /** - * Parameter dictates how the geometry of a multipatch feature will be returned. Currently, the only supported value is `xyFootprint` and the xy footprint of each multipatch geometry will be returned in the result. + * 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; /** - * Number of features to retrieve. Should be used in conjunction with [start property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start). Use this to implement paging and retrieve "pages" of results when querying. If not provided, but an instance of Query has a `start` property, 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 **Max Record Count** 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/table being queried. + * 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 that will be used to order the query results. Specfiy `ASC` (ascending) or `DESC` (descending) after the field name to control the order. The default order is `ASC`. `orderByFields` is only supported on [MapImageLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) and tables where `supportsAdvancedQueries = true`. *Requires ArcGIS Server service version 10.1 or greater.* + * 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. Fields must exist in the map layer. You must list actual field names rather than the alias names. You are, however, able to use the alias names when you display the results. You can set field alias names in the map document. When specifying the output fields, you should limit the fields to only those you expect to use in the query or the results. The fewer fields you include, the faster the response will be. Each query must have access to the Shape and ObjectId fields for a layer. However, your list of fields does not need to include these two fields. + * Attribute fields to include in the [FeatureSet](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) */ @@ -30823,43 +31803,47 @@ declare namespace __esri { */ outSpatialReference: SpatialReference; /** - * The definitions for one or more field-based statistics to be calculated. `outStatistics` is only supported on layers/tables where `supportsStatistics = true`. If `outStatistics` is specified the only other query parameters that will be used are `groupByFieldsForStatistics`, `orderByFields`, `text` and `where`. *Requires ArcGIS Server service version 10.1 or greater.* + * 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 ArcGIS Server service 10.5 or greater. + * 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[]; /** - * Specify the pixel level to be identified on the X and Y axis. Defaults to the base resolution of the dataset if not specified. Applicable only to Image Service layers. + * 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. *Only works with ArcGIS Online hosted services.* + * Used to project the geometry onto a virtual grid, likely representing pixels on the screen. + * > **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 Server service 10.5 or greater. + * 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 string describes the spatial relationship to be tested when the spatial relationship is `relation`. The [Relational functions for ST_Geometry](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) topic has additional details. + * 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 [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) each polygon geometry will be returned with a centroid. This operation is only supported in ArcGIS Online hosted feature services. + * 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) * @@ -30867,7 +31851,9 @@ declare namespace __esri { */ returnCentroid: boolean; /** - * If `true` then the query returns distinct values based on the fields specified in `outFields`. This parameter applies only if `supportsAdvancedQueries` property of the layer is `true`. *Requires ArcGIS Server 10.1 Service Pack 1 or later.* + * 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) * @@ -30875,7 +31861,8 @@ declare namespace __esri { */ returnDistinctValues: boolean; /** - * If `true`, then all features are returned for each tile request, even if they exceed the maximum record limit per query indicated on the service by `maxRecordCount`. If `false`, the tile request will not return any features if the `maxRecordCount` limit is exceeded. **Support is limited to feature services hosted on ArcGIS Online.** + * 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) * @@ -30883,7 +31870,8 @@ declare namespace __esri { */ returnExceededLimitFeatures: boolean; /** - * If `true`, each feature in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) includes the geometry. Set to `false` (default) if you do not plan to include highlighted features on a map since the geometry takes up a significant portion of the response. + * 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) * @@ -30891,35 +31879,31 @@ declare namespace __esri { */ returnGeometry: boolean; /** - * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then m-values are returned in the geometry. + * 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) - * - * @default false */ returnM: boolean; /** - * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then z-values are returned in the geometry. + * 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) - * - * @default false */ returnZ: boolean; /** - * The spatial relationship to be applied to the input geometry while performing the query. The valid values are listed in the table below: + * 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 | Part of a feature from feature class 1 intersects a feature from feature class 2. - * contains | Part or all of a feature from feature class 1 is contained within a feature from feature class 2. - * crosses | The feature from feature class 1 crosses a feature from feature class 2. - * envelope-intersects | The envelope of feature class 1 intersects with the envelope of feature class 2. + * intersects | Returns features from the layer or layer view that intersect the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * contains | Returns features from the layer or layer view that are completely contained by the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * crosses | Returns features from the layer or layer view that cross the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * envelope-intersects | Returns features from the layer or layer view that intersect the envelope (or extent) of the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). * index-intersects | The envelope of the query feature class intersects the index entry for the target feature class. - * overlaps | Features from feature class 1 overlap features in feature class 2. - * touches | The feature from feature class 1 touches the border of a feature from feature class 2. - * within | The feature from feature class 1 is completely enclosed by the feature from feature class 2. - * relation | Allows specification of any relationship defined using the [Shape Comparison Language](http://resources.esri.com/help/9.3/arcgisengine/dotnet/concepts_start.htm#40de6491-9b2d-440d-848b-2609efcd46b1.htm). + * overlaps | Returns features from the layer or layer view that overlap the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * touches | Returns features from the layer or layer view that touch the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * within | Returns features from the layer or layer view that are completely within the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * relation | Allows specification of any relationship defined using the [Shape Comparison Language](http://resources.esri.com/help/9.3/arcgisengine/dotnet/concepts_start.htm#40de6491-9b2d-440d-848b-2609efcd46b1.htm). If this value is specified, then the [relationParameter](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#relationParameter) must also be specified. * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) @@ -30928,7 +31912,8 @@ declare namespace __esri { */ 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. **Known 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) * @@ -30936,13 +31921,14 @@ declare namespace __esri { */ sqlFormat: string; /** - * Zero-based index indicating where to begin retrieving features. Should be used in conjunction with [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num). Use this to implement paging and retrieve "pages" of results when querying. Features are sorted ascending by object ID by default. + * 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. + * > **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 map document. You can determine what the display field is for a layer in the Services Directory. + * 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) * @@ -30950,7 +31936,9 @@ declare namespace __esri { */ text: string; /** - * The unit for calculating the buffer distance. if unit is not specified, the unit is derived from the geometry spatial reference. If the geometry spatial reference is not specified, the unit is derived from the feature service spatial reference. This parameter only applies if [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm) is `true`. **Known Values:** feet | miles | nautical-miles | us-nautical-miles | meters | kilometers + * 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) */ @@ -30974,7 +31962,7 @@ declare namespace __esri { interface QueryConstructor { /** - * Query is used to define parameters to filter a layer's features, either by its attributes or its geometry. Once a Query object is created, you can set its properties to conform to the filtering requirements of the application. Once a Query object is created and its properties are set, it is then ready to be passed into an executable function in [QueryTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html) (e.g. `QueryTask.execute(Query)`). The returned result is often a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). + * 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) */ @@ -30994,73 +31982,90 @@ declare namespace __esri { */ datumTransformation?: number; /** - * Buffer distance for input geometries. The distance unit is specified by [units property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#units). Query results will include features within the distance specified of the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) of the query. This parameter only applies if [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm) is `true`. + * 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; /** - * Specify the geodatabase version to display. + * 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` is applied to this geometry while performing the query. The valid geometry types are [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html), [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), or [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html). + * 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; /** - * Specify the number of decimal places for the geometries returned by the query operation. + * 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; /** - * One or more field names that will be used to group the statistics. This is only valid when `outStatistics` has been defined. Requires ArcGIS Server service version 10.1 or greater. + * One or more field names that will be used to group the statistics. This is only valid when [outStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outStatistics) has been defined. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics) */ groupByFieldsForStatistics?: string[]; /** - * The historic moment to query. This parameter applies only if the `supportsQueryWithHistoricMoment` property of the layers being queried is set to `true`. This setting is provided in the layer resource. + * 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 allowable offset used for generalizing geometries returned by the query operation. The offset is in the units of `outSpatialReference`. If `outSpatialReference` is not defined, the spatial reference of the map is used. + * The maximum allowable offset used for generalizing geometries returned by the query operation. The offset is in the units of [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference). If `outSpatialReference` is not defined, the spatial reference of the view is used. + * > **Known Limitations** This property does not apply to layer view or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#maxAllowableOffset) */ maxAllowableOffset?: number; /** - * Parameter dictates how the geometry of a multipatch feature will be returned. Currently, the only supported value is `xyFootprint` and the xy footprint of each multipatch geometry will be returned in the result. + * 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; /** - * Number of features to retrieve. Should be used in conjunction with [start property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start). Use this to implement paging and retrieve "pages" of results when querying. If not provided, but an instance of Query has a `start` property, 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 **Max Record Count** 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/table being queried. + * 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 that will be used to order the query results. Specfiy `ASC` (ascending) or `DESC` (descending) after the field name to control the order. The default order is `ASC`. `orderByFields` is only supported on [MapImageLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) and tables where `supportsAdvancedQueries = true`. *Requires ArcGIS Server service version 10.1 or greater.* + * 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. Fields must exist in the map layer. You must list actual field names rather than the alias names. You are, however, able to use the alias names when you display the results. You can set field alias names in the map document. When specifying the output fields, you should limit the fields to only those you expect to use in the query or the results. The fewer fields you include, the faster the response will be. Each query must have access to the Shape and ObjectId fields for a layer. However, your list of fields does not need to include these two fields. + * Attribute fields to include in the [FeatureSet](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) */ @@ -31072,43 +32077,47 @@ declare namespace __esri { */ outSpatialReference?: SpatialReferenceProperties; /** - * The definitions for one or more field-based statistics to be calculated. `outStatistics` is only supported on layers/tables where `supportsStatistics = true`. If `outStatistics` is specified the only other query parameters that will be used are `groupByFieldsForStatistics`, `orderByFields`, `text` and `where`. *Requires ArcGIS Server service version 10.1 or greater.* + * 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 ArcGIS Server service 10.5 or greater. + * 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[]; /** - * Specify the pixel level to be identified on the X and Y axis. Defaults to the base resolution of the dataset if not specified. Applicable only to Image Service layers. + * 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. *Only works with ArcGIS Online hosted services.* + * Used to project the geometry onto a virtual grid, likely representing pixels on the screen. + * > **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 Server service 10.5 or greater. + * 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 string describes the spatial relationship to be tested when the spatial relationship is `relation`. The [Relational functions for ST_Geometry](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) topic has additional details. + * 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 [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) each polygon geometry will be returned with a centroid. This operation is only supported in ArcGIS Online hosted feature services. + * 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) * @@ -31116,7 +32125,9 @@ declare namespace __esri { */ returnCentroid?: boolean; /** - * If `true` then the query returns distinct values based on the fields specified in `outFields`. This parameter applies only if `supportsAdvancedQueries` property of the layer is `true`. *Requires ArcGIS Server 10.1 Service Pack 1 or later.* + * 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) * @@ -31124,7 +32135,8 @@ declare namespace __esri { */ returnDistinctValues?: boolean; /** - * If `true`, then all features are returned for each tile request, even if they exceed the maximum record limit per query indicated on the service by `maxRecordCount`. If `false`, the tile request will not return any features if the `maxRecordCount` limit is exceeded. **Support is limited to feature services hosted on ArcGIS Online.** + * 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) * @@ -31132,7 +32144,8 @@ declare namespace __esri { */ returnExceededLimitFeatures?: boolean; /** - * If `true`, each feature in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) includes the geometry. Set to `false` (default) if you do not plan to include highlighted features on a map since the geometry takes up a significant portion of the response. + * 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) * @@ -31140,35 +32153,31 @@ declare namespace __esri { */ returnGeometry?: boolean; /** - * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then m-values are returned in the geometry. + * 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) - * - * @default false */ returnM?: boolean; /** - * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then z-values are returned in the geometry. + * 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) - * - * @default false */ returnZ?: boolean; /** - * The spatial relationship to be applied to the input geometry while performing the query. The valid values are listed in the table below: + * 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 | Part of a feature from feature class 1 intersects a feature from feature class 2. - * contains | Part or all of a feature from feature class 1 is contained within a feature from feature class 2. - * crosses | The feature from feature class 1 crosses a feature from feature class 2. - * envelope-intersects | The envelope of feature class 1 intersects with the envelope of feature class 2. + * intersects | Returns features from the layer or layer view that intersect the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * contains | Returns features from the layer or layer view that are completely contained by the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * crosses | Returns features from the layer or layer view that cross the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * envelope-intersects | Returns features from the layer or layer view that intersect the envelope (or extent) of the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). * index-intersects | The envelope of the query feature class intersects the index entry for the target feature class. - * overlaps | Features from feature class 1 overlap features in feature class 2. - * touches | The feature from feature class 1 touches the border of a feature from feature class 2. - * within | The feature from feature class 1 is completely enclosed by the feature from feature class 2. - * relation | Allows specification of any relationship defined using the [Shape Comparison Language](http://resources.esri.com/help/9.3/arcgisengine/dotnet/concepts_start.htm#40de6491-9b2d-440d-848b-2609efcd46b1.htm). + * overlaps | Returns features from the layer or layer view that overlap the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * touches | Returns features from the layer or layer view that touch the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * within | Returns features from the layer or layer view that are completely within the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * relation | Allows specification of any relationship defined using the [Shape Comparison Language](http://resources.esri.com/help/9.3/arcgisengine/dotnet/concepts_start.htm#40de6491-9b2d-440d-848b-2609efcd46b1.htm). If this value is specified, then the [relationParameter](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#relationParameter) must also be specified. * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) @@ -31177,7 +32186,8 @@ declare namespace __esri { */ 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. **Known 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) * @@ -31185,13 +32195,14 @@ declare namespace __esri { */ sqlFormat?: string; /** - * Zero-based index indicating where to begin retrieving features. Should be used in conjunction with [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num). Use this to implement paging and retrieve "pages" of results when querying. Features are sorted ascending by object ID by default. + * 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. + * > **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 map document. You can determine what the display field is for a layer in the Services Directory. + * 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) * @@ -31199,7 +32210,9 @@ declare namespace __esri { */ text?: string; /** - * The unit for calculating the buffer distance. if unit is not specified, the unit is derived from the geometry spatial reference. If the geometry spatial reference is not specified, the unit is derived from the feature service spatial reference. This parameter only applies if [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm) is `true`. **Known Values:** feet | miles | nautical-miles | us-nautical-miles | meters | kilometers + * 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) */ @@ -31237,13 +32250,13 @@ declare namespace __esri { */ extent?: Extent; /** - * Geometry coordinates are optimized for viewing and displaying of data. **Known Values:** view + * Geometry coordinates are optimized for viewing and displaying of data. **Possible Values:** view * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#quantizationParameters) */ mode?: string; /** - * The integer's coordinates will be returned relative to the origin position defined by this property value. **Known Values:** upper-left | lower-left + * 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) * @@ -31604,13 +32617,13 @@ declare namespace __esri { */ directionsLanguage: string; /** - * The length units to use when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * 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. **Known Values:** complete | complete-no-events | instructions-only | standard | summary-only + * 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) * @@ -31658,7 +32671,7 @@ declare namespace __esri { */ ignoreInvalidLocations: boolean; /** - * The network attribute name to be used as the impedance attribute in the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty array, it will default to the default of the service. For example, set `impedanceAttribute = "Time"` for the quickest route and `impedanceAttribute = "Length"` for shortest drive, assuming the service has those two esriNAUTCost attributes. For more information, see [Understanding the network attribute](http://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000). + * 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) */ @@ -31670,13 +32683,13 @@ declare namespace __esri { */ outputGeometryPrecision: number; /** - * The units of the output geometry precision. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * 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). **Known Values:** none | straight | true-shape | true-shape-with-measure + * The type of output lines to be generated in the result. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Possible 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) * @@ -31720,7 +32733,7 @@ declare namespace __esri { */ restrictionAttributes: string[]; /** - * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Known Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections + * 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) */ @@ -31856,13 +32869,13 @@ declare namespace __esri { */ directionsLanguage?: string; /** - * The length units to use when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * 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. **Known Values:** complete | complete-no-events | instructions-only | standard | summary-only + * 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) * @@ -31910,7 +32923,7 @@ declare namespace __esri { */ ignoreInvalidLocations?: boolean; /** - * The network attribute name to be used as the impedance attribute in the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty array, it will default to the default of the service. For example, set `impedanceAttribute = "Time"` for the quickest route and `impedanceAttribute = "Length"` for shortest drive, assuming the service has those two esriNAUTCost attributes. For more information, see [Understanding the network attribute](http://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000). + * 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) */ @@ -31922,13 +32935,13 @@ declare namespace __esri { */ outputGeometryPrecision?: number; /** - * The units of the output geometry precision. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * 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). **Known Values:** none | straight | true-shape | true-shape-with-measure + * The type of output lines to be generated in the result. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Possible 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) * @@ -31972,7 +32985,7 @@ declare namespace __esri { */ restrictionAttributes?: string[]; /** - * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Known Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections + * 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) */ @@ -32195,7 +33208,7 @@ declare namespace __esri { */ facilities: DataLayer | FeatureSet; /** - * The network attribute name used as the impedance attribute in analysis. The default is as defined in the routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty string, it will use the default of the service. For example, set `impedanceAttribute = 'Time'` for quickest route and `impedanceAttribute = 'Length'` for shortest drive. Assuming the service has those two esriNAUTCost attributes. View the [Understanding the network attribute](http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00470000000M000000.htm) ArcGIS desktop help topic for more details. + * 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) */ @@ -32215,7 +33228,7 @@ declare namespace __esri { */ outputGeometryPrecision: number; /** - * The units of the output geometry precision. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * 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) */ @@ -32349,7 +33362,7 @@ declare namespace __esri { */ splitPolygonsAtBreaks: boolean; /** - * Local date and time at the facility. if `travelDirection = "esriNATravelDirectionToFacility"`, the `timeOfDay` value specifies arrival time at the facility. if `travelDirection = "esriNATravelDirectionFromFacility"`, `timeOfDay` specifies departure time from the facility. Requires ArcGIS Server service version 10.1 or greater. + * 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) */ @@ -32455,7 +33468,7 @@ declare namespace __esri { */ facilities?: DataLayerProperties | FeatureSetProperties; /** - * The network attribute name used as the impedance attribute in analysis. The default is as defined in the routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty string, it will use the default of the service. For example, set `impedanceAttribute = 'Time'` for quickest route and `impedanceAttribute = 'Length'` for shortest drive. Assuming the service has those two esriNAUTCost attributes. View the [Understanding the network attribute](http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00470000000M000000.htm) ArcGIS desktop help topic for more details. + * 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) */ @@ -32475,7 +33488,7 @@ declare namespace __esri { */ outputGeometryPrecision?: number; /** - * The units of the output geometry precision. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * 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) */ @@ -32609,7 +33622,7 @@ declare namespace __esri { */ splitPolygonsAtBreaks?: boolean; /** - * Local date and time at the facility. if `travelDirection = "esriNATravelDirectionToFacility"`, the `timeOfDay` value specifies arrival time at the facility. if `travelDirection = "esriNATravelDirectionFromFacility"`, `timeOfDay` specifies departure time from the facility. Requires ArcGIS Server service version 10.1 or greater. + * 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) */ @@ -32760,19 +33773,19 @@ declare namespace __esri { interface StatisticDefinition extends Accessor, JSONSupport { /** - * Defines the field for which statistics will be calculated. + * 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. Output field names can only contain alpha-numeric characters and an underscore. If no output field name is specified, the map server assigns a field name to the returned statistic field. + * 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. **Known Values:** count | sum | min | max | avg | stddev | var + * 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) */ @@ -32791,19 +33804,19 @@ declare namespace __esri { interface StatisticDefinitionProperties { /** - * Defines the field for which statistics will be calculated. + * 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. Output field names can only contain alpha-numeric characters and an underscore. If no output field name is specified, the map server assigns a field name to the returned statistic field. + * 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. **Known Values:** count | sum | min | max | avg | stddev | var + * 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) */ @@ -37831,7 +38844,7 @@ declare namespace __esri { * [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 known values and type of draw action it creates. **Known Values:** point | multipoint | polyline | polygon | rectangle | circle | ellipse + * 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 * ------------- | -------------------- @@ -37842,16 +38855,16 @@ declare namespace __esri { * 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 only applies when creating `polygon` and `polyline` geometries. **Known 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. - * freehand | Vertices are added while the pointer is dragged. + * 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; + create(drawAction: string, drawOptions?: DrawCreateDrawOptions): DrawAction; /** * Resets the drawing by clearing the active action. * @@ -37864,7 +38877,7 @@ declare namespace __esri { interface DrawConstructor { /** - * The Draw class provides advanced drawing capabilities for developers who need complete control over creating temporary geometries. For example, if you want to prevent users from drawing self-intersecting lines or overlapping polygons, then you can use this class to implement these rules. The draw experience is built upon draw actions, which use the view events to generate a set of coordinates for creating new geometries. Each geometry type has a corresponding draw action class. + * 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) */ @@ -37892,18 +38905,16 @@ declare namespace __esri { export interface DrawCreateDrawOptions extends Object { /** - * The drawing mode. The drawing mode only applies when creating `polygon` and `polyline` geometries. **Known 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. - * freehand | Vertices are added while the pointer is dragged. + * 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) - * - * @default hybrid */ mode?: string; } @@ -37987,19 +38998,6 @@ declare namespace __esri { * */ complete(): void; - - - on(name: "cursor-update", eventHandler: MultipointDrawActionCursorUpdateEventHandler): IHandle; - - on(name: "vertex-add", eventHandler: MultipointDrawActionVertexAddEventHandler): IHandle; - - on(name: "vertex-remove", eventHandler: MultipointDrawActionVertexRemoveEventHandler): IHandle; - - on(name: "draw-complete", eventHandler: MultipointDrawActionDrawCompleteEventHandler): IHandle; - - on(name: "undo", eventHandler: MultipointDrawActionUndoEventHandler): IHandle; - - on(name: "redo", eventHandler: MultipointDrawActionRedoEventHandler): IHandle; } interface MultipointDrawActionConstructor { @@ -38014,82 +39012,6 @@ declare namespace __esri { } - export interface MultipointDrawActionCursorUpdateEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface MultipointDrawActionDrawCompleteEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertices: number[][]; - } - - export interface MultipointDrawActionRedoEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface MultipointDrawActionUndoEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface MultipointDrawActionVertexAddEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface MultipointDrawActionVertexRemoveEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - interface PointDrawAction extends DrawAction { /** * An array of x,y coordinates for the [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometry. @@ -38106,11 +39028,6 @@ declare namespace __esri { * */ complete(): void; - - - on(name: "cursor-update", eventHandler: PointDrawActionCursorUpdateEventHandler): IHandle; - - on(name: "draw-complete", eventHandler: PointDrawActionDrawCompleteEventHandler): IHandle; } interface PointDrawActionConstructor { @@ -38125,31 +39042,9 @@ declare namespace __esri { } - export interface PointDrawActionCursorUpdateEvent { - - coordinates: number[]; - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - } - - export interface PointDrawActionDrawCompleteEvent { - - coordinates: number[]; - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - } - interface PolygonDrawAction extends DrawAction { /** - * The drawing mode. **Known 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 | * ----- | ----------- | @@ -38178,19 +39073,6 @@ declare namespace __esri { * */ complete(): void; - - - on(name: "cursor-update", eventHandler: PolygonDrawActionCursorUpdateEventHandler): IHandle; - - on(name: "vertex-add", eventHandler: PolygonDrawActionVertexAddEventHandler): IHandle; - - on(name: "vertex-remove", eventHandler: PolygonDrawActionVertexRemoveEventHandler): IHandle; - - on(name: "draw-complete", eventHandler: PolygonDrawActionDrawCompleteEventHandler): IHandle; - - on(name: "undo", eventHandler: PolygonDrawActionUndoEventHandler): IHandle; - - on(name: "redo", eventHandler: PolygonDrawActionRedoEventHandler): IHandle; } interface PolygonDrawActionConstructor { @@ -38203,7 +39085,7 @@ declare namespace __esri { interface PolygonDrawActionProperties extends DrawActionProperties { /** - * The drawing mode. **Known 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 | * ----- | ----------- | @@ -38219,85 +39101,9 @@ declare namespace __esri { mode?: string; } - export interface PolygonDrawActionCursorUpdateEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface PolygonDrawActionDrawCompleteEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertices: number[][]; - } - - export interface PolygonDrawActionRedoEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface PolygonDrawActionUndoEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface PolygonDrawActionVertexAddEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface PolygonDrawActionVertexRemoveEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - interface PolylineDrawAction extends DrawAction { /** - * The drawing mode. **Known 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 | * ----- | ----------- | @@ -38326,19 +39132,6 @@ declare namespace __esri { * */ complete(): void; - - - on(name: "cursor-update", eventHandler: PolylineDrawActionCursorUpdateEventHandler): IHandle; - - on(name: "vertex-add", eventHandler: PolylineDrawActionVertexAddEventHandler): IHandle; - - on(name: "vertex-remove", eventHandler: PolylineDrawActionVertexRemoveEventHandler): IHandle; - - on(name: "draw-complete", eventHandler: PolylineDrawActionDrawCompleteEventHandler): IHandle; - - on(name: "undo", eventHandler: PolylineDrawActionUndoEventHandler): IHandle; - - on(name: "redo", eventHandler: PolylineDrawActionRedoEventHandler): IHandle; } interface PolylineDrawActionConstructor { @@ -38351,7 +39144,7 @@ declare namespace __esri { interface PolylineDrawActionProperties extends DrawActionProperties { /** - * The drawing mode. **Known 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 | * ----- | ----------- | @@ -38367,83 +39160,21 @@ declare namespace __esri { mode?: string; } - export interface PolylineDrawActionCursorUpdateEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface PolylineDrawActionDrawCompleteEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertices: number[][]; - } - - export interface PolylineDrawActionRedoEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface PolylineDrawActionUndoEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface PolylineDrawActionVertexAddEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface PolylineDrawActionVertexRemoveEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - interface SegmentDrawAction extends DrawAction { + /** + * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * freehand | Vertices are added while the pointer is dragged. + * click | Vertices are added when the pointer is clicked. SegmentDrawActions are created from 2 vertices. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-SegmentDrawAction.html#mode) + * + * @default freehand + */ + mode: string; /** * Two-dimensional array of numbers representing the coordinates of each vertex comprising the geometry being drawn. * @@ -38452,20 +39183,13 @@ declare namespace __esri { 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. Call this method if the drawing logic needs to be completed other than by double-clicking or pressing the "C" key. + * 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; - - - on(name: "cursor-update", eventHandler: SegmentDrawActionCursorUpdateEventHandler): IHandle; - - on(name: "draw-complete", eventHandler: SegmentDrawActionDrawCompleteEventHandler): IHandle; - - on(name: "vertex-add", eventHandler: SegmentDrawActionVertexAddEventHandler): IHandle; } interface SegmentDrawActionConstructor { @@ -38477,46 +39201,273 @@ declare namespace __esri { export const SegmentDrawAction: SegmentDrawActionConstructor; interface SegmentDrawActionProperties extends DrawActionProperties { - + /** + * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * freehand | Vertices are added while the pointer is dragged. + * click | Vertices are added when the pointer is clicked. SegmentDrawActions are created from 2 vertices. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-SegmentDrawAction.html#mode) + * + * @default freehand + */ + mode?: string; } - export interface SegmentDrawActionCursorUpdateEvent { + export class 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; - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; + /** + * 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; + /** + * 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; + /** + * 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 interface SegmentDrawActionDrawCompleteEvent { - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertices: number[][]; + 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; } - export interface SegmentDrawActionVertexAddEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; + /** + * 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[]; } + 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; + } + + 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. * @@ -39093,12 +40044,13 @@ declare namespace __esri { highlight(target?: Graphic | Graphic[] | number | number[]): any; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns the [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** - * * Polyline, and Point geometries are not supported in the `geometry` query parameter. - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param). - * * The following Query parameters are currently not supported: - * * `orderByField` - * * `distance` and `units` + * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are not currently supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. + * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * GDM 2000 (4742) – Malaysia + * * Gusterberg (Ferro) (8042) – Austria/Czech Republic + * * ISN2016 (8086) - Iceland + * * SVY21 (4757) - Singapore * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#queryExtent) * @@ -39108,12 +40060,13 @@ declare namespace __esri { queryExtent(params?: Query | QueryProperties): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns the number of features that satisfy the query. If query parameters are not provided, the count of all features available for drawing is returned. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** - * * Polyline, and Point geometries are not supported in the `geometry` query parameter. - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param). - * * The following Query parameters are currently not supported: - * * `orderByField` - * * `distance` and `units` + * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are currently not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. + * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * GDM 2000 (4742) – Malaysia + * * Gusterberg (Ferro) (8042) – Austria/Czech Republic + * * ISN2016 (8086) - Iceland + * * SVY21 (4757) - Singapore * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#queryFeatureCount) * @@ -39122,28 +40075,30 @@ declare namespace __esri { */ queryFeatureCount(params?: Query | QueryProperties): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns an array of [Graphic[]](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). If query parameters are not provided, all features available for drawing are returned. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** - * * Polyline, and Point geometries are not supported in the `geometry` query parameter. - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param). - * * The following Query parameters are currently not supported: - * * `orderByField` - * * `distance` and `units` + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). If query parameters are not provided, all features available for drawing are returned. + * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are currently not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. + * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * GDM 2000 (4742) – Malaysia + * * Gusterberg (Ferro) (8042) – Austria/Czech Republic + * * ISN2016 (8086) - Iceland + * * SVY21 (4757) - Singapore * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-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; + queryFeatures(params?: Query | QueryProperties): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns array of the ObjectIDs of features that satisfy the input query. If query parameters are not provided, the ObjectIDs of all features available for drawing are returned. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** - * * Polyline, and Point geometries are not supported in the `geometry` query parameter. - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param). - * * The following Query parameters are currently not supported: - * * `orderByField` - * * `distance` and `units` + * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are currently not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. + * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * GDM 2000 (4742) – Malaysia + * * Gusterberg (Ferro) (8042) – Austria/Czech Republic + * * ISN2016 (8086) - Iceland + * * SVY21 (4757) - Singapore * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#queryObjectIds) * @@ -39166,6 +40121,13 @@ declare namespace __esri { } 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; + /** * Highlights the given feature(s). * > **Known Limitations** In 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) this method is only supported for [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) that have opted in to [WebGL rendering](esri-layers-FeatureLayer.html#webgl-rendering). @@ -39178,15 +40140,14 @@ declare namespace __esri { highlight(target?: Graphic | Graphic[] | number | number[]): any; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns the [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. Valid only for [hosted feature services](http://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm) on [arcgis.com](http://arcgis.com) and for ArcGIS Server 10.3.1 and later. If query parameters are not provided, the extent and count of all features available for drawing are returned. To query for the extent of features directly from a Feature Service rather than those visible in the view, you must use the [FeatureLayer.queryExtent()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryExtent) method. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** - * * For spatial queries: - * * [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'` can be used to query against layers of any geometry type. - * * [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries with `spatialRelationship = 'intersects'` can only be used to query against point layers. - * * Polyline, and Point geometries are not supported. - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param) - * * The following Query parameters are currently not supported: - * * `orderByField` - * * `distance` and `units` + * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are currently not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * * Spatial queries are executed against quantized geometries in the layer view. The resolution of layer view geometries, is only as precise as the scale resolution of the view. Therefore, the results of the same query could be different when executed at different scales. This also means that geometries returned from any layer view query will likewise be at the same scale resolution of the view. + * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. + * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * GDM 2000 (4742) – Malaysia + * * Gusterberg (Ferro) (8042) – Austria/Czech Republic + * * ISN2016 (8086) - Iceland + * * SVY21 (4757) - Singapore * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryExtent) * @@ -39196,15 +40157,14 @@ declare namespace __esri { queryExtent(params?: Query | QueryProperties): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns the number of features that satisfy the query. If query parameters are not provided, the count of all features available for drawing is returned. To query for the count of features directly from a Feature Service rather than those visible in the view, you must use the [FeatureLayer.queryFeatureCount()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatureCount) method. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** - * * For spatial queries: - * * [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'` can be used to query against layers of any geometry type. - * * [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries with `spatialRelationship = 'intersects'` can only be used to query against point layers. - * * Polyline, and Point geometries are not supported. - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param) - * * The following Query parameters are currently not supported: - * * `orderByField` - * * `distance` and `units` + * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are currently not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * * Spatial queries are executed against quantized geometries in the layer view. The resolution of layer view geometries, is only as precise as the scale resolution of the view. Therefore, the results of the same query could be different when executed at different scales. This also means that geometries returned from any layer view query will likewise be at the same scale resolution of the view. + * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. + * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * GDM 2000 (4742) – Malaysia + * * Gusterberg (Ferro) (8042) – Austria/Czech Republic + * * ISN2016 (8086) - Iceland + * * SVY21 (4757) - Singapore * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatureCount) * @@ -39213,34 +40173,32 @@ declare namespace __esri { */ queryFeatureCount(params?: Query | QueryProperties): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns an array of [Graphic[]](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). If query parameters are not provided, all features available for drawing are returned. To execute a query against all the features in a Feature Service rather than only those in the client, you must use the [FeatureLayer.queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures) method. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** - * * For spatial queries: - * * [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'` can be used to query against layers of any geometry type. - * * [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries with `spatialRelationship = 'intersects'` can only be used to query against point layers. - * * Polyline, and Point geometries are not supported. - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param). - * * The following Query parameters are currently not supported: - * * `orderByField` - * * `distance` and `units` + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). If query parameters are not provided, all features available for drawing are returned. To execute a query against all the features in a Feature Service rather than only those in the client, you must use the [FeatureLayer.queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures) method. + * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are currently not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * * Spatial queries are executed against quantized geometries in the layer view. The resolution of layer view geometries, is only as precise as the scale resolution of the view. Therefore, the results of the same query could be different when executed at different scales. This also means that geometries returned from any layer view query will likewise be at the same scale resolution of the view. + * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. + * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * GDM 2000 (4742) – Malaysia + * * Gusterberg (Ferro) (8042) – Austria/Czech Republic + * * ISN2016 (8086) - Iceland + * * SVY21 (4757) - Singapore * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-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; + queryFeatures(params?: Query | QueryProperties): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns array of the ObjectIDs of features that satisfy the input query. If query parameters are not provided, the ObjectIDs of all features available for drawing are returned. To query for ObjectIDs of features directly from a Feature Service rather than those visible in the view, you must use the [FeatureLayer.queryObjectIds()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryObjectIds) method. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** - * * For spatial queries: - * * [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'` can be used to query against layers of any geometry type. - * * [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries with `spatialRelationship = 'intersects'` can only be used to query against point layers. - * * Polyline, and Point geometries are not supported. - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param). - * * The following Query parameters are currently not supported: - * * `orderByField` - * * `distance` and `units` + * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are currently not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * * Spatial queries are executed against quantized geometries in the layer view. The resolution of layer view geometries, is only as precise as the scale resolution of the view. Therefore, the results of the same query could be different when executed at different scales. This also means that geometries returned from any layer view query will likewise be at the same scale resolution of the view. + * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. + * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * GDM 2000 (4742) – Malaysia + * * Gusterberg (Ferro) (8042) – Austria/Czech Republic + * * ISN2016 (8086) - Iceland + * * SVY21 (4757) - Singapore * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryObjectIds) * @@ -39732,7 +40690,7 @@ declare namespace __esri { * * Object with a combination of `target`, `center` and `scale` properties (with `target` being any of the types listed above). The `center` property is provided as a convenience to animate the [MapView.center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center) and is equivalent to specifying the `target` with the center [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). * * - * This function returns a promise which resolves as soon as the new view has been set to the target. If the transition is animated, then the ongoing animation can be obtained using [MapView.animation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#animation). Take note that if you pass in an [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) as the `target` geometry, the `goTo` method will zoom to the nearest LOD of the basemap. + * 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`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) * @@ -40518,6 +41476,14 @@ declare namespace __esri { } 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). * > **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. @@ -40557,6 +41523,20 @@ declare namespace __esri { * * // Disable automatic lighting updates by camera tracking * view.environment.lighting.cameraTrackingEnabled = true; + * + * // Set a background color + * const view = new SceneView({ + * container: "view", + * map: map, + * environment: { + * background: { + * type: "color", + * color: [255, 252, 244, 1] + * }, + * starsEnabled: false, + * atmosphereEnabled: false + * } + * }); * ``` * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) @@ -40807,6 +41787,14 @@ declare namespace __esri { export const SceneView: SceneViewConstructor; 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). * > **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. @@ -40846,6 +41834,20 @@ declare namespace __esri { * * // Disable automatic lighting updates by camera tracking * view.environment.lighting.cameraTrackingEnabled = true; + * + * // Set a background color + * const view = new SceneView({ + * container: "view", + * map: map, + * environment: { + * background: { + * type: "color", + * color: [255, 252, 244, 1] + * }, + * starsEnabled: false, + * atmosphereEnabled: false + * } + * }); * ``` * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) @@ -41257,7 +42259,7 @@ declare namespace __esri { */ clipDistance?: SceneViewConstraintsClipDistanceProperties; /** - * When enabled, prevents the user from navigating below the surface in a local SceneView. + * 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) */ @@ -41284,7 +42286,7 @@ declare namespace __esri { */ clipDistance?: SceneViewConstraintsClipDistance; /** - * When enabled, prevents the user from navigating below the surface in a local SceneView. + * 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) */ @@ -41432,6 +42434,12 @@ declare namespace __esri { 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. * @@ -41461,6 +42469,12 @@ 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. * @@ -41535,7 +42549,7 @@ declare namespace __esri { */ date?: DateProperties; /** - * Indicates whether to show shadows cast by the sun + * 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) * @@ -41570,7 +42584,7 @@ declare namespace __esri { */ date?: Date; /** - * Indicates whether to show shadows cast by the sun + * 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) * @@ -41648,7 +42662,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) */ - center?: number[]; + center?: number[] | Point; /** * The [SceneView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale) to go to. * @@ -41678,7 +42692,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) */ - position?: number; + position?: Point; } @@ -41865,10 +42879,10 @@ declare namespace __esri { * * @param component The component(s) to add to the UI. This can be a widget instance, HTML element, a string value representing a DOM node ID, or an array containing a combination of any of those types. See the example snippets below for code examples. Alternatively, you can pass an array of objects with the following specification. * @param component.component The component to add to the UI. This can be a widget instance, HTML element, a string value representing a DOM node ID. - * @param component.position The position in the view at which to add the component. If not specified, `manual` is used by default. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual + * @param component.position The position in the view at which to add the component. If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual * @param component.index The placement index of the component. This index shows where to place the component relative to other components. For example a value of `0` would place it topmost when position is top-*, leftmost for bottom-left and right most for bottom-right. - * @param position The position in the view at which to add the component. If not specified, `manual` is used by default. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual - * @param position.position The position in the view at which to add the component(s). If not specified, `manual` is used by default. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual + * @param position 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. * */ @@ -41878,7 +42892,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#empty) * - * @param position The position from which to remove all components. If not specified, `manual` is used by default. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual + * @param position The position from which to remove all components. If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual * */ empty(position?: string): void; @@ -41889,8 +42903,8 @@ declare namespace __esri { * * @param component The component(s) to move. This value can be a widget instance, HTML element, a string value representing a DOM node ID, or an array containing a combination of any of those types. See the example snippets below for code examples. Alternatively, you can pass an array of objects with the following specification. * @param component.component The component to move. This can be a widget instance, HTML element, a string value representing a DOM node ID. - * @param component.position The destination position. The component will be placed in the UI [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) when not provided. If not specified, `manual` is used by default. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual - * @param position The destination position. The component will be placed in the UI [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) when not provided. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual + * @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; @@ -41949,7 +42963,7 @@ declare namespace __esri { */ component: Widget | HTMLElement | string; /** - * The position in the view at which to add the component. If not specified, `manual` is used by default. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual + * The position in the view at which to add the component. If not specified, `manual` is used by default. **Possible Values:** 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) */ @@ -41965,7 +42979,7 @@ declare namespace __esri { export interface UIAddPosition extends Object { /** - * The position in the view at which to add the component(s). If not specified, `manual` is used by default. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual + * The position in the view at which to add the component(s). If not specified, `manual` is used by default. **Possible Values:** 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) */ @@ -41987,7 +43001,7 @@ declare namespace __esri { */ component: Widget | HTMLElement | string; /** - * The destination position. The component will be placed in the UI [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) when not provided. If not specified, `manual` is used by default. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual + * The destination position. The component will be placed in the UI [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) when not provided. If not specified, `manual` is used by default. **Possible Values:** 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) */ @@ -42210,7 +43224,7 @@ 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. **Known 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 * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ViewAnimation.html#state) * @@ -42928,13 +43942,111 @@ declare namespace __esri { search?: SearchProperties; } + 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; + } + + 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; + + fromJSON(json: any): Background; + } + + export const Background: BackgroundConstructor; + + 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; + } + + 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; + + fromJSON(json: any): ColorBackground; + } + + export const ColorBackground: ColorBackgroundConstructor; + + 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; + } + 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. By default this is simply 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. @@ -42955,12 +44067,36 @@ declare namespace __esri { export const Environment: EnvironmentConstructor; 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. By default this is simply 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; } interface websceneInitialViewProperties extends Accessor, corePromise { @@ -42977,7 +44113,7 @@ declare namespace __esri { */ spatialReference: SpatialReference; /** - * The viewing mode of the scene. Global scenes allow the user to navigate the globe. Local scenes allow for navigation and feature display in a particular "localized" area. Users may also navigate the view's camera below the surface of a basemap in local scenes. **Known Values:** global | local + * 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) * @@ -43023,7 +44159,7 @@ declare namespace __esri { */ spatialReference?: SpatialReferenceProperties; /** - * The viewing mode of the scene. Global scenes allow the user to navigate the globe. Local scenes allow for navigation and feature display in a particular "localized" area. Users may also navigate the view's camera below the surface of a basemap in local scenes. **Known Values:** global | local + * 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) * @@ -43048,7 +44184,7 @@ declare namespace __esri { */ date: Date; /** - * The type of direct shadows. + * 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) * @@ -43092,7 +44228,7 @@ declare namespace __esri { */ date?: DateProperties; /** - * The type of direct shadows. + * 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) * @@ -43177,6 +44313,12 @@ declare namespace __esri { * [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). * @@ -43307,6 +44449,12 @@ declare namespace __esri { * [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). * @@ -43450,6 +44598,25 @@ declare namespace __esri { } + export interface SlideGroundProperties extends Object { + /** + * Ground opacity + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#ground) + */ + opacity?: number; + } + + 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. @@ -43611,6 +44778,12 @@ declare namespace __esri { } 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 + * + * [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. * @@ -43655,6 +44828,12 @@ declare namespace __esri { 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 + * + * [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. * @@ -43700,7 +44879,7 @@ declare namespace __esri { */ readonly state: string; /** - * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Known 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 distance values. **Possible Values:** imperial | metric | square-inches | square-feet | square-yards | square-miles | square-meters | square-kilometers | square-us-feet | acres | ares | hectares * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#unit) */ @@ -43742,7 +44921,7 @@ declare namespace __esri { 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. **Known Values:** euclidean | geodesic + * 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) */ @@ -43796,7 +44975,7 @@ declare namespace __esri { */ readonly attributionText: string; /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#iconClass) */ @@ -43881,7 +45060,7 @@ declare namespace __esri { */ readonly items: Collection; /** - * The view model's state. **Known Values:** ready | disabled + * 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) * @@ -43937,7 +45116,7 @@ declare namespace __esri { */ activeBasemap: Basemap; /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#iconClass) */ @@ -43997,7 +45176,7 @@ declare namespace __esri { */ activeBasemap?: BasemapProperties; /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#iconClass) */ @@ -44042,7 +45221,7 @@ declare namespace __esri { */ source: LocalBasemapsSource | PortalBasemapsSource; /** - * The view model's state. **Known Values:** ready | disabled + * 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) * @@ -44117,7 +45296,7 @@ declare namespace __esri { */ readonly error: Error; /** - * The item's state. **Known Values:** loading | ready | 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) * @@ -44215,6 +45394,12 @@ declare namespace __esri { * [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 { @@ -44244,6 +45429,12 @@ declare namespace __esri { * [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 BasemapToggle extends Widget { @@ -44359,7 +45550,7 @@ declare namespace __esri { */ nextBasemap: Basemap; /** - * The view model's state. **Known Values:** ready | disabled + * 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) * @@ -44419,6 +45610,194 @@ declare namespace __esri { view?: MapViewProperties | SceneViewProperties; } + interface Bookmarks extends Widget, GoTo { + /** + * A collection of [Bookmark](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html)s. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#bookmarks) + */ + bookmarks: 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; + } + + interface BookmarksConstructor { + /** + * The Bookmarks widget allows end users to quickly navigate to a particular area of interest. It displays a list of bookmarks, which typically are defined inside the [WebMap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#bookmarks). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html) + */ + + new(properties?: BookmarksProperties): Bookmarks; + } + + export const Bookmarks: BookmarksConstructor; + + interface BookmarksProperties extends WidgetProperties, GoToProperties { + /** + * A collection of [Bookmark](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html)s. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#bookmarks) + */ + bookmarks?: CollectionProperties; + /** + * The view from which the widget will operate. + * + * [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; + } + + interface Bookmark { + /** + * The `active` property is true while goTo() is animating. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html#active) + * + * @default false + */ + active: boolean; + /** + * The extent of the specified bookmark item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html#extent) + */ + extent: Extent; + /** + * The name of the bookmark item. Used as a label in the [Bookmarks](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html) widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html#name) + */ + name: string; + /** + * The URL for a thumbnail image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html#thumbnail) + */ + thumbnail: BookmarkThumbnail; + } + + interface BookmarkConstructor { + + + + new(properties?: any): Bookmark; + } + + export const Bookmark: BookmarkConstructor; + + + export interface BookmarkThumbnail extends Object { + /** + * URL to a thumbnail to display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html#thumbnail) + */ + url?: string; + } + + interface BookmarksViewModel extends Accessor, GoTo { + /** + * A collection of [Bookmark](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html)s. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#bookmarks) + */ + 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; + } + + export const BookmarksViewModel: BookmarksViewModelConstructor; + + interface BookmarksViewModelProperties extends GoToProperties { + /** + * A collection of [Bookmark](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html)s. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#bookmarks) + */ + bookmarks?: CollectionProperties; + /** + * The view from which the widget will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#view) + */ + view?: MapViewProperties; + } + 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. @@ -44681,9 +46060,9 @@ declare namespace __esri { label: string; } - interface Compass extends Widget { + interface Compass extends Widget, GoTo { /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#iconClass) */ @@ -44737,7 +46116,7 @@ declare namespace __esri { export const Compass: CompassConstructor; - interface CompassProperties extends WidgetProperties { + 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). * @@ -44752,7 +46131,7 @@ declare namespace __esri { viewModel?: CompassViewModelProperties; } - interface CompassViewModel extends Accessor { + interface CompassViewModel extends Accessor, GoTo { /** * The orientation axes (x, y, z). * @@ -44762,7 +46141,7 @@ declare namespace __esri { */ orientation: any; /** - * The view model's state. **Known Values:** compass | rotation | disabled + * 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) * @@ -44798,7 +46177,7 @@ declare namespace __esri { export const CompassViewModel: CompassViewModelConstructor; - interface CompassViewModelProperties { + interface CompassViewModelProperties extends GoToProperties { /** * The orientation axes (x, y, z). * @@ -44815,7 +46194,7 @@ declare namespace __esri { view?: MapViewProperties | SceneViewProperties; } - interface CoordinateConversion extends Widget { + 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. * @@ -44835,7 +46214,7 @@ declare namespace __esri { */ formats: Collection; /** - * Describes the current mode of the widget. **Known 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. * @@ -44853,7 +46232,7 @@ declare namespace __esri { */ 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. **Known Values:** auto | expand-up | expand-down + * 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) * @@ -44913,7 +46292,7 @@ declare namespace __esri { export const CoordinateConversion: CoordinateConversionConstructor; - interface CoordinateConversionProperties extends WidgetProperties { + 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. * @@ -44933,7 +46312,7 @@ declare namespace __esri { */ formats?: CollectionProperties; /** - * Describes the current mode of the widget. **Known 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. * @@ -44951,7 +46330,7 @@ declare namespace __esri { */ 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. **Known Values:** auto | expand-up | expand-down + * 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) * @@ -44980,7 +46359,7 @@ declare namespace __esri { viewModel?: CoordinateConversionViewModelProperties; } - interface CoordinateConversionViewModel extends Accessor { + 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. * @@ -45006,7 +46385,7 @@ declare namespace __esri { */ locationSymbol: SimpleMarkerSymbol | PictureMarkerSymbol; /** - * Describes the current mode of the widget. **Known 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. * @@ -45024,7 +46403,7 @@ declare namespace __esri { */ requestDelay: number; /** - * The view model's state. **Known Values:** ready | loading | disabled + * 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) * @@ -45078,7 +46457,7 @@ declare namespace __esri { export const CoordinateConversionViewModel: CoordinateConversionViewModelConstructor; - interface CoordinateConversionViewModelProperties { + 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. * @@ -45104,7 +46483,7 @@ declare namespace __esri { */ locationSymbol?: SimpleMarkerSymbolProperties | PictureMarkerSymbolProperties; /** - * Describes the current mode of the widget. **Known 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. * @@ -45235,23 +46614,28 @@ declare namespace __esri { * @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; } export const Format: Format; /** - * Information describing how a Format should be projected. Used to define custom Formats. 1. If the conversion can be performed synchronously, a convert function should be defined. 2. If the conversion cannot be performed synchronously, a convertDeferred function should be defined. 3. Alternatively, a [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html) can be provided, and the Format will project to this Spatial Reference. + * 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 { - /** - * The SpatialReference to project to. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#ConversionInfo) - */ - spatialReference?: SpatialReference; - /** * 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). * @@ -45260,14 +46644,6 @@ declare namespace __esri { * */ convert(): void; - /** - * A function that takes a point and returns a promise that resolves into 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) - * - * - */ - convertDeferred(): void; /** * A function that takes a string and returns a Point. * @@ -45325,9 +46701,9 @@ declare namespace __esri { coordinate: string; } - interface Directions extends Widget { + interface Directions extends Widget, GoTo { /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#iconClass) */ @@ -45425,7 +46801,7 @@ declare namespace __esri { export const Directions: DirectionsConstructor; - interface DirectionsProperties extends WidgetProperties { + interface DirectionsProperties extends WidgetProperties, GoToProperties { /** * The maximum number of stops allowed for routing. * @@ -45476,7 +46852,7 @@ declare namespace __esri { viewModel?: DirectionsViewModelProperties; } - interface DirectionsViewModel extends Accessor { + 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). * @@ -45655,7 +47031,7 @@ declare namespace __esri { export const DirectionsViewModel: DirectionsViewModelConstructor; - interface DirectionsViewModelProperties { + 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). * @@ -45759,7 +47135,7 @@ declare namespace __esri { */ description: string; /** - * Number indicating the message type returned from the service. This number correlates to one of the known values listed below. + * Number indicating the message type returned from the service. This number correlates to one of the possible values listed below. * * Number | Value * ------|------------ @@ -46033,7 +47409,7 @@ declare namespace __esri { /** * The view of the widget. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) + * [Read more...](global.html) */ view?: MapView | SceneView; /** @@ -46045,6 +47421,12 @@ 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 + * + * [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. * @@ -46089,6 +47471,12 @@ declare namespace __esri { 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 + * + * [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. * @@ -46134,7 +47522,7 @@ declare namespace __esri { */ readonly state: string; /** - * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Known 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:** imperial | metric | inches | feet | yards | miles | nautical-miles | meters | kilometers | us-feet * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#unit) */ @@ -46176,7 +47564,7 @@ declare namespace __esri { 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. **Known Values:** euclidean | geodesic + * 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) */ @@ -46468,7 +47856,7 @@ declare namespace __esri { */ group: string; /** - * The view model's state. **Known Values:** ready | disabled + * 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) * @@ -46784,7 +48172,7 @@ declare namespace __esri { */ element: HTMLElement; /** - * The view model's state. **Known Values:** active | ready | feature-unsupported | disabled + * 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) * @@ -46847,9 +48235,9 @@ declare namespace __esri { view?: MapViewProperties | SceneViewProperties; } - interface Home extends Widget { + interface Home extends Widget, GoTo { /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#iconClass) */ @@ -46912,7 +48300,7 @@ declare namespace __esri { export const Home: HomeConstructor; - interface HomeProperties extends WidgetProperties { + 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. * @@ -46936,7 +48324,7 @@ declare namespace __esri { viewpoint?: ViewpointProperties; } - interface HomeViewModel extends Accessor, Evented { + interface HomeViewModel extends Accessor, Evented, GoTo { /** * The current state of the widget. **Possible Values:** disabled | ready | going-home * @@ -46981,7 +48369,7 @@ declare namespace __esri { export const HomeViewModel: HomeViewModelConstructor; - interface HomeViewModelProperties { + interface HomeViewModelProperties extends GoToProperties { /** * The view associated with the widget instance. * @@ -47003,7 +48391,7 @@ declare namespace __esri { interface LayerList extends Widget { /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#iconClass) */ @@ -47019,7 +48407,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#listItemCreatedFunction) */ - listItemCreatedFunction: Function; + listItemCreatedFunction: ListItemCreatedHandler; /** * A collection of [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html)s representing operational layers. * @@ -47056,7 +48444,7 @@ declare namespace __esri { */ render(): any; /** - * Triggers the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#event:trigger-action) event and executes the given [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html). + * 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) * @@ -47064,7 +48452,7 @@ declare namespace __esri { * @param item An item associated with the action. * */ - triggerAction(action: Action, item: ListItem): void; + triggerAction(action: ActionButton | ActionToggle, item: ListItem): void; } interface LayerListConstructor { @@ -47081,7 +48469,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#listItemCreatedFunction) */ - listItemCreatedFunction?: Function; + listItemCreatedFunction?: ListItemCreatedHandler; /** * A collection of [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html)s representing operational layers. * @@ -47124,7 +48512,7 @@ declare namespace __esri { */ readonly operationalItems: Collection; /** - * The view model's state. **Known Values:** ready | disabled + * 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) * @@ -47139,7 +48527,7 @@ declare namespace __esri { view: MapView | SceneView; /** - * Triggers the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#event:trigger-action) event and executes the given [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html). + * 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) * @@ -47147,7 +48535,7 @@ declare namespace __esri { * @param item An item associated with the action. * */ - triggerAction(action: Action, item: ListItem): void; + triggerAction(action: ActionButton | ActionToggle, item: ListItem): void; } interface LayerListViewModelConstructor { @@ -47187,7 +48575,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#actionsSections) */ - actionsSections: Collection>; + actionsSections: Collection>; /** * When a layer contains sublayers, this property is a Collection of ListItem objects belonging to the given layer. * @@ -47362,9 +48750,11 @@ declare namespace __esri { export const ListItemPanel: ListItemPanelConstructor; + export type ListItemCreatedHandler = (event: any) => void; + interface Legend extends Widget { /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#iconClass) */ @@ -47469,7 +48859,7 @@ declare namespace __esri { layer: Layer; } - interface Locate extends Widget { + 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. * @@ -47493,11 +48883,17 @@ declare namespace __esri { */ graphic: Graphic; /** - * The widget's default icon font. + * 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). * @@ -47557,7 +48953,7 @@ declare namespace __esri { export const Locate: LocateConstructor; - interface LocateProperties extends WidgetProperties { + 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. * @@ -47581,7 +48977,7 @@ declare namespace __esri { */ graphic?: GraphicProperties; /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#iconClass) */ @@ -47616,7 +49012,7 @@ declare namespace __esri { viewModel?: LocateViewModelProperties; } - interface LocateViewModel extends Accessor, Evented, GeolocationPositioning { + interface LocateViewModel extends Accessor, Evented, GeolocationPositioning, GoTo { /** * The current state of the widget. **Possible Values:** disabled | ready | locating * @@ -47648,13 +49044,13 @@ declare namespace __esri { export const LocateViewModel: LocateViewModelConstructor; - interface LocateViewModelProperties extends GeolocationPositioningProperties { + interface LocateViewModelProperties extends GeolocationPositioningProperties, GoToProperties { } interface NavigationToggle extends Widget { /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#iconClass) */ @@ -47826,13 +49222,21 @@ declare namespace __esri { view?: SceneViewProperties; } - interface Popup extends Widget, Evented { + interface Popup extends Widget, GoTo, Evented { /** - * Defines actions that may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the `actions` array or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the array. The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [Action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html) class. + * Defines actions that may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the `actions` array or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the array. The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) classes. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions) */ - actions: Collection; + 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. * @@ -47864,7 +49268,7 @@ declare namespace __esri { */ content: string | HTMLElement | Widget; /** - * Dock position in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). **Known Values:** top-left | top-center | top-right | bottom-left | bottom-center | bottom-right + * 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) */ @@ -47904,7 +49308,8 @@ declare namespace __esri { */ features: Graphic[]; /** - * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Currently highlight only works in 3D. + * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) set on the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitation** Only [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) rendered with [WebGL](esri-layers-FeatureLayer.html#webgl-rendering) support highlight. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#highlightEnabled) * @@ -48070,13 +49475,21 @@ declare namespace __esri { export const Popup: PopupConstructor; - interface PopupProperties extends WidgetProperties { + interface PopupProperties extends WidgetProperties, GoToProperties { /** - * Defines actions that may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the `actions` array or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the array. The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [Action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html) class. + * Defines actions that may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the `actions` array or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the array. The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) classes. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions) */ - actions?: CollectionProperties; + 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. * @@ -48134,7 +49547,8 @@ declare namespace __esri { */ features?: GraphicProperties[]; /** - * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Currently highlight only works in 3D. + * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) set on the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitation** Only [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) rendered with [WebGL](esri-layers-FeatureLayer.html#webgl-rendering) support highlight. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#highlightEnabled) * @@ -48191,13 +49605,19 @@ declare namespace __esri { visible?: boolean; } - interface PopupViewModel extends Accessor, Evented { + 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-Action.html) objects. Each action may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [Action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html) class. + * [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) objects. Each action may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#actions) */ - actions: Collection; + 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. * @@ -48227,7 +49647,8 @@ declare namespace __esri { */ features: Graphic[]; /** - * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Currently highlight only works in 3D. + * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) set on the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitation** Only [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) rendered with [WebGL](esri-layers-FeatureLayer.html#webgl-rendering) support highlight. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#highlightEnabled) * @@ -48275,7 +49696,7 @@ declare namespace __esri { */ selectedFeatureIndex: number; /** - * The view model's state. **Known Values:** ready | disabled + * 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) * @@ -48351,13 +49772,13 @@ declare namespace __esri { export const PopupViewModel: PopupViewModelConstructor; - interface PopupViewModelProperties { + 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-Action.html) objects. Each action may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [Action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html) class. + * [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) objects. Each action may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#actions) */ - actions?: CollectionProperties; + 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. * @@ -48379,7 +49800,8 @@ declare namespace __esri { */ features?: GraphicProperties[]; /** - * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Currently highlight only works in 3D. + * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) set on the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitation** Only [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) rendered with [WebGL](esri-layers-FeatureLayer.html#webgl-rendering) support highlight. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#highlightEnabled) * @@ -48426,7 +49848,7 @@ declare namespace __esri { export interface PopupViewModelTriggerActionEvent { - action: Action; + action: ActionButton | ActionToggle; } @@ -48546,7 +49968,7 @@ declare namespace __esri { interface Print extends Widget { /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#iconClass) */ @@ -48725,9 +50147,19 @@ declare namespace __esri { */ dpi: string; /** - * The output format for the printed map. **Known Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz + * 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; /** @@ -48753,6 +50185,8 @@ declare namespace __esri { * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) + * + * @default letter-ansi-a-landscape */ layout: string; /** @@ -48823,9 +50257,19 @@ declare namespace __esri { */ dpi?: string; /** - * The output format for the printed map. **Known Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz + * 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; /** @@ -48851,6 +50295,8 @@ declare namespace __esri { * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) + * + * @default letter-ansi-a-landscape */ layout?: string; /** @@ -48885,13 +50331,13 @@ declare namespace __esri { interface ScaleBar extends Widget { /** - * The style for the scale bar. Valid values are `ruler` or `line`. When `unit` is set to `dual`, the style will always be `line`. + * 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. Valid values are `non-metric`, `metric` or `dual`. When using `dual`, the scale bar displays both metric and non-metric units. Metric values shows either kilometers or meters depending on the scale, and similarly non-metric values shows miles and feet depending on the scale. + * 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 * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#unit) * @@ -48935,13 +50381,13 @@ declare namespace __esri { interface ScaleBarProperties extends WidgetProperties { /** - * The style for the scale bar. Valid values are `ruler` or `line`. When `unit` is set to `dual`, the style will always be `line`. + * 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. Valid values are `non-metric`, `metric` or `dual`. When using `dual`, the scale bar displays both metric and non-metric units. Metric values shows either kilometers or meters depending on the scale, and similarly non-metric values shows miles and feet depending on the scale. + * 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 * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#unit) * @@ -48988,11 +50434,13 @@ declare namespace __esri { view?: MapViewProperties; } - interface widgetsSearch extends Widget { + interface widgetsSearch extends Widget, GoTo { /** * The [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) object currently selected. Can be either a [feature layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or a [locator task](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#activeSource) + * + * @default null */ readonly activeSource: FeatureLayer | Locator; /** @@ -49020,17 +50468,19 @@ declare namespace __esri { */ autoSelect: boolean; /** - * The default source used for the Search widget. These can range from a [Locator Source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) to a [Feature Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#defaultSource) - */ - readonly defaultSource: LocatorSource | FeatureLayerSource; - /** - * The widget's default icon font. + * 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. * @@ -49090,8 +50540,16 @@ declare namespace __esri { * 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. * @@ -49111,7 +50569,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#results) */ - results: any[]; + readonly results: any[]; /** * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-false](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-false.png) * @@ -49143,14 +50601,6 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) */ sources: Collection; - /** - * The current state of the widget. **Known Values:** ready | disabled | searching - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#state) - * - * @default ready - */ - readonly state: string; /** * An array of results from the [suggest method](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggest). This is available if working with a 10.3 geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e. `supportsPagination = true`. * @@ -49242,7 +50692,7 @@ declare namespace __esri { export const widgetsSearch: widgetsSearchConstructor; - interface widgetsSearchProperties extends WidgetProperties { + interface widgetsSearchProperties extends WidgetProperties, GoToProperties { /** * The selected source's index. This value is `-1` when all sources are selected. * @@ -49267,6 +50717,14 @@ declare namespace __esri { * @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/latest/assets/img/apiref/widgets/search-locationEnabled.png) * > The use of this property is only supported on secure origins. To use it, switch your application to a secure origin, such as HTTPS. Note that localhost is considered "potentially secure" and can be used for easy testing in browsers that supports [Window.isSecureContext](https://developer.mozilla.org/en-US/docs/Web/API/Window/isSecureContext#Browser_compatibility) (currently Chrome and Firefox). @@ -49320,8 +50778,16 @@ declare namespace __esri { * 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. * @@ -49330,12 +50796,6 @@ declare namespace __esri { * @default true */ resultGraphicEnabled?: boolean; - /** - * An array of objects, each containing a [SearchResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResult) from the search. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#results) - */ - results?: any[]; /** * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-false](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-false.png) * @@ -49383,7 +50843,7 @@ declare namespace __esri { viewModel?: SearchViewModelProperties; } - interface SearchViewModel extends Accessor, Evented { + 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). * @@ -49406,40 +50866,79 @@ declare namespace __esri { * @default "Find address or place" */ allPlaceholder: string; + /** + * The combined collection of [defaultSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) and [sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources). The [defaultSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) displays first in the Search UI. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-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; /** - * The default source used for the Search widget. + * A read-only property that is a [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [FeaturelayerSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) and/or [LocatorSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource). This property may contain [ArcGIS Portal](https://enterprise.arcgis.com/en/portal/) [locators](http://enterprise.arcgis.com/en/server/latest/publish-services/windows/geocode-services.htm) and any web map or web scene [configurable search sources](http://doc.arcgis.com/en/arcgis-online/create-maps/configure-feature-search.htm). This property is used to populate the Search UI if the [sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) property is not set. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSource) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) */ - readonly defaultSource: SearchViewModelFeatureLayerSource | SearchViewModelLocatorSource; + 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/latest/assets/img/apiref/widgets/search-locationEnabled.png) + * > The use of this property is only supported on secure origins. To use it, switch your application to a secure origin, such as HTTPS. Note that localhost is considered "potentially secure" and can be used for easy testing in browsers that supports [Window.isSecureContext](https://developer.mozilla.org/en-US/docs/Web/API/Window/isSecureContext#Browser_compatibility) (currently Chrome and Firefox). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-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; /** @@ -49452,24 +50951,38 @@ declare namespace __esri { * Indicates whether to display the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) on feature click. The graphic can be clicked to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). This is not the same as using [popupOpenOnSelect](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupOpenOnSelect) which opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but it is not opened by default. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupEnabled) + * + * @default true */ popupEnabled: boolean; /** * Indicates whether to show the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a result is selected. Using `popupOpenOnSelect` opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but not opened by default. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupOpenOnSelect) + * + * @default true */ popupOpenOnSelect: boolean; /** * A customized PopupTemplate for the selected feature. Note that specifying a wildcard {*} for the popupTemplate will return all fields in addition to search-specific fields. * * [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; /** @@ -49484,12 +50997,16 @@ declare namespace __esri { * 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 */ - results: any[]; + readonly results: any[]; /** * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-true-false](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-false.png) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#searchAllEnabled) + * + * @default true */ searchAllEnabled: boolean; /** @@ -49502,8 +51019,18 @@ declare namespace __esri { * 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: * * [LocatorSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) @@ -49515,28 +51042,44 @@ declare namespace __esri { * [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 + * + * [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 geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e. `supportsPagination = true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestions) + * + * @default null */ readonly suggestions: SearchViewModelSuggestResult[]; /** * Enable suggestions for the widget. This is only available if working with a 10.3 geocoding service that has [suggest capability loaded] (https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e. `supportsPagination = true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestionsEnabled) + * + * @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; @@ -49557,6 +51100,14 @@ declare namespace __esri { * */ 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 geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e.`supportsPagination = true`. * @@ -49589,7 +51140,7 @@ declare namespace __esri { export const SearchViewModel: SearchViewModelConstructor; - interface SearchViewModelProperties { + interface SearchViewModelProperties extends GoToProperties { /** * The selected source's index. This value is `-1` when all sources are selected. * @@ -49610,50 +51161,95 @@ declare namespace __esri { * 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/latest/assets/img/apiref/widgets/search-locationEnabled.png) + * > The use of this property is only supported on secure origins. To use it, switch your application to a secure origin, such as HTTPS. Note that localhost is considered "potentially secure" and can be used for easy testing in browsers that supports [Window.isSecureContext](https://developer.mozilla.org/en-US/docs/Web/API/Window/isSecureContext#Browser_compatibility) (currently Chrome and Firefox). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-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). This is not the same as using [popupOpenOnSelect](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupOpenOnSelect) which opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but it is not opened by default. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupEnabled) + * + * @default true */ popupEnabled?: boolean; /** * Indicates whether to show the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a result is selected. Using `popupOpenOnSelect` opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but not opened by default. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupOpenOnSelect) + * + * @default true */ popupOpenOnSelect?: boolean; /** * A customized PopupTemplate for the selected feature. Note that specifying a wildcard {*} for the popupTemplate will return all fields in addition to search-specific fields. * * [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. * @@ -49662,16 +51258,12 @@ declare namespace __esri { * @default true */ resultGraphicEnabled?: boolean; - /** - * An array of current results from the search. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#results) - */ - results?: any[]; /** * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-true-false](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-false.png) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#searchAllEnabled) + * + * @default true */ searchAllEnabled?: boolean; /** @@ -49695,18 +51287,24 @@ declare namespace __esri { * 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 geocoding service that has [suggest capability loaded] (https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e. `supportsPagination = true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestionsEnabled) + * + * @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; } @@ -51061,7 +52659,7 @@ declare namespace __esri { interface SketchViewModel extends Accessor, Evented { /** - * Graphic representing the temporary geometry that is being drawn on the view. + * Graphic representing the sketch that is being drawn on the view. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#graphic) */ @@ -51073,29 +52671,56 @@ declare namespace __esri { */ layer: GraphicsLayer; /** - * A simple marker symbol used for representing the point geometry that is being drawn. + * A simple marker symbol used for representing the point geometry that is being drawn. The default value is the following: + * ```js + * { + * type: "simple-marker", + * style: "circle", + * size: 6, + * color: [255, 255, 255], + * outline: { + * color: [50, 50, 50], + * width: 1 + * } + * } + * ``` * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#pointSymbol) */ pointSymbol: SimpleMarkerSymbol; /** - * A simple fill symbol used for representing the polygon geometry that is being drawn. + * A simple fill symbol used for representing the polygon geometry that is being drawn. The default value is the following: + * ```js + * { + * type: "simple-fill", + * color: [150, 150, 150, 0.2], + * outline: { + * color: [50, 50, 50], + * width: 2 + * } + * } + * ``` * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#polygonSymbol) */ polygonSymbol: SimpleFillSymbol; /** - * A simple line symbol used for representing the polyline geometry that is being drawn. + * A simple line symbol used for representing the polyline geometry that is being drawn. The default value is the following: + * ```js + * { + * type: "simple-line", + * color: [130, 130, 130], + * width: 2 + * } + * ``` * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#polylineSymbol) */ polylineSymbol: SimpleLineSymbol; /** - * The view model's state. **Known Values:** ready | disabled + * The sketch view model's state. **Possible Values:** ready | disabled | creating | updating * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#state) - * - * @default disabled */ readonly state: string; /** @@ -51106,7 +52731,7 @@ declare namespace __esri { view: MapView; /** - * Completes the active drawing and fires the [draw-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:draw-complete) event. If called mid-drawing, `complete()` finishes the active drawing and keeps the valid geometry. + * Completes the active drawing and fires the [create-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:create-complete) event. If called mid-drawing, `complete()` finishes the active drawing and keeps the valid geometry. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#complete) * @@ -51114,33 +52739,23 @@ declare namespace __esri { */ complete(): void; /** - * Creates an instance of the requested draw action type. See the table below for a list of known values and type of draw action it creates. **Known Values:** point | multipoint | polyline | polygon | rectangle | circle - * - * Geometry type | Draw action instance - * ------------- | -------------------- - * point | [PointDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PointDrawAction.html) - * multipoint | [MultipointDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-MultipointDrawAction.html) - * polyline | [PolylineDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolylineDrawAction.html) - * polygon | [PolygonDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolygonDrawAction.html) - * rectangle/square, circle/ellipse | [SegmentDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-SegmentDrawAction.html) - * - * **Note:** Creating circle does not work in all spatial references. + * Creates the requested draw action. **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. + * @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 only applies when creating `polygon` and `polyline` geometries. **Known Values:** + * The drawing mode. The drawing 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. - * freehand | Vertices are added while the pointer is dragged. + * 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(drawAction: string, drawOptions?: SketchViewModelCreateDrawOptions): void; /** * Resets SketchViewModel to prepare for another create operation. Reset discards the current drawing, if called mid drawing. * @@ -51150,19 +52765,19 @@ declare namespace __esri { */ reset(): void; /** - * Starts an update operation for the selected geometry and fires [update-start](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:update-start) event. + * 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. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) * - * @param geometry The geometry to be updated. + * @param graphic The graphic to be updated. * */ - update(geometry: Geometry): void; + update(graphic: Graphic): void; } interface SketchViewModelConstructor { /** - * SketchViewModel simplifies the process of adding temporary geometries to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). It saves the effort of writing lots of code for sketching different geometry types. SketchViewModel is intended for basic usage, without advanced features such as preventing self-intersecting lines or overlapping polygons. If more control is required for creating temporary geometries, then use the [Draw](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html) class instead. + * 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. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html) */ @@ -51180,19 +52795,48 @@ declare namespace __esri { */ layer?: GraphicsLayerProperties; /** - * A simple marker symbol used for representing the point geometry that is being drawn. + * A simple marker symbol used for representing the point geometry that is being drawn. The default value is the following: + * ```js + * { + * type: "simple-marker", + * style: "circle", + * size: 6, + * color: [255, 255, 255], + * outline: { + * color: [50, 50, 50], + * width: 1 + * } + * } + * ``` * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#pointSymbol) */ pointSymbol?: SimpleMarkerSymbolProperties; /** - * A simple fill symbol used for representing the polygon geometry that is being drawn. + * A simple fill symbol used for representing the polygon geometry that is being drawn. The default value is the following: + * ```js + * { + * type: "simple-fill", + * color: [150, 150, 150, 0.2], + * outline: { + * color: [50, 50, 50], + * width: 2 + * } + * } + * ``` * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#polygonSymbol) */ polygonSymbol?: SimpleFillSymbolProperties; /** - * A simple line symbol used for representing the polyline geometry that is being drawn. + * A simple line symbol used for representing the polyline geometry that is being drawn. The default value is the following: + * ```js + * { + * type: "simple-line", + * color: [130, 130, 130], + * width: 2 + * } + * ``` * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#polylineSymbol) */ @@ -51208,18 +52852,16 @@ declare namespace __esri { export interface SketchViewModelCreateDrawOptions extends Object { /** - * The drawing mode. The drawing mode only applies when creating `polygon` and `polyline` geometries. **Known Values:** + * The drawing mode. The drawing 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. - * freehand | Vertices are added while the pointer is dragged. + * 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) - * - * @default hybrid */ mode?: string; } @@ -51310,6 +52952,32 @@ declare namespace __esri { view?: MapViewProperties | SceneViewProperties; } + 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; + } + + export const GoTo: GoToConstructor; + + 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 { /** @@ -51381,7 +53049,29 @@ declare namespace __esri { export const widget: widget; - interface Track extends Widget { + export type GoToOverride = (view: MapView | SceneView, goToParameters: GoToParameters) => void; + + /** + * 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; + } + + 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. * @@ -51405,7 +53095,7 @@ declare namespace __esri { */ graphic: Graphic; /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#iconClass) */ @@ -51491,7 +53181,7 @@ declare namespace __esri { export const Track: TrackConstructor; - interface TrackProperties extends WidgetProperties { + 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. * @@ -51544,7 +53234,7 @@ declare namespace __esri { viewModel?: TrackViewModelProperties; } - interface TrackViewModel extends Accessor, Evented, GeolocationPositioning { + interface TrackViewModel extends Accessor, Evented, GeolocationPositioning, GoTo { /** * The current state of the widget. **Possible Values:** disabled | ready | tracking | waiting * @@ -51592,7 +53282,7 @@ declare namespace __esri { export const TrackViewModel: TrackViewModelConstructor; - interface TrackViewModelProperties extends GeolocationPositioningProperties { + interface TrackViewModelProperties extends GeolocationPositioningProperties, GoToProperties { } @@ -51999,7 +53689,7 @@ declare namespace __esri { interface Zoom extends Widget { /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#iconClass) */ @@ -52011,7 +53701,7 @@ declare namespace __esri { */ readonly label: string; /** - * Determines the layout/orientation of the Zoom widget. **Known Values:** vertical | horizontal + * 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) * @@ -52071,7 +53761,7 @@ declare namespace __esri { interface ZoomProperties extends WidgetProperties { /** - * Determines the layout/orientation of the Zoom widget. **Known Values:** vertical | horizontal + * 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) * @@ -52167,18 +53857,6 @@ declare namespace __esri { view?: MapViewProperties | SceneViewProperties; } - export type MultipointDrawActionCursorUpdateEventHandler = (event: MultipointDrawActionCursorUpdateEvent) => void; - - export type MultipointDrawActionDrawCompleteEventHandler = (event: MultipointDrawActionDrawCompleteEvent) => void; - - export type MultipointDrawActionRedoEventHandler = (event: MultipointDrawActionRedoEvent) => void; - - export type MultipointDrawActionUndoEventHandler = (event: MultipointDrawActionUndoEvent) => void; - - export type MultipointDrawActionVertexAddEventHandler = (event: MultipointDrawActionVertexAddEvent) => void; - - export type MultipointDrawActionVertexRemoveEventHandler = (event: MultipointDrawActionVertexRemoveEvent) => void; - export type OpenStreetMapLayerLayerviewCreateEventHandler = (event: OpenStreetMapLayerLayerviewCreateEvent) => void; export type OpenStreetMapLayerLayerviewDestroyEventHandler = (event: OpenStreetMapLayerLayerviewDestroyEvent) => void; @@ -52187,34 +53865,6 @@ declare namespace __esri { export type PointCloudLayerLayerviewDestroyEventHandler = (event: PointCloudLayerLayerviewDestroyEvent) => void; - export type PointDrawActionCursorUpdateEventHandler = (event: PointDrawActionCursorUpdateEvent) => void; - - export type PointDrawActionDrawCompleteEventHandler = (event: PointDrawActionDrawCompleteEvent) => void; - - export type PolygonDrawActionCursorUpdateEventHandler = (event: PolygonDrawActionCursorUpdateEvent) => void; - - export type PolygonDrawActionDrawCompleteEventHandler = (event: PolygonDrawActionDrawCompleteEvent) => void; - - export type PolygonDrawActionRedoEventHandler = (event: PolygonDrawActionRedoEvent) => void; - - export type PolygonDrawActionUndoEventHandler = (event: PolygonDrawActionUndoEvent) => void; - - export type PolygonDrawActionVertexAddEventHandler = (event: PolygonDrawActionVertexAddEvent) => void; - - export type PolygonDrawActionVertexRemoveEventHandler = (event: PolygonDrawActionVertexRemoveEvent) => void; - - export type PolylineDrawActionCursorUpdateEventHandler = (event: PolylineDrawActionCursorUpdateEvent) => void; - - export type PolylineDrawActionDrawCompleteEventHandler = (event: PolylineDrawActionDrawCompleteEvent) => void; - - export type PolylineDrawActionRedoEventHandler = (event: PolylineDrawActionRedoEvent) => void; - - export type PolylineDrawActionUndoEventHandler = (event: PolylineDrawActionUndoEvent) => void; - - export type PolylineDrawActionVertexAddEventHandler = (event: PolylineDrawActionVertexAddEvent) => void; - - export type PolylineDrawActionVertexRemoveEventHandler = (event: PolylineDrawActionVertexRemoveEvent) => void; - export type PopupViewModelTriggerActionEventHandler = (event: PopupViewModelTriggerActionEvent) => void; export type SceneLayerLayerviewCreateEventHandler = (event: SceneLayerLayerviewCreateEvent) => void; @@ -52269,12 +53919,6 @@ declare namespace __esri { export type SearchViewModelSuggestStartEventHandler = (event: SearchViewModelSuggestStartEvent) => void; - export type SegmentDrawActionCursorUpdateEventHandler = (event: SegmentDrawActionCursorUpdateEvent) => void; - - export type SegmentDrawActionDrawCompleteEventHandler = (event: SegmentDrawActionDrawCompleteEvent) => void; - - export type SegmentDrawActionVertexAddEventHandler = (event: SegmentDrawActionVertexAddEvent) => void; - export type StreamLayerLayerviewCreateEventHandler = (event: StreamLayerLayerviewCreateEvent) => void; export type StreamLayerLayerviewDestroyEventHandler = (event: StreamLayerLayerviewDestroyEvent) => void; @@ -52490,6 +54134,11 @@ declare module "esri/layers/BaseElevationLayer" { export = BaseElevationLayer; } +declare module "esri/layers/BingMapsLayer" { + import BingMapsLayer = __esri.BingMapsLayer; + export = BingMapsLayer; +} + declare module "esri/layers/CSVLayer" { import CSVLayer = __esri.CSVLayer; export = CSVLayer; @@ -52780,6 +54429,11 @@ declare module "esri/renderers/ClassBreaksRenderer" { export = ClassBreaksRenderer; } +declare module "esri/renderers/HeatmapRenderer" { + import HeatmapRenderer = __esri.HeatmapRenderer; + export = HeatmapRenderer; +} + declare module "esri/renderers/Renderer" { import Renderer = __esri.Renderer; export = Renderer; @@ -52830,9 +54484,19 @@ declare module "esri/renderers/support/AuthoringInfoVisualVariable" { export = AuthoringInfoVisualVariable; } -declare module "esri/support/Action" { - import Action = __esri.Action; - export = Action; +declare module "esri/renderers/support/HeatmapColorStop" { + import HeatmapColorStop = __esri.HeatmapColorStop; + export = HeatmapColorStop; +} + +declare module "esri/support/actions/ActionButton" { + import ActionButton = __esri.ActionButton; + export = ActionButton; +} + +declare module "esri/support/actions/ActionToggle" { + import ActionToggle = __esri.ActionToggle; + export = ActionToggle; } declare module "esri/symbols/ExtrudeSymbol3DLayer" { @@ -53355,6 +55019,11 @@ declare module "esri/views/ui/DefaultUI" { export = DefaultUI; } +declare module "esri/views/2d/ViewState" { + import ViewState = __esri.ViewState; + export = ViewState; +} + declare module "esri/views/2d/draw/Draw" { import Draw = __esri.Draw; export = Draw; @@ -53390,6 +55059,11 @@ 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/InitialViewProperties" { import InitialViewProperties = __esri.InitialViewProperties; export = InitialViewProperties; @@ -53445,6 +55119,16 @@ declare module "esri/webscene/applicationProperties/Viewing" { export = Viewing; } +declare module "esri/webscene/background/Background" { + import Background = __esri.Background; + export = Background; +} + +declare module "esri/webscene/background/ColorBackground" { + import ColorBackground = __esri.ColorBackground; + export = ColorBackground; +} + declare module "esri/widgets/AreaMeasurement3D" { import AreaMeasurement3D = __esri.AreaMeasurement3D; export = AreaMeasurement3D; @@ -53465,6 +55149,11 @@ declare module "esri/widgets/BasemapToggle" { export = BasemapToggle; } +declare module "esri/widgets/Bookmarks" { + import Bookmarks = __esri.Bookmarks; + export = Bookmarks; +} + declare module "esri/widgets/ColorSlider" { import ColorSlider = __esri.ColorSlider; export = ColorSlider; @@ -53610,6 +55299,16 @@ declare module "esri/widgets/BasemapToggle/BasemapToggleViewModel" { export = BasemapToggleViewModel; } +declare module "esri/widgets/Bookmarks/Bookmark" { + import Bookmark = __esri.Bookmark; + export = Bookmark; +} + +declare module "esri/widgets/Bookmarks/BookmarksViewModel" { + import BookmarksViewModel = __esri.BookmarksViewModel; + export = BookmarksViewModel; +} + declare module "esri/widgets/Compass/CompassViewModel" { import CompassViewModel = __esri.CompassViewModel; export = CompassViewModel; @@ -53740,11 +55439,6 @@ declare module "esri/layers/DynamicLayer" { export = DynamicLayer; } -declare module "esri/layers/TiledLayer" { - import TiledLayer = __esri.TiledLayer; - export = TiledLayer; -} - declare module "esri/layers/mixins/ArcGISCachedService" { import ArcGISCachedService = __esri.ArcGISCachedService; export = ArcGISCachedService; @@ -53790,6 +55484,11 @@ declare module "esri/renderers/VisualVariablesMixin" { export = VisualVariablesMixin; } +declare module "esri/support/actions/ActionBase" { + import ActionBase = __esri.ActionBase; + export = ActionBase; +} + declare module "esri/support/LayersMixin" { import LayersMixin = __esri.LayersMixin; export = LayersMixin; @@ -53815,6 +55514,11 @@ declare module "esri/widgets/support/GeolocationPositioning" { export = GeolocationPositioning; } +declare module "esri/widgets/support/GoTo" { + import GoTo = __esri.GoTo; + export = GoTo; +} + declare module "esri/config" { import config = __esri.config; export = config; @@ -54038,3 +55742,84 @@ declare module "esri/geometry" { 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 e4161412b5..5ce4cfa06c 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.24 +// Type definitions for ArcGIS API for JavaScript 3.25 // Project: https://developers.arcgis.com/javascript/3/ // Definitions by: Esri // Bjorn Svensson @@ -45,7 +45,6 @@ declare module "esri" { import PrintTemplate = require("esri/tasks/PrintTemplate"); import QueryTask = require("esri/tasks/QueryTask"); import DataProviderGE = require("esri/dijit/geoenrichment/ReportPlayer/DataProviderGE"); - import PlayerResizeModes = require("esri/dijit/geoenrichment/ReportPlayer/PlayerResizeModes"); import PlayerThemes = require("esri/dijit/geoenrichment/ReportPlayer/PlayerThemes"); import TextSymbol = require("esri/symbols/TextSymbol"); import StandardGeographyQueryTask = require("esri/tasks/geoenrichment/StandardGeographyQueryTask"); @@ -1896,14 +1895,29 @@ declare module "esri" { values: number[]; } export interface ReportPlayerOptions { + /** Indicates whether left and right arrows key can be used to paginate when viewMode is set to PlayerViewModes.PANELS_IN_SLIDES. */ + allowKeyboardNavigation?: boolean; /** Specifies which export options are available for the report. */ dataProvider?: DataProviderGE; - /** Indicate whether to display the report in slide view or full screen, defaults to false which is full view. */ - isSlidesView?: boolean; + /** Specifies how the ReportPlayer should zoom by default. */ + defaultZoomBehavior?: string; + /** Indicates whether interactive experience for panels should be enabled. */ + enableDataDrilling?: boolean; /** Specifies the resize mode of the ReportPlayer. */ - resizeMode?: PlayerResizeModes; + resizeMode?: string; + /** If true, indicates that panels should scale to fit the window. */ + scaleSlidesToFitWindow?: boolean; + /** Indicates whether the analysis area title will be shown in the toolbar. */ + showAreaTitle?: boolean; + /** Indicates whether the toolbar will be shown in a compact popup view. */ + showToolbarInPopup?: boolean; /** Specifies the theme of the ReportPlayer. */ theme?: PlayerThemes; + /** + * Specifies the display of the report in full page view, slide view, or stacked panel view. + * @deprecated + */ + viewMode?: string; } export interface RingBufferOptions { /** The radii to use to create ring buffers */ @@ -7549,22 +7563,45 @@ declare module "esri/dijit/geoenrichment/ReportPlayer/PlayerThemes" { export = PlayerThemes; } +declare module "esri/dijit/geoenrichment/ReportPlayer/PlayerViewModes" { + /** An enumerator of available view modes displaying the Report Player. */ + class PlayerViewModes { + /** Displays one full page at a time. */ + static FULL_PAGES: any; + /** Panels will be shown in the slides view mode. */ + static PANELS_IN_SLIDES: any; + /** Panels will be shown in a single stack. */ + static PANELS_IN_STACK: any; + } + export = PlayerViewModes; +} + declare module "esri/dijit/geoenrichment/ReportPlayer/ReportPlayer" { import esri = require("esri"); import DataProviderGE = require("esri/dijit/geoenrichment/ReportPlayer/DataProviderGE"); - import PlayerResizeModes = require("esri/dijit/geoenrichment/ReportPlayer/PlayerResizeModes"); - import PlayerThemes = require("esri/dijit/geoenrichment/ReportPlayer/PlayerThemes"); /** The ReportPlayer widget runs infographic report templates for a provided analysis area. */ class ReportPlayer { + /** Indicates whether left and right arrows key can be used to paginate when viewMode is set to PlayerViewModes.PANELS_IN_SLIDES. */ + allowKeyboardNavigation: boolean; /** Data Provider for the ReportPlayer which allows you to specify which export options are available when running the report. */ dataProvider: DataProviderGE; - /** Indicate whether to display the report in slide view or full screen, defaults to false which is full view. */ - isSlidesView: boolean; + /** Specifies how the ReportPlayer should zoom by default. */ + defaultZoomBehavior: string; + /** Indicates whether interactive experience for panels should be enabled. */ + enableDataDrilling: boolean; /** Specifies the resize mode of the ReportPlayer. */ - resizeModes: PlayerResizeModes; + resizeMode: string; + /** If true, indicates that panels should scale to fit the window. */ + scaleSlidesToFitWindow: boolean; + /** Indicates whether the analysis area title will be shown in the toolbar. */ + showAreaTitle: boolean; + /** Indicates whether the toolbar will be shown in a compact popup view. */ + showToolbarInPopup: boolean; /** Specifies the theme of the ReportPlayer. */ - theme: PlayerThemes; + theme: string; + /** Specifies the display of the report in full page view, slide view, or stacked panel view. */ + viewMode: string; /** * Creates a new ReportPlayer dijit using the given DOM node. * @param params Various parameters that can be used to configure the ReportPlayer. @@ -7577,6 +7614,22 @@ declare module "esri/dijit/geoenrichment/ReportPlayer/ReportPlayer" { * @param playParams See the object specifications table below for the structure of the playParams object. */ playReport(dataProviderParams: any, playParams?: any): any; + /** + * Sets the width and height of the ReportPlayer when resizeMode is set to PlayerResizeModes.MANUAL. + * @param width The width in pixels. + * @param height The height in pixels. + */ + resize(width?: number, height?: number): any; + /** + * Sets the maximum height for the Report Player. + * @param number The height in pixels. + */ + setMaxHeight(number: number): number; + /** + * Sets the maximum width for the Report Player. + * @param number The width in pixels. + */ + setMaxWidth(number: number): number; } export = ReportPlayer; } @@ -11463,6 +11516,8 @@ declare module "esri/layers/VectorTileLayer" { /** A VectorTileLayer renders cached tiles of data. */ class VectorTileLayer extends Layer { + /** The current style information of the VectorTileLayer. */ + currentStyleInfo: any; /** The full extent of the layer. */ fullExtent: Extent; /** The initial extent of the layer. */ @@ -11608,7 +11663,7 @@ declare module "esri/layers/WCSLayer" { import Point = require("esri/geometry/Point"); import Layer = require("esri/layers/layer"); - /** (Currently in beta) The WCSLayer works with OGC Web Coverage Services. */ + /** The WCSLayer works with OGC Web Coverage Services. */ class WCSLayer { /** Resamples pixel by bilinear interpolation. */ static INTERPOLATION_BILINEAR: any; @@ -12566,7 +12621,7 @@ declare module "esri/opsdashboard/DataSourceProxy" { import Query = require("esri/tasks/query"); import Graphic = require("esri/graphic"); - /** DataSourceProxy is a proxy class that represents a operations dashboard data source. */ + /** (Currently in Mature Support) DataSourceProxy is a proxy class that represents a operations dashboard data source. */ class DataSourceProxy { /** Read-only: The name of the display field. */ displayFieldName: string; @@ -12634,7 +12689,7 @@ declare module "esri/opsdashboard/ExtensionBase" { import esri = require("esri"); import MapWidgetProxy = require("esri/opsdashboard/MapWidgetProxy"); - /** ExtensionBase is a base class used by all the extension proxies. */ + /** (Currently in Mature Support) ExtensionBase is a base class used by all the extension proxies. */ class ExtensionBase { /** "circle" */ static CIRCLE: any; @@ -12712,7 +12767,7 @@ declare module "esri/opsdashboard/ExtensionBase" { declare module "esri/opsdashboard/ExtensionConfigurationBase" { import ExtensionBase = require("esri/opsdashboard/ExtensionBase"); - /** ExtensionConfigurationBase is a base class used by all the extension configuration proxies. */ + /** (Currently in Mature Support) ExtensionConfigurationBase is a base class used by all the extension configuration proxies. */ class ExtensionConfigurationBase extends ExtensionBase { /** The object that will store the Widget/MapTool/FeatureAction configuration. */ config: any; @@ -12728,7 +12783,7 @@ declare module "esri/opsdashboard/ExtensionConfigurationBase" { declare module "esri/opsdashboard/FeatureActionConfigurationProxy" { import ExtensionConfigurationBase = require("esri/opsdashboard/ExtensionConfigurationBase"); - /** FeatureActionConfigurationProxy is a class used to provide the configuration user experience for an operations dashboard extension feature action. */ + /** (Currently in Mature Support) FeatureActionConfigurationProxy is a class used to provide the configuration user experience for an operations dashboard extension feature action. */ class FeatureActionConfigurationProxy extends ExtensionConfigurationBase { } export = FeatureActionConfigurationProxy; @@ -12738,7 +12793,7 @@ declare module "esri/opsdashboard/FeatureActionFeatures" { import DataSourceProxy = require("esri/opsdashboard/DataSourceProxy"); import Graphic = require("esri/graphic"); - /** FeatureActionFeatures is a specialized collection of features used by WidgetProxy to hold the collection of features for the associated feature actions. */ + /** (Currently in Mature Support) FeatureActionFeatures is a specialized collection of features used by WidgetProxy to hold the collection of features for the associated feature actions. */ class FeatureActionFeatures { /** The DataSourceProxy from which the collection of features belongs to. */ dataSourceProxy: DataSourceProxy; @@ -12782,7 +12837,7 @@ declare module "esri/opsdashboard/GraphicsLayerProxy" { import Renderer = require("esri/renderers/Renderer"); import Graphic = require("esri/graphic"); - /** GraphicsLayerProxy is a proxy class that represents a graphics layer in a map widget in the host application. */ + /** (Currently in Mature Support) GraphicsLayerProxy is a proxy class that represents a graphics layer in a map widget in the host application. */ class GraphicsLayerProxy { /** Read-only: The current host graphics layer maximum visible scale. */ maxScale: number; @@ -12843,7 +12898,7 @@ declare module "esri/opsdashboard/GraphicsLayerProxy" { declare module "esri/opsdashboard/MapToolConfigurationProxy" { import ExtensionConfigurationBase = require("esri/opsdashboard/ExtensionConfigurationBase"); - /** MapToolConfigurationProxy is a class used to provide the configuration user experience for an operations dashboard extension map tool. */ + /** (Currently in Mature Support) MapToolConfigurationProxy is a class used to provide the configuration user experience for an operations dashboard extension map tool. */ class MapToolConfigurationProxy extends ExtensionConfigurationBase { } export = MapToolConfigurationProxy; @@ -12854,7 +12909,7 @@ declare module "esri/opsdashboard/MapToolProxy" { import MapWidgetProxy = require("esri/opsdashboard/MapWidgetProxy"); import Geometry = require("esri/geometry/Geometry"); - /** MapToolProxy is a class used to define an operations dashboard extension map tool. */ + /** (Currently in Mature Support) MapToolProxy is a class used to define an operations dashboard extension map tool. */ class MapToolProxy { /** Read-only: The available size for the map tool user experience on the host map widget. */ availableDisplaySize: number; @@ -12907,7 +12962,7 @@ declare module "esri/opsdashboard/MapWidgetProxy" { import Point = require("esri/geometry/Point"); import Extent = require("esri/geometry/Extent"); - /** MapWidgetProxy is a proxy class that represents a operations dashboard map widget. */ + /** (Currently in Mature Support) MapWidgetProxy is a proxy class that represents a operations dashboard map widget. */ class MapWidgetProxy { /** Read-only: The map id. */ id: string; @@ -12954,7 +13009,7 @@ declare module "esri/opsdashboard/WidgetConfigurationProxy" { import DataSourceProxy = require("esri/opsdashboard/DataSourceProxy"); import MapWidgetProxy = require("esri/opsdashboard/MapWidgetProxy"); - /** WidgetConfigurationProxy is a class used to provide the configuration user experience for an operations dashboard extension widget. */ + /** (Currently in Mature Support) WidgetConfigurationProxy is a class used to provide the configuration user experience for an operations dashboard extension widget. */ class WidgetConfigurationProxy extends ExtensionConfigurationBase { /** * Called by the host application when the user has changed the selected data source in the data source selector. @@ -12990,7 +13045,7 @@ declare module "esri/opsdashboard/WidgetProxy" { import Graphic = require("esri/graphic"); import Geometry = require("esri/geometry/Geometry"); - /** WidgetProxy is a class used to define an operations dashboard extension widget. */ + /** (Currently in Mature Support) WidgetProxy is a class used to define an operations dashboard extension widget. */ class WidgetProxy extends ExtensionBase { /** Read-only: If the widget was configured to consume data sources, the dataSourceConfig array will hold a collection of dataSourceConfig objects. */ dataSourceConfigs: any[]; @@ -13051,7 +13106,7 @@ declare module "esri/opsdashboard/featureActionProxy" { import DataSourceProxy = require("esri/opsdashboard/DataSourceProxy"); import FeatureSet = require("esri/tasks/FeatureSet"); - /** featureActionProxy is a singleton object that allows implementing an operations dashboard Feature Action extension. */ + /** (Currently in Mature Support) featureActionProxy is a singleton object that allows implementing an operations dashboard Feature Action extension. */ class featureActionProxy extends ExtensionBase { /** Event raised when the feature action should execute for a set of features. */ on(type: "execute", listener: (event: { config: any; dataSourceProxy: DataSourceProxy; featureSet: FeatureSet; target: featureActionProxy }) => void): esri.Handle; @@ -13903,6 +13958,11 @@ declare module "esri/renderers/smartMapping" { * @param params See the Object Specifications table below for the structure of the params object. */ createPredominanceRenderer(params: any): any; + /** + * Creates a renderer for exploring the relationship between two numeric attributes. + * @param params See the object specifications table below for the structure of the params object. + */ + createRelationshipRenderer(params: any): any; /** * Defines the size of the symbol where feature size is proportional to data value. * @param params See the object specifications table below for the structure of the params object. @@ -15776,6 +15836,8 @@ declare module "esri/tasks/ImageServiceIdentifyParameters" { class ImageServiceIdentifyParameters { /** Input geometry that defines the location to be identified. */ geometry: Geometry; + /** If the returnCatalogItems parameter is set to true, this parameter will take effect. */ + maxItemCount: number; /** Specifies the mosaic rules defining the image sorting order. */ mosaicRule: MosaicRule; /** The pixel or RGB color value representing no information. */ @@ -15794,6 +15856,8 @@ declare module "esri/tasks/ImageServiceIdentifyParameters" { returnCatalogItems: boolean; /** When true, each feature in the catalog items includes the geometry. */ returnGeometry: boolean; + /** If true, returns the pixel values of all mosaicked raster catalog items under the requested geometry. */ + returnPixelValues: boolean; /** Specify a time extent. */ timeExtent: TimeExtent; /** Creates a new ImageServiceIdentifyParameters object. */ @@ -18456,3 +18520,16 @@ declare module "esri/workers/WorkerClient" { export = WorkerClient; } +declare module "sri/dijit/geoenrichment/ReportPlayer/PlayerZoomBehaviors" { + /** Enumerator of available zoom behavior options for the ReportPlayer. */ + class PlayerZoomBehaviors { + /** The Report Player zooms in to fit a full page in the viewable area. */ + static FIT_PAGE: any; + /** The Report Player zooms to fit the full page's width in the viewable area. */ + static FIT_PAGE_WIDTH: any; + /** The zoom will be set to 100% (not zoomed). */ + static RESET: any; + } + export = PlayerZoomBehaviors; +} + diff --git a/types/archiver/archiver-tests.ts b/types/archiver/archiver-tests.ts index dbb1df1de7..d61950b657 100644 --- a/types/archiver/archiver-tests.ts +++ b/types/archiver/archiver-tests.ts @@ -67,3 +67,15 @@ archiver.use(() => {}); archiver.finalize(); archiver.symlink('./path', './target'); + +function fakeHandler(err: Archiver.ArchiverError) { + console.log(err.code); + console.log(err.message); + console.log(err.stack); + console.log(err.data); +} + +const fakeError = new Archiver.ArchiverError('code', 'foo'); + +archiver.on('error', fakeHandler); +archiver.on('warning', fakeHandler); diff --git a/types/archiver/index.d.ts b/types/archiver/index.d.ts index d33e8ec6dd..a9cafca24b 100644 --- a/types/archiver/index.d.ts +++ b/types/archiver/index.d.ts @@ -24,9 +24,26 @@ declare namespace archiver { mode?: number; } + interface ProgressData { + entries: { + total: number; + processed: number; + }; + fs: { + totalBytes: number; + processedBytes: number; + }; + } + /** A function that lets you either opt out of including an entry (by returning false), or modify the contents of an entry as it is added (by returning an EntryData) */ type EntryDataFunction = (entry: EntryData) => false | EntryData; + class ArchiverError extends Error { + code: string; // Since archiver format support is modular, we cannot enumerate all possible error codes, as the modules can throw arbitrary ones. + data: any; + constructor(code: string, data: any); + } + interface Archiver extends stream.Transform { abort(): this; append(source: stream.Readable | Buffer | string, name?: EntryData): this; @@ -44,6 +61,13 @@ declare namespace archiver { use(plugin: Function): this; symlink(filepath: string, target: string): this; + + on(event: 'error' | 'warning', listener: (error: ArchiverError) => void): this; + on(event: 'data', listener: (data: EntryData) => void): this; + on(event: 'progress', listener: (progress: ProgressData) => void): this; + on(event: 'close' | 'drain' | 'finish', listener: () => void): this; + on(event: 'pipe' | 'unpipe', listener: (src: stream.Readable) => void): this; + on(event: string, listener: (...args: any[]) => void): this; } type ArchiverOptions = CoreOptions & TransformOptions & ZipOptions & TarOptions; diff --git a/types/asana/index.d.ts b/types/asana/index.d.ts index 9bbfb62508..4a0ce5a05f 100644 --- a/types/asana/index.d.ts +++ b/types/asana/index.d.ts @@ -2,10 +2,7 @@ // Project: https://github.com/Asana/node-asana // Definitions by: Qubo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -/// - +// TypeScript Version: 2.8 import * as Promise from 'bluebird'; declare namespace asana { diff --git a/types/asap/asap-tests.ts b/types/asap/asap-tests.ts new file mode 100644 index 0000000000..3ffb3d97bb --- /dev/null +++ b/types/asap/asap-tests.ts @@ -0,0 +1,36 @@ +import asap = require("asap"); +import rawAsap = require("asap/raw"); + +class Callable { + call(): void { + "'Callable' invoked"; + } +} +function f(): void { + "'f' invoked"; +} + +// $ExpectType void +asap(f); + +// $ExpectType void +asap((): void => { + "'arrow' invoked"; +}); + +// $ExpectType void +asap(new Callable()); + +// $ExpectType void +rawAsap(f); + +// $ExpectType void +rawAsap((): void => { + "'arrow' invoked"; +}); + +// $ExpectType void +rawAsap(new Callable()); + +// $ExpectType void +rawAsap.requestFlush(); diff --git a/types/asap/index.d.ts b/types/asap/index.d.ts new file mode 100644 index 0000000000..c5fc69aee3 --- /dev/null +++ b/types/asap/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for asap 2.0 +// Project: https://github.com/kriskowal/asap +// Definitions by: fpascutti +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface Task { + call(...args: any[]): any; +} + +/** + * Executes a task as soon as possible. + * @param task Function or any object that implements `call()`. + */ +declare function asap(task: Task): void; +export = asap; diff --git a/types/asap/raw.d.ts b/types/asap/raw.d.ts new file mode 100644 index 0000000000..c587a9c5b2 --- /dev/null +++ b/types/asap/raw.d.ts @@ -0,0 +1,16 @@ +interface Task { + call(...args: any[]): any; +} + +/** + * Executes a task as soon as possible. + * @param task Function or any object that implements `call()`. + */ +declare function rawAsap(task: Task): void; +declare namespace rawAsap { + /** + * Flushes the event queue. + */ + function requestFlush(): void; +} +export = rawAsap; diff --git a/types/asap/tsconfig.json b/types/asap/tsconfig.json new file mode 100644 index 0000000000..ea8a3d1091 --- /dev/null +++ b/types/asap/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": [ + "asap-tests.ts", + "index.d.ts", + "raw.d.ts" + ] +} diff --git a/types/asap/tslint.json b/types/asap/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/asap/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/atlassian-crowd-client/api.d.ts b/types/atlassian-crowd-client/api.d.ts new file mode 100644 index 0000000000..0064382605 --- /dev/null +++ b/types/atlassian-crowd-client/api.d.ts @@ -0,0 +1,10 @@ +import { Settings } from "./settings"; + +declare class CrowdApi { + settings: Settings; + constructor(settings: Settings); + request(method: string, path: string, data?: any): Promise; + log(...args: any[]): void; +} + +export = CrowdApi; diff --git a/types/atlassian-crowd-client/atlassian-crowd-client-tests.ts b/types/atlassian-crowd-client/atlassian-crowd-client-tests.ts new file mode 100644 index 0000000000..c43c272343 --- /dev/null +++ b/types/atlassian-crowd-client/atlassian-crowd-client-tests.ts @@ -0,0 +1,44 @@ +import CrowdClient = require("atlassian-crowd-client"); +import Attributes = require("atlassian-crowd-client/lib/models/attributes"); +import Group = require("atlassian-crowd-client/lib/models/group"); +import Session = require("atlassian-crowd-client/lib/models/session"); +import User = require("atlassian-crowd-client/lib/models/user"); + +// Initialize the Crowd client: +const crowd = new CrowdClient({ + baseUrl: "https://crowd.example.com/", + application: { + name: "demo", + password: "example" + } +}); + +// Create a new user: +crowd.user.create(new User("John", "Doe", "John Doe", "johndoe@example.com", "johndoe", "secret")); +// Remove +crowd.user.remove("johndoe"); + +// Authenticate to Crowd: +crowd.session.create("someusername", "somepassword").then((session: Session) => { + // Fetch the user profile: + crowd.session.getUser(session.token).then((user: User) => { + console.log("Hello, " + user.displayname); + }); +}); + +// Find all active groups (using Crowd Query Language): +crowd.search.group("active=true").then((groups: string[] | Group[]) => { + console.log("Found groups: " + groups.length); +}); + +const group = new Group("testgroup1", "Test group"); + +const attributes = new Attributes({ + foo: "Foo", + bar: ["Bar", "Baz"], + obj: { a: "A" } +}); + +crowd.group.attributes.set(group.groupname, attributes).then(() => { + console.log("Group attribute is set."); +}); diff --git a/types/atlassian-crowd-client/index.d.ts b/types/atlassian-crowd-client/index.d.ts new file mode 100644 index 0000000000..a2e5d8e88f --- /dev/null +++ b/types/atlassian-crowd-client/index.d.ts @@ -0,0 +1,117 @@ +// Type definitions for atlassian-crowd-client 2.0 +// Project: https://github.com/ghengeveld/atlassian-crowd-client +// Definitions by: mtgto +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import CrowdApi = require("./api"); +import { Settings } from "./settings"; +import Attributes = require("./lib/models/attributes"); +import Group = require("./lib/models/group"); +import User = require("./lib/models/user"); +import Session = require("./lib/models/session"); +import ValidationFactors = require("./lib/models/validation-factors"); + +export = CrowdClient; +declare class CrowdClient extends CrowdApi { + settings: Settings; + + constructor(settings: Settings); + + user: { + get: (username: string, withAttributes?: boolean) => Promise; + create: (user: User) => Promise; + update: (username: string, user: User) => Promise; + rename: (oldname: string, newname: string) => Promise; + remove: (username: string) => Promise; + attributes: { + list: (username: string) => Promise; + set: (username: string, attributes: Attributes) => Promise; + remove: (username: string, attributename: string) => Promise; + password: { + set: (username: string, password: string) => Promise; + reset: (username: string) => Promise; + }; + username: { + request: (email: string) => Promise; + }; + }; + groups: { + get: (username: string, groupname: string, nested?: boolean) => Promise; + list: (username: string, nested?: boolean, startIndex?: number, maxResults?: number) => Promise; + add: (username: string, groupname: string) => Promise; + remove: (username: string, groupname: string) => Promise; + }; + }; + group: { + get: (groupname: string, withAttributes?: boolean) => Promise; + create: (group: Group) => Promise; + update: (groupname: string, group: Group) => Promise; + remove: (groupname: string) => Promise; + attributes: { + list: (groupname: string) => Promise; + set: (groupname: string, attributes: Attributes) => Promise; + remove: (groupname: string, attributename: string) => Promise; + }; + users: { + get: (groupname: string, username: string, nested?: boolean) => Promise; + list: ( + groupname: string, + nested?: boolean, + startIndex?: number, + maxResults?: number, + expand?: boolean, + ) => Promise; + add: (groupname: string, username: string) => Promise; + remove: (groupname: string, username: string) => Promise; + }; + parents: { + get: (groupname: string, parentname: string, nested?: boolean) => Promise; + list: (groupname: string, nested?: boolean, startIndex?: number, maxResults?: number) => Promise; + add: (groupname: string, parentname: string) => Promise; + }; + children: { + get: (groupname: string, childname: string, nested?: boolean) => Promise; + list: (groupname: string, nested?: boolean, startIndex?: number, maxResults?: number) => Promise; + add: (groupname: string, childname: string) => Promise; + remove: (groupname: string, childname: string) => Promise; + }; + membership: () => Promise; + }; + authentication: { + authenticate: (username: string, password: string) => Promise; + }; + search: { + user: ( + restriction: string, + expand?: boolean, + startIndex?: number, + maxResults?: number, + ) => Promise; + group: ( + restriction: string, + expand?: boolean, + startIndex?: number, + maxResults?: number, + ) => Promise; + }; + session: { + getUser: (token: string) => Promise; + validate: (token: string, validationFactors?: ValidationFactors) => Promise; + create: ( + username: string, + password: string, + validationFactors?: ValidationFactors, + duration?: number, + ) => Promise; + createUnvalidated: ( + username: string, + validationFactors?: ValidationFactors, + duration?: number, + ) => Promise; + remove: (token: string) => Promise; + removeAll: (username: string, exclude?: string) => Promise; + }; + config: { + cookie: () => Promise; + }; +} diff --git a/types/atlassian-crowd-client/lib/models/attributes.d.ts b/types/atlassian-crowd-client/lib/models/attributes.d.ts new file mode 100644 index 0000000000..3385311546 --- /dev/null +++ b/types/atlassian-crowd-client/lib/models/attributes.d.ts @@ -0,0 +1,8 @@ +export = Attributes; +declare class Attributes { + readonly attributes: {[name: string]: any}; + + constructor(attributePairs: {[name: string]: any}); + toCrowd(stringify?: (attr: any) => string): any; + static fromCrowd(attributesArr: ReadonlyArray<{name: string}>, parse?: (json: string) => any): Attributes; +} diff --git a/types/atlassian-crowd-client/lib/models/group.d.ts b/types/atlassian-crowd-client/lib/models/group.d.ts new file mode 100644 index 0000000000..e7dc70b6df --- /dev/null +++ b/types/atlassian-crowd-client/lib/models/group.d.ts @@ -0,0 +1,18 @@ +export = Group; +declare class Group { + readonly groupname: string; + readonly description: string; + readonly active: boolean; + readonly attributes?: any; + + constructor(groupname: string, description?: string, active?: boolean, attributes?: any); + toCrowd(): GroupObj; + static fromCrowd(obj: {name: string, description?: string, active?: boolean, attributes: any}): Group; +} + +interface GroupObj { + readonly type: "GROUP"; + readonly name: string; + readonly description: string; + readonly active: boolean; +} diff --git a/types/atlassian-crowd-client/lib/models/session.d.ts b/types/atlassian-crowd-client/lib/models/session.d.ts new file mode 100644 index 0000000000..2ef16a0814 --- /dev/null +++ b/types/atlassian-crowd-client/lib/models/session.d.ts @@ -0,0 +1,16 @@ +export = Session; +declare class Session { + readonly token: string; + readonly createdAt: Date; + readonly expiresAt: Date; + + constructor(token: string, createdAt: Date, expiresAt: Date); + toCrowd(): SessionObj; + static fromCrowd(obj: SessionObj): Session; +} + +interface SessionObj { + readonly token: string; + readonly "created-date": number; + readonly "expiry-date": number; +} diff --git a/types/atlassian-crowd-client/lib/models/user.d.ts b/types/atlassian-crowd-client/lib/models/user.d.ts new file mode 100644 index 0000000000..cf5fdeb115 --- /dev/null +++ b/types/atlassian-crowd-client/lib/models/user.d.ts @@ -0,0 +1,25 @@ +export = User; +declare class User { + readonly firstname: string; + readonly lastname: string; + readonly displayname: string; + readonly email: string; + readonly username: string; + readonly password?: string; + readonly active: boolean; + readonly attributes: {[key: string]: any}; + + constructor(firstname: string, lastname: string, displayname: string, email: string, username: string, password?: string, active?: boolean, attributes?: any); + toCrowd(): UserObj; + static fromCrowd(userObj: UserObj): User; +} + +interface UserObj { + readonly "name": string; + readonly "first-name": string; + readonly "last-name": string; + readonly "display-name": string; + readonly "email": string; + readonly "active": boolean; + readonly "password"?: { value: string }; +} diff --git a/types/atlassian-crowd-client/lib/models/validation-factors.d.ts b/types/atlassian-crowd-client/lib/models/validation-factors.d.ts new file mode 100644 index 0000000000..60e418f80d --- /dev/null +++ b/types/atlassian-crowd-client/lib/models/validation-factors.d.ts @@ -0,0 +1,12 @@ +export = ValidationFactors; +declare class ValidationFactors { + readonly validationFactors: any; + + constructor(validationFactorPairs: any); + toCrowd(): ValidationFactorsObj; + static fromCrowd(validationFactorsObj: ValidationFactorsObj): ValidationFactors; +} + +interface ValidationFactorsObj { + validationFactors: any[]; +} diff --git a/types/atlassian-crowd-client/settings.d.ts b/types/atlassian-crowd-client/settings.d.ts new file mode 100644 index 0000000000..755c26038a --- /dev/null +++ b/types/atlassian-crowd-client/settings.d.ts @@ -0,0 +1,12 @@ +export interface Settings { + readonly baseUrl: string; + readonly application: { + readonly name: string; + readonly password: string; + } + readonly nesting?: boolean; + readonly sessionTimeout?: number; + readonly debug?: boolean; + readonly attributesParser?: (json: string) => any; + readonly attributesEncoder?: (obj: any) => string; +} diff --git a/types/atlassian-crowd-client/tsconfig.json b/types/atlassian-crowd-client/tsconfig.json new file mode 100644 index 0000000000..51cfc0966c --- /dev/null +++ b/types/atlassian-crowd-client/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", + "atlassian-crowd-client-tests.ts" + ] +} diff --git a/types/atlassian-crowd-client/tslint.json b/types/atlassian-crowd-client/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/atlassian-crowd-client/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/atob/index.d.ts b/types/atob/index.d.ts index 632880f7a6..1feb3481e8 100644 --- a/types/atob/index.d.ts +++ b/types/atob/index.d.ts @@ -2,6 +2,6 @@ // Project: https://git.coolaj86.com/coolaj86/atob.js.git // Definitions by: John Wright // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 2.1 export default function(str: string): string; diff --git a/types/auth0/index.d.ts b/types/auth0/index.d.ts index 18cc086ed8..e03ad5aa06 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/auth0/node-auth0 // Definitions by: Wilson Hobbs , Seth Westphal , Amiram Korach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as Promise from 'bluebird'; @@ -264,7 +264,7 @@ export interface CreateClientGrant { scope: string[]; } -export type Strategy = +export type Strategy = 'ad' | 'adfs' | 'amazon' | 'dropbox' | 'bitbucket' | 'aol' | 'auth0-adldap' | 'auth0-oidc' | 'auth0' | 'baidu' | 'bitly' | 'box' | 'custom' | 'daccount' | 'dwolla' | 'email' | 'evernote-sandbox' | 'evernote' | 'exact' | 'facebook' | 'fitbit' | 'flickr' | 'github' | diff --git a/types/auto-bind/auto-bind-tests.ts b/types/auto-bind/auto-bind-tests.ts new file mode 100644 index 0000000000..2c3754e09d --- /dev/null +++ b/types/auto-bind/auto-bind-tests.ts @@ -0,0 +1,65 @@ +import autoBind = require("auto-bind"); + +const emptyConfig: autoBind.AutoBindOptions = {}; +const onlyIncludeInConfig: autoBind.AutoBindOptions = { + include: [] +}; +const onlyExcludeInConfig: autoBind.AutoBindOptions = { + exclude: [] +}; +const emptyArraysInConfig: autoBind.AutoBindOptions = { + include: [], + exclude: [] +}; +const regexConfig: autoBind.AutoBindOptions = { + include: [/test[123]/], + exclude: [/test[123]/, /^regex[123]$/] +}; +const stringConfig: autoBind.AutoBindOptions = { + include: ["test"], + exclude: ["123", "abc"] +}; +const mixConfig: autoBind.AutoBindOptions = { + include: ["test", /test[123]/], + exclude: ["123", /test[123]/] +}; + +class TestConfigs { + constructor() { + // no config + autoBind(this); + autoBind.react(this); + + // empty configs + autoBind(this, emptyConfig); + autoBind.react(this, emptyConfig); + + // include only configs + autoBind(this, onlyIncludeInConfig); + autoBind.react(this, onlyIncludeInConfig); + + // exclude only configs + autoBind(this, onlyExcludeInConfig); + autoBind.react(this, onlyExcludeInConfig); + + // empty array configs + autoBind(this, emptyArraysInConfig); + autoBind.react(this, emptyArraysInConfig); + + // regex configs + autoBind(this, regexConfig); + autoBind.react(this, regexConfig); + + // string configs + autoBind(this, stringConfig); + autoBind.react(this, stringConfig); + + // mix configs + autoBind(this, mixConfig); + autoBind.react(this, mixConfig); + } + + shutUpNoUnnecessaryClass() { + // noop + } +} diff --git a/types/auto-bind/index.d.ts b/types/auto-bind/index.d.ts new file mode 100644 index 0000000000..9b91fb3da6 --- /dev/null +++ b/types/auto-bind/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for auto-bind 1.2 +// Project: https://github.com/sindresorhus/auto-bind#readme +// Definitions by: Sindre Seppola +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +declare namespace autoBind { + interface AutoBindOptions { + include?: Array; + exclude?: Array; + } + + type AutoBindFunction = ( + self: selfT, + options?: AutoBindOptions + ) => selfT; +} + +interface AutoBindModule + extends autoBind.AutoBindFunction { + react: autoBind.AutoBindFunction; +} + +declare const autoBind: AutoBindModule; +export = autoBind; diff --git a/types/auto-bind/tsconfig.json b/types/auto-bind/tsconfig.json new file mode 100644 index 0000000000..d9589cadad --- /dev/null +++ b/types/auto-bind/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "auto-bind-tests.ts" + ] +} diff --git a/types/auto-bind/tslint.json b/types/auto-bind/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/auto-bind/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/backbone/backbone-tests.ts b/types/backbone/backbone-tests.ts index 7b6fad9b56..65a1463978 100644 --- a/types/backbone/backbone-tests.ts +++ b/types/backbone/backbone-tests.ts @@ -398,7 +398,10 @@ namespace v1Changes { namespace Collection { function test_fetch() { var collection = new EmployeeCollection; - collection.fetch({ reset: true }); + collection.fetch({ + reset: true, + remove: false + }); } function test_create() { diff --git a/types/backbone/index.d.ts b/types/backbone/index.d.ts index 3d4c90d369..81bce43606 100644 --- a/types/backbone/index.d.ts +++ b/types/backbone/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for Backbone 1.3.3 // Project: http://backbonejs.org/ -// Definitions by: Boris Yankov , Natan Vivo +// Definitions by: Boris Yankov +// Natan Vivo +// kenjiru // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -76,7 +78,7 @@ declare namespace Backbone { interface ModelDestroyOptions extends Waitable, PersistenceOptions { } - interface CollectionFetchOptions extends PersistenceOptions, Parseable { + interface CollectionFetchOptions extends PersistenceOptions, Parseable, CollectionSetOptions { reset?: boolean; } diff --git a/types/barbellweights/barbellweights-tests.ts b/types/barbellweights/barbellweights-tests.ts new file mode 100644 index 0000000000..7652728824 --- /dev/null +++ b/types/barbellweights/barbellweights-tests.ts @@ -0,0 +1,33 @@ +import { BarbellWeight } from "barbellweights"; + +let calculator: BarbellWeight; +let results: any; + +calculator = new BarbellWeight(200, "bench press"); +results = calculator.getResults(); + +calculator = new BarbellWeight(500, "deadlift"); +results = calculator.getResults(); + +calculator = new BarbellWeight(400, "squat"); +results = calculator.getResults(); + +calculator = new BarbellWeight(400, "deadlift", { program: "QUARTER" }); +results = calculator.getResults(); + +calculator = new BarbellWeight(400, "deadlift", { bar: 45 }); +results = calculator.getResults(); + +calculator = new BarbellWeight(400, "deadlift", { plates: [45, 10, 5] }); +results = calculator.getResults(); + +calculator = new BarbellWeight(400, "deadlift", { warmup_round_to: 5 }); +results = calculator.getResults(); + +calculator = new BarbellWeight(300, "squat", { + program: "STARTING_STRENGTH", + bar: 45, + plates: [45, 25, 10, 5], + warmup_round_to: 5 +}); +results = calculator.getResults(); diff --git a/types/barbellweights/index.d.ts b/types/barbellweights/index.d.ts new file mode 100644 index 0000000000..069f016f8e --- /dev/null +++ b/types/barbellweights/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for barbellweights 0.4 +// Project: https://github.com/toddhibbs/barbellweight#readme +// Definitions by: evelijn +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface options { + program?: string; + bar?: number; + plates?: number[]; + warmup_round_to?: number; +} + +export class BarbellWeight { + constructor(workingWeight: number, lift: string, options?: options); + getResults(): any; +} + +export namespace BarbellWeight { + namespace BarbellWeight { + function getResults(): void; + } +} diff --git a/types/barbellweights/tsconfig.json b/types/barbellweights/tsconfig.json new file mode 100644 index 0000000000..1acdbe017b --- /dev/null +++ b/types/barbellweights/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", + "barbellweights-tests.ts" + ] +} diff --git a/types/barbellweights/tslint.json b/types/barbellweights/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/barbellweights/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/blue-tape/blue-tape-tests.ts b/types/blue-tape/blue-tape-tests.ts index c34bc6e32c..526142158b 100644 --- a/types/blue-tape/blue-tape-tests.ts +++ b/types/blue-tape/blue-tape-tests.ts @@ -1,5 +1,3 @@ -/// - import tape = require('blue-tape'); import P = require('bluebird'); diff --git a/types/blue-tape/index.d.ts b/types/blue-tape/index.d.ts index c2d2d50ab5..b086124695 100644 --- a/types/blue-tape/index.d.ts +++ b/types/blue-tape/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/spion/blue-tape // Definitions by: Haoqun Jiang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/bluebird-global/index.d.ts b/types/bluebird-global/index.d.ts index 6b22cb7114..0d8ac4eeb3 100644 --- a/types/bluebird-global/index.d.ts +++ b/types/bluebird-global/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/petkaantonov/bluebird // Definitions by: d-ph // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /* * 1. Why use `bluebird-global` instead of `bluebird`? diff --git a/types/jquery/test/bluebird-global-tests.ts b/types/bluebird-global/test/jquery-tests.ts similarity index 75% rename from types/jquery/test/bluebird-global-tests.ts rename to types/bluebird-global/test/jquery-tests.ts index 3b7f58e9cd..c4c98fadfc 100644 --- a/types/jquery/test/bluebird-global-tests.ts +++ b/types/bluebird-global/test/jquery-tests.ts @@ -1,4 +1,4 @@ -/// +/// // Pulls in bluebird-global to test compatibility. // Fixes https://github.com/DefinitelyTyped/DefinitelyTyped/issues/26328. diff --git a/types/bluebird-global/tsconfig.json b/types/bluebird-global/tsconfig.json index d037429e0d..aa19fd3cda 100644 --- a/types/bluebird-global/tsconfig.json +++ b/types/bluebird-global/tsconfig.json @@ -19,6 +19,7 @@ }, "files": [ "index.d.ts", - "bluebird-global-tests.ts" + "bluebird-global-tests.ts", + "test/jquery-tests.ts" ] } \ No newline at end of file diff --git a/types/bluebird-retry/index.d.ts b/types/bluebird-retry/index.d.ts index b7ba96495d..7192ff90a3 100644 --- a/types/bluebird-retry/index.d.ts +++ b/types/bluebird-retry/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/jut-io/bluebird-retry // Definitions by: Pascal Vomhoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import Promise = require('bluebird'); diff --git a/types/bluebird/bluebird-tests.ts b/types/bluebird/bluebird-tests.ts index e5a39714d1..7330bd5b31 100644 --- a/types/bluebird/bluebird-tests.ts +++ b/types/bluebird/bluebird-tests.ts @@ -590,25 +590,39 @@ obj = fooProm.toJSON(); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -barProm = fooArrProm.spread((one: Foo, two: Bar, twotwo: Foo) => { +barProm = fooArrProm.spread((one: Foo, two: Foo, twotwo: Foo) => { return bar; }); // - - - - - - - - - - - - - - - - - -barProm = fooArrProm.spread((one: Foo, two: Bar, twotwo: Foo) => { +barProm = fooArrProm.spread((one: Foo, two: Foo, twotwo: Foo) => { return barThen; }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// TODO fix collection inference +fooArrProm = fooArrProm.all(); + +// $ExpectType Bluebird +fooProm.all(); -barArrProm = fooProm.all(); fooInspectionPromise = fooProm.reflect(); -barProm = fooProm.any(); -barArrProm = fooProm.some(num); -barProm = fooProm.race(); + +fooProm = fooArrProm.any(); + +// $ExpectType Bluebird +fooProm.any(); + +fooArrProm = fooArrProm.some(num); + +// $ExpectType Bluebird +fooProm.some(num); + +fooProm = fooArrProm.race(); + +// $ExpectType Bluebird +fooProm.race(); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -649,21 +663,19 @@ Promise.all([fooProm, barProm, fooProm]).then(result => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// TODO fix collection inference - -barArrProm = fooArrProm.map((item: Foo, index: number, arrayLength: number) => { +barArrProm = fooArrProm.map((item: Foo, index: number, arrayLength: number) => { return bar; }); -barArrProm = fooArrProm.map((item: Foo) => { +barArrProm = fooArrProm.map((item: Foo) => { return bar; }); -barArrProm = fooArrProm.map((item: Foo, index: number, arrayLength: number) => { +barArrProm = fooArrProm.map((item: Foo, index: number, arrayLength: number) => { return bar; }, { concurrency: 1 }); -barArrProm = fooArrProm.map((item: Foo) => { +barArrProm = fooArrProm.map((item: Foo) => { return bar; }, { concurrency: 1 @@ -671,37 +683,37 @@ barArrProm = fooArrProm.map((item: Foo) => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -barArrProm = fooArrProm.mapSeries((item: Foo, index: number, arrayLength: number) => { +barArrProm = fooArrProm.mapSeries((item: Foo, index: number, arrayLength: number) => { return bar; }); -barArrProm = fooArrProm.mapSeries((item: Foo) => { +barArrProm = fooArrProm.mapSeries((item: Foo) => { return bar; }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -barProm = fooArrProm.reduce((memo: Bar, item: Foo, index: number, arrayLength: number) => { +barProm = fooArrProm.reduce((memo: Bar, item: Foo, index: number, arrayLength: number) => { return memo; }); -barProm = fooArrProm.reduce((memo: Bar, item: Foo) => { +barProm = fooArrProm.reduce((memo: Bar, item: Foo) => { return memo; }, bar); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -fooArrProm = fooArrProm.filter((item: Foo, index: number, arrayLength: number) => { +fooArrProm = fooArrProm.filter((item: Foo, index: number, arrayLength: number) => { return bool; }); -fooArrProm = fooArrProm.filter((item: Foo) => { +fooArrProm = fooArrProm.filter((item: Foo) => { return bool; }); -fooArrProm = fooArrProm.filter((item: Foo, index: number, arrayLength: number) => { +fooArrProm = fooArrProm.filter((item: Foo, index: number, arrayLength: number) => { return bool; }, { concurrency: 1 }); -fooArrProm = fooArrProm.filter((item: Foo) => { +fooArrProm = fooArrProm.filter((item: Foo) => { return bool; }, { concurrency: 1 @@ -709,10 +721,10 @@ fooArrProm = fooArrProm.filter((item: Foo) => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -fooArrProm = fooArrProm.each((item: Foo): Bar => bar); -fooArrProm = fooArrProm.each((item: Foo, index: number): Bar => index ? bar : null); -fooArrProm = fooArrProm.each((item: Foo, index: number, arrayLength: number): Bar => bar); -fooArrProm = fooArrProm.each((item: Foo, index: number, arrayLength: number): Promise => barProm); +fooArrProm = fooArrProm.each((item: Foo): Bar => bar); +fooArrProm = fooArrProm.each((item: Foo, index: number): Bar => index ? bar : null); +fooArrProm = fooArrProm.each((item: Foo, index: number, arrayLength: number): Bar => bar); +fooArrProm = fooArrProm.each((item: Foo, index: number, arrayLength: number): Promise => barProm); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/types/bluebird/index.d.ts b/types/bluebird/index.d.ts index 1e49e04f51..f6a869c392 100644 --- a/types/bluebird/index.d.ts +++ b/types/bluebird/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/petkaantonov/bluebird // Definitions by: Leonard Hecker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /*! * The code following this comment originates from: @@ -36,6 +36,8 @@ */ type CatchFilter = (new (...args: any[]) => E) | ((error: E) => boolean) | (object & E); +type IterableItem = R extends Iterable ? U : never; +type IterableOrNever = R extends Iterable ? R : never; declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** @@ -453,14 +455,12 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Like calling `.then`, but the fulfillment value or rejection reason is assumed to be an array, which is flattened to the formal parameters of the handlers. */ - spread(fulfilledHandler: (...values: W[]) => U | PromiseLike): Bluebird; - spread(fulfilledHandler: (...args: any[]) => U | PromiseLike): Bluebird; + spread(fulfilledHandler: (...values: Array>) => U | PromiseLike): Bluebird; /** * Same as calling `Promise.all(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - // TODO type inference from array-resolving promise? - all(): Bluebird; + all(): Bluebird>; /** * Same as calling `Promise.props(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. @@ -471,48 +471,42 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Same as calling `Promise.any(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - // TODO type inference from array-resolving promise? - any(): Bluebird; + any(): Bluebird>; /** * Same as calling `Promise.some(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - // TODO type inference from array-resolving promise? - some(count: number): Bluebird; + some(count: number): Bluebird>; /** * Same as calling `Promise.race(thisPromise, count)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - // TODO type inference from array-resolving promise? - race(): Bluebird; + race(): Bluebird>; /** * Same as calling `Bluebird.map(thisPromise, mapper)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - // TODO type inference from array-resolving promise? - map(mapper: (item: Q, index: number, arrayLength: number) => U | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; + map(mapper: (item: IterableItem, index: number, arrayLength: number) => U | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird ? U[] : never>; /** * Same as calling `Promise.reduce(thisPromise, Function reducer, initialValue)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - // TODO type inference from array-resolving promise? - reduce(reducer: (memo: U, item: Q, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Bluebird; + reduce(reducer: (memo: U, item: IterableItem, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Bluebird ? U : never>; /** * Same as calling ``Promise.filter(thisPromise, filterer)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - // TODO type inference from array-resolving promise? - filter(filterer: (item: U, index: number, arrayLength: number) => boolean | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; + filter(filterer: (item: IterableItem, index: number, arrayLength: number) => boolean | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird>; /** * Same as calling ``Bluebird.each(thisPromise, iterator)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - each(iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; + each(iterator: (item: IterableItem, index: number, arrayLength: number) => U | PromiseLike): Bluebird>; /** * Same as calling ``Bluebird.mapSeries(thisPromise, iterator)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - mapSeries(iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; + mapSeries(iterator: (item: IterableItem, index: number, arrayLength: number) => U | PromiseLike): Bluebird ? U[] : never>; /** * Cancel this `promise`. Will not do anything if this promise is already settled or if the cancellation feature has not been enabled diff --git a/types/bookshelf/index.d.ts b/types/bookshelf/index.d.ts index c151e81624..7467b3178f 100644 --- a/types/bookshelf/index.d.ts +++ b/types/bookshelf/index.d.ts @@ -2,7 +2,7 @@ // Project: http://bookshelfjs.org/ // Definitions by: Andrew Schurman , Vesa Poikajärvi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import Knex = require('knex'); import knex = require('knex'); diff --git a/types/bootstrap/bootstrap-tests.ts b/types/bootstrap/bootstrap-tests.ts index f0a353889c..f0bbbea7f2 100755 --- a/types/bootstrap/bootstrap-tests.ts +++ b/types/bootstrap/bootstrap-tests.ts @@ -56,6 +56,10 @@ $("#carousel").carousel({ pause: false, }); +$("#carousel").carousel({ + interval: false, +}); + // -------------------------------------------------------------------------------------- // Collapse // -------------------------------------------------------------------------------------- diff --git a/types/bootstrap/index.d.ts b/types/bootstrap/index.d.ts index bba7b71c59..8a815bccd5 100755 --- a/types/bootstrap/index.d.ts +++ b/types/bootstrap/index.d.ts @@ -46,7 +46,7 @@ export interface CarouselOption { * * @default 5000 */ - interval?: number; + interval?: false | number; /** * Whether the carousel should react to keyboard events. diff --git a/types/bpmn-moddle/bpmn-moddle-tests.ts b/types/bpmn-moddle/bpmn-moddle-tests.ts new file mode 100644 index 0000000000..00e92bddf5 --- /dev/null +++ b/types/bpmn-moddle/bpmn-moddle-tests.ts @@ -0,0 +1,24 @@ +import * as BPMNModdle from "bpmn-moddle"; + +const moddle: BPMNModdle.Moddle = {} as any; + +const element1 = moddle.create("bpmn:UserTask"); // Expect type User Task +element1.$type = "bpmn:UserTask"; // Expect to check against type correctly + +const bpmnModdle: BPMNModdle.BPMNModdle = {} as any; + +bpmnModdle.fromXML("", (err, definitions, parseContext) => { + err; // type of error + definitions; // type of definition + parseContext; // type of any +}); + +const definition: BPMNModdle.Definitions = {} as any; + +// Expect type of process or undefined +const maybeProcess = definition.rootElements.find( + i => i.$type === "bpmn:Process" +); + +// Expect process to have additional typings to base element1 +const process = maybeProcess as BPMNModdle.Process; diff --git a/types/bpmn-moddle/index.d.ts b/types/bpmn-moddle/index.d.ts new file mode 100644 index 0000000000..f4411e05fa --- /dev/null +++ b/types/bpmn-moddle/index.d.ts @@ -0,0 +1,1068 @@ +// Type definitions for bpmn-moddle 5.1 +// Project: https://github.com/bpmn-io/bpmn-moddle +// Definitions by: Hayden +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +declare namespace BPMNModdle { + type AdHocOrdering = "Parallel" | "Sequential"; + type AssociationDirection = "None" | "One" | "Both"; + type ChoreographyLoopType = + | "None" + | "Standard" + | "MultiInstanceSequential" + | "MultiInstanceParallel"; + type EventBasedGatewayType = "Parallel" | "Exclusive"; + type GatewayDirection = + | "Unspecified" + | "Converging" + | "Diverging" + | "Mixed"; + type ItemKind = "Physical" | "Information"; + type MultiInstanceBehaviour = "None" | "One" | "All" | "Complex"; + type ProcessType = "None" | "Public" | "Private"; + type RelationshipDirection = "None" | "Forward" | "Backward" | "Both"; + + interface TypeDerived { + $type: ElementType; + } + interface BaseElement extends TypeDerived { + /** + * Is the primary Id of the element + */ + id: string; + + /** + * Documentation for the element + */ + documentation?: Documentation[]; + + /** + * Reference to the extension definitions for this element + */ + extensionDefinitions?: ExtensionDefinition[]; + + /** + * Extension Elements + */ + extensionElements?: ExtensionElements; + + /** + * Attributes that aren't defined by the BPMN Spec such + * as Camunda properties + */ + $attrs?: { + [key: string]: any; + }; + } + + // tslint:disable-next-line:no-empty-interface + interface RootElement extends BaseElement {} + interface Interface extends RootElement { + name: string; + operations: Operation[]; + implementationRef: string; + } + + interface Operation extends BaseElement { + name: string; + inMessageRef: Message; + outMessageRef: Message; + errorRef: ErrorElement; + implementationRef: string; + } + + // tslint:disable-next-line:no-empty-interface + interface EndPoint extends RootElement {} + // tslint:disable-next-line:no-empty-interface + interface Auditing extends BaseElement {} + interface CallableElement extends RootElement { + name: string; + ioSpecification: InputOutputSpecification; + supportedInterfaceRef: Interface; + ioBinding: InputOutputBinding; + } + interface ResourceRole extends BaseElement { + name: string; + resourceRef: Resource; + ResourceParameterBindings: ResourceParameterBinding[]; + resourceAssignmentExpression: ResourceAssignmentExpression; + } + interface GlobalTask extends CallableElement { + resources: ResourceRole; + } + // tslint:disable-next-line:no-empty-interface + interface Monitoring extends BaseElement {} + + // tslint:disable-next-line:no-empty-interface + interface Performer extends ResourceRole {} + interface Process extends FlowElementsContainer, CallableElement { + processType: string; + isClosed: boolean; + auditing: Auditing; + monitoring: Monitoring; + properties: Property[]; + laneSets: LaneSet[]; + flowElements: FlowElement[]; + artifacts: Artifact[]; + resources: ResourceRole[]; + correlationSubscriptions: CorrelationSubscription[]; + supports: Process[]; + definitionalCollaborationRef: Collaboration; + isExecutable: boolean; + } + interface LaneSet extends BaseElement { + lanes: Lane[]; + name: string; + } + interface Lane extends BaseElement { + name: string; + partitionElementRef: BaseElement; + partitionElement: BaseElement; + flowNodeRef: FlowNode[]; + childLaneSet: LaneSet; + } + // tslint:disable-next-line:no-empty-interface + interface GlobalManualTask extends GlobalTask {} + // tslint:disable-next-line:no-empty-interface + interface ManualTask extends Task {} + interface UserTask extends Task { + renderings: Rendering[]; + implementation: string; + } + // tslint:disable-next-line:no-empty-interface + interface Rendering extends BaseElement {} + // tslint:disable-next-line:no-empty-interface + interface HumanPerformer extends Performer {} + // tslint:disable-next-line:no-empty-interface + interface PotentialOwner extends Performer {} + interface GlobalUserTask extends GlobalTask { + implementation: string; + renderings: Rendering; + } + interface Gateway extends FlowNode { + /** + * @default Unspecified + */ + gatewayDirection: GatewayDirection; + } + interface EventBasedGateway extends Gateway { + instantiate: boolean; + /** + * @default Exclusive + */ + eventGatewayType: EventBasedGatewayType; + } + interface ComplexGateway extends Gateway { + activationCondition: Expression; + default: SequenceFlow; + } + interface ExclusiveGateway extends Gateway { + default: SequenceFlow; + } + interface InclusiveGateway extends Gateway { + default: SequenceFlow; + } + // tslint:disable-next-line:no-empty-interface + interface ParallelGateway extends Gateway {} + interface Relationship extends BaseElement { + type: string; + direction: RelationshipDirection; + source: BaseElement[]; + target: BaseElement[]; + } + interface Extension extends TypeDerived { + /** + * @default false + */ + mustUnderstand: boolean; + definition: ExtensionDefinition; + } + interface ExtensionDefinition extends TypeDerived { + name: string; + extensionAttributeDefinitions: ExtensionAttributeDefinition[]; + } + interface ExtensionAttributeDefinition extends TypeDerived { + name: string; + type: string; + /** + * @default false + */ + isReference: boolean; + } + interface ExtensionElements extends TypeDerived { + valueRef: BaseElement; + values: BaseElement[]; + extensionAttributeDefinition: ExtensionAttributeDefinition; + [key: string]: any; + } + interface Documentation extends BaseElement { + text: string; + /** + * @default "text/plain" + */ + textFormat: string; + } + interface Event extends FlowNode, InteractionNode { + properties: Property[]; + } + // tslint:disable-next-line:no-empty-interface + interface IntermediateCatchEvent extends CatchEvent {} + // tslint:disable-next-line:no-empty-interface + interface IntermediateThrowEvent extends ThrowEvent {} + // tslint:disable-next-line:no-empty-interface + interface EndEvent extends ThrowEvent {} + interface StartEvent extends CatchEvent { + /** + * @default true + */ + isInterrupting: boolean; + } + interface ThrowEvent extends Event { + dataInputs: DataInput[]; + dataInputAssociations: DataInputAssociation[]; + inputSet: InputSet; + eventDefinitions: EventDefinition[]; + eventDefinitionRef: EventDefinition[]; + } + interface CatchEvent extends Event { + /** + * @default false + */ + parallelMultiple: boolean; + dataOutputs: DataOutput[]; + dataOutputAssociations: DataOutputAssociation[]; + outputSet: OutputSet; + eventDefinitions: EventDefinition[]; + } + interface BoundaryEvent extends CatchEvent { + /** + * @default true + */ + cancelActivity: boolean; + attachedToRef: Activity; + } + + // tslint:disable-next-line:no-empty-interface + interface EventDefinition extends RootElement {} + // tslint:disable-next-line:no-empty-interface + interface CancelEventDefinition extends EventDefinition {} + interface ErrorEventDefinition extends EventDefinition { + errorRef: ErrorElement; + } + // tslint:disable-next-line:no-empty-interface + interface TerminateEventDefinition extends EventDefinition {} + interface EscalationEventDefinition extends EventDefinition { + escalationRef: Escalation; + } + interface Escalation extends RootElement { + structureRef: ItemDefinition; + name: string; + escalationCode: string; + } + interface CompensateEventDefinition extends EventDefinition { + waitForCompletion: boolean; + activityRef: Activity; + } + interface TimerEventDefinition extends EventDefinition { + timeDate: Expression; + timeCycle: Expression; + timeDuration: Expression; + } + interface LinkEventDefinition extends EventDefinition { + name: string; + target: LinkEventDefinition; + source: LinkEventDefinition; + } + interface MessageEventDefinition extends EventDefinition { + nessageRef: Message; + operationRef: Operation; + } + interface ConditionalEventDefinition extends EventDefinition { + condition: Expression; + } + interface SignalEventDefinition extends EventDefinition { + singalRef: Signal; + } + interface Signal extends RootElement { + structureRef: ItemDefinition; + name: string; + } + // tslint:disable-next-line:no-empty-interface + interface ImplicitThrowEvent extends ThrowEvent {} + interface DataState extends BaseElement { + name: string; + } + interface ItemAwareElement extends BaseElement { + itemSubjectRef: ItemDefinition; + dataState: DataState; + } + interface DataAssociation extends BaseElement { + assignment: Assignment; + sourceRef: ItemAwareElement; + targetRef: ItemAwareElement; + transformation: FormalExpression; + } + interface DataInput extends ItemAwareElement { + name: string; + /** @default false */ + isCollection: boolean; + inputSetRef: InputSet; + inputSetWithOptional: InputSet; + inputSetWithWhileExecuting: InputSet; + } + interface DataOutput extends ItemAwareElement { + name: string; + /** + * @default false + */ + isCollection: boolean; + outputSetRef: InputSet[]; + outputSetWithOptional: InputSet[]; + outputSetWithWhileExecuting: InputSet[]; + } + interface InputSet extends BaseElement { + name: string; + dataInputRefs: DataInput[]; + optionalInputRefs: DataInput[]; + whileExecutingInputsRefs: DataInput[]; + outputSetRefs: OutputSet[]; + } + interface OutputSet extends BaseElement { + dataOutputRefs: DataOutput[]; + name: string; + inputSetRefs: InputSet[]; + optionalOutputRefs: DataOutput[]; + whileExecutingOutputREfs: DataOutput[]; + } + interface Property extends ItemAwareElement { + name: string; + } + // tslint:disable-next-line:no-empty-interface + interface DataInputAssociation extends DataAssociation {} + // tslint:disable-next-line:no-empty-interface + interface DataOutputAssociation extends DataAssociation {} + interface InputOutputSpecification extends BaseElement { + dataInputs: DataInput[]; + dataOutputs: DataOutput[]; + inputSets: InputSet[]; + outputSets: OutputSet[]; + } + interface DataObject extends FlowElement, ItemAwareElement { + /** @default false */ + isCollection: boolean; + } + interface InputOutputBinding extends TypeDerived { + inputDataRef: InputSet; + outputDataRef: OutputSet; + operationRef: Operation; + } + interface Assignment extends BaseElement { + from: Expression; + to: Expression; + } + interface DataStore extends RootElement, ItemAwareElement { + name: string; + capacity: number; + isUnlimited: boolean; + } + interface DataStoreReference extends FlowElement, ItemAwareElement { + dataStoreRef: DataStore; + } + interface DataObjectReference extends ItemAwareElement, FlowElement { + dataObjectRef: DataObject; + } + interface ConversationLink extends BaseElement { + sourceRef: InteractionNode; + targetRef: InteractionNode; + name: string; + } + + interface ConversationAssociation extends ConversationNode { + innerConversationNodeRef: ConversationNode; + outerConversationNodeRef: ConversationNode; + } + interface CallConversation extends ConversationNode { + calledCollaborationRef: Collaboration; + participantAssociations: ParticipantAssociation[]; + } + // tslint:disable-next-line:no-empty-interface + interface Conversation extends ConversationNode {} + interface SubConversation extends ConversationNode { + conversationNodes: ConversationNode[]; + } + interface ConversationNode extends InteractionNode, BaseElement { + name: string; + participantRefs: Participant[]; + messageFlowRefs: MessageFlow[]; + correlationKeys: CorrelationKey[]; + } + // tslint:disable-next-line:no-empty-interface + interface GlobalConversation extends Collaboration {} + interface PartnerEntity extends RootElement { + name: string; + participantRef: Participant[]; + } + interface PartnerRole extends RootElement { + name: string; + participantRef: Participant[]; + } + + interface CorrelationProperty extends RootElement { + correlationPropertyRetrievalExpression: CorrelationPropertyRetrievalExpression; + name: string; + type: ItemDefinition; + } + interface ErrorElement extends RootElement { + structureRef: ItemDefinition; + name: string; + errorCode: string; + } + interface CorrelationKey extends BaseElement { + correlationPropertyRef: CorrelationProperty; + name: string; + } + interface Expression extends BaseElement { + body: string; + } + interface FormalExpression extends Expression { + language: string; + evaluatesToTypeRef: ItemDefinition; + } + interface Message extends RootElement { + name: string; + itemRef: ItemDefinition; + } + interface ItemDefinition extends RootElement { + itemKind: ItemKind; + structureRef: string; + /** @default false */ + isCollection: boolean; + import: Import; + } + interface FlowElement extends RootElement { + name?: string; + auditing: Auditing; + monitoring: Monitoring; + categoryValueRef: CategoryValue[]; + } + interface SequenceFlow extends FlowElement { + isImmediate: boolean; + conditionExpression: Expression; + sourceRef: FlowNode; + targetRef: FlowNode; + } + interface FlowElementsContainer extends BaseElement { + laneSets: LaneSet[]; + flowElements: FlowElement[]; + } + interface FlowNode extends FlowElement { + incoming: SequenceFlow[]; + outgoing: SequenceFlow[]; + lanes: Lane[]; + } + interface CorrelationPropertyRetrievalExpression extends BaseElement { + messagePath: FormalExpression; + messageRef: Message; + } + interface CorrelationPropertyBinding extends BaseElement { + dataPath: FormalExpression; + correlationPropertyRef: CorrelationProperty; + } + interface Resource extends RootElement { + name: string; + resourceParameters: ResourceParameter[]; + } + interface ResourceParameter extends BaseElement { + name: string; + isRequired: boolean; + type: ItemDefinition; + } + interface CorrelationSubscription extends BaseElement { + correlationKeyRef: CorrelationKey; + correlationPropertyBinding: CorrelationKey[]; + } + interface MessageFlow extends BaseElement { + name: string; + sourceRef: InteractionNode; + targetRef: InteractionNode; + messageRef: Message; + } + interface MessageFlowAssociation extends BaseElement { + innerMessageFlowRef: MessageFlow; + outerMessageFlowRef: MessageFlow; + } + interface InteractionNode extends TypeDerived { + incomingConversationLinks: ConversationLink[]; + outgoingConversationLinks: ConversationLink[]; + } + interface Participant extends InteractionNode, BaseElement { + name: string; + interfaceRef: Interface[]; + participantMultiplicity: ParticipantMultiplicity; + endPointRefs: EndPoint[]; + processRef: Process; + } + interface ParticipantAssociation extends BaseElement { + innerParticipantRef: Participant; + outerParticipantRef: Participant; + } + interface ParticipantMultiplicity extends BaseElement { + minimum: number; + maximum: number; + } + interface Collaboration extends RootElement { + name: string; + isClosed: boolean; + participants: Participant[]; + messageFlows: MessageFlow[]; + artifacts: Artifact[]; + conversations: ConversationNode[]; + conversationAssociations: ConversationAssociation[]; + participantAssociations: ParticipantAssociation[]; + messageFlowAssociations: MessageFlowAssociation[]; + correlationKeys: CorrelationKey[]; + choreographyRef: Choreography[]; + conversationLinks: ConversationLink[]; + } + interface ChoreographyActivity extends FlowNode { + participantRef: Participant[]; + initiatingParticipantRef: Participant; + correlationKeys: CorrelationKey[]; + loopType: ChoreographyLoopType; + } + interface CallChoreography extends ChoreographyActivity { + calledChoreographyRef: Choreography; + participantAssociations: ParticipantAssociation[]; + } + interface SubChoreography + extends ChoreographyActivity, + FlowElementsContainer { + artifacts: Artifact[]; + } + interface ChoreographyTask extends ChoreographyActivity { + messageFlowRef: MessageFlow[]; + } + // tslint:disable-next-line:no-empty-interface + interface Choreography extends FlowElementsContainer, Collaboration {} + interface GlobalChoreographyTask extends Choreography { + initiatingParticipantRef: Participant; + } + interface TextAnnotation extends Artifact { + text: string; + textFormat: string; + } + interface Group extends Artifact { + categoryValueRef: CategoryValue; + } + interface Association extends Artifact { + associationDirection: AssociationDirection; + sourceRef: BaseElement; + targetRef: BaseElement; + } + interface Category extends RootElement { + categoryValue: CategoryValue; + name: string; + } + // tslint:disable-next-line:no-empty-interface + interface Artifact extends BaseElement {} + interface CategoryValue extends BaseElement { + categorizedFlowElements: FlowElement[]; + value: string; + } + interface Activity extends FlowNode { + isForCompensation: boolean; + default: SequenceFlow; + ioSpecification: InputOutputSpecification; + boundaryEventRefs: BoundaryEvent[]; + properties: Property[]; + dataInputAssociations: DataInputAssociation[]; + dataOutputAssociations: DataOutputAssociation[]; + startQuantity: number; + resources: ResourceRole; + completionQuantity: number; + loopCharacteristics: LoopCharacteristics; + } + interface ServiceTask extends Task { + implementation: string; + operationRef: Operation; + } + interface SubProcess + extends Activity, + FlowElementsContainer, + InteractionNode { + triggeredByEvent: boolean; + artifacts: Artifact[]; + } + // tslint:disable-next-line:no-empty-interface + interface LoopCharacteristics extends BaseElement {} + interface MultiInstanceLoopCharacteristics extends LoopCharacteristics { + isSequential: boolean; + behavior: MultiInstanceBehaviour; + loopCardinality: Expression; + loopDataInputRef: ItemAwareElement; + loopDataOutputRef: ItemAwareElement; + inputDataItem: DataInput; + outputDataItem: DataOutput; + complexBehaviorDefinition: ComplexBehaviorDefinition; + completionCondition: Expression; + oneBehaviorEventRef: EventDefinition; + noneBehaviorEventRef: EventDefinition; + } + interface StandardLoopCharacteristics extends LoopCharacteristics { + testBefore: boolean; + loopCondition: Expression; + loopMaximum: Expression; + } + interface CallActivity extends Activity { + calledElement: string; + } + // tslint:disable-next-line:no-empty-interface + interface Task extends Activity, InteractionNode {} + interface SendTask extends Task { + implementation: string; + operationRef: Operation; + messageRef: Message; + } + interface ReceiveTask extends Task { + implementation: string; + instantiate: boolean; + operationRef: Operation; + messageRef: Message; + } + interface ScriptTask extends Task { + scriptFormat: string; + script: string; + } + interface BusinessRuleTask extends Task { + implementation: string; + } + interface AdHocSubProcess extends SubProcess { + completionCondition: Expression; + ordering: AdHocOrdering; + cancelRemainingInstances: boolean; + } + interface Transaction extends SubProcess { + protocal: string; + method: string; + } + interface GlobalScriptTask extends GlobalTask { + scriptLanguage: string; + script: string; + } + interface GlobalBusinessRuleTask extends GlobalTask { + implementation: string; + } + interface ComplexBehaviorDefinition extends BaseElement { + condition: FormalExpression; + event: ImplicitThrowEvent; + } + interface ResourceParameterBinding extends TypeDerived { + expression: Expression; + parameterRef: ResourceParameter; + } + interface ResourceAssignmentExpression extends BaseElement { + expression: Expression; + } + interface Import extends TypeDerived { + importType: string; + location: string; + namespace: string; + } + interface Definitions extends BaseElement { + name: string; + targetNamespace: string; + expressionLanguage: string; + typeLanguage: string; + imports: Import[]; + extensions: Extension[]; + rootElements: RootElement[]; + diagrams: BPMNDiagram; + er: string; + relationship: Relationship[]; + erVersion: string; + } + interface BPMNDiagram extends Diagram { + plane: BPMNPlane; + labelStyle: BPMNLabelStyle; + } + // tslint:disable-next-line:no-empty-interface + interface BPMNPlane extends Plane {} + // tslint:disable-next-line:no-empty-interface + interface BPMNShape extends LabeledShape {} + // tslint:disable-next-line:no-empty-interface + interface BPMNEdge extends LabeledEdge {} + // tslint:disable-next-line:no-empty-interface + interface BPMNLabel extends Label {} + // tslint:disable-next-line:no-empty-interface + interface BPMNLabelStyle extends Style {} + interface Font extends TypeDerived { + name: string; + size: number; + isBold: boolean; + isItalic: boolean; + isUnderline: boolean; + isStrikeThrough: boolean; + } + interface Point extends TypeDerived { + x: number; + y: number; + width: number; + height: number; + } + // tslint:disable-next-line:no-empty-interface + interface Bounds extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface DiagramElement extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface Node extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface Edge extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface Diagram extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface Shape extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface Plane extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface LabeledEdge extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface LabeledShape extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface Label extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface Style extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface ColoredShape extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface ColoredEdge extends TypeDerived {} + + interface ElementTypes { + "bpmn:Interface": Interface; + "bpmn:Operation": Operation; + "bpmn:EndPoint": EndPoint; + "bpmn:Auditing": Auditing; + "bpmn:GlobalTask": GlobalTask; + "bpmn:Monitoring": Monitoring; + "bpmn:Performer": Performer; + "bpmn:Process": Process; + "bpmn:LaneSet": LaneSet; + "bpmn:Lane": Lane; + "bpmn:GlobalManualTask": GlobalManualTask; + "bpmn:ManualTask": ManualTask; + "bpmn:UserTask": UserTask; + "bpmn:Rendering": Rendering; + "bpmn:HumanPerformer": HumanPerformer; + "bpmn:PotentialOwner": PotentialOwner; + "bpmn:GlobalUserTask": GlobalUserTask; + "bpmn:Gateway": Gateway; + "bpmn:EventBasedGateway": EventBasedGateway; + "bpmn:ComplexGateway": ComplexGateway; + "bpmn:ExclusiveGateway": ExclusiveGateway; + "bpmn:InclusiveGateway": InclusiveGateway; + "bpmn:ParallelGateway": ParallelGateway; + "bpmn:RootElement": RootElement; + "bpmn:Relationship": Relationship; + "bpmn:BaseElement": BaseElement; + "bpmn:Extension": Extension; + "bpmn:ExtensionDefinition": ExtensionDefinition; + "bpmn:ExtensionAttributeDefinition": ExtensionAttributeDefinition; + "bpmn:ExtensionElements": ExtensionElements; + "bpmn:Documentation": Documentation; + "bpmn:Event": Event; + "bpmn:IntermediateCatchEvent": IntermediateCatchEvent; + "bpmn:IntermediateThrowEvent": IntermediateThrowEvent; + "bpmn:EndEvent": EndEvent; + "bpmn:StartEvent": StartEvent; + "bpmn:ThrowEvent": ThrowEvent; + "bpmn:CatchEvent": CatchEvent; + "bpmn:BoundaryEvent": BoundaryEvent; + "bpmn:EventDefinition": EventDefinition; + "bpmn:CancelEventDefinition": CancelEventDefinition; + "bpmn:ErrorEventDefinition": ErrorEventDefinition; + "bpmn:TerminateEventDefinition": TerminateEventDefinition; + "bpmn:EscalationEventDefinition": EscalationEventDefinition; + "bpmn:Escalation": Escalation; + "bpmn:CompensateEventDefinition": CompensateEventDefinition; + "bpmn:TimerEventDefinition": TimerEventDefinition; + "bpmn:LinkEventDefinition": LinkEventDefinition; + "bpmn:MessageEventDefinition": MessageEventDefinition; + "bpmn:ConditionalEventDefinition": ConditionalEventDefinition; + "bpmn:SignalEventDefinition": SignalEventDefinition; + "bpmn:Signal": Signal; + "bpmn:ImplicitThrowEvent": ImplicitThrowEvent; + "bpmn:DataState": DataState; + "bpmn:ItemAwareElement": ItemAwareElement; + "bpmn:DataAssociation": DataAssociation; + "bpmn:DataInput": DataInput; + "bpmn:DataOutput": DataOutput; + "bpmn:InputSet": InputSet; + "bpmn:OutputSet": OutputSet; + "bpmn:Property": Property; + "bpmn:DataInputAssociation": DataInputAssociation; + "bpmn:DataOutputAssociation": DataOutputAssociation; + "bpmn:InputOutputSpecification": InputOutputSpecification; + "bpmn:DataObject": DataObject; + "bpmn:InputOutputBinding": InputOutputBinding; + "bpmn:Assignment": Assignment; + "bpmn:DataStore": DataStore; + "bpmn:DataStoreReference": DataStoreReference; + "bpmn:DataObjectReference": DataObjectReference; + "bpmn:ConversationLink": ConversationLink; + "bpmn:ConversationAssociation": ConversationAssociation; + "bpmn:CallConversation": CallConversation; + "bpmn:Conversation": Conversation; + "bpmn:SubConversation": SubConversation; + "bpmn:ConversationNode": ConversationNode; + "bpmn:GlobalConversation": GlobalConversation; + "bpmn:PartnerEntity": PartnerEntity; + "bpmn:PartnerRole": PartnerRole; + "bpmn:CorrelationProperty": CorrelationProperty; + "bpmn:Error": ErrorElement; + "bpmn:CorrelationKey": CorrelationKey; + "bpmn:Expression": Expression; + "bpmn:FormalExpression": FormalExpression; + "bpmn:Message": Message; + "bpmn:ItemDefinition": ItemDefinition; + "bpmn:FlowElement": FlowElement; + "bpmn:SequenceFlow": SequenceFlow; + "bpmn:FlowElementsContainer": FlowElementsContainer; + "bpmn:CallableElement": CallableElement; + "bpmn:FlowNode": FlowNode; + "bpmn:CorrelationPropertyRetrievalExpression": CorrelationPropertyRetrievalExpression; + "bpmn:CorrelationPropertyBinding": CorrelationPropertyBinding; + "bpmn:Resource": Resource; + "bpmn:ResourceParameter": ResourceParameter; + "bpmn:CorrelationSubscription": CorrelationSubscription; + "bpmn:MessageFlow": MessageFlow; + "bpmn:MessageFlowAssociation": MessageFlowAssociation; + "bpmn:InteractionNode": InteractionNode; + "bpmn:Participant": Participant; + "bpmn:ParticipantAssociation": ParticipantAssociation; + "bpmn:ParticipantMultiplicity": ParticipantMultiplicity; + "bpmn:Collaboration": Collaboration; + "bpmn:ChoreographyActivity": ChoreographyActivity; + "bpmn:CallChoreography": CallChoreography; + "bpmn:SubChoreography": SubChoreography; + "bpmn:ChoreographyTask": ChoreographyTask; + "bpmn:Choreography": Choreography; + "bpmn:GlobalChoreographyTask": GlobalChoreographyTask; + "bpmn:TextAnnotation": TextAnnotation; + "bpmn:Group": Group; + "bpmn:Association": Association; + "bpmn:Category": Category; + "bpmn:Artifact": Artifact; + "bpmn:CategoryValue": CategoryValue; + "bpmn:Activity": Activity; + "bpmn:ServiceTask": ServiceTask; + "bpmn:SubProcess": SubProcess; + "bpmn:LoopCharacteristics": LoopCharacteristics; + "bpmn:MultiInstanceLoopCharacteristics": MultiInstanceLoopCharacteristics; + "bpmn:StandardLoopCharacteristics": StandardLoopCharacteristics; + "bpmn:CallActivity": CallActivity; + "bpmn:Task": Task; + "bpmn:SendTask": SendTask; + "bpmn:ReceiveTask": ReceiveTask; + "bpmn:ScriptTask": ScriptTask; + "bpmn:BusinessRuleTask": BusinessRuleTask; + "bpmn:AdHocSubProcess": AdHocSubProcess; + "bpmn:Transaction": Transaction; + "bpmn:GlobalScriptTask": GlobalScriptTask; + "bpmn:GlobalBusinessRuleTask": GlobalBusinessRuleTask; + "bpmn:ComplexBehaviorDefinition": ComplexBehaviorDefinition; + "bpmn:ResourceRole": ResourceRole; + "bpmn:ResourceParameterBinding": ResourceParameterBinding; + "bpmn:ResourceAssignmentExpression": ResourceAssignmentExpression; + "bpmn:Import": Import; + "bpmn:Definitions": Definitions; + "bpmndi:BPMNDiagram": BPMNDiagram; + "bpmndi:BPMNPlane": BPMNPlane; + "bpmndi:BPMNShape": BPMNShape; + "bpmndi:BPMNEdge": BPMNEdge; + "bpmndi:BPMNLabel": BPMNLabel; + "bpmndi:BPMNLabelStyle": BPMNLabelStyle; + "dc:boolean": boolean; + "dc:number": number; + "dc:Real": any; + "dc:string": string; + "dc:Font": Font; + "dc:Point": Point; + "dc:Bounds": Bounds; + "di:DiagramElement": DiagramElement; + "di:Node": Node; + "di:Edge": Edge; + "di:Diagram": Diagram; + "di:Shape": Shape; + "di:Plane": Plane; + "di:LabeledEdge": LabeledEdge; + "di:LabeledShape": LabeledShape; + "di:Label": Label; + "di:Style": Style; + "di:Extension": Extension; + "bioc:ColoredShape": ColoredShape; + "bioc:ColoredEdge": ColoredEdge; + } + + type ElementType = keyof ElementTypes; + + interface Option { + [key: string]: any; + } + + interface BPMNModdleConstructor { + new (packages?: any, options?: Option): BPMNModdle; + } + + type ImportFn = ( + err: Error, + definitions: Definitions, + parseContext: any + ) => void; + + interface Moddle { + /** + * Create an instance of the specified type. + * + * @example + * + * var foo = moddle.create('my:Foo'); + * var bar = moddle.create('my:Bar', { id: 'BAR_1' }); + * + * @param descriptor the type descriptor or name know to the model + * @param attrs a number of attributes to initialize the model instance with + * @return model instance + */ + create( + descriptor: K, + attrs?: any + ): T[K]; + create(descriptor: any, attrs?: any): BaseElement; + + /** + * Returns the type representing a given descriptor + * + * @example + * + * var Foo = moddle.getType('my:Foo'); + * var foo = new Foo({ 'id' : 'FOO_1' }); + * + * @param descriptor the type descriptor or name know to the model + * @return the type representing the descriptor + */ + getType(descriptor: any): any; + + /** + * Creates an any-element type to be used within model instances. + * + * This can be used to create custom elements that lie outside the meta-model. + * The created element contains all the meta-data required to serialize it + * as part of meta-model elements. + * + * @example + * + * var foo = moddle.createAny('vendor:Foo', 'http://vendor', { + * value: 'bar' + * }); + * + * var container = moddle.create('my:Container', 'http://my', { + * any: [ foo ] + * }); + * + * // go ahead and serialize the stuff + * + * + * @param name the name of the element + * @param nsUri the namespace uri of the element + * @param [properties] a map of properties to initialize the instance with + * @return the any type instance + */ + createAny(name: string, nsUri: string, properties: any): any; + + /** + * Returns a registered package by uri or prefix + * + * @return the package + */ + getPackage(uriOrPrefix: any): any; + + /** + * Returns a snapshot of all known packages + * + * @return the package + */ + getPackages(): any; + /** + * Returns the descriptor for an element + */ + getElementDescriptor(element: any): any; + + /** + * Returns true if the given descriptor or instance + * represents the given type. + * + * May be applied to this, if element is omitted. + */ + hasType(element: any, type: string): any; + + /** + * Returns the descriptor of an elements named property + */ + getPropertyDescriptor(element: any, property: any): any; + /** + * Returns a mapped type's descriptor + */ + getTypeDescriptor(type: string): any; + } + + interface BPMNModdle extends Moddle { + /** + * Instantiates a BPMN model tree from a given xml string. + * + * @param xmlStr + * XML string + * + * @param done + * done callback + */ + fromXML(xmlStr: string, done: ImportFn): void; + + /** + * Instantiates a BPMN model tree from a given xml string. + * + * @param xmlStr + * XML string + * + * @param options + * Options to pass to the underlying reader + * + * @param done + * done callback + */ + fromXML(xmlStr: string, options: Option, done: ImportFn): void; + + /** + * Instantiates a BPMN model tree from a given xml string. + * + * @param xmlStr + * XML string + * + * @param typeName + * Name of the root element + * + * @param options + * Options to pass to the underlying reader + * + * @param done + * done callback + */ + fromXML( + xmlStr: string, + typeName: string, + options: Option, + done: ImportFn + ): void; + } +} + +declare const BPMNModdle: BPMNModdle.BPMNModdleConstructor; +export = BPMNModdle; diff --git a/types/bpmn-moddle/tsconfig.json b/types/bpmn-moddle/tsconfig.json new file mode 100644 index 0000000000..2fbd3fe7c3 --- /dev/null +++ b/types/bpmn-moddle/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", "bpmn-moddle-tests.ts"] +} diff --git a/types/bpmn-moddle/tslint.json b/types/bpmn-moddle/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/bpmn-moddle/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bson/bson-tests.ts b/types/bson/bson-tests.ts index b3173053c8..f75ee94523 100644 --- a/types/bson/bson-tests.ts +++ b/types/bson/bson-tests.ts @@ -9,7 +9,7 @@ let Long = bson.Long; let doc = { long: Long.fromNumber(100) } // Serialize a document -let data = BSON.serialize(doc, false, true, false); +let data = BSON.serialize(doc); console.log("data:", data); // Deserialize the resulting Buffer diff --git a/types/bson/index.d.ts b/types/bson/index.d.ts index 4d30097478..6bad691dcf 100644 --- a/types/bson/index.d.ts +++ b/types/bson/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bson 1.0.4 +// Type definitions for bson 1.0.6 // Project: https://github.com/mongodb/js-bson // Definitions by: Hiroki Horiuchi // Federico Caselli @@ -6,34 +6,81 @@ /// +interface CommonSerializeOptions { + /** {default:false}, the serializer will check if keys are valid. */ + checkKeys?: boolean; + /** {default:false}, serialize the javascript functions. */ + serializeFunctions?: boolean; + /** {default:true}, ignore undefined fields. */ + ignoreUndefined?: boolean; +} + +export interface SerializeOptions extends CommonSerializeOptions { + /** {default:1024*1024*17}, minimum size of the internal temporary serialization buffer. */ + minInternalBufferSize?: number; +} + +export interface SerializeWithBufferAndIndexOptions extends CommonSerializeOptions { + /** {default:0}, the index in the buffer where we wish to start serializing into. */ + index?: number; +} + export interface DeserializeOptions { - /** {Boolean, default:false}, evaluate functions in the BSON document scoped to the object deserialized. */ + /** {default:false}, evaluate functions in the BSON document scoped to the object deserialized. */ evalFunctions?: boolean; - /** {Boolean, default:false}, cache evaluated functions for reuse. */ + /** {default:false}, cache evaluated functions for reuse. */ cacheFunctions?: boolean; - /** {Boolean, default:false}, use a crc32 code for caching, otherwise use the string of the function. */ + /** {default:false}, use a crc32 code for caching, otherwise use the string of the function. */ cacheFunctionsCrc32?: boolean; - /** {Boolean, default:false}, deserialize Binary data directly into node.js Buffer object. */ + /** {default:true}, when deserializing a Long will fit it into a Number if it's smaller than 53 bits. */ + promoteLongs?: boolean; + /** {default:false}, deserialize Binary data directly into node.js Buffer object. */ promoteBuffers?: boolean; + /** {default:false}, when deserializing will promote BSON values to their Node.js closest equivalent types. */ + promoteValues?: boolean; + /** {default:null}, allow to specify if there what fields we wish to return as unserialized raw buffer. */ + fieldsAsRaw?: { readonly [fieldName: string]: boolean }; + /** {default:false}, return BSON regular expressions as BSONRegExp instances. */ + bsonRegExp?: boolean; } export interface CalculateObjectSizeOptions { - /** {Boolean, default:false}, serialize the javascript functions */ + /** {default:false}, serialize the javascript functions */ serializeFunctions?: boolean; - /** {Boolean, default:true}, ignore undefined fields. */ + /** {default:true}, ignore undefined fields. */ ignoreUndefined?: boolean; } export class BSON { + /** - * @param {Object} object the Javascript object to serialize. - * @param {Boolean} checkKeys the serializer will check if keys are valid. - * @param {Boolean} asBuffer return the serialized object as a Buffer object (ignore). - * @param {Boolean} serializeFunctions serialize the javascript functions (default:false) - * @return {Buffer} returns a TypedArray or Array depending on what your browser supports + * Serialize a Javascript object. + * + * @param object The Javascript object to serialize. + * @param options Serialize options. + * @return The Buffer object containing the serialized object. */ - serialize(object: any, checkKeys?: boolean, asBuffer?: boolean, serializeFunctions?: boolean): Buffer; - deserialize(buffer: Buffer, options?: DeserializeOptions, isArray?: boolean): any; + serialize(object: any, options?: SerializeOptions): Buffer; + + /** + * Serialize a Javascript object using a predefined Buffer and index into the buffer, useful when pre-allocating the space for serialization. + * + * @param object The Javascript object to serialize. + * @param buffer The Buffer you pre-allocated to store the serialized BSON object. + * @param options Serialize options. + * @returns The index pointing to the last written byte in the buffer + */ + serializeWithBufferAndIndex(object: any, buffer: Buffer, options?: SerializeWithBufferAndIndexOptions): number; + + /** + * Deserialize data as BSON. + * + * @param buffer The buffer containing the serialized set of BSON documents. + * @param options Deserialize options. + * @returns The deserialized Javascript Object. + */ + deserialize(buffer: Buffer, options?: DeserializeOptions): any; + /** * Calculate the bson size for a passed in Javascript object. * @@ -42,17 +89,44 @@ export class BSON { * @return {Number} returns the number of bytes the BSON object will take up. */ calculateObjectSize(object: any, options?: CalculateObjectSizeOptions): number; + + /** + * Deserialize stream data as BSON documents. + * + * @param data The buffer containing the serialized set of BSON documents. + * @param startIndex The start index in the data Buffer where the deserialization is to start. + * @param numberOfDocuments Number of documents to deserialize + * @param documents An array where to store the deserialized documents + * @param docStartIndex The index in the documents array from where to start inserting documents + * @param options Additional options used for the deserialization + * @returns The next index in the buffer after deserialization of the `numberOfDocuments` + */ + deserializeStream( + data: Buffer, + startIndex: number, + numberOfDocuments: number, + documents: Array, + docStartIndex: number, + options?: DeserializeOptions + ): number; + } +/** A class representation of the BSON Binary type. */ export class Binary { - static SUBTYPE_DEFAULT: number; - static SUBTYPE_FUNCTION: number; - static SUBTYPE_BYTE_ARRAY: number; - static SUBTYPE_UUID_OLD: number; - static SUBTYPE_UUID: number; - static SUBTYPE_MD5: number; - static SUBTYPE_USER_DEFINED: number; + static readonly SUBTYPE_DEFAULT: number; + static readonly SUBTYPE_FUNCTION: number; + static readonly SUBTYPE_BYTE_ARRAY: number; + static readonly SUBTYPE_UUID_OLD: number; + static readonly SUBTYPE_UUID: number; + static readonly SUBTYPE_MD5: number; + static readonly SUBTYPE_USER_DEFINED: number; + + /** + * @param buffer A buffer object containing the binary data + * @param subType Binary data subtype + */ constructor(buffer: Buffer, subType?: number); /** The underlying Buffer which stores the binary data. */ @@ -69,80 +143,193 @@ export class Binary { /** Writes a buffer or string to the binary */ write(buffer: Buffer | string, offset: number): void; } + +/** A class representation of the BSON Code type. */ export class Code { + /** + * @param code A string or function. + * @param scope An optional scope for the function. + */ constructor(code: string | Function, scope?: any); } + +/** + * A class representation of the BSON DBRef type. + * @deprecated + */ export class DBRef { + /** + * @param namespace The collection name. + * @param oid The reference ObjectID. + * @param db Optional db name, if omitted the reference is local to the current db + */ constructor(namespace: string, oid: ObjectID, db?: string); + namespace: string; oid: ObjectID; db?: string; } + +/** A class representation of the BSON Double type. */ export class Double { + /** + * @param value The number we want to represent as a double. + */ constructor(value: number); valueOf(): number; } -export class Long { - static MAX_VALUE: Long; - static MIN_VALUE: Long; - static NEG_ONE: Long; - static ONE: Long; - static ZERO: Long; - static fromInt(i: number): Long; - static fromNumber(n: number): Long; - static fromBits(lowBits: number, highBits: number): Long; - static fromString(s: string, opt_radix?: number): Long; +/** + * Base class for Long and Timestamp. + * In original js-node@1.0.x code 'Timestamp' is a 100% copy-paste of 'Long' + * with 'Long' replaced by 'Timestamp' (changed to inheritance in js-node@2.0.0) + */ +declare class LongLike { + /** + * @param low The low (signed) 32 bits. + * @param high The high (signed) 32 bits. + */ constructor(low: number, high: number); - add(other: Long): Long; - and(other: Long): Long; - compare(other: Long): number; - div(other: Long): Long; - equals(other: Long): boolean; + /** Returns the sum of `this` and the `other`. */ + add(other: T): T; + /** Returns the bitwise-AND of `this` and the `other`. */ + and(other: T): T; + /** + * Compares `this` with the given `other`. + * @returns 0 if they are the same, 1 if the this is greater, and -1 if the given one is greater. + */ + compare(other: T): number; + /** Returns `this` divided by the given `other`. */ + div(other: T): T; + /** Return whether `this` equals the `other` */ + equals(other: T): boolean; + /** Return the high 32-bits value. */ getHighBits(): number; + /** Return the low 32-bits value. */ getLowBits(): number; + /** Return the low unsigned 32-bits value. */ getLowBitsUnsigned(): number; + /** Returns the number of bits needed to represent the absolute value of `this`. */ getNumBitsAbs(): number; - greaterThan(other: Long): number; - greaterThanOrEqual(other: Long): number; + /** Return whether `this` is greater than the `other`. */ + greaterThan(other: T): boolean; + /** Return whether `this` is greater than or equal to the `other`. */ + greaterThanOrEqual(other: T): boolean; + /** Return whether `this` value is negative. */ isNegative(): boolean; + /** Return whether `this` value is odd. */ isOdd(): boolean; + /** Return whether `this` value is zero. */ isZero(): boolean; - lessThan(other: Long): boolean; - lessThanOrEqual(other: Long): boolean; - modulo(other: Long): Long; - multiply(other: Long): Long; - negate(): Long; - not(): Long; - notEquals(other: Long): boolean; - or(other: Long): Long; - shiftLeft(other: number): Long; - shiftRight(other: number): Long; - shiftRightUnsigned(other: number): Long; - subtract(other: Long): Long; + /** Return whether `this` is less than the `other`. */ + lessThan(other: T): boolean; + /** Return whether `this` is less than or equal to the `other`. */ + lessThanOrEqual(other: T): boolean; + /** Returns `this` modulo the given `other`. */ + modulo(other: T): T; + /** Returns the product of `this` and the given `other`. */ + multiply(other: T): T; + /** The negation of this value. */ + negate(): T; + /** The bitwise-NOT of this value. */ + not(): T; + /** Return whether `this` does not equal to the `other`. */ + notEquals(other: T): boolean; + /** Returns the bitwise-OR of `this` and the given `other`. */ + or(other: T): T; + /** + * Returns `this` with bits shifted to the left by the given amount. + * @param numBits The number of bits by which to shift. + */ + shiftLeft(numBits: number): T; + /** + * Returns `this` with bits shifted to the right by the given amount. + * @param numBits The number of bits by which to shift. + */ + shiftRight(numBits: number): T; + /** + * Returns `this` with bits shifted to the right by the given amount, with the new top bits matching the current sign bit. + * @param numBits The number of bits by which to shift. + */ + shiftRightUnsigned(numBits: number): T; + /** Returns the difference of `this` and the given `other`. */ + subtract(other: T): T; + /** Return the int value (low 32 bits). */ toInt(): number; + /** Return the JSON value. */ toJSON(): string; + /** Returns closest floating-point representation to `this` value */ toNumber(): number; + /** + * Return as a string + * @param radix the radix in which the text should be written. {default:10} + */ toString(radix?: number): string; - xor(other: Long): Long; + /** Returns the bitwise-XOR of `this` and the given `other`. */ + xor(other: T): T; + } + +/** + * A class representation of the BSON Long type, a 64-bit two's-complement + * integer value, which faithfully simulates the behavior of a Java "Long". This + * implementation is derived from LongLib in GWT. + */ +export class Long extends LongLike { + + static readonly MAX_VALUE: Long; + static readonly MIN_VALUE: Long; + static readonly NEG_ONE: Long; + static readonly ONE: Long; + static readonly ZERO: Long; + + /** Returns a Long representing the given (32-bit) integer value. */ + static fromInt(i: number): Long; + /** Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. */ + static fromNumber(n: number): Long; + /** + * Returns a Long representing the 64-bit integer that comes by concatenating the given high and low bits. Each is assumed to use 32 bits. + * @param lowBits The low 32-bits. + * @param highBits The high 32-bits. + */ + static fromBits(lowBits: number, highBits: number): Long; + /** + * Returns a Long representation of the given string + * @param opt_radix The radix in which the text is written. {default:10} + */ + static fromString(s: string, opt_radix?: number): Long; + +} + +/** A class representation of the BSON Decimal128 type. */ export class Decimal128 { + + /** Create a Decimal128 instance from a string representation. */ static fromString(s: string): Decimal128; + /** + * @param bytes A buffer containing the raw Decimal128 bytes. + */ constructor(bytes: Buffer); toJSON(): string; toString(): string; } + +/** A class representation of the BSON MaxKey type. */ export class MaxKey { constructor(); } + +/** A class representation of the BSON MinKey type. */ export class MinKey { constructor(); } + +/** A class representation of the BSON ObjectID type. */ export class ObjectID { /** * Create a new ObjectID instance @@ -173,10 +360,10 @@ export class ObjectID { static isValid(id: string | number | ObjectID): boolean; /** * Compares the equality of this ObjectID with `otherID`. - * @param {object} otherID ObjectID instance to compare against. + * @param {ObjectID|string} otherID ObjectID instance to compare against. * @return {boolean} the result of comparing two ObjectID's */ - equals(otherID: ObjectID): boolean; + equals(otherID: ObjectID | string): boolean; /** * Generate a 12 byte id string used in ObjectID's * @param {number} time optional parameter allowing to pass in a second based timestamp. @@ -185,7 +372,7 @@ export class ObjectID { generate(time?: number): Buffer; /** * Returns the generation date (accurate up to the second) that this ID was generated. - * @return {date} the generation date + * @return {Date} the generation date */ getTimestamp(): Date; /** @@ -194,56 +381,45 @@ export class ObjectID { */ toHexString(): string; } + export { ObjectID as ObjectId }; + +/** A class representation of the BSON RegExp type. */ export class BSONRegExp { constructor(pattern: string, options: string); } + +/** + * A class representation of the BSON Symbol type. + * @deprecated + */ export class Symbol { constructor(value: string); } -export class Timestamp { - constructor(low: number, high: number); - static MAX_VALUE: Timestamp; - static MIN_VALUE: Timestamp; - static NEG_ONE: Timestamp; - static ONE: Timestamp; - static ZERO: Timestamp; +/** A class representation of the BSON Timestamp type. */ +export class Timestamp extends LongLike { - static fromBits(lowBits: number, highBits: number): Timestamp; + static readonly MAX_VALUE: Timestamp; + static readonly MIN_VALUE: Timestamp; + static readonly NEG_ONE: Timestamp; + static readonly ONE: Timestamp; + static readonly ZERO: Timestamp; + + /** Returns a Timestamp represented by the given (32-bit) integer value */ static fromInt(value: number): Timestamp; + /** Returns a Timestamp representing the given number value, provided that it is a finite number. */ static fromNumber(value: number): Timestamp; - static fromString(str: string, radix?: number): Timestamp; + /** + * Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits. + * @param lowBits The low 32-bits. + * @param highBits The high 32-bits. + */ + static fromBits(lowBits: number, highBits: number): Timestamp; + /** + * Returns a Timestamp from the given string. + * @param opt_radix The radix in which the text is written. {default:10} + */ + static fromString(str: string, opt_radix?: number): Timestamp; - add(other: Timestamp): Timestamp; - and(other: Timestamp): Timestamp; - compare(other: Timestamp): number; - div(other: Timestamp): Timestamp; - equals(other: Timestamp): boolean; - getHighBits(): number; - getLowBits(): number; - getLowBitsUnsigned(): number; - getNumBitsAbs(): number; - greaterThan(other: Timestamp): number; - greaterThanOrEqual(other: Timestamp): number; - isNegative(): boolean; - isOdd(): boolean; - isZero(): boolean; - lessThan(other: Timestamp): boolean; - lessThanOrEqual(other: Timestamp): boolean; - modulo(other: Timestamp): Timestamp; - multiply(other: Timestamp): Timestamp; - negate(): Timestamp; - not(): Timestamp; - notEquals(other: Timestamp): boolean; - or(other: Timestamp): Timestamp; - shiftLeft(other: number): Timestamp; - shiftRight(other: number): Timestamp; - shiftRightUnsigned(other: number): Timestamp; - subtract(other: Timestamp): Timestamp; - toInt(): number; - toJSON(): string; - toNumber(): number; - toString(radix?: number): string; - xor(other: Timestamp): Timestamp; } diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index cdef279acb..009e26ef95 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -8,7 +8,7 @@ // Oleg Repin // David Koblas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as Redis from "ioredis"; import * as Promise from "bluebird"; @@ -159,11 +159,6 @@ declare namespace Bull { } interface RepeatOptions { - /** - * Cron pattern specifying when the job should execute - */ - cron: string; - /** * Timezone */ @@ -180,6 +175,20 @@ declare namespace Bull { limit?: number; } + interface CronRepeatOptions extends RepeatOptions { + /** + * Cron pattern specifying when the job should execute + */ + cron: string; + } + + interface EveryRepeatOptions extends RepeatOptions { + /** + * Repeat every millis (cron setting cannot be used together with this setting.) + */ + every: number; + } + interface JobOptions { /** * Optional priority value. ranges from 1 (highest priority) to MAX_INT (lowest priority). @@ -201,7 +210,7 @@ declare namespace Bull { /** * Repeat job according to a cron specification */ - repeat?: RepeatOptions; + repeat?: CronRepeatOptions | EveryRepeatOptions; /** * Backoff setting for automatic retries if the job fails diff --git a/types/bunyan-winston-adapter/bunyan-winston-adapter-tests.ts b/types/bunyan-winston-adapter/bunyan-winston-adapter-tests.ts index fc4518fa29..f6abd7e736 100644 --- a/types/bunyan-winston-adapter/bunyan-winston-adapter-tests.ts +++ b/types/bunyan-winston-adapter/bunyan-winston-adapter-tests.ts @@ -1,7 +1,7 @@ import { createAdapter } from "bunyan-winston-adapter"; -import { Logger, LoggerInstance, transports } from "winston"; +import { createLogger } from "winston"; -const logger = new Logger(); +const logger = createLogger(); const mapping = { trace: 'silly' }; diff --git a/types/bunyan-winston-adapter/index.d.ts b/types/bunyan-winston-adapter/index.d.ts index 6798b8f1c9..718c9804e1 100644 --- a/types/bunyan-winston-adapter/index.d.ts +++ b/types/bunyan-winston-adapter/index.d.ts @@ -5,6 +5,6 @@ // TypeScript Version: 2.1 import * as bunyan from "bunyan"; -import { LoggerInstance } from "winston"; +import { Logger } from "winston"; -export function createAdapter(logger: LoggerInstance, mapping?: any): bunyan; +export function createAdapter(logger: Logger, mapping?: any): bunyan; diff --git a/types/bunyan-winston-adapter/package.json b/types/bunyan-winston-adapter/package.json new file mode 100644 index 0000000000..0aa4cf368f --- /dev/null +++ b/types/bunyan-winston-adapter/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "winston": "^3.0.0" + } +} diff --git a/types/canvas-gauges/index.d.ts b/types/canvas-gauges/index.d.ts index e5b4f69047..3c3a617ed7 100644 --- a/types/canvas-gauges/index.d.ts +++ b/types/canvas-gauges/index.d.ts @@ -118,6 +118,8 @@ declare namespace CanvasGauges { barProgress?: boolean, barShadow?: number } + + export const GenericOptions: GenericOptions; export interface RadialGaugeOptions extends GenericOptions { ticksAngle?: number, diff --git a/types/cesium/index.d.ts b/types/cesium/index.d.ts index 21b80f7d05..967c124bac 100644 --- a/types/cesium/index.d.ts +++ b/types/cesium/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for cesium 1.44 +// Type definitions for cesium 1.46 // Project: http://cesiumjs.org // Definitions by: Aigars Zeiza // Harry Nicholls @@ -1437,10 +1437,10 @@ declare namespace Cesium { } class TerrainData { + credits: Credit[]; waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement; interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number; isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean; - createMesh(tilingScheme: TilingScheme, x: number, y: number, level: number): Promise; upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise; wasCreatedByUpsampling(): boolean; } @@ -1459,7 +1459,7 @@ declare namespace Cesium { } abstract class TerrainProvider { - availability: any; // TileAvailability + availability: TileAvailability; credit: Credit; errorEvent: Event; hasVertexNormals: boolean; @@ -1475,6 +1475,15 @@ declare namespace Cesium { requestTileGeometry(x: number, y: number, level: number, throttleRequests?: boolean): Promise; } + class TileAvailability { + constructor(tilingScheme: TilingScheme, maximumLevel: number); + addAvailableTileRange(level: number, startX: number, startY: number, endX: number, endY: number): void; + computeBestAvailableLevelOverRectangle(rectangle: Rectangle): number; + computeChildMaskForTile(level: number, x: number, y: number): number; + computeMaximumLevelAtPosition(position: Cartographic): number; + isTileAvailable(level: number, x: number, y: number): boolean; + } + class TileProviderError { provider: ImageryProvider | TerrainProvider; message: string; @@ -3007,23 +3016,84 @@ declare namespace Cesium { destroy(): void; } + class GoogleEarthEnterpriseMetadata { + imageryPresent: boolean; + key: ArrayBuffer; + negativeAltitudeExponentBias: number; + negativeAltitudeThreshold: number; + protoImagery: boolean; + readonly proxy: Proxy; + readonly readyPromise: Promise; + readonly resource: Resource; + terrainPresent: boolean; + readonly url: string; + constructor(resourceOrUrl: Resource | string); + static quadKeyToTileXY(quadkey: string): {x: number, y: number, level: number}; + static tileXYToQuadKey(x: number, y: number, level: number): string; + } + class GoogleEarthEnterpriseImageryProvider extends ImageryProvider { - url: string; - path: string; - channel: number; - version: number; - requestType: string; + readonly url: string; constructor(options: { - url: string; + url: Resource | string; + metadata: GoogleEarthEnterpriseMetadata; + ellipsoid?: Ellipsoid; + tileDiscardPolicy?: TileDiscardPolicy; + credit?: Credit | string; + }); + } + + class GoogleEarthEnterpriseMapsProvider extends ImageryProvider { + readonly channel: number; + readonly path: string; + readonly requestType: string; + readonly url: string; + readonly version: number; + static logoUrl: string; + constructor(options: { + url: Resource | string; channel: number; path?: string; maximumLevel?: number; tileDiscardPolicy?: TileDiscardPolicy; ellipsoid?: Ellipsoid; - proxy?: Proxy }); } + class GoogleEarthEnterpriseTerrainData extends TerrainData { + constructor(options: { + buffer: ArrayBuffer; + negativeAltitudeExponentBias: number; + negativeElevationThreshold: number; + childTileMask?: number; + createdByUpsampling?: boolean; + credits?: Credit[]; + }); + } + + class GoogleEarthEnterpriseTerrainProvider { + static heightmapTerrainQuality: number; + availability: TileAvailability; + credit: Credit; + errorEvent: Event; + hasVertexNormals: boolean; + hasWaterMask: boolean; + ready: boolean; + readonly readyPromise: Promise; + tilingScheme: TilingScheme; + constructor(options: { + url: Resource | string; + metadata: GoogleEarthEnterpriseMetadata; + ellipsoid?: Ellipsoid; + credit?: Credit | string; + }) + static getEstimatedLevelZeroGeometricErrorForAHeightmap(ellipsoid: Ellipsoid, tileImageWidth: number, numberOfTilesAtLevelZero: number): number; + static getRegularGridIndices(width: number, height: number): Uint16Array; + getLevelMaximumGeometricError(level: number): number; + getTileDataAvailable(x: number, y: number, level: number): boolean; + requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise; + } + class GridImageryProvider extends ImageryProvider { constructor(options?: { tilingScheme?: TilingScheme; diff --git a/types/chai-http/chai-http-tests.ts b/types/chai-http/chai-http-tests.ts index 882f089a47..37a4df794e 100644 --- a/types/chai-http/chai-http-tests.ts +++ b/types/chai-http/chai-http-tests.ts @@ -84,6 +84,10 @@ chai.request(app) .then((res: ChaiHttp.Response) => chai.expect(res).to.have.status(200)) .catch((err: any) => { throw err; }); +chai.request(app) + .keepOpen() + .close((err: any) => { throw err; }); + const agent = chai.request.agent(app); agent @@ -97,6 +101,8 @@ agent .then((res: ChaiHttp.Response) => chai.expect(res).to.have.status(200)); }); +agent.close((err: any) => { throw err; }); + function test1() { const req = chai.request(app).get('/'); req.then((res: ChaiHttp.Response) => { diff --git a/types/chai-http/index.d.ts b/types/chai-http/index.d.ts index 77c711cb7f..de3caa13e7 100644 --- a/types/chai-http/index.d.ts +++ b/types/chai-http/index.d.ts @@ -64,6 +64,8 @@ declare global { del(url: string, callback?: (err: any, res: Response) => void): request.Request; options(url: string, callback?: (err: any, res: Response) => void): request.Request; patch(url: string, callback?: (err: any, res: Response) => void): request.Request; + keepOpen(): Agent; + close(callback?: (err: any) => void): Agent; } interface TypeComparison { diff --git a/types/chai/tslint.json b/types/chai/tslint.json index f99183c97d..e6f749320f 100644 --- a/types/chai/tslint.json +++ b/types/chai/tslint.json @@ -9,6 +9,7 @@ "no-redundant-jsdoc-2": false, "no-single-declare-module": false, "no-unnecessary-generics": false, - "strict-export-declare-modifiers": false + "strict-export-declare-modifiers": false, + "use-default-type-parameter": false } } diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index 089b41ac12..36f25643d9 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -4,8 +4,14 @@ import { Chart, ChartData, Point } from "chart.js"; // import chartjs = require('chart.js'); // => chartjs.Chart +const plugin = { + afterDraw: (chartInstance: Chart, easing: string, options?: any) => { + } +}; + const chart: Chart = new Chart(new CanvasRenderingContext2D(), { type: "bar", + plugins: [plugin, plugin], data: { labels: ["group 1"], datasets: [ diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 7fbca1bcb7..521002f256 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -52,37 +52,54 @@ declare class Chart { [key: string]: any; }; + static helpers: { + [key: string]: any; + }; + // Tooltip Static Options static Tooltip: Chart.ChartTooltipsStaticConfiguration; } declare class PluginServiceStatic { - register(plugin: PluginServiceRegistrationOptions): void; - unregister(plugin: PluginServiceRegistrationOptions): void; + register(plugin: PluginServiceGlobalRegistration & PluginServiceRegistrationOptions): void; + unregister(plugin: PluginServiceGlobalRegistration & PluginServiceRegistrationOptions): void; +} + +interface PluginServiceGlobalRegistration { + id?: string; } interface PluginServiceRegistrationOptions { beforeInit?(chartInstance: Chart, options?: any): void; afterInit?(chartInstance: Chart, options?: any): void; - resize?(chartInstance: Chart, newChartSize: Size, options?: any): void; - beforeUpdate?(chartInstance: Chart, options?: any): void; - afterScaleUpdate?(chartInstance: Chart, options?: any): void; + afterUpdate?(chartInstance: Chart, options?: any): void; + + beforeLayout?(chartInstance: Chart, options?: any): void; + afterLayout?(chartInstance: Chart, options?: any): void; + beforeDatasetsUpdate?(chartInstance: Chart, options?: any): void; afterDatasetsUpdate?(chartInstance: Chart, options?: any): void; - afterUpdate?(chartInstance: Chart, options?: any): void; + + beforeDatasetUpdate?(chartInstance: Chart, options?: any): void; + afterDatasetUpdate?(chartInstance: Chart, options?: any): void; // This is called at the start of a render. It is only called once, even if the animation will run for a number of frames. Use beforeDraw or afterDraw // to do something on each animation frame beforeRender?(chartInstance: Chart, options?: any): void; + afterRender?(chartInstance: Chart, options?: any): void; // Easing is for animation beforeDraw?(chartInstance: Chart, easing: string, options?: any): void; afterDraw?(chartInstance: Chart, easing: string, options?: any): void; + // Before the datasets are drawn but after scales are drawn beforeDatasetsDraw?(chartInstance: Chart, easing: string, options?: any): void; afterDatasetsDraw?(chartInstance: Chart, easing: string, options?: any): void; + beforeDatasetDraw?(chartInstance: Chart, easing: string, options?: any): void; + afterDatasetDraw?(chartInstance: Chart, easing: string, options?: any): void; + // Called before drawing the `tooltip`. If any plugin returns `false`, // the tooltip drawing is cancelled until another `render` is triggered. beforeTooltipDraw?(chartInstance: Chart, tooltipData?: any, options?: any): void; @@ -90,16 +107,15 @@ interface PluginServiceRegistrationOptions { // be called if the tooltip drawing has been previously cancelled. afterTooltipDraw?(chartInstance: Chart, tooltipData?: any, options?: any): void; - destroy?(chartInstance: Chart): void; - // Called when an event occurs on the chart beforeEvent?(chartInstance: Chart, event: Event, options?: any): void; afterEvent?(chartInstance: Chart, event: Event, options?: any): void; -} -interface Size { - height: number; - width: number; + resize?(chartInstance: Chart, newChartSize: Chart.ChartSize, options?: any): void; + destroy?(chartInstance: Chart): void; + + /** @deprecated since version 2.5.0. Use `afterLayout` instead. */ + afterScaleUpdate?(chartInstance: Chart, options?: any): void; } interface Meta { @@ -223,8 +239,7 @@ declare namespace Chart { type?: ChartType | string; data?: ChartData; options?: ChartOptions; - // Plugins can require any options - plugins?: any; + plugins?: PluginServiceRegistrationOptions[]; } interface ChartData { @@ -236,6 +251,11 @@ declare namespace Chart { scale?: RadialLinearScale; } + interface ChartSize { + height: number; + width: number; + } + interface ChartOptions { responsive?: boolean; responsiveAnimationDuration?: number; @@ -244,6 +264,7 @@ declare namespace Chart { events?: string[]; onHover?(this: Chart, event: MouseEvent, activeElements: Array<{}>): any; onClick?(event?: MouseEvent, activeElements?: Array<{}>): any; + onResize?(this: Chart, newSize: ChartSize): void; title?: ChartTitleOptions; legend?: ChartLegendOptions; tooltips?: ChartTooltipOptions; @@ -259,7 +280,7 @@ declare namespace Chart { rotation?: number; devicePixelRatio?: number; // Plugins can require any options - plugins?: { [plugin: string]: any }; + plugins?: { [pluginId: string]: any }; } interface ChartFontOptions { diff --git a/types/classnames/index.d.ts b/types/classnames/index.d.ts index 40e3ce835c..0c3502d4dd 100644 --- a/types/classnames/index.d.ts +++ b/types/classnames/index.d.ts @@ -21,7 +21,9 @@ interface ClassArray extends Array { } // tslint:disable-line no-emp type ClassNamesFn = (...classes: ClassValue[]) => string; -declare const classNames: ClassNamesFn; +type ClassNamesExport = ClassNamesFn & { default: ClassNamesFn }; + +declare const classNames: ClassNamesExport; export = classNames; export as namespace classNames; diff --git a/types/cleave.js/cleave.js-tests.tsx b/types/cleave.js/cleave.js-tests.tsx index eb682d432b..a826d2607a 100644 --- a/types/cleave.js/cleave.js-tests.tsx +++ b/types/cleave.js/cleave.js-tests.tsx @@ -1,6 +1,7 @@ import * as React from "react"; import Cleave = require("cleave.js"); import CleaveReact = require("cleave.js/react"); +import { Props } from "cleave.js/react/props"; const ExampleSelector1 = () => { const cleave = new Cleave("#my-input", { phone: true }); @@ -29,3 +30,14 @@ const ExampleReact1 = (props: any) => { /> ); }; + +const ExampleReact2 = (props: Props) => { + return ( + + ); +}; diff --git a/types/cleave.js/react/index.d.ts b/types/cleave.js/react/index.d.ts index 1f50cbdbf3..bf158b8f4d 100644 --- a/types/cleave.js/react/index.d.ts +++ b/types/cleave.js/react/index.d.ts @@ -1,13 +1,5 @@ import * as React from "react"; -import { CleaveOptions } from "../options"; - -type InitHandler = (owner: React.ReactInstance) => void; - -interface Props extends React.InputHTMLAttributes { - onInit?: InitHandler; - options: CleaveOptions; - htmlRef?: (i: any) => void; -} +import { Props } from "./props"; declare var Cleave: React.ComponentClass; export = Cleave; diff --git a/types/cleave.js/react/props.d.ts b/types/cleave.js/react/props.d.ts new file mode 100644 index 0000000000..6ce47db62c --- /dev/null +++ b/types/cleave.js/react/props.d.ts @@ -0,0 +1,10 @@ +import * as React from "react"; +import { CleaveOptions } from "../options"; + +export type InitHandler = (owner: React.ReactInstance) => void; + +export interface Props extends React.InputHTMLAttributes { + onInit?: InitHandler; + options: CleaveOptions; + htmlRef?: (i: any) => void; +} diff --git a/types/cleave.js/tsconfig.json b/types/cleave.js/tsconfig.json index ec4da5d047..1cf200a1d2 100644 --- a/types/cleave.js/tsconfig.json +++ b/types/cleave.js/tsconfig.json @@ -23,6 +23,7 @@ "index.d.ts", "options/creditCard.d.ts", "options/index.d.ts", - "react/index.d.ts" + "react/index.d.ts", + "react/props.d.ts" ] } \ No newline at end of file diff --git a/types/codemirror/index.d.ts b/types/codemirror/index.d.ts index e7fa7c368e..6dbfef6e60 100644 --- a/types/codemirror/index.d.ts +++ b/types/codemirror/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: mihailik // nrbernard // Pr1st0n +// rileymiller // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export = CodeMirror; @@ -16,6 +17,7 @@ declare namespace CodeMirror { export var Pos: CodeMirror.PositionConstructor; export var Pass: any; + function countColumn(line: string, index: number | null, tabSize: number): number; function fromTextArea(host: HTMLTextAreaElement, options?: EditorConfiguration): CodeMirror.EditorFromTextArea; /** It contains a string that indicates the version of the library. This is a triple of integers "major.minor.patch", diff --git a/types/common-prefix/common-prefix-tests.ts b/types/common-prefix/common-prefix-tests.ts new file mode 100644 index 0000000000..5de96a5358 --- /dev/null +++ b/types/common-prefix/common-prefix-tests.ts @@ -0,0 +1,4 @@ +import common = require('common-prefix'); // common is(string: ReadOnlyArray) => string + +// $ExpectType string +common(['a']); diff --git a/types/common-prefix/index.d.ts b/types/common-prefix/index.d.ts new file mode 100644 index 0000000000..482e880f05 --- /dev/null +++ b/types/common-prefix/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for common-prefix 1.1 +// Project: https://github.com/hughsk/common-prefix +// Definitions by: Sean Marvi Oliver Genabe +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function common(strings: ReadonlyArray): string; + +export = common; diff --git a/types/common-prefix/tsconfig.json b/types/common-prefix/tsconfig.json new file mode 100644 index 0000000000..e7b8748dee --- /dev/null +++ b/types/common-prefix/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "common-prefix-tests.ts" + ] +} diff --git a/types/common-prefix/tslint.json b/types/common-prefix/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/common-prefix/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/consolidate/index.d.ts b/types/consolidate/index.d.ts index bfe432214f..23f431d8f8 100644 --- a/types/consolidate/index.d.ts +++ b/types/consolidate/index.d.ts @@ -2,13 +2,13 @@ // Project: https://github.com/visionmedia/consolidate.js // Definitions by: Carlos Ballesteros Velasco , Theo Sherry , Nicolas Henry // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 // Imported from: https://github.com/soywiz/typescript-node-definitions/consolidate.d.ts /// -/// +import Promise = require("bluebird"); declare var cons: Consolidate; diff --git a/types/consolidate/tslint.json b/types/consolidate/tslint.json index a41bf5d19a..a403f5da2b 100644 --- a/types/consolidate/tslint.json +++ b/types/consolidate/tslint.json @@ -4,6 +4,7 @@ "adjacent-overload-signatures": false, "array-type": false, "arrow-return-shorthand": false, + "await-promise": false, "ban-types": false, "callable-types": false, "comment-format": false, diff --git a/types/cookiejar/cookiejar-tests.ts b/types/cookiejar/cookiejar-tests.ts new file mode 100644 index 0000000000..9cc131e433 --- /dev/null +++ b/types/cookiejar/cookiejar-tests.ts @@ -0,0 +1,92 @@ +import cookiejarLib = require('cookiejar'); + +const { Cookie, CookieAccessInfo, CookieJar } = cookiejarLib; + +// Original test: https://github.com/bmeck/node-cookiejar/blob/master/tests/test.js + +let testCookie = new Cookie("a=1;domain=.test.com;path=/"); +// assert.equal(testCookie.name, "a"); +// assert.equal(testCookie.value, "1"); +// assert.equal(testCookie.domain, ".test.com"); +// assert.equal(testCookie.path, "/"); +// assert.equal(testCookie.secure, false); +// assert.equal(testCookie.expiration_date, Infinity); + +// assert.deepEqual(testCookie, new Cookie("a=1;domain=.test.com;path=/")); +// assert.ok(testCookie.collidesWith(new Cookie("a=1;domain=.test.com;path=/"))); + +testCookie = new Cookie("a=1;path=/", ".test.com"); +// assert.equal(testCookie.domain, ".test.com"); + +// Test CookieJar +const testCookieJar = new CookieJar(); +testCookieJar.setCookies([ + "a=1;domain=.test.com;path=/", + "b=2;domain=test.com;path=/", + "c=3;domain=test.com;path=/;expires=January 1, 1970" +].join(':')); + +let testCookies = testCookieJar.getCookies(new CookieAccessInfo("test.com", "/")); +// assert.equal(testCookies.length, 2, "Expires on setCookies fail\n" + testCookies.toString()); +// assert.equal(testCookies.toValueString(), 'a=1;b=2', "Cannot get value string of multiple cookies"); + +testCookies = testCookieJar.getCookies(new CookieAccessInfo("www.test.com", "/")); +// assert.equal(testCookies.length, 2, "Wildcard domain fail\n" + testCookies.toString()); + +testCookieJar.setCookies("b=2;domain=test.com;path=/;expires=January 1, 1970"); +testCookies = testCookieJar.getCookies(new CookieAccessInfo("test.com", "/")); +// assert.equal(testCookies.length, 1, "Delete cookie fail\n" + testCookies.toString()); +// assert.equal(String(testCookieJar.getCookies(new CookieAccessInfo("test.com", "/"))), "a=1; domain=.test.com; path=/"); + +testCookie = new Cookie("a=1;domain=test.com;path=/;HttpOnly"); +// assert.ok(testCookie.noscript, "HttpOnly flag parsing failed\n" + testCookie.toString()); + +const testCookieJar2 = new CookieJar(); +testCookieJar2.setCookies([ + "a=1;domain=.test.com;path=/", + "a=1;domain=.test.com;path=/", + "a=2;domain=.test.com;path=/", + "b=3;domain=.test.com;path=/" +]); +testCookies = testCookieJar2.getCookies(new CookieAccessInfo("test.com", "/")); +// assert.equal(testCookies.length, 2); +// assert.equal(testCookies[0].value, 2); + +// Test pure appending +testCookieJar2.setCookie("d=4;domain=.test.com;path=/"); +testCookies = testCookieJar2.getCookies(new CookieAccessInfo("test.com", "/")); +// assert.equal(testCookies.length, 3); +// assert.equal(testCookies[2].value, 4); + +// Test Ignore Trailing Semicolons (Github Issue #6) +testCookie = new Cookie("a=1;domain=.test.com;path=/;;;;"); +// assert.equal(testCookie.name, "a"); +// assert.equal(testCookie.value, "1"); +// assert.equal(testCookie.domain, ".test.com"); +// assert.equal(testCookie.path, "/"); +// assert.deepEqual(testCookie, new Cookie("a=1;domain=.test.com;path=/")); + +// Test request_path and request_domain +testCookieJar2.setCookie(new Cookie("sub=4;path=/", "test.com")); +testCookie = testCookieJar2.getCookie("sub", new CookieAccessInfo("sub.test.com", "/")); +// assert.equal(testCookie, undefined); + +testCookie = testCookieJar2.getCookie("sub", new CookieAccessInfo("test.com", "/")); +// assert.equal(testCookie.name, "sub"); +// assert.equal(testCookie.domain, "test.com"); + +testCookieJar2.setCookie(new Cookie("sub=4;path=/accounts", "test.com", "/accounts")); +testCookie = testCookieJar2.getCookie("sub", new CookieAccessInfo("test.com", "/foo")); +// assert.equal(testCookie, undefined); + +testCookie = testCookieJar2.getCookie("sub", new CookieAccessInfo("test.com", "/accounts")); +// assert.equal(testCookie.path, "/accounts"); + +testCookieJar2.setCookie(new Cookie("sub=5;path=/", "test.com", "/accounts")); +testCookies = testCookieJar2.getCookies(new CookieAccessInfo("test.com")); +// assert.equal(testCookies.length, 4); + +testCookieJar2.setCookie(new Cookie("sub=5;path=/", "test.com", "/accounts")); +testCookie = testCookieJar2.getCookie('sub', CookieAccessInfo.All); +// assert(testCookie); +// assert.equal(testCookie.name, 'sub'); diff --git a/types/cookiejar/index.d.ts b/types/cookiejar/index.d.ts new file mode 100644 index 0000000000..ba50b63ea2 --- /dev/null +++ b/types/cookiejar/index.d.ts @@ -0,0 +1,116 @@ +// Type definitions for CookieJar 2.1 +// Project: https://github.com/bmeck/node-cookiejar +// Definitions by: Rafal Proszowski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export class CookieAccessInfo { + /** + * Class to determine matching qualities of a cookie + * @param domain string domain to match + * @param path string path to match + * @param secure boolean access is secure (ssl generally) + * @param script boolean access is from a script + */ + constructor(domain: string, path?: string, secure?: boolean, script?: boolean); + + static All: CookieAccessInfo; + domain: string; // domain to match + path: string; // path to match + secure: boolean; // access is secure (ssl generally) + script: boolean; // access is from a script +} + +export class Cookie { + name: string; // name of the cookie + value: string; // string associated with the cookie + domain: string; // domain to match (on a cookie a '.' at the start means a wildcard matching anything ending in the rest) + explicit_domain: boolean; // if the domain was explicitly set via the cookie string + path: string; // base path to match (matches any path starting with this '/' is root) + explicit_path: boolean; // if the path was explicitly set via the cookie string + noscript: boolean; // if it should be kept from scripts + secure: boolean; // should it only be transmitted over secure means + expiration_date: number; // number of millis since 1970 at which this should be removed + + /** + * It turns input into a Cookie (singleton if given a Cookie), the + * request_domain argument is used to default the domain if it is not + * explicit in the cookie string, the request_path argument is used to set + * the path if it is not explicit in a cookie String. + * + * Explicit domains/paths will cascade, implied domains/paths must exactly + * match (see http://en.wikipedia.org/wiki/HTTP_cookie#Domain_and_Pat). + * @param cookie string or a cookie to work on + * @param requestDomain string argument is used to default the domain if it is not explicit in the cookie string + * @param requestPath string argument is used to set the path if it is not explicit in a cookie String + */ + constructor(cookie: string | Cookie, requestDomain?: string, requestPath?: string); + + /** + * the set-cookie: string for this cookie + */ + toString(): string; + + /** + * the cookie: string for this cookie + */ + toValueString(): string; + + /** + * parses the string onto this cookie or a new one if called directly + * @param cookie string to be parsed into a Cookie + * @param requestDomain string definind the requesting domain + * @param requestPath string defining the requesting path + */ + parse(cookie: string, requestDomain?: string, requestPath?: string): Cookie; + + /** + * returns true if the access_info allows retrieval of this cookie + * @param accessInfo CookieAccessInfo + */ + matches(accessInfo: CookieAccessInfo): boolean; + + /** + * returns true if the cookies cannot exist in the same space + * (domain and path match) + * @param cookie Cookie + */ + collidesWith(cookie: Cookie): boolean; +} + +export class CookieJar { + /** + * class to hold numerous cookies from multiple domains correctly + */ + constructor(); + + /** + * modify (or add if not already-existing) a cookie to the jar + * @param cookie string | Cookie + * @param requestDomain string argument is used to default the domain if it is not explicit in the cookie string + * @param requestPath string argument is used to set the path if it is not explicit in a cookie String + */ + setCookie(cookie: string | Cookie, requestDomain?: string, requestPath?: string): Cookie | false; + + /** + * modify (or add if not already-existing) a large number of cookies to the + * jar + * @param cookie string or list of strings defining cookies + * @param requestDomain string argument is used to default the domain if it is not explicit in the cookie string + * @param requestPath string argument is used to set the path if it is not explicit in a cookie String + */ + setCookies(cookie: string | ReadonlyArray, requestDomain?: string, requestPath?: string): ReadonlyArray | false; + + /** + * get a cookie with the name and access_info matching + * @param cookieName string to be parsed into a Cookie + * @param accessInfo CookieAccessInfo + */ + getCookie(cookieName: string, accessInfo: CookieAccessInfo): Cookie; + + /** + * grab all cookies matching this access_info + * @param accessInfo CookieAccessInfo + */ + getCookies(accessInfo: CookieAccessInfo): ReadonlyArray; +} diff --git a/types/cookiejar/tsconfig.json b/types/cookiejar/tsconfig.json new file mode 100644 index 0000000000..7fbf974ede --- /dev/null +++ b/types/cookiejar/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", + "cookiejar-tests.ts" + ] +} diff --git a/types/cookiejar/tslint.json b/types/cookiejar/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cookiejar/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/create-react-class/create-react-class-tests.ts b/types/create-react-class/create-react-class-tests.ts index f8d8b132c7..3d7536d722 100644 --- a/types/create-react-class/create-react-class-tests.ts +++ b/types/create-react-class/create-react-class-tests.ts @@ -56,7 +56,7 @@ const ClassicComponent: React.ClassicComponentClass = createReactClass, nextProps, nextState) { const newFoo: string = nextProps.foo; const newBar: number = nextState.bar; - return newFoo !== this.props.foo && newBar !== this.state!.bar; + return newFoo !== this.props.foo && newBar !== this.state.bar; }, statics: { test: 1 diff --git a/types/crypto-js/index.d.ts b/types/crypto-js/index.d.ts index 99df7ce4cb..02db36ab6c 100644 --- a/types/crypto-js/index.d.ts +++ b/types/crypto-js/index.d.ts @@ -9,11 +9,15 @@ export as namespace CryptoJS; declare var CryptoJS: CryptoJS.Hashes; declare namespace CryptoJS { - interface Base {} + interface Base { + create(): any; + } interface BufferedBlockAlgorithm extends Base {} - interface Hasher extends BufferedBlockAlgorithm {} + interface Hasher extends BufferedBlockAlgorithm { + update(messageUpdate: WordArray|string): Hasher; + } interface Cipher extends BufferedBlockAlgorithm { createEncryptor(secretPassphrase: string, option?: CipherOption): Encryptor; diff --git a/types/css-to-style/css-to-style-tests.ts b/types/css-to-style/css-to-style-tests.ts new file mode 100644 index 0000000000..ede5ae8f06 --- /dev/null +++ b/types/css-to-style/css-to-style-tests.ts @@ -0,0 +1,9 @@ +import toStyle from "css-to-style"; + +toStyle(); // $ExpectError + +toStyle({}); // $ExpectError + +toStyle(1); // $ExpectError + +toStyle(''); // $ExpectType CSSStyleDeclaration diff --git a/types/css-to-style/index.d.ts b/types/css-to-style/index.d.ts new file mode 100644 index 0000000000..eb450341f9 --- /dev/null +++ b/types/css-to-style/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for css-to-style 1.2 +// Project: https://github.com/jacobbuck/css-to-style +// Definitions by: Ben Grynhaus +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +declare function toStyle(cssText: string): CSSStyleDeclaration; + +export default toStyle; diff --git a/types/css-to-style/tsconfig.json b/types/css-to-style/tsconfig.json new file mode 100644 index 0000000000..8b3a9292b3 --- /dev/null +++ b/types/css-to-style/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es5", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "css-to-style-tests.ts"] +} diff --git a/types/css-to-style/tslint.json b/types/css-to-style/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/css-to-style/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cytoscape/cytoscape-tests.ts b/types/cytoscape/cytoscape-tests.ts index 10a38145de..394851623d 100644 --- a/types/cytoscape/cytoscape-tests.ts +++ b/types/cytoscape/cytoscape-tests.ts @@ -343,17 +343,29 @@ const positions = oneOf({a: {x: 100, y: 100}}, (node: cytoscape.NodeCollection): // TODO: cy.style +// $ExpectType string cy.png({ - output: oneOf('base64uri', 'base64', 'blob', undefined), + output: oneOf('base64uri', 'base64', undefined), bg: oneOf('#ffffff', undefined), full: true, scale: 2, maxWidth: 100, maxHeight: 100 }); +// $ExpectType Blob +cy.png({ + output: 'blob', + bg: oneOf('#ffffff', undefined), + full: true, + scale: 2, + maxWidth: 100, + maxHeight: 100 +}); + aliases(cy.jpg, cy.jpeg); +// $ExpectType string cy.jpg({ - output: oneOf('base64uri', 'base64', 'blob', undefined), + output: oneOf('base64uri', 'base64', undefined), bg: oneOf('#ffffff', undefined), full: true, scale: 2, @@ -361,6 +373,17 @@ cy.jpg({ maxHeight: 100, quality: 0.5 }); +// $ExpectType Blob +cy.jpg({ + output: 'blob', + bg: oneOf('#ffffff', undefined), + full: true, + scale: 2, + maxWidth: 100, + maxHeight: 100, + quality: 0.5 +}); + cy.json(cy.json()); // Types possible to call methods @@ -387,9 +410,15 @@ eles.restore(); ]).forEach((elemType) => { aliases(elemType.clone, elemType.copy); // events(elemType); - TODO - aliases(elemType.data, elemType.attr); aliases(elemType.removeData, elemType.removeAttr); }); +([ele, node, edge] as [ + cytoscape.SingularElementReturnValue, + cytoscape.NodeSingular, + cytoscape.EdgeSingular +]).forEach((elemType) => { + aliases(elemType.data, elemType.attr); +}); // TODO: tests for data flow const loops = oneOf(true, false); @@ -430,6 +459,8 @@ aliases(eles.renderedBoundingBox, eles.renderedBoundingbox); const flags: boolean[] = [ node.grabbed(), node.grabbable(), node.locked(), ele.active(), ]; +nodes.lock(); node.lock(); +nodes.unlock(); node.unlock(); const edgePoints: cytoscape.Position[] = [ ...edge.controlPoints(), ...edge.segmentPoints(), edge.sourceEndpoint(), edge.targetEndpoint(), edge.midpoint() @@ -458,6 +489,27 @@ eles.style(eles.style()); aliases(eles.style, eles.css); aliases(ele.renderedCss, ele.renderedStyle); +nodes.forEach((child) => { + child.animate({ + position: node.position(), + duration: 300, + complete: () => { + console.log(child.id()); + } + }); +}); + +nodes.animate({ + renderedPosition: node.position() +}, { + style: { backgroundColor: 'red' }, + duration: 1000, + queue: true, + complete: () => console.log('end'), + step: () => console.log('step'), + easing: 'ease-in-out-quint' +}); + eles.anySame(nodes); aliases(eles.contains, eles.has); aliases(eles.allAreNeighbors, eles.allAreNeighbours); @@ -488,7 +540,7 @@ cy.collection().merge(diff.left).merge(diff.right).merge(diff.both).unmerge(coll eles.sort((a, b) => 1).map((ele, i, eles) => [i, ele]); eles.reduce((prev, ele, i, eles) => [...prev, [ele, i]], []).concat(['finish']); -const min = eles.min((ele, i, eles) => ele.id.length + i); min.ele.scratch('min', min.value); +const min = eles.min((ele, i, eles) => ele.id.length + i); min.ele.scratch('min', min.value).scratch('min').value; const max = eles.max((ele, i, eles) => ele.id.length + i); max.ele.scratch('max', max.value); // TODO: traversing (need to actively check the nodes/edges distinction) diff --git a/types/cytoscape/index.d.ts b/types/cytoscape/index.d.ts index 1fcdcb0f08..9b56a2fd43 100644 --- a/types/cytoscape/index.d.ts +++ b/types/cytoscape/index.d.ts @@ -482,7 +482,8 @@ declare namespace cytoscape { * @param namespace A namespace string. * @param value The value to set at the specified namespace. */ - scratch(namespace?: string, value?: any): Scratchpad; + scratch(namespace?: string): Scratchpad; + scratch(namespace: string, value: any): this; /** * Remove scratchpad data. You should remove scratchpad data only at your own namespaces. @@ -490,7 +491,7 @@ declare namespace cytoscape { * * @param namespace A namespace string. */ - removeScratch(namespace: string): void; + removeScratch(namespace: string): this; } /** @@ -508,25 +509,25 @@ declare namespace cytoscape { * @param eventsMap A map of event names to handler functions. */ - on(events: EventNames, handler: EventHandler): void; - on(events: EventNames, selector: Selector, handler: EventHandler): void; - on(events: EventNames, selector: Selector, data: any, handler: EventHandler): void; - on(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): void; + on(events: EventNames, handler: EventHandler): this; + on(events: EventNames, selector: Selector, handler: EventHandler): this; + on(events: EventNames, selector: Selector, data: any, handler: EventHandler): this; + on(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): this; - bind(events: EventNames, handler: EventHandler): void; - bind(events: EventNames, selector: Selector, handler: EventHandler): void; - bind(events: EventNames, selector: Selector, data: any, handler: EventHandler): void; - bind(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): void; + bind(events: EventNames, handler: EventHandler): this; + bind(events: EventNames, selector: Selector, handler: EventHandler): this; + bind(events: EventNames, selector: Selector, data: any, handler: EventHandler): this; + bind(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): this; - listen(events: EventNames, handler: EventHandler): void; - listen(events: EventNames, selector: Selector, handler: EventHandler): void; - listen(events: EventNames, selector: Selector, data: any, handler: EventHandler): void; - listen(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): void; + listen(events: EventNames, handler: EventHandler): this; + listen(events: EventNames, selector: Selector, handler: EventHandler): this; + listen(events: EventNames, selector: Selector, data: any, handler: EventHandler): this; + listen(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): this; - addListener(events: EventNames, handler: EventHandler): void; - addListener(events: EventNames, selector: Selector, handler: EventHandler): void; - addListener(events: EventNames, selector: Selector, data: any, handler: EventHandler): void; - addListener(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): void; + addListener(events: EventNames, handler: EventHandler): this; + addListener(events: EventNames, selector: Selector, handler: EventHandler): this; + addListener(events: EventNames, selector: Selector, data: any, handler: EventHandler): this; + addListener(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): this; /** * Get a promise that is resolved with the first @@ -542,7 +543,7 @@ declare namespace cytoscape { * @param events A space separated list of event names. * @param handler The handler function that is called when one of the specified events occurs. */ - one(events: EventNames, handler: EventHandler): void; + one(events: EventNames, handler: EventHandler): this; /** * Bind to events that occur in the graph, and trigger the handler only once. * @@ -550,7 +551,7 @@ declare namespace cytoscape { * @param handler The handler function that is called when one of the specified events occurs. * @param selector A selector to specify elements for which the handler is triggered. */ - one(events: EventNames, selector: Selector, handler: EventHandler): void; + one(events: EventNames, selector: Selector, handler: EventHandler): this; /** * Bind to events that occur in the graph, and trigger the handler only once. * @@ -559,7 +560,7 @@ declare namespace cytoscape { * @param selector A selector to specify elements for which the handler is triggered. * @param data A plain object which is passed to the handler in the event object argument. */ - one(events: EventNames, selector: Selector, data: any, handler: EventHandler): void; + one(events: EventNames, selector: Selector, data: any, handler: EventHandler): this; /** * Bind to events that occur in the graph, and trigger the handler only once. * @@ -567,7 +568,7 @@ declare namespace cytoscape { * @param selector A selector to specify elements for which the handler is triggered. * @param data A plain object which is passed to the handler in the event object argument. */ - one(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): void; + one(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): this; /** * Remove event handlers. @@ -578,17 +579,17 @@ declare namespace cytoscape { * @param handler [optional] A reference to the handler function to remove. * @param eventsMap A map of event names to handler functions to remove. */ - off(events: EventNames, selector?: Selector, handler?: EventHandler): void; - off(eventsMap: { [value: string]: EventHandler }, selector?: Selector): void; + off(events: EventNames, selector?: Selector, handler?: EventHandler): this; + off(eventsMap: { [value: string]: EventHandler }, selector?: Selector): this; - unbind(events: EventNames, selector?: Selector, handler?: EventHandler): void; - unbind(eventsMap: { [value: string]: EventHandler }, selector?: Selector): void; + unbind(events: EventNames, selector?: Selector, handler?: EventHandler): this; + unbind(eventsMap: { [value: string]: EventHandler }, selector?: Selector): this; - unlisten(events: EventNames, selector?: Selector, handler?: EventHandler): void; - unlisten(eventsMap: { [value: string]: EventHandler }, selector?: Selector): void; + unlisten(events: EventNames, selector?: Selector, handler?: EventHandler): this; + unlisten(eventsMap: { [value: string]: EventHandler }, selector?: Selector): this; - removeListener(events: EventNames, selector?: Selector, handler?: EventHandler): void; - removeListener(eventsMap: { [value: string]: EventHandler }, selector?: Selector): void; + removeListener(events: EventNames, selector?: Selector, handler?: EventHandler): this; + removeListener(eventsMap: { [value: string]: EventHandler }, selector?: Selector): this; /** * Trigger one or more events. @@ -596,14 +597,14 @@ declare namespace cytoscape { * @param events A space separated list of event names to trigger. * @param extraParams [optional] An array of additional parameters to pass to the handler. */ - trigger(events: EventNames, extraParams?: any[]): void; - emit(events: EventNames, extraParams?: any[]): void; + trigger(events: EventNames, extraParams?: any[]): this; + emit(events: EventNames, extraParams?: any[]): this; /** * Run a callback as soon as the graph becomes ready. If the graph is already ready, then the callback is called immediately. * @param fn The callback run as soon as the graph is ready, inside which this refers to the core (cy). */ - ready(fn: EventHandler): void; + ready(fn: EventHandler): this; } interface ZoomOptionsModel { @@ -695,7 +696,7 @@ declare namespace cytoscape { * * @param bool A truthy value enables panning; a falsey value disables it. */ - panningEnabled(bool: boolean): void; + panningEnabled(bool: boolean): this; /** * Get whether panning by user events (e.g. dragging the graph background) is enabled. If cy.boxSelectionEnabled() === true, then the user must taphold to initiate panning. @@ -709,7 +710,7 @@ declare namespace cytoscape { * * @param bool A truthy value enables user panning; a falsey value disables it. */ - userPanningEnabled(bool: boolean): void; + userPanningEnabled(bool: boolean): this; /** * Get the zoom level. * http://js.cytoscape.org/#cy.zoom @@ -722,7 +723,7 @@ declare namespace cytoscape { * @param level The zoom level to set. * @param options The options for zooming. */ - zoom(level?: number | ZoomOptions): void; + zoom(level?: number | ZoomOptions): this; /** * Set or get whether zooming is enabled. Get if no parameter provided. @@ -730,7 +731,7 @@ declare namespace cytoscape { * * @param bool A truthy value enables zooming; a falsey value disables it. */ - zoomingEnabled(bool?: boolean): void; + zoomingEnabled(bool?: boolean): this; /** * Get whether zooming by user events (e.g. mouse wheel, pinch-to-zoom) @@ -745,7 +746,7 @@ declare namespace cytoscape { * * @param bool A truthy value enables user zooming; a falsey value disables it. */ - userZoomingEnabled(bool?: boolean): void; + userZoomingEnabled(bool?: boolean): this; /** * Get the minimum zoom level. @@ -758,7 +759,7 @@ declare namespace cytoscape { * * @param zoom The new minimum zoom level to use. */ - minZoom(zoom: number): void; + minZoom(zoom: number): this; /** * Get the maximum zoom level. @@ -771,7 +772,7 @@ declare namespace cytoscape { * * @param zoom The new maximum zoom level to use. */ - maxZoom(zoom: number): void; + maxZoom(zoom: number): this; /** * Set the viewport state (pan & zoom) in one call. @@ -780,7 +781,7 @@ declare namespace cytoscape { * @param zoom The zoom level to set. * @param pan The pan to set (a rendered position). */ - viewport(zoom: number, pan: Position): void; + viewport(zoom: number, pan: Position): this; /** * Get whether box selection is enabled. @@ -795,7 +796,7 @@ declare namespace cytoscape { * * @param bool A truthy value enables box selection; a falsey value disables it. */ - boxSelectionEnabled(bool: boolean): void; + boxSelectionEnabled(bool: boolean): this; /** * Get the on-screen width of the viewport in pixels. @@ -832,7 +833,7 @@ declare namespace cytoscape { * * @param bool A truthy value enables autolocking; a falsey value disables it. */ - autolock(bool: boolean): void; + autolock(bool: boolean): this; /** * Get whether nodes are automatically ungrabified @@ -847,7 +848,7 @@ declare namespace cytoscape { * * @param bool A truthy value enables autolocking; a falsey value disables it. */ - autoungrabify(bool: boolean): void; + autoungrabify(bool: boolean): this; /** * Get whether nodes are automatically unselectified @@ -862,7 +863,7 @@ declare namespace cytoscape { * * @param bool A truthy value enables autolocking; a falsey value disables it. */ - autounselectify(bool: boolean): void; + autounselectify(bool: boolean): this; /** * Force the renderer to redraw (i.e. draw a new frame). @@ -872,7 +873,7 @@ declare namespace cytoscape { * but it should not be needed for most developers. * http://js.cytoscape.org/#cy.forceRender */ - forceRender(): void; + forceRender(): this; /** * Force the renderer to recalculate the viewport bounds. @@ -914,7 +915,7 @@ declare namespace cytoscape { /** An object containing centring options from which the graph will be animated. */ center?: CenterOptions; /** easing - A transition-timing-function easing style string that shapes the animation progress curve. */ - easing?: string; // TODO: explicit type + easing?: Css.TransitionTimingFunction; /** duration - The duration of the animation in milliseconds. */ duration?: number; @@ -949,7 +950,7 @@ declare namespace cytoscape { * Get an animation of the viewport. * http://js.cytoscape.org/#cy.animation */ - animation(options: AnimationOptions): any; + animation(options: AnimationOptions): AnimationManipulation; /** * Add a delay between animations for the viewport. @@ -963,7 +964,7 @@ declare namespace cytoscape { * Get a delay animation of the viewport. * http://js.cytoscape.org/#cy.delayAnimation */ - delayAnimation(duration: number): void; + delayAnimation(duration: number): AnimationManipulation; /** * Stop all viewport animations that are currently running. @@ -994,7 +995,7 @@ declare namespace cytoscape { * An analogue to run a layout on a subset of the graph exists as eles.layout(). * http://js.cytoscape.org/#cy.layout */ - layout(layout: LayoutOptions): LayoutManipulation; + layout(layout: LayoutOptions): Layouts; /** * Get a new layout, which can be used to algorithmically * position the nodes in the graph. @@ -1007,8 +1008,8 @@ declare namespace cytoscape { * Note that you must call layout.run() in order for it to affect the graph. * An analogue to make a layout on a subset of the graph exists as eles.makeLayout(). */ - makeLayout(options: LayoutOptions): LayoutManipulation; - createLayout(options: LayoutOptions): LayoutManipulation; + makeLayout(options: LayoutOptions): Layouts; + createLayout(options: LayoutOptions): Layouts; } /** @@ -1052,10 +1053,6 @@ declare namespace cytoscape { * http://js.cytoscape.org/#core/export */ interface ExportOptions { - /** - * output Whether the output should be 'base64uri' (default), 'base64', or 'blob'. - */ - output?: "base64uri" | "base64" | "blob"; /** * The background colour of the image (transparent by default). */ @@ -1077,6 +1074,18 @@ declare namespace cytoscape { */ maxHeight?: number; } + interface ExportStringOptions extends ExportOptions { + /** + * output Whether the output should be 'base64uri' (default), 'base64', or 'blob'. + */ + output?: "base64uri" | "base64"; + } + interface ExportBlobOptions extends ExportOptions { + /** + * output Whether the output should be 'base64uri' (default), 'base64', or 'blob'. + */ + output?: "blob"; + } interface ExportJpgOptions extends ExportOptions { /** @@ -1086,22 +1095,29 @@ declare namespace cytoscape { */ quality?: number; } + interface ExportJpgStringOptions extends ExportJpgOptions, ExportStringOptions { + } + interface ExportJpgBlobOptions extends ExportJpgOptions, ExportBlobOptions { + } interface CoreExport { /** * Export the current graph view as a PNG image in Base64 representation. */ - png(options?: ExportOptions): string; + png(options?: ExportStringOptions): string; + png(options?: ExportBlobOptions): Blob; /** * Export the current graph view as a JPG image in Base64 representation. */ - jpg(options?: ExportJpgOptions): string; + jpg(options?: ExportJpgStringOptions): string; + jpg(options?: ExportJpgBlobOptions): Blob; /** * Export the current graph view as a JPG image in Base64 representation. */ - jpeg(options?: ExportJpgOptions): string; + jpeg(options?: ExportJpgStringOptions): string; + jpeg(options?: ExportJpgBlobOptions): Blob; /** * Export the graph as JSON, the same format used at initialisation. @@ -1156,7 +1172,7 @@ declare namespace cytoscape { * * The output is a collection of edge elements OR single edge. */ - interface EdgeCollection extends EdgeSingular, + interface EdgeCollection extends Collection, EdgeCollectionTraversing { } /** * nodes -> Cy.NodeCollection @@ -1164,7 +1180,7 @@ declare namespace cytoscape { * * The output is a collection of node elements OR single node. */ - interface NodeCollection extends NodeSingular, + interface NodeCollection extends Collection, NodeCollectionMetadata, NodeCollectionPosition, NodeCollectionTraversing, NodeCollectionCompound { } @@ -1174,14 +1190,14 @@ declare namespace cytoscape { * edge --> Cy.EdgeSingular * a collection of a single edge */ - interface EdgeSingular extends Singular, + interface EdgeSingular extends Singular, EdgeCollection, EdgeSingularData, EdgeSingularPoints, EdgeSingularTraversing { } /** * node --> Cy.NodeSingular * a collection of a single node */ - interface NodeSingular extends Singular, + interface NodeSingular extends Singular, NodeCollection, NodeSingularMetadata, NodeSingularPosition, NodeSingularCompound { } /** @@ -1250,18 +1266,18 @@ declare namespace cytoscape { /** * http://js.cytoscape.org/#eles.on */ - on(events: EventNames, selector: string, data: any, handler: EventHandler): void; - on(events: EventNames, selector: string, handler: EventHandler): void; - on(events: EventNames, handler: EventHandler): void; - bind(events: EventNames, selector: string, data: any, handler: EventHandler): void; - bind(events: EventNames, selector: string, handler: EventHandler): void; - bind(events: EventNames, handler: EventHandler): void; - listen(events: EventNames, selector: string, data: any, handler: EventHandler): void; - listen(events: EventNames, selector: string, handler: EventHandler): void; - listen(events: EventNames, handler: EventHandler): void; - addListener(events: EventNames, selector: string, data: any, handler: EventHandler): void; - addListener(events: EventNames, selector: string, handler: EventHandler): void; - addListener(events: EventNames, handler: EventHandler): void; + on(events: EventNames, selector: string, data: any, handler: EventHandler): this; + on(events: EventNames, selector: string, handler: EventHandler): this; + on(events: EventNames, handler: EventHandler): this; + bind(events: EventNames, selector: string, data: any, handler: EventHandler): this; + bind(events: EventNames, selector: string, handler: EventHandler): this; + bind(events: EventNames, handler: EventHandler): this; + listen(events: EventNames, selector: string, data: any, handler: EventHandler): this; + listen(events: EventNames, selector: string, handler: EventHandler): this; + listen(events: EventNames, handler: EventHandler): this; + addListener(events: EventNames, selector: string, data: any, handler: EventHandler): this; + addListener(events: EventNames, selector: string, handler: EventHandler): this; + addListener(events: EventNames, handler: EventHandler): this; /** * http://js.cytoscape.org/#eles.promiseOn * alias: pon @@ -1277,29 +1293,29 @@ declare namespace cytoscape { * @param event The event object. * http://js.cytoscape.org/#eles.one */ - one(events: EventNames, selector: string, data: any, handler: EventHandler): void; - one(events: EventNames, selector: string, handler: EventHandler): void; - one(events: EventNames, handler: EventHandler): void; + one(events: EventNames, selector: string, data: any, handler: EventHandler): this; + one(events: EventNames, selector: string, handler: EventHandler): this; + one(events: EventNames, handler: EventHandler): this; /** * http://js.cytoscape.org/#eles.once */ - once(events: EventNames, selector: string, data: any, handler: EventHandler): void; - once(events: EventNames, selector: string, handler: EventHandler): void; - once(events: EventNames, handler: EventHandler): void; + once(events: EventNames, selector: string, data: any, handler: EventHandler): this; + once(events: EventNames, selector: string, handler: EventHandler): this; + once(events: EventNames, handler: EventHandler): this; /** * http://js.cytoscape.org/#eles.off * alias unbind, unlisten, removeListener */ - off(events: EventNames, selector?: string, handler?: EventHandler): void; - unbind(events: EventNames, selector?: string, handler?: EventHandler): void; - unlisten(events: EventNames, selector?: string, handler?: EventHandler): void; - removeListener(events: EventNames, selector?: string, handler?: EventHandler): void; + off(events: EventNames, selector?: string, handler?: EventHandler): this; + unbind(events: EventNames, selector?: string, handler?: EventHandler): this; + unlisten(events: EventNames, selector?: string, handler?: EventHandler): this; + removeListener(events: EventNames, selector?: string, handler?: EventHandler): this; /** * http://js.cytoscape.org/#eles.trigger * alias: emit */ - trigger(events: EventNames, extra?: string[]): void; - emit(events: EventNames, extra?: string[]): void; + trigger(events: EventNames, extra?: string[]): this; + emit(events: EventNames, extra?: string[]): this; } /** @@ -1344,12 +1360,12 @@ declare namespace cytoscape { * @param name The name of the field to set. * @param value The value to set for the field. */ - data(name: string, value: any): void; + data(name: string, value: any): this; /** * Update multiple data fields at once via an object. * @param obj The object containing name- value pairs to update data fields. */ - data(obj: any): void; + data(obj: any): this; /** * Get a particular data field for the element. * @param name The name of the field to get. @@ -1360,12 +1376,12 @@ declare namespace cytoscape { * @param name The name of the field to set. * @param value The value to set for the field. */ - attr(name: string, value: any): void; + attr(name: string, value: any): this; /** * Update multiple data fields at once via an object. * @param obj The object containing name- value pairs to update data fields. */ - attr(obj: any): void; + attr(obj: any): this; /** * Get or set the scratchpad at a particular namespace, @@ -1377,7 +1393,8 @@ declare namespace cytoscape { * @param namespace A namespace string. * @param value The value to set at the specified namespace. */ - scratch(namespace?: string, value?: any): Scratchpad; + scratch(namespace?: string): Scratchpad; + scratch(namespace: string, value: any): this; /** * Remove scratchpad data. @@ -1385,7 +1402,7 @@ declare namespace cytoscape { * http://js.cytoscape.org/#ele.removeScratch * @param namespace A namespace string. */ - removeScratch(namespace: string): void; + removeScratch(namespace: string): this; /** * A shortcut to get the ID of an element. @@ -1574,18 +1591,6 @@ declare namespace cytoscape { */ point(pos: Position): this; - /** - * Shift the positions of the nodes by a given model position vector. - * @param dimension The position dimension to shift. - * @param value The value to shift the dimension. - */ - shift(dimension: PositionDimension, value?: number): this; - /** - * Shift the positions of the nodes by a given model position vector. - * @param pos An object specifying name-value pairs representing dimensions to shift. - */ - shift(pos: Position): this; - /** * Get or set the rendered (on-screen) position of a node. * http://js.cytoscape.org/#node.renderedPosition @@ -1597,8 +1602,8 @@ declare namespace cytoscape { * @param pos An object specifying name-value pairs representing dimensions to set. */ renderedPosition(dimension?: PositionDimension): Position; - renderedPosition(dimension: PositionDimension, value: Position): void; - renderedPosition(pos: { [name: string]: number }): void; + renderedPosition(dimension: PositionDimension, value: Position): this; + renderedPosition(pos: { [name: string]: number }): this; /** * Set the value of a specified rendered position dimension. @@ -1607,8 +1612,8 @@ declare namespace cytoscape { * @param pos An object specifying name-value pairs representing dimensions to set. */ renderedPoint(dimension?: PositionDimension): Position; - renderedPoint(dimension: PositionDimension, value: Position): void; - renderedPoint(pos: { [name: string]: number }): void; + renderedPoint(dimension: PositionDimension, value: Position): this; + renderedPoint(pos: { [name: string]: number }): this; /** * @@ -1621,8 +1626,8 @@ declare namespace cytoscape { * @param pos An object specifying name-value pairs representing dimensions to set. */ relativePosition(dimension?: PositionDimension): Position; - relativePosition(dimension: PositionDimension, value: Position): void; - relativePosition(pos: { [name: string]: number }): void; + relativePosition(dimension: PositionDimension, value: Position): this; + relativePosition(pos: { [name: string]: number }): this; /** * Get the value of a specified relative position dimension. @@ -1631,8 +1636,8 @@ declare namespace cytoscape { * @param pos An object specifying name-value pairs representing dimensions to set. */ relativePoint(dimension?: PositionDimension): Position; - relativePoint(dimension: PositionDimension, value: Position): void; - relativePoint(pos: { [name: string]: number }): void; + relativePoint(dimension: PositionDimension, value: Position): this; + relativePoint(pos: { [name: string]: number }): this; /** * Get whether a node is currently grabbed, meaning the user has hold of the node. @@ -1655,43 +1660,55 @@ declare namespace cytoscape { * @param ele The element being iterated over for which the function should return a position to set. * @param ix The index of the element when iterating over the elements in the collection. */ - type ElementPositionFunction = (ele: NodeSingular, ix: number) => void; - type ElementCollectionFunction = (ele: NodeSingular, ix: number, eles: CollectionArgument) => void; + type ElementPositionFunction = (ele: NodeSingular, ix: number) => Position; + type ElementCollectionFunction = (ele: NodeSingular, ix: number, eles: CollectionArgument) => Position; /** * http://js.cytoscape.org/#collection/position--dimensions */ interface NodeCollectionPosition { + /** + * Shift the positions of the nodes by a given model position vector. + * @param dimension The position dimension to shift. + * @param value The value to shift the dimension. + */ + shift(dimension: PositionDimension, value?: number): this; + /** + * Shift the positions of the nodes by a given model position vector. + * @param pos An object specifying name-value pairs representing dimensions to shift. + */ + shift(pos: Position): this; + /** * Set the positions via a function. * @param handler A callback function that returns the position to set for each element. * @param pos An object specifying name-value pairs representing dimensions to set. * http://js.cytoscape.org/#nodes.positions */ - positions(handler: ElementPositionFunction | Position): void; - modelPositions(handler: ElementPositionFunction | Position): void; - points(handler: ElementPositionFunction | Position): void; + positions(handler: ElementPositionFunction | Position): this; + modelPositions(handler: ElementPositionFunction | Position): this; + points(handler: ElementPositionFunction | Position): this; /** * Allow the user to grab the nodes. * http://js.cytoscape.org/#nodes.grabify */ - grabify(): void; + grabify(): this; /** * Disallow the user to grab the nodes. * http://js.cytoscape.org/#nodes.ungrabify */ - ungrabify(): void; + ungrabify(): this; /** * Lock the nodes such that their positions can not be changed. * http://js.cytoscape.org/#nodes.lock */ - lock(): void; + lock(): this; /** * Unlock the nodes such that their positions can be changed. * http://js.cytoscape.org/#nodes.unlock */ - unlock(): void; + unlock(): this; } /** * http://js.cytoscape.org/#collection/position--dimensions @@ -1781,9 +1798,9 @@ declare namespace cytoscape { * * @param options The layout options. */ - layout(options: LayoutOptions): LayoutManipulation; - makeLayout(options: LayoutOptions): LayoutManipulation; - createLayout(options: LayoutOptions): LayoutManipulation; + layout(options: LayoutOptions): Layouts; + makeLayout(options: LayoutOptions): Layouts; + createLayout(options: LayoutOptions): Layouts; } /** @@ -1796,7 +1813,7 @@ declare namespace cytoscape { animationDuration?: number; // easing of animation, if enabled animationEasing?: number; - // collection of elements involved in the layout; set by cy.layout() or eles.layout() + // collection of elements involved in the layout; set by cy.layout() or eles.layout(s) eles: CollectionArgument; // whether to fit the viewport to the graph fit?: boolean; @@ -1862,23 +1879,23 @@ declare namespace cytoscape { * Make the elements selected (NB other elements outside the collection are not affected). * http://js.cytoscape.org/#eles.select */ - select(): void; + select(): this; /** * Make the elements not selected (NB other elements outside the collection are not affected). * http://js.cytoscape.org/#eles.unselect */ - unselect(): void; - deselect(): void; + unselect(): this; + deselect(): this; /** * Make the selection states of the elements mutable. * http://js.cytoscape.org/#eles.selectify */ - selectify(): void; + selectify(): this; /** * Make the selection states of the elements immutable. * http://js.cytoscape.org/#eles.unselectify */ - unselectify(): void; + unselectify(): this; } /** @@ -1894,34 +1911,34 @@ declare namespace cytoscape { * http://js.cytoscape.org/#eles.addClass * @param classes A space-separated list of class names to add to the elements. */ - addClass(classes: ClassNames): void; + addClass(classes: ClassNames): this; /** * Remove classes from elements. * @param classes A space-separated list of class names to remove from the elements. * http://js.cytoscape.org/#eles.removeClass */ - removeClass(classes: ClassNames): void; + removeClass(classes: ClassNames): this; /** * Toggle whether the elements have the specified classes. * @param classes A space-separated list of class names to toggle on the elements. * @param toggle [optional] Instead of automatically toggling, adds the classes on truthy values or removes them on falsey values. * http://js.cytoscape.org/#eles.toggleClass */ - toggleClass(classes: ClassNames, toggle?: boolean): void; + toggleClass(classes: ClassNames, toggle?: boolean): this; /** * Replace the current list of classes on the elements with the specified list. * @param classes A space-separated list of class names that replaces the current class list. * http://js.cytoscape.org/#eles.classes * Note: can be used to clear all classes (no arguments). */ - classes(classes?: ClassNames): void; + classes(classes?: ClassNames): this; /** * Add classes to the elements, and then remove the classes after a specified duration. * @param classes A space-separated list of class names to flash on the elements. * @param duration [optional] The duration in milliseconds that the classes should be added on the elements. After the duration, the classes are removed. * http://js.cytoscape.org/#eles.flashClass */ - flashClass(classes: ClassNames, duration?: number): void; + flashClass(classes: ClassNames, duration?: number): this; /** * Set a particular style property value. @@ -2046,19 +2063,15 @@ declare namespace cytoscape { /** A function to call each time the animation steps. */ step?(): void; /** A transition-timing-function easing style string that shapes the animation progress curve. */ - easing?(): void; + easing?: Css.TransitionTimingFunction; } - interface ElementAnimateOptionPos { + interface ElementAnimateOptionPos extends ElementAnimateOptionsBase { /** A position to which the elements will be animated. */ - position?: Position; - /** A rendered position to which the elements will be animated. */ - renderedPosition?: Position; + position: Position; } - interface ElementAnimateOptionRen { - /** A position to which the elements will be animated. */ - position?: Position; + interface ElementAnimateOptionRen extends ElementAnimateOptionsBase { /** A rendered position to which the elements will be animated. */ - renderedPosition?: Position; + renderedPosition: Position; } interface CollectionAnimation { /** @@ -2066,28 +2079,28 @@ declare namespace cytoscape { * @param options An object containing the details of the animation. * http://js.cytoscape.org/#eles.animate */ - animate(options: ElementAnimateOptionPos | ElementAnimateOptionRen): void; + animate(options: ElementAnimateOptionPos | ElementAnimateOptionRen, params?: ElementAnimateOptionsBase): this; /** * Add a delay between animations for the elements. * @param duration How long the delay should be in milliseconds. * @param complete A function to call when the delay is complete. * http://js.cytoscape.org/#eles.delay */ - delay(duration: number, complete: () => void): void; + delay(duration: number, complete: () => void): this; /** * Stop all animations that are currently running. * @param clearQueue A boolean, indicating whether the queue of animations should be emptied. * @param jumpToEnd A boolean, indicating whether the currently-running animations should jump to their ends rather than just stopping midway. * http://js.cytoscape.org/#eles.stop */ - stop(clearQueue: boolean, jumpToEnd: boolean): void; + stop(clearQueue: boolean, jumpToEnd: boolean): this; /** * Remove all queued animations for the elements. * http://js.cytoscape.org/#eles.clearQueue */ - clearQueue(): void; + clearQueue(): this; } - interface SingularAnimationOptions { + interface SingularAnimationOptionsBase { /** A position to which the elements will be animated. */ position: Position; /** A rendered position to which the elements will be animated. */ @@ -2097,7 +2110,15 @@ declare namespace cytoscape { /** The duration of the animation in milliseconds. */ duration: number; /** A transition-timing-function easing style string that shapes the animation progress curve. */ - easing(): void; + easing: Css.TransitionTimingFunction; + } + interface SingularAnimationOptionsPos extends SingularAnimationOptionsBase { + /** A position to which the elements will be animated. */ + position: Position; + } + interface SingularAnimationOptionsRen extends SingularAnimationOptionsBase { + /** A rendered position to which the elements will be animated. */ + renderedPosition: Position; } interface SingularAnimation { /** @@ -2108,14 +2129,14 @@ declare namespace cytoscape { * Get an animation for the element. * @param options An object containing the details of the animation. */ - animation(options: SingularAnimationOptions): void; + animation(options: SingularAnimationOptionsRen | SingularAnimationOptionsPos): AnimationManipulation; /** * Get a delay animation for the element. * @param duration How long the delay should be in milliseconds. * http://js.cytoscape.org/#ele.delayAnimation */ - delayAnimation(duration: number): void; + delayAnimation(duration: number): AnimationManipulation; } /** @@ -2231,8 +2252,8 @@ declare namespace cytoscape { * eles - The collection of elements being iterated. * @param thisArg [optional] The value for this within the iterating function. */ - each(each: (ele: TIn, i: number, eles: this) => void | boolean, thisArg?: any): void; - forEach(each: (ele: TIn, i: number, eles: this) => void | boolean, thisArg?: any): void; + each(each: (ele: TIn, i: number, eles: this) => void | boolean, thisArg?: any): this; + forEach(each: (ele: TIn, i: number, eles: this) => void | boolean, thisArg?: any): this; /** * Get an element at a particular index in the collection. @@ -2272,7 +2293,7 @@ declare namespace cytoscape { /** * Get the collection as an array, maintaining the order of the elements. */ - toArray(): SingularElementReturnValue[]; + toArray(): TOut[]; } /** @@ -2527,7 +2548,7 @@ declare namespace cytoscape { * * http://js.cytoscape.org/#eles.min */ - min(fn: (ele: CollectionArgument, i: number, eles: CollectionArgument) => any, thisArg?: any): { + min(fn: (ele: SingularElementArgument, i: number, eles: CollectionArgument) => any, thisArg?: any): { /** * The minimum value found. */ @@ -2535,7 +2556,7 @@ declare namespace cytoscape { /** * The element that corresponds to the minimum value. */ - ele: CollectionArgument + ele: SingularElementReturnValue }; /** @@ -2549,15 +2570,15 @@ declare namespace cytoscape { * * http://js.cytoscape.org/#eles.max */ - max(fn: (ele: CollectionArgument, i: number, eles: CollectionArgument) => any, thisArg?: any): { + max(fn: (ele: SingularElementArgument, i: number, eles: CollectionArgument) => any, thisArg?: any): { /** - * The maximum value found. + * The minimum value found. */ value: any, /** - * The element that corresponds to the maximum value. + * The element that corresponds to the minimum value. */ - ele: CollectionArgument + ele: SingularElementReturnValue }; } @@ -2973,7 +2994,7 @@ declare namespace cytoscape { */ interface SearchPageRankResult { /** function that computes the rank of a given node (either object or selector string) */ - rank(node: NodeCollection): void; + rank(node: NodeCollection): number; } /** @@ -3183,7 +3204,7 @@ declare namespace cytoscape { * returning the minimum spanning tree, assuming undirected edges. * http://js.cytoscape.org/#eles.kruskal */ - kruskal(handler: (edge: EdgeCollection) => number): void; + kruskal(handler: (edge: EdgeCollection) => number): CollectionReturnValue; /** * Finds the minimum cut in a graph using the Karger-Stein algorithm. * The optimal result is found with a high probability, but without guarantee. @@ -4656,10 +4677,10 @@ declare namespace cytoscape { * @param handler The handler function that is called * when one of the specified events occurs. */ - on(events: EventNames, data: any, handler: EventHandler): void; - bind(events: EventNames, data: any, handler: EventHandler): void; - listen(events: EventNames, data: any, handler: EventHandler): void; - addListener(events: EventNames, data: any, handler: EventHandler): void; + on(events: EventNames, data: any, handler: EventHandler): this; + bind(events: EventNames, data: any, handler: EventHandler): this; + listen(events: EventNames, data: any, handler: EventHandler): this; + addListener(events: EventNames, data: any, handler: EventHandler): this; /** * Get a promise that is resolved with the first of any of @@ -4675,8 +4696,8 @@ declare namespace cytoscape { * @param data [optional] A plain object which is passed to the handler in the event object argument. * @param handler The handler function that is called when one of the specified events occurs. */ - one(events: EventNames, handler: EventHandler): void; - one(events: EventNames, data: any, handler: EventHandler): void; + one(events: EventNames, handler: EventHandler): this; + one(events: EventNames, data: any, handler: EventHandler): this; /** * Remove event handlers on the layout. @@ -4685,10 +4706,10 @@ declare namespace cytoscape { * @param events A space separated list of event names. * @param handler [optional] A reference to the handler function to remove. */ - off(events: EventNames, handler?: EventHandler): void; - unbind(events: EventNames, handler?: EventHandler): void; - unlisten(events: EventNames, handler?: EventHandler): void; - removeListener(events: EventNames, handler?: EventHandler): void; + off(events: EventNames, handler?: EventHandler): this; + unbind(events: EventNames, handler?: EventHandler): this; + unlisten(events: EventNames, handler?: EventHandler): this; + removeListener(events: EventNames, handler?: EventHandler): this; /** * Trigger one or more events on the layout. @@ -4696,7 +4717,7 @@ declare namespace cytoscape { * @param events A space separated list of event names to trigger. * @param extraParams [optional] An array of additional parameters to pass to the handler. */ - trigger(events: EventNames, extraParams?: any[]): void; + trigger(events: EventNames, extraParams?: any[]): this; } /** @@ -4717,7 +4738,7 @@ declare namespace cytoscape { * If the animation is complete, it restarts from the beginning. * http://js.cytoscape.org/#ani.play */ - play(): void; + play(): this; /** * Get whether the animation is currently playing. * http://js.cytoscape.org/#ani.playing diff --git a/types/d3-transition/index.d.ts b/types/d3-transition/index.d.ts index eb60cec49f..2f935802bb 100644 --- a/types/d3-transition/index.d.ts +++ b/types/d3-transition/index.d.ts @@ -561,6 +561,12 @@ export interface Transition number): this; } +/** + * Represents the union of the Selection and Transition types for any usages that operate on both. + * Typically used for functions which take in either a selection or transition and set or update attributes. + */ +export type SelectionOrTransition = Selection | Transition; + /** * Returns a new transition with the specified name. If a name is not specified, null is used. * The new transition is only exclusive with other transitions of the same name. diff --git a/types/d3-zoom/d3-zoom-tests.ts b/types/d3-zoom/d3-zoom-tests.ts index 8051898b8b..819f344422 100644 --- a/types/d3-zoom/d3-zoom-tests.ts +++ b/types/d3-zoom/d3-zoom-tests.ts @@ -166,7 +166,7 @@ svgZoom = svgZoom.touchable(true); svgZoom = svgZoom.touchable(function(d, i, group) { const that: SVGRectElement = this; const datum: SVGDatum = d; - const g: SVGRectElement[] | NodeListOf = group; + const g: SVGRectElement[] | ArrayLike = group; return "ontouchstart" in this && datum.height > 0; }); diff --git a/types/datatables.net/datatables.net-tests.ts b/types/datatables.net/datatables.net-tests.ts index 423dcaf4c9..d22e878d34 100644 --- a/types/datatables.net/datatables.net-tests.ts +++ b/types/datatables.net/datatables.net-tests.ts @@ -1002,6 +1002,9 @@ const static_6 = new $.fn.dataTable.Api("selector"); const version: boolean = $.fn.dataTable.versionCheck("1.10.0"); const isDataTable: boolean = $.fn.dataTable.isDataTable("selector"); +const isDataTable_3: boolean = $.fn.dataTable.isDataTable(dt.row("selector").node()); +const isDataTable_2: boolean = $.fn.dataTable.isDataTable($("selector")); +const isDataTable_4: boolean = $.fn.dataTable.isDataTable($("selector").dataTable().api()); const escapeRegex: string = $.fn.dataTable.util.escapeRegex(""); const throttle_1 = $.fn.dataTable.util.throttle((data) => { diff --git a/types/datatables.net/index.d.ts b/types/datatables.net/index.d.ts index a8f63a999e..ae7edf755a 100644 --- a/types/datatables.net/index.d.ts +++ b/types/datatables.net/index.d.ts @@ -1094,13 +1094,13 @@ declare namespace DataTables { (): JQueryDataTables; /** - * Check is a table node is a DataTable or not + * Check if a table node is a DataTable already or not. * * Usage: * $.fn.dataTable.isDataTable("selector"); - * @param table Selector string for table + * @param table The table to check. */ - isDataTable(table: string): boolean; + isDataTable(table: string | Node | JQuery | Api): boolean; /** * Helpers for `columns.render`. diff --git a/types/db-migrate-base/index.d.ts b/types/db-migrate-base/index.d.ts index a881fa6a06..c1c9189a50 100644 --- a/types/db-migrate-base/index.d.ts +++ b/types/db-migrate-base/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/db-migrate/db-migrate-base // Definitions by: nickiannone // Definitions: https://github.com/nickiannone/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/db-migrate-pg/index.d.ts b/types/db-migrate-pg/index.d.ts index 09cba26317..71726463e4 100644 --- a/types/db-migrate-pg/index.d.ts +++ b/types/db-migrate-pg/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/db-migrate/pg // Definitions by: nickiannone // Definitions: https://github.com/nickiannone/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as pg from "pg"; import * as DbMigrateBase from "db-migrate-base"; diff --git a/types/dd-trace/dd-trace-tests.ts b/types/dd-trace/dd-trace-tests.ts index 6281802d36..18f5daae10 100644 --- a/types/dd-trace/dd-trace-tests.ts +++ b/types/dd-trace/dd-trace-tests.ts @@ -5,6 +5,10 @@ const tracer = ddTrace.init({ service: 'MyLovelyService', hostname: 'localhost', port: 8126, + logger: { + debug: msg => { }, + error: err => { } + } }); tracer diff --git a/types/dd-trace/index.d.ts b/types/dd-trace/index.d.ts index 7ce1e89b09..11bcdb42f2 100644 --- a/types/dd-trace/index.d.ts +++ b/types/dd-trace/index.d.ts @@ -91,6 +91,16 @@ interface TracerOptions { * @default true */ plugins?: boolean; + + /** + * Custom logger to be used by the tracer (if debug = true), + * should support debug() and error() methods + * see https://datadog.github.io/dd-trace-js/#custom-logging__anchor + */ + logger?: { + debug: (message: string) => void + error: (err: Error) => void + }; } interface ExperimentalOptions { @@ -135,5 +145,5 @@ interface TraceOptions { /** * Global tags that should be assigned to every span. */ - tags?: { [key: string]: any; } | string; + tags?: { [key: string]: any } | string; } diff --git a/types/dockerode/index.d.ts b/types/dockerode/index.d.ts index 188643dc28..5c1c1bfae6 100644 --- a/types/dockerode/index.d.ts +++ b/types/dockerode/index.d.ts @@ -962,11 +962,11 @@ declare class Dockerode { pull(repoTag: string, options: {}, callback: Callback, auth?: {}): Dockerode.Image; pull(repoTag: string, options: {}, auth?: {}): Promise; - run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, createOptions: {}, startOptions: {}, callback: Callback): events.EventEmitter; - run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, startOptions: {}, callback: Callback): events.EventEmitter; - run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, callback: Callback): events.EventEmitter; - run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, createOptions: {}, callback: Callback): events.EventEmitter; - run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, createOptions?: {}, startOptions?: {}): Promise; + run(image: string, cmd: string[], outputStream: NodeJS.WritableStream | NodeJS.WritableStream[], createOptions: {}, startOptions: {}, callback: Callback): events.EventEmitter; + run(image: string, cmd: string[], outputStream: NodeJS.WritableStream | NodeJS.WritableStream[], startOptions: {}, callback: Callback): events.EventEmitter; + run(image: string, cmd: string[], outputStream: NodeJS.WritableStream | NodeJS.WritableStream[], callback: Callback): events.EventEmitter; + run(image: string, cmd: string[], outputStream: NodeJS.WritableStream | NodeJS.WritableStream[], createOptions: {}, callback: Callback): events.EventEmitter; + run(image: string, cmd: string[], outputStream: NodeJS.WritableStream | NodeJS.WritableStream[], createOptions?: {}, startOptions?: {}): Promise; swarmInit(options: {}, callback: Callback): void; swarmInit(options: {}): Promise; diff --git a/types/documentdb/index.d.ts b/types/documentdb/index.d.ts index e7962ba568..118881a378 100644 --- a/types/documentdb/index.d.ts +++ b/types/documentdb/index.d.ts @@ -802,7 +802,7 @@ export class DocumentClient { * @param [options] - Represents the feed options. * @returns - An instance of queryIterator to handle reading feed. */ - queryDocuments(collectionLink: string, query: DocumentQuery, options?: FeedOptions): QueryIterator; + queryDocuments(collectionLink: string, query: DocumentQuery, options?: FeedOptions): QueryIterator; /** * Query the triggers for the collection. diff --git a/types/domready/domready-tests.ts b/types/domready/domready-tests.ts index 01be4213f4..6c5e126bf3 100644 --- a/types/domready/domready-tests.ts +++ b/types/domready/domready-tests.ts @@ -1,5 +1,5 @@ import domready = require("domready"); -domready(function () { +domready(() => { // dom is loaded! -}) \ No newline at end of file +}); diff --git a/types/domready/index.d.ts b/types/domready/index.d.ts index 9548757894..6f9ea3a0a7 100644 --- a/types/domready/index.d.ts +++ b/types/domready/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for domready +// Type definitions for domready 1.0 // Project: https://github.com/ded/domready // Definitions by: Christian Holm Nielsen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare function domready(callback: () => any) : void; +declare function domready(callback: () => void): void; export = domready; -export as namespace domready; \ No newline at end of file +export as namespace domready; diff --git a/types/domready/tsconfig.json b/types/domready/tsconfig.json index 1495d185a6..4b4263f4b1 100644 --- a/types/domready/tsconfig.json +++ b/types/domready/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", "domready-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/domready/tslint.json b/types/domready/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/domready/tslint.json +++ b/types/domready/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/dts-generator/index.d.ts b/types/dts-generator/index.d.ts index 5ef99eb2b0..d4d730850c 100644 --- a/types/dts-generator/index.d.ts +++ b/types/dts-generator/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/SitePen/dts-generator#readme // Definitions by: Matt Traynham // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import ts = require('typescript'); import Bluebird = require('bluebird'); diff --git a/types/ecma-proposal-math-extensions/ecma-proposal-math-extensions-tests.ts b/types/ecma-proposal-math-extensions/ecma-proposal-math-extensions-tests.ts new file mode 100644 index 0000000000..3dc5a9d61a --- /dev/null +++ b/types/ecma-proposal-math-extensions/ecma-proposal-math-extensions-tests.ts @@ -0,0 +1,7 @@ +import "ecma-proposal-math-extensions"; + +Math.scale(42, 21, 64, 0, 100); +Math.fscale(0.42, 0.21, 0.64, 0.0, 1.0); +Math.clamp(42, 0, 100); +Math.radians(180) === 180 * Math.DEG_PER_RAD; +Math.degrees(Math.PI) === Math.PI * Math.RAD_PER_DEG; diff --git a/types/ecma-proposal-math-extensions/index.d.ts b/types/ecma-proposal-math-extensions/index.d.ts new file mode 100644 index 0000000000..6412e63dd6 --- /dev/null +++ b/types/ecma-proposal-math-extensions/index.d.ts @@ -0,0 +1,52 @@ +// Type definitions for ecma-proposal-math-extensions 0.0 +// Project: https://github.com/rwaldron/proposal-math-extensions#readme +// Definitions by: Konstantin Simon Maria Möllers +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.0 + +interface Math { + /** This is the number of how many degrees are one radian. */ + readonly DEG_PER_RAD: number; + /** This is the number of how many radians are one degree. */ + readonly RAD_PER_DEG: number; + /** + * Scales a value between `inLow` and `inHigh` to the range of `outLow` to `outHigh`. + * @param x The numeric value in the input range to scale. + * @param inLow The lower bound of the input range. + * @param inHigh The upper bound of the input range. + * @param outLow The lower bound of the output range. + * @param outHigh The upper bound of the output range. + * @return The input value scaled to the output range. + */ + scale(x: number, inLow: number, inHigh: number, outLow: number, outHigh: number): number; + /** + * Scales a floating point value between `inLow` and `inHigh` to the range of `outLow` to `outHigh`. + * @param x The numeric value in the input range to scale. + * @param inLow The lower bound of the input range. + * @param inHigh The upper bound of the input range. + * @param outLow The lower bound of the output range. + * @param outHigh The upper bound of the output range. + * @return The input value scaled to the output range. + */ + fscale(x: number, inLow: number, inHigh: number, outLow: number, outHigh: number): number; + /** + * Clamps an incoming value `x` to a range between `lower` and `upper`. + * @param x The value to clamp. + * @param lower The lower bound of the range to clamp `x` to. + * @param upper The upper bound of the range to clamp `x` to. + * @return The input value clamped to the given range. + */ + clamp(x: number, lower: number, upper: number): number; + /** + * Converts an angle given in degrees to an angle given in radians. + * @param degrees The input angle in degrees. + * @return The output angle in radians. + */ + radians(degrees: number): number; + /** + * Converts an angle given in radians to an angle given in degrees. + * @param radians The input angle in radians. + * @return The output angle in degrees. + */ + degrees(radians: number): number; +} diff --git a/types/ecma-proposal-math-extensions/tsconfig.json b/types/ecma-proposal-math-extensions/tsconfig.json new file mode 100644 index 0000000000..52115765eb --- /dev/null +++ b/types/ecma-proposal-math-extensions/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "target": "es2017", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ecma-proposal-math-extensions-tests.ts" + ] +} diff --git a/types/ecma-proposal-math-extensions/tslint.json b/types/ecma-proposal-math-extensions/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ecma-proposal-math-extensions/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/elasticsearch/elasticsearch-tests.ts b/types/elasticsearch/elasticsearch-tests.ts index 35b4e39798..85574e3c91 100644 --- a/types/elasticsearch/elasticsearch-tests.ts +++ b/types/elasticsearch/elasticsearch-tests.ts @@ -44,6 +44,13 @@ client.indices.delete({ }, (error) => { }); +client.indices.delete({ + index: 'test_index', + ignoreUnavailable: true +}).then((body) => { +}, (error) => { +}); + client.deleteByQuery({ index: 'test_index', type: 'test_type', diff --git a/types/elasticsearch/index.d.ts b/types/elasticsearch/index.d.ts index 2cfd14f689..c791db72c3 100644 --- a/types/elasticsearch/index.d.ts +++ b/types/elasticsearch/index.d.ts @@ -1143,6 +1143,7 @@ export interface IndicesDeleteParams extends GenericParams { timeout?: TimeSpan; masterTimeout?: TimeSpan; index: NameList; + ignoreUnavailable?: boolean; } export interface IndicesDeleteAliasParams extends GenericParams { diff --git a/types/electron-packager/electron-packager-tests.ts b/types/electron-packager/electron-packager-tests.ts index f956910b78..06cadf97f0 100644 --- a/types/electron-packager/electron-packager-tests.ts +++ b/types/electron-packager/electron-packager-tests.ts @@ -2,7 +2,7 @@ import packager = require("electron-packager"); function callback(err: Error, appPaths: string[]) { const msg = err.message; - const index = appPaths.indexOf("test"); + const index = appPaths.indexOf("test"); } function completeFunction(buildPath: string, electronVersion: string, platform: string, arch: string, callbackFn: () => void) { @@ -13,6 +13,8 @@ function ignoreFunction(path: string) { return true; } +// this is the obsolete API and will be removed in a future version + packager({ dir: ".", name: "myapplication", @@ -30,6 +32,29 @@ packager({ } }, callback); +function onCompleted(appPaths: string | string[]) { +} + +function onError(error: Error) { +} + +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" + } +}).then(onCompleted).catch(onError); + packager({ dir: ".", name: "myapplication", @@ -44,7 +69,7 @@ packager({ "requested-execution-level": "requireAdministrator", "application-manifest": "manifest.xml" } -}, callback); +}).then(onCompleted).catch(onError); packager({ dir: ".", @@ -52,14 +77,14 @@ packager({ platform: "all", arch: "all", electronVersion: "0.34.0" -}, callback); +}).then(onCompleted).catch(onError); packager({ dir: ".", name: "myapplication", electronVersion: "0.34.0", all: true -}, callback); +}).then(onCompleted).catch(onError); packager({ dir: ".", @@ -67,7 +92,7 @@ packager({ electronVersion: "0.34.0", arch: "arm64", executableName: "myapp" -}, callback); +}).then(onCompleted).catch(onError); packager({ dir: ".", @@ -110,7 +135,7 @@ packager({ "requested-execution-level": "asInvoker", "application-manifest": "manifest.xml" } -}, callback); +}).then(onCompleted).catch(onError); packager({ dir: ".", @@ -142,7 +167,7 @@ packager({ extendInfo: "plist.txt", helperBundleId: "23223f", osxSign: true -}, callback); +}).then(onCompleted).catch(onError); packager({ dir: ".", @@ -161,7 +186,7 @@ packager({ ignore: ignoreFunction, packageManager: "cnpm", platform: "linux" -}, callback); +}).then(onCompleted).catch(onError); packager({ dir: ".", @@ -192,4 +217,4 @@ packager({ "myapp2" ] }] -}, callback); +}).then(onCompleted).catch(onError); diff --git a/types/electron-packager/index.d.ts b/types/electron-packager/index.d.ts index 6e430ecdb2..0e438ebc6e 100644 --- a/types/electron-packager/index.d.ts +++ b/types/electron-packager/index.d.ts @@ -1,14 +1,28 @@ -// Type definitions for electron-packager 10.1 +// Type definitions for electron-packager 12.0 // Project: https://github.com/electron-userland/electron-packager // Definitions by: Maxime LUCE // Juan Jimenez-Anca // John Kleinschmidt +// Brendan Forster // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// export = electronPackager; +/** + * 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. + * + * @returns A promise containing the path(s) to the newly created application(s) + */ +declare function electronPackager(opts: electronPackager.Options): Promise; + /** * This will: * - Find or download the correct release of Electron @@ -18,6 +32,8 @@ export = electronPackager; * * @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; diff --git a/types/ember-data/index.d.ts b/types/ember-data/index.d.ts index b891bbe1d1..b071662326 100644 --- a/types/ember-data/index.d.ts +++ b/types/ember-data/index.d.ts @@ -526,7 +526,7 @@ declare module 'ember-data' { * invoking the callback with the name of each relationship and its relationship * descriptor. */ - eachRelationship(callback: Function, binding: any): any; + eachRelationship(callback: (name: string, details: RelationshipMeta) => void, binding?: any): any; /** * Represents the model's class name as a string. This can be used to look up the model's class name through * `DS.Store`'s modelFor method. @@ -577,7 +577,7 @@ declare module 'ember-data' { * invoking the callback with the name of each relationship and its relationship * descriptor. */ - static eachRelationship(callback: Function, binding: any): any; + static eachRelationship(callback: (name: string, details: RelationshipMeta) => void, binding?: any): any; /** * Given a callback, iterates over each of the types related to a model, * invoking the callback with the related type's class. Each type will be diff --git a/types/ember-data/test/relationships.ts b/types/ember-data/test/relationships.ts index df43387bb4..06795c0e26 100644 --- a/types/ember-data/test/relationships.ts +++ b/types/ember-data/test/relationships.ts @@ -12,6 +12,20 @@ const Polymorphic = DS.Model.extend({ paymentMethods: DS.hasMany('payment-method', { polymorphic: true }) }); +Polymorphic.eachRelationship(() => ''); +Polymorphic.eachRelationship(() => '', {}); +Polymorphic.eachRelationship((n, meta) => { + let s: string = n; + let m: 'belongsTo' | 'hasMany' = meta.kind; +}); +let p = Polymorphic.create(); +p.eachRelationship(() => ''); +p.eachRelationship(() => '', {}); +p.eachRelationship((n, meta) => { + let s: string = n; + let m: 'belongsTo' | 'hasMany' = meta.kind; +}); + class Comment extends DS.Model { author = DS.attr('string'); } diff --git a/types/ember-qunit/ember-qunit-tests.ts b/types/ember-qunit/ember-qunit-tests.ts index 6ddb4e5454..acd9650f98 100644 --- a/types/ember-qunit/ember-qunit-tests.ts +++ b/types/ember-qunit/ember-qunit-tests.ts @@ -2,6 +2,7 @@ import Ember from 'ember'; import hbs from 'htmlbars-inline-precompile'; import { module } from 'qunit'; import { + start, test, skip, moduleFor, @@ -137,3 +138,5 @@ module('x-foo', function(hooks) { module('foo service', function(hooks) { setupTest(hooks); }); + +start(); diff --git a/types/ember-qunit/index.d.ts b/types/ember-qunit/index.d.ts index 9dc93b980b..5dbfb49401 100644 --- a/types/ember-qunit/index.d.ts +++ b/types/ember-qunit/index.d.ts @@ -97,6 +97,48 @@ declare module 'ember-qunit' { export class QUnitAdapter extends Ember.Test.Adapter { } export { module, test, skip, only, todo } from 'qunit'; + + interface QUnitStartOptions { + /** + * If `false` tests will not be loaded automatically. + */ + loadTests?: boolean; + + /** + * If `false` the test container will not be setup based on `devmode`, + * `dockcontainer`, or `nocontainer` URL params. + */ + setupTestContainer?: boolean; + + /** + * If `false` tests will not be automatically started (you must run + * `QUnit.start()` to kick them off). + */ + startTests?: boolean; + + /** + * If `false` the default Ember.Test adapter will not be updated. + */ + setupTestAdapter?: boolean; + + /** + * `false` opts out of the default behavior of setting `Ember.testing` + * to `true` before all tests and back to `false` after each test will. + */ + setupEmberTesting?: boolean; + + /** + * If `false` validation of `Ember.onerror` will be disabled. + */ + setupEmberOnerrorValidation?: boolean; + + /** + * If `false` test isolation validation will be disabled. + */ + setupTestIsolationValidatoin?: boolean; + } + + export function start(options?: QUnitStartOptions): void; } declare module 'qunit' { diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index 29940fc201..a15987ae83 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -7,6 +7,7 @@ // Theron Cross // Martin Feckie // Alex LaFroscia +// Mike North // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -1498,25 +1499,25 @@ declare module 'ember' { __ember_mixin__: never; static create( - args?: T & ThisType> + args?: MixinOrLiteral & ThisType> ): Mixin; static create( - arg1: T1 & ThisType>, - arg2: T2 & ThisType> + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType> ): Mixin; static create( - arg1: T1 & ThisType>, - arg2: T2 & ThisType>, - arg3: T3 & ThisType> + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType>, + arg3: MixinOrLiteral & ThisType> ): Mixin; static create( - arg1: T1 & ThisType>, - arg2: T2 & ThisType>, - arg3: T3 & ThisType>, - arg4: T4 & ThisType> + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType>, + arg3: MixinOrLiteral & ThisType>, + arg4: MixinOrLiteral & ThisType> ): Mixin; } /** @@ -1990,6 +1991,19 @@ declare module 'ember' { */ transitionTo(name: string, ...object: any[]): Transition; + // https://emberjs.com/api/ember/3.2/classes/Route/methods/intermediateTransitionTo?anchor=intermediateTransitionTo + /** + * Perform a synchronous transition into another route without attempting to resolve promises, + * update the URL, or abort any currently active asynchronous transitions + * (i.e. regular transitions caused by transitionTo or URL changes). + * + * @param name the name of the route or a URL + * @param object the model(s) or identifier(s) to be used while + * transitioning to the route. + * @returns the Transition object associated with this attempted transition + */ + intermediateTransitionTo(name: string, ...object: any[]): Transition; + // properties /** * The controller associated with this route. diff --git a/types/ember/test/mixin.ts b/types/ember/test/mixin.ts index 2c417c00da..a89f490a11 100755 --- a/types/ember/test/mixin.ts +++ b/types/ember/test/mixin.ts @@ -44,3 +44,14 @@ const obj = LiteralMixins.create(); assertType(obj.a); assertType(obj.b); assertType(obj.c); + +/* Test composition of mixins */ +const EditableAndCancelableMixin = Ember.Mixin.create(EditableMixin, { + cancelled: false, +}); + +const EditableAndCancelableComment = Ember.Route.extend(EditableAndCancelableMixin); + +const editableAndCancelable = EditableAndCancelableComment.create(); +assertType(editableAndCancelable.isEditing); +assertType(editableAndCancelable.cancelled); diff --git a/types/ember/test/route.ts b/types/ember/test/route.ts index fad5bbc634..84e432dbd3 100755 --- a/types/ember/test/route.ts +++ b/types/ember/test/route.ts @@ -92,4 +92,13 @@ class RouteUsingClass extends Route.extend({ beforeModel(this: RouteUsingClass) { return 'beforeModel can return anything, not just promises'; } + intermediateTransitionWithoutModel() { + this.intermediateTransitionTo('some-route'); + } + intermediateTransitionWithModel() { + this.intermediateTransitionTo('some.other.route', { }); + } + intermediateTransitionWithMultiModel() { + this.intermediateTransitionTo('some.other.route', 1, 2, { }); + } } diff --git a/types/ember/test/router.ts b/types/ember/test/router.ts index c663083679..ff5f4c554f 100755 --- a/types/ember/test/router.ts +++ b/types/ember/test/router.ts @@ -34,6 +34,11 @@ const RouterServiceConsumer = Ember.Service.extend({ Ember.get(this, 'router') .transitionTo('some.other.route', model); }, + transitionWithMultiModel() { + const model = Ember.Object.create(); + Ember.get(this, 'router') + .transitionTo('some.other.route', model, model); + }, transitionWithModelAndOptions() { const model = Ember.Object.create(); Ember.get(this, 'router') diff --git a/types/ember__test-helpers/ember__test-helpers-tests.ts b/types/ember__test-helpers/ember__test-helpers-tests.ts new file mode 100644 index 0000000000..9fe9e4c297 --- /dev/null +++ b/types/ember__test-helpers/ember__test-helpers-tests.ts @@ -0,0 +1,95 @@ +/// + +import { test } from 'qunit'; +import Application from '@ember/application'; +import hbs from 'htmlbars-inline-precompile'; +import { + click, + doubleClick, + tap, + focus, + blur, + triggerEvent, + triggerKeyEvent, + fillIn, + render, + find, + findAll, + getRootElement, + pauseTest, + resumeTest, + waitFor, + waitUntil, + settled, + isSettled, + getSettledState, + visit, + currentURL, + currentRouteName, + setApplication +} from '@ember/test-helpers'; + +const MyApp = Application.extend({ modulePrefix: 'my-app' }); + +setApplication(MyApp.create()); + +test('DOM interactions', async () => { + await render(hbs`
Hello, world
`); + + await click('.message'); + await doubleClick('.message'); + await tap('.message'); + await focus('.message'); + await blur('.message'); + await triggerEvent('.message', 'custom-event'); + await triggerKeyEvent('.message', 'keydown', 'Enter', { ctrlKey: true }); + await fillIn('.message', 'content'); + + const messageElement = find('.message')!; + await click(messageElement); + await doubleClick(messageElement); + await tap(messageElement); + await focus(messageElement); + await blur(messageElement); + await triggerEvent(messageElement, 'custom-event'); + await triggerKeyEvent(messageElement, 'keydown', 'Enter', { ctrlKey: true }); + await fillIn(messageElement, 'content'); + + const allMessages = findAll('.message'); + for (const element of allMessages) { + await click(element); + } + + const root = getRootElement(); + await click(root); +}); + +test('routing helpers', async (assert) => { + await visit('/foo'); + + assert.equal(currentURL(), '/foo'); + assert.equal(currentRouteName(), 'foo'); +}); + +test('pause and resume', async () => { + await pauseTest(); + setTimeout(resumeTest, 1000); +}); + +test('wait helpers', async (assert) => { + await render(hbs`
Hello
`); + + await waitFor('.message', { count: 1, timeout: 10, timeoutMessage: 'uh oh' }); + await waitUntil(() => 'hello', { timeout: 1000, timeoutMessage: 'boom' }); + + await settled(); + assert.ok(isSettled()); + + const { + hasPendingRequests, + hasPendingTimers, + hasPendingWaiters, + hasRunLoop, + pendingRequestCount + } = getSettledState(); +}); diff --git a/types/ember__test-helpers/index.d.ts b/types/ember__test-helpers/index.d.ts new file mode 100644 index 0000000000..067222b425 --- /dev/null +++ b/types/ember__test-helpers/index.d.ts @@ -0,0 +1,220 @@ +// Type definitions for @ember/test-helpers 0.7 +// Project: https://github.com/emberjs/ember-test-helpers +// Definitions by: Dan Freeman +// James C. Davis +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/// + +declare module '@ember/test-helpers' { + // DOM Interaction Helpers + + export type Target = string | Element; + + export { default as click } from '@ember/test-helpers/dom/click'; + export { default as doubleClick } from '@ember/test-helpers/dom/double-click'; + export { default as tap } from '@ember/test-helpers/dom/tap'; + export { default as focus } from '@ember/test-helpers/dom/focus'; + export { default as blur } from '@ember/test-helpers/dom/blur'; + 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'; + + // DOM Query Helpers + + export { default as find } from '@ember/test-helpers/dom/find'; + export { default as findAll } from '@ember/test-helpers/dom/find-all'; + export { default as getRootElement } from '@ember/test-helpers/dom/get-root-element'; + + // Routing Helpers + + export { visit, currentRouteName, currentURL } from '@ember/test-helpers/setup-application-context'; + + // Rendering Helpers + + export { render, clearRender } from '@ember/test-helpers/setup-rendering-context'; + + // Wait Helpers + + export { default as waitFor } from '@ember/test-helpers/dom/wait-for'; + export { default as waitUntil } from '@ember/test-helpers/wait-until'; + export { default as settled, isSettled, getSettledState } from '@ember/test-helpers/settled'; + + // Pause Helpers + + export { pauseTest, resumeTest } from '@ember/test-helpers/setup-context'; + + // Test Framework APIs + + export { setResolver, getResolver } from '@ember/test-helpers/resolver'; + export { default as setupContext, getContext, setContext, unsetContext } from '@ember/test-helpers/setup-context'; + export { default as teardownContext } from '@ember/test-helpers/teardown-context'; + export { default as setupRenderingContext } from '@ember/test-helpers/setup-rendering-context'; + export { default as teardownRenderingContext } from '@ember/test-helpers/teardown-rendering-context'; + export { getApplication, setApplication } from '@ember/test-helpers/application'; + export { default as setupApplicationContext } from '@ember/test-helpers/setup-application-context'; + export { default as teardownApplicationContext } from '@ember/test-helpers/teardown-application-context'; + export { default as validateErrorHandler } from '@ember/test-helpers/validate-error-handler'; +} + +declare module '@ember/test-helpers/dom/click' { + import { Target } from '@ember/test-helpers'; + + export default function(target: Target): Promise; +} + +declare module '@ember/test-helpers/dom/double-click' { + import { Target } from '@ember/test-helpers'; + + export default function(target: Target): Promise; +} + +declare module '@ember/test-helpers/dom/tap' { + import { Target } from '@ember/test-helpers'; + + export default function(target: Target): Promise; +} + +declare module '@ember/test-helpers/dom/focus' { + import { Target } from '@ember/test-helpers'; + + export default function(target: Target): Promise; +} + +declare module '@ember/test-helpers/dom/blur' { + import { Target } from '@ember/test-helpers'; + + export default function(target: Target): Promise; +} + +declare module '@ember/test-helpers/dom/trigger-event' { + import { Target } from '@ember/test-helpers'; + + export default function(target: Target, eventType: string, options?: object): Promise; +} + +declare module '@ember/test-helpers/dom/trigger-key-event' { + import { Target } from '@ember/test-helpers'; + + export type KeyEvent = 'keydown' | 'keyup' | 'keypress'; + + export interface KeyModifiers { + ctrlKey?: boolean; + altKey?: boolean; + shiftKey?: boolean; + metaKey?: boolean; + } + + export default function(target: Target, eventType: KeyEvent, key: number | string, modifiers?: KeyModifiers): Promise; +} + +declare module '@ember/test-helpers/dom/fill-in' { + import { Target } from '@ember/test-helpers'; + + export default function(target: Target, text: string): Promise; +} + +declare module '@ember/test-helpers/dom/find' { + export default function(selector: string): Element | null; +} + +declare module '@ember/test-helpers/dom/find-all' { + export default function(selector: string): Element[]; +} + +declare module '@ember/test-helpers/dom/get-root-element' { + export default function(): Element; +} + +declare module '@ember/test-helpers/setup-application-context' { + export default function(context: Context): Promise; + export function visit(url: string): Promise; + export function currentRouteName(): string; + export function currentURL(): string; +} + +declare module '@ember/test-helpers/setup-rendering-context' { + import { TemplateFactory } from 'htmlbars-inline-precompile'; + + export default function(context: Context): Promise; + export function render(template: TemplateFactory): Promise; + export function clearRender(): Promise; +} + +declare module '@ember/test-helpers/dom/wait-for' { + export interface Options { + timeout?: number; + count?: number; + timeoutMessage?: string; + } + + export default function(selector: string, options?: Options): Promise; +} + +declare module '@ember/test-helpers/wait-until' { + export interface Options { + timeout?: number; + timeoutMessage?: string; + } + + export default function(callback: () => T, options?: Options): Promise; +} + +declare module '@ember/test-helpers/settled' { + export interface SettledState { + hasRunLoop: boolean; + hasPendingTimers: boolean; + hasPendingWaiters: boolean; + hasPendingRequests: boolean; + pendingRequestCount: number; + } + + export default function(): Promise; + export function isSettled(): boolean; + export function getSettledState(): SettledState; +} + +declare module '@ember/test-helpers/setup-context' { + import Resolver from '@ember/application/resolver'; + + export default function(context: C, options?: { resolver?: Resolver }): Promise; + export function getContext(): object; + export function setContext(context: object): void; + export function unsetContext(): void; + + export function pauseTest(): Promise; + export function resumeTest(): void; +} + +declare module '@ember/test-helpers/resolver' { + import Resolver from '@ember/application/resolver'; + + export function setResolver(resolver: Resolver): void; + export function getResolver(): Resolver; +} + +declare module '@ember/test-helpers/teardown-context' { + export default function(context: object): Promise; +} + +declare module '@ember/test-helpers/teardown-rendering-context' { + export default function(context: object): Promise; +} + +declare module '@ember/test-helpers/teardown-application-context' { + export default function(context: object): Promise; +} + +declare module '@ember/test-helpers/validate-error-handler' { + import Error from '@ember/error'; + + export default function(callback?: (error: Error) => void): { isValid: boolean, message: string }; +} + +declare module '@ember/test-helpers/application' { + import Application from '@ember/application'; + + export function getApplication(): Application; + export function setApplication(application: Application): void; +} diff --git a/types/ember__test-helpers/tsconfig.json b/types/ember__test-helpers/tsconfig.json new file mode 100644 index 0000000000..de0efdd984 --- /dev/null +++ b/types/ember__test-helpers/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "@ember/test-helpers": ["ember__test-helpers"] + } + }, + "files": [ + "index.d.ts", + "ember__test-helpers-tests.ts" + ] +} diff --git a/types/ember__test-helpers/tslint.json b/types/ember__test-helpers/tslint.json new file mode 100644 index 0000000000..4c4fc86ace --- /dev/null +++ b/types/ember__test-helpers/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "strict-export-declare-modifiers": false + } +} diff --git a/types/enhanced-resolve/index.d.ts b/types/enhanced-resolve/index.d.ts index 1cf3a3397a..0a82a4263e 100644 --- a/types/enhanced-resolve/index.d.ts +++ b/types/enhanced-resolve/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for enhanced-resolve v3.0.0 // Project: https://github.com/webpack/enhanced-resolve.git -// Definitions by: e-cloud , Onigoetz +// Definitions by: e-cloud +// Onigoetz +// John Reilly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 diff --git a/types/enzyme/enzyme-tests.tsx b/types/enzyme/enzyme-tests.tsx index b97711edec..e1762b843e 100644 --- a/types/enzyme/enzyme-tests.tsx +++ b/types/enzyme/enzyme-tests.tsx @@ -86,6 +86,34 @@ function ShallowWrapperTest() { let anotherStatelessWrapper: ShallowWrapper; let anotherComponentWrapper: ShallowWrapper; + // testStatePropsInstanceFn(shallow()); + function testStatePropsInstance() { + const wrapper = shallow(); + + const { + numberProp, // $ExpectType number + stringProp // $ExpectType string + } = wrapper.props(); + const { + stateProperty // $ExpectType string + } = wrapper.state(); + const { + handleEcho // $ExpectType (value: string) => string + } = wrapper.instance(); + + // $ExpectError + wrapper.setState({stateProperty: 123}); + // $ExpectError + wrapper.setState({statePropertyzasd: 'hello'}); + wrapper.setState({stateProperty: 'hello'}); + + // $ExpectError + wrapper.setProps({numberProp: '123'}); + // $ExpectError + wrapper.setProps({numberPropzasd: 'hello'}); + wrapper.setProps({numberProp: 123}); + } + function test_props_state_inferring() { let wrapper: ShallowWrapper; wrapper = shallow(); @@ -455,6 +483,33 @@ function ReactWrapperTest() { let anotherStatelessWrapper: ReactWrapper; let anotherComponentWrapper: ReactWrapper; + function testStatePropsInstance() { + const wrapper = mount(); + + const { + numberProp, // $ExpectType number + stringProp // $ExpectType string + } = wrapper.props(); + const { + stateProperty // $ExpectType string + } = wrapper.state(); + const { + handleEcho // $ExpectType (value: string) => string + } = wrapper.instance(); + + // $ExpectError + wrapper.setState({stateProperty: 123}); + // $ExpectError + wrapper.setState({statePropertyzasd: 'hello'}); + wrapper.setState({stateProperty: 'hello'}); + + // $ExpectError + wrapper.setProps({numberProp: '123'}); + // $ExpectError + wrapper.setProps({numberPropzasd: 'hello'}); + wrapper.setProps({numberProp: 123}); + } + function test_prop_state_inferring() { let wrapper: ReactWrapper; wrapper = mount(); diff --git a/types/enzyme/index.d.ts b/types/enzyme/index.d.ts index f8dc9e9406..7327f69511 100644 --- a/types/enzyme/index.d.ts +++ b/types/enzyme/index.d.ts @@ -589,14 +589,14 @@ export interface MountRendererProps { * Shallow rendering is useful to constrain yourself to testing a component as a unit, and to ensure that * your tests aren't indirectly asserting on behavior of child components. */ -export function shallow(node: ReactElement

, options?: ShallowRendererProps): ShallowWrapper; +export function shallow(node: ReactElement

, options?: ShallowRendererProps): ShallowWrapper; export function shallow

(node: ReactElement

, options?: ShallowRendererProps): ShallowWrapper; export function shallow(node: ReactElement

, options?: ShallowRendererProps): ShallowWrapper; /** * Mounts and renders a react component into the document and provides a testing wrapper around it. */ -export function mount(node: ReactElement

, options?: MountRendererProps): ReactWrapper; +export function mount(node: ReactElement

, options?: MountRendererProps): ReactWrapper; export function mount

(node: ReactElement

, options?: MountRendererProps): ReactWrapper; export function mount(node: ReactElement

, options?: MountRendererProps): ReactWrapper; diff --git a/types/epilogue/index.d.ts b/types/epilogue/index.d.ts index 3fe56b9e9f..e54f127d9e 100644 --- a/types/epilogue/index.d.ts +++ b/types/epilogue/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/dchester/epilogue // Definitions by: Satana Charuwichitratana // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.8 import { Sequelize, diff --git a/types/eslint/eslint-tests.ts b/types/eslint/eslint-tests.ts index 6a81d69c8a..b0c3c1966d 100644 --- a/types/eslint/eslint-tests.ts +++ b/types/eslint/eslint-tests.ts @@ -446,6 +446,7 @@ let cli: CLIEngine; cli = new CLIEngine({ allowInlineConfig: false }); cli = new CLIEngine({ baseConfig: false }); +cli = new CLIEngine({ baseConfig: { extends: ['lynt'] }}); cli = new CLIEngine({ cache: true }); cli = new CLIEngine({ cacheFile: 'foo' }); cli = new CLIEngine({ configFile: 'foo' }); diff --git a/types/eslint/index.d.ts b/types/eslint/index.d.ts index 89067f97c8..031ab984f7 100644 --- a/types/eslint/index.d.ts +++ b/types/eslint/index.d.ts @@ -483,7 +483,7 @@ export class CLIEngine { export namespace CLIEngine { class Options { allowInlineConfig?: boolean; - baseConfig?: boolean; + baseConfig?: false | { [name: string]: any }; cache?: boolean; cacheFile?: string; cacheLocation?: string; diff --git a/types/exceljs/exceljs-tests.ts b/types/exceljs/exceljs-tests.ts index 684fad8719..0f5504fef0 100644 --- a/types/exceljs/exceljs-tests.ts +++ b/types/exceljs/exceljs-tests.ts @@ -1,7 +1,6 @@ import * as Excel from 'exceljs'; import * as stream from 'stream'; import * as fs from 'fs'; -import * as Bluebird from 'bluebird'; // most examples taken and adapted from README.md @@ -464,4 +463,4 @@ worksheet.commit(); workbook.commit().then(() => null); -Excel.config.setValue('promise', Bluebird); +Excel.config.setValue('promise', Promise); diff --git a/types/expect-puppeteer/expect-puppeteer-tests.ts b/types/expect-puppeteer/expect-puppeteer-tests.ts index 4ad0ce1f3c..4c646da1d9 100644 --- a/types/expect-puppeteer/expect-puppeteer-tests.ts +++ b/types/expect-puppeteer/expect-puppeteer-tests.ts @@ -5,7 +5,8 @@ const testGlobal = async (instance: ElementHandle | Page) => { await expect(instance).toClick("selector", { polling: "mutation", text: "text" }); await expect(instance).toClick("selector", { polling: "raf", timeout: 777 }); - await expect(instance).toDisplayDialog(async () => {}); + const dialog = await expect(instance).toDisplayDialog(async () => {}); + console.log(dialog.message()); await expect(instance).toFill("selector", "value"); await expect(instance).toFill("selector", "value", { polling: 777 }); diff --git a/types/expect-puppeteer/index.d.ts b/types/expect-puppeteer/index.d.ts index 24675ee695..7c216f4259 100644 --- a/types/expect-puppeteer/index.d.ts +++ b/types/expect-puppeteer/index.d.ts @@ -1,12 +1,13 @@ // Type definitions for expect-puppeteer 2.2 // Project: https://github.com/smooth-code/jest-puppeteer/tree/master/packages/expect-puppeteer // Definitions by: Josh Goldberg +// Tanguy Krotoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 /// -import { ElementHandle, Page } from "puppeteer"; +import { ElementHandle, Page, Dialog } from "puppeteer"; /** * Interval at which pageFunctions may be executed. @@ -39,7 +40,7 @@ interface ExpectPuppeteer { // These must all match the ExpectPuppeteer interface above. // We can't extend from it directly because some method names conflict in type-incompatible ways. toClick(selector: string, options?: ExpectToClickOptions): Promise; - toDisplayDialog(block: () => Promise): Promise; + toDisplayDialog(block: () => Promise): Promise

; toFill(selector: string, value: string, options?: ExpectTimingActions): Promise; toMatch(selector: string, options?: ExpectTimingActions): Promise; toMatchElement(selector: string, options?: ExpectToClickOptions): Promise; @@ -54,7 +55,7 @@ declare global { // These must all match the ExpectPuppeteer interface above. // We can't extend from it directly because some method names conflict in type-incompatible ways. toClick(selector: string, options?: ExpectToClickOptions): Promise; - toDisplayDialog(block: () => Promise): Promise; + toDisplayDialog(block: () => Promise): Promise; toFill(selector: string, value: string, options?: ExpectTimingActions): Promise; toMatch(selector: string, options?: ExpectTimingActions): Promise; toMatchElement(selector: string, options?: ExpectToClickOptions): Promise; diff --git a/types/expo/expo-tests.tsx b/types/expo/expo-tests.tsx index fa329ea8e3..210c3400a9 100644 --- a/types/expo/expo-tests.tsx +++ b/types/expo/expo-tests.tsx @@ -25,6 +25,7 @@ import { ImagePicker, ImageManipulator, FaceDetector, + Linking, Svg, IntentLauncherAndroid, KeepAwake, @@ -373,9 +374,9 @@ async () => { }; async () => { - const result = await ImageManipulator.manipulate('url', { + const result = await ImageManipulator.manipulate('url', [{ rotate: 90 - }, { + }], { compress: 0.75 }); @@ -400,6 +401,38 @@ async () => { result.faces[0]; }; +async () => { + function isBoolean(x: boolean) { + } + function isString(x: string) { + } + // Two examples of members inherited from react-native Linking + // to prove that inheritence is working. + Linking.addEventListener('url', (e) => { + e.url === ''; + }); + isBoolean(await Linking.canOpenURL('expo://')); + + // Extensions added by expo. + + isString(Linking.makeUrl('path')); + isString(Linking.makeUrl('path', { q: 2, u: 'ery', })); + + const { + path, + queryParams, + } = Linking.parse(''); + isString(path); + isString(queryParams['x'] || ''); + + const { + path: path2, + queryParams: queryParams2, + } = await Linking.parseInitialURLAsync(); + isString(path2); + isString(queryParams2['y'] || ''); +}; + () => ( // Michael Prokopchuk // Tina Roh +// Nathan Phillip Brink // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -18,6 +19,7 @@ import { ColorPropType, ImageRequireSource, ImageURISource, + LinkingStatic as ReactNativeLinkingStatic, NativeEventEmitter, ViewProps, ViewStyle, @@ -36,6 +38,7 @@ export type ResizeModeStretch = 'stretch'; export type URISource = ImageURISource; export interface HashMap { [key: string]: any; } +export interface StringHashMap { [key: string]: string; } /** Access the device accelerometer sensor(s) to respond to changes in acceleration in 3d space. */ export namespace Accelerometer { @@ -1513,6 +1516,27 @@ export namespace Gyroscope { * ImageManipulator */ export namespace ImageManipulator { + type Action = Resize | Rotate | Flip | Crop; + + interface Resize { + resize: { width: number, height: number }; + } + + interface Rotate { + rotate: number; + } + + interface Flip { + flip?: { vertical?: boolean; horizontal?: boolean }; + } + + interface Crop { + originX: number; + originY: number; + width: number; + height: number; + } + interface ImageResult { uri: string; width: number; @@ -1527,21 +1551,7 @@ export namespace ImageManipulator { format?: 'jpeg' | 'png'; } - interface CropParameters { - originX: number; - originY: number; - width: number; - height: number; - } - - interface ImageManipulationOptions { - resize?: { width?: number; height?: number }; - rotate?: number; - flip?: { vertical?: boolean; horizontal?: boolean }; - crop?: CropParameters; - } - - function manipulate(uri: string, actions: ImageManipulationOptions, saveOptions?: SaveOptions): Promise; + function manipulate(uri: string, actions: Action[], saveOptions?: SaveOptions): Promise; } /** @@ -1705,6 +1715,21 @@ export interface LinearGradientProps { export class LinearGradient extends Component { } // #endregion +/** + * Linking + */ +export interface LinkInfo { + path: string; + queryParams: Partial; +} + +export interface LinkingStatic extends ReactNativeLinkingStatic { + makeUrl(path: string, queryParams?: HashMap): string; + parse(url: string): LinkInfo; + parseInitialURLAsync(): Promise; +} +export const Linking: LinkingStatic; + /** * Location */ diff --git a/types/express-winston/express-winston-tests.ts b/types/express-winston/express-winston-tests.ts index 5671160de0..57b93c14f8 100644 --- a/types/express-winston/express-winston-tests.ts +++ b/types/express-winston/express-winston-tests.ts @@ -23,20 +23,14 @@ app.use(expressWinston.logger({ skip: (req, res) => false, statusLevels: ({ error: 'error', success: 'success', warn: 'warn' }), transports: [ - new winston.transports.Console({ - json: true, - colorize: true - }) + new winston.transports.Console({}) ] })); // Logger with minimum options (transport) app.use(expressWinston.logger({ transports: [ - new winston.transports.Console({ - json: true, - colorize: true - }) + new winston.transports.Console({}) ], })); @@ -55,20 +49,14 @@ app.use(expressWinston.errorLogger({ requestFilter: (req, prop) => true, requestWhitelist: ['foo', 'bar'], transports: [ - new winston.transports.Console({ - json: true, - colorize: true - }) + new winston.transports.Console({}) ] })); // Error Logger with min options (transports) app.use(expressWinston.errorLogger({ transports: [ - new winston.transports.Console({ - json: true, - colorize: true - }) + new winston.transports.Console({}) ], })); diff --git a/types/express-winston/index.d.ts b/types/express-winston/index.d.ts index e6184f64b9..a691000dd8 100644 --- a/types/express-winston/index.d.ts +++ b/types/express-winston/index.d.ts @@ -5,7 +5,8 @@ // TypeScript Version: 2.2 import { ErrorRequestHandler, Handler, Request, Response } from 'express'; -import { TransportInstance, Winston } from 'winston'; +import * as winston from 'winston'; +import * as Transport from 'winston-transport'; export type DynamicMetaFunction = (req: Request, res: Response, err: Error) => object; export type DynamicLevelFunction = (req: Request, res: Response, err: Error) => string; @@ -39,11 +40,11 @@ export interface BaseLoggerOptions { } export interface LoggerOptionsWithTransports extends BaseLoggerOptions { - transports: TransportInstance[]; + transports: Transport[]; } export interface LoggerOptionsWithWinstonInstance extends BaseLoggerOptions { - winstonInstance: Winston; + winstonInstance: typeof winston; } export type LoggerOptions = LoggerOptionsWithTransports | LoggerOptionsWithWinstonInstance; @@ -61,11 +62,11 @@ export interface BaseErrorLoggerOptions { } export interface ErrorLoggerOptionsWithTransports extends BaseErrorLoggerOptions { - transports: TransportInstance[]; + transports: Transport[]; } export interface ErrorLoggerOptionsWithWinstonInstance extends BaseErrorLoggerOptions { - winstonInstance: Winston; + winstonInstance: typeof winston; } export type ErrorLoggerOptions = ErrorLoggerOptionsWithTransports | ErrorLoggerOptionsWithWinstonInstance; diff --git a/types/express-winston/package.json b/types/express-winston/package.json new file mode 100644 index 0000000000..0aa4cf368f --- /dev/null +++ b/types/express-winston/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "winston": "^3.0.0" + } +} diff --git a/types/fabric/fabric-impl.d.ts b/types/fabric/fabric-impl.d.ts index 07c1227706..9163569fff 100644 --- a/types/fabric/fabric-impl.d.ts +++ b/types/fabric/fabric-impl.d.ts @@ -851,6 +851,12 @@ interface IStaticCanvasOptions { * Indicates whether the browser can be scrolled when using a touchscreen and dragging on the canvas */ allowTouchScrolling?: boolean; + + /** + * When true, canvas is scaled by devicePixelRatio for better rendering on retina screens + */ + enableRetinaScaling?: boolean; + /** * Indicates whether this canvas will use image smoothing, this is on by default in browsers */ @@ -1867,7 +1873,7 @@ export class Image { * @param [callback] Callback to invoke when image is created (newly created image is passed as a first argument) * @param [imgOptions] Options object */ - static fromURL(url: string, callback?: (image: Image) => void, objObjects?: IObjectOptions): Image; + static fromURL(url: string, callback?: (image: Image) => void, imgOptions?: IImageOptions): Image; /** * Creates an instance of fabric.Image from its object representation * @param object Object to create an instance from diff --git a/types/facebook-js-sdk/index.d.ts b/types/facebook-js-sdk/index.d.ts index 69f7fbb08d..8a635d8995 100644 --- a/types/facebook-js-sdk/index.d.ts +++ b/types/facebook-js-sdk/index.d.ts @@ -189,6 +189,7 @@ declare namespace facebook { expiresIn: number; signedRequest: string; userID: string; + grantedScopes?: string; } interface StatusResponse { diff --git a/types/find-parent-dir/find-parent-dir-tests.ts b/types/find-parent-dir/find-parent-dir-tests.ts new file mode 100644 index 0000000000..31b3307377 --- /dev/null +++ b/types/find-parent-dir/find-parent-dir-tests.ts @@ -0,0 +1,19 @@ +/// + +import findParentDir = require("find-parent-dir"); + +let parentDir: string | null; + +findParentDir(__dirname, ".git", (err, dir) => { + if (err) { + console.error("error", err); + } else { + parentDir = dir; + } +}); + +try { + parentDir = findParentDir.sync(__dirname, ".git"); +} catch (err) { + console.error("error", err); +} diff --git a/types/find-parent-dir/index.d.ts b/types/find-parent-dir/index.d.ts new file mode 100644 index 0000000000..0302255198 --- /dev/null +++ b/types/find-parent-dir/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for find-parent-dir 0.3 +// Project: https://github.com/thlorenz/find-parent-dir +// Definitions by: Ika +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Finds the first parent directory that contains a given file or directory. + */ +declare function findParentDir( + currentFullPath: string, + clue: string, + cb: (err: any, dir: string | null) => void +): void; + +declare namespace findParentDir { + function sync(currentFullPath: string, clue: string): string | null; +} + +export = findParentDir; diff --git a/types/find-parent-dir/tsconfig.json b/types/find-parent-dir/tsconfig.json new file mode 100644 index 0000000000..83c817d86c --- /dev/null +++ b/types/find-parent-dir/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": ["index.d.ts", "find-parent-dir-tests.ts"] +} diff --git a/types/find-parent-dir/tslint.json b/types/find-parent-dir/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/find-parent-dir/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/find-project-root/find-project-root-tests.ts b/types/find-project-root/find-project-root-tests.ts new file mode 100644 index 0000000000..b77d7846d0 --- /dev/null +++ b/types/find-project-root/find-project-root-tests.ts @@ -0,0 +1,7 @@ +/// + +import findProjectRoot = require("find-project-root"); + +const root: string | null = findProjectRoot(process.cwd(), { + maxDepth: 12 +}); diff --git a/types/find-project-root/index.d.ts b/types/find-project-root/index.d.ts new file mode 100644 index 0000000000..a541c1f982 --- /dev/null +++ b/types/find-project-root/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for find-project-root 1.1 +// Project: https://github.com/kirstein/find-project-root +// Definitions by: Ika +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Finds the project root by custom markers + */ +declare function findProjectRoot( + path: string, + options?: findProjectRoot.Options +): null | string; + +declare namespace findProjectRoot { + interface Options { + /** + * total number of levels the algorithm can traverse + */ + maxDepth?: number; + /** + * markers that it will search for + */ + markers?: string[]; + } +} + +export = findProjectRoot; diff --git a/types/find-project-root/tsconfig.json b/types/find-project-root/tsconfig.json new file mode 100644 index 0000000000..1e727f9025 --- /dev/null +++ b/types/find-project-root/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": ["index.d.ts", "find-project-root-tests.ts"] +} diff --git a/types/find-project-root/tslint.json b/types/find-project-root/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/find-project-root/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/fs-extra-promise/index.d.ts b/types/fs-extra-promise/index.d.ts index a7222b9d5d..c2c12f6d28 100644 --- a/types/fs-extra-promise/index.d.ts +++ b/types/fs-extra-promise/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/overlookmotel/fs-extra-promise // Definitions by: midknight41 , Jason Swearingen , Hiromi Shikata // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/fs-extra/index.d.ts b/types/fs-extra/index.d.ts index 153b285ae1..c5eddbf416 100644 --- a/types/fs-extra/index.d.ts +++ b/types/fs-extra/index.d.ts @@ -207,9 +207,9 @@ export function rmdir(path: string | Buffer): Promise; export function stat(path: string | Buffer, callback: (err: NodeJS.ErrnoException, stats: Stats) => any): void; export function stat(path: string | Buffer): Promise; -export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type: fs.symlink.Type | undefined, callback: (err: NodeJS.ErrnoException) => void): void; +export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type: FsSymlinkType | undefined, callback: (err: NodeJS.ErrnoException) => void): void; export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, callback: (err: NodeJS.ErrnoException) => void): void; -export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type?: fs.symlink.Type): Promise; +export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type?: FsSymlinkType): Promise; export function truncate(path: string | Buffer, callback: (err: NodeJS.ErrnoException) => void): void; export function truncate(path: string | Buffer, len: number, callback: (err: NodeJS.ErrnoException) => void): void; @@ -261,6 +261,7 @@ export type CopyFilterSync = (src: string, dest: string) => boolean; export type CopyFilterAsync = (src: string, dest: string) => Promise; export type SymlinkType = "dir" | "file"; +export type FsSymlinkType = "dir" | "file" | "junction"; export interface CopyOptions { dereference?: boolean; diff --git a/types/generic-pool/generic-pool-tests.ts b/types/generic-pool/generic-pool-tests.ts index 9cc8707c86..6cf0292709 100644 --- a/types/generic-pool/generic-pool-tests.ts +++ b/types/generic-pool/generic-pool-tests.ts @@ -11,8 +11,8 @@ const factory = { resolve(conn); }); }, - destroy: (conn: Connection): Promise => { - return new Promise(resolve => { + destroy: (conn: Connection): Promise => { + return new Promise(resolve => { conn.connected = false; resolve(); }); @@ -53,7 +53,7 @@ pool.acquire() return pool.destroy(conn); }).then(() => { return pool.clear(); - }).then((results: undefined[]) => { + }).then(() => { }); pool.on('factoryCreateError', (err: Error) => { diff --git a/types/generic-pool/index.d.ts b/types/generic-pool/index.d.ts index bcfbb907e1..8cae9ce37c 100644 --- a/types/generic-pool/index.d.ts +++ b/types/generic-pool/index.d.ts @@ -20,14 +20,14 @@ export class Pool extends EventEmitter { acquire(priority?: number): PromiseLike; release(resource: T): void; destroy(resource: T): void; - drain(): PromiseLike; - clear(): PromiseLike; + drain(): PromiseLike; + clear(): PromiseLike; use(cb: (resource: T) => U): PromiseLike; } export interface Factory { create(): PromiseLike; - destroy(client: T): PromiseLike; + destroy(client: T): PromiseLike; validate?(client: T): PromiseLike; } diff --git a/types/get-folder-size/get-folder-size-tests.ts b/types/get-folder-size/get-folder-size-tests.ts new file mode 100644 index 0000000000..0165988fea --- /dev/null +++ b/types/get-folder-size/get-folder-size-tests.ts @@ -0,0 +1,5 @@ +import getFolderSize = require('get-folder-size'); + +getFolderSize('.', (err: Error | null, size: number) => {}); + +getFolderSize('.', /types/, (err: Error | null, size: number) => {}); diff --git a/types/get-folder-size/index.d.ts b/types/get-folder-size/index.d.ts new file mode 100644 index 0000000000..cf91fddfa4 --- /dev/null +++ b/types/get-folder-size/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for get-folder-size 2.0 +// Project: https://github.com/alessioalex/get-folder-size +// Definitions by: Mariusz Szczepańczyk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = getFolderSize; + +declare function getFolderSize(folder: string, callback: (err: Error | null, size: number) => void): void; +declare function getFolderSize(folder: string, regexIgnorePattern: RegExp, callback: (err: Error | null, size: number) => void): void; diff --git a/types/get-folder-size/tsconfig.json b/types/get-folder-size/tsconfig.json new file mode 100644 index 0000000000..2e5c9817ae --- /dev/null +++ b/types/get-folder-size/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", + "get-folder-size-tests.ts" + ] +} diff --git a/types/get-folder-size/tslint.json b/types/get-folder-size/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/get-folder-size/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/git-url-parse/git-url-parse-tests.ts b/types/git-url-parse/git-url-parse-tests.ts new file mode 100644 index 0000000000..41fd0bd0f0 --- /dev/null +++ b/types/git-url-parse/git-url-parse-tests.ts @@ -0,0 +1,8 @@ +import gitUrlParse = require('git-url-parse'); + +gitUrlParse("git@github.com:IonicaBizau/node-git-url-parse.git"); // $ExpectType GitUrl +gitUrlParse("git@github.com:IonicaBizau/node-git-url-parse.git").toString(); // $ExpectType string +gitUrlParse("git@github.com:IonicaBizau/node-git-url-parse.git").toString('git+ssh'); // $ExpectType string + +gitUrlParse.stringify(gitUrlParse("git@github.com:IonicaBizau/node-git-url-parse.git")); // $ExpectType string +gitUrlParse.stringify(gitUrlParse("git@github.com:IonicaBizau/node-git-url-parse.git"), 'https'); // $ExpectType string diff --git a/types/git-url-parse/index.d.ts b/types/git-url-parse/index.d.ts new file mode 100644 index 0000000000..5c1d14ba7a --- /dev/null +++ b/types/git-url-parse/index.d.ts @@ -0,0 +1,48 @@ +// Type definitions for git-url-parse 9.0 +// Project: https://github.com/IonicaBizau/git-url-parse +// Definitions by: Klaus Meinhardt +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace gitUrlParse { + interface GitUrl { + /** An array with the url protocols (usually it has one element). */ + protocols: string[]; + port: number | null; + /** The url domain (including subdomains). */ + resource: string; + /** The authentication user (usually for ssh urls). */ + user: string; + pathname: string; + hash: string; + search: string; + href: string; + protocol: string; + /** The oauth token (could appear in the https urls). */ + token: string; + /** The Git provider (e.g. `"github.com"`). */ + source: string; + /** The repository owner. */ + owner: string; + /** The repository name. */ + name: string; + /** The repository ref (e.g., "master" or "dev"). */ + ref: string; + /** A filepath relative to the repository root. */ + filepath: string; + /** The type of filepath in the url ("blob" or "tree"). */ + filepathtype: string; + /** The owner and name values in the `owner/name` format. */ + full_name: string; + /** The organization the owner belongs to. This is CloudForge specific. */ + organization: string; + /** Whether to add the `.git` suffix or not. */ + git_suffix?: boolean; + toString(type?: string): string; + } + + function stringify(url: GitUrl, type?: string): string; +} + +declare function gitUrlParse(url: string): gitUrlParse.GitUrl; + +export = gitUrlParse; diff --git a/types/git-url-parse/tsconfig.json b/types/git-url-parse/tsconfig.json new file mode 100644 index 0000000000..0261055b6f --- /dev/null +++ b/types/git-url-parse/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", + "git-url-parse-tests.ts" + ] +} diff --git a/types/git-url-parse/tslint.json b/types/git-url-parse/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/git-url-parse/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/github-url-to-object/github-url-to-object-tests.ts b/types/github-url-to-object/github-url-to-object-tests.ts new file mode 100644 index 0000000000..a6de7f1355 --- /dev/null +++ b/types/github-url-to-object/github-url-to-object-tests.ts @@ -0,0 +1,5 @@ +import gh = require('github-url-to-object'); + +gh('github:monkey/business'); // $ExpectType Result | null +gh('https://ghe.example.com:heroku/heroku-flags.git', {enterprise: true}); // $ExpectType Result | null +gh({url: 'git+https://github.com/monkey/business.git'}); // $ExpectType Result | null diff --git a/types/github-url-to-object/index.d.ts b/types/github-url-to-object/index.d.ts new file mode 100644 index 0000000000..a46ca93dd7 --- /dev/null +++ b/types/github-url-to-object/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for github-url-to-object 4.0 +// Project: https://github.com/zeke/github-url-to-object#readme +// Definitions by: Klaus Meinhardt +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace gh { + interface Options { + enterprise?: boolean; + } + interface Result { + user: string; + repo: string; + branch: string; + https_url: string; + tarball_url: string; + clone_url: string; + travis_url: string; + api_url: string; + zip_url: string; + } +} + +declare function gh(url: string | {url: string}, options?: gh.Options): gh.Result | null; + +export = gh; diff --git a/types/github-url-to-object/tsconfig.json b/types/github-url-to-object/tsconfig.json new file mode 100644 index 0000000000..d25b3d0527 --- /dev/null +++ b/types/github-url-to-object/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", + "github-url-to-object-tests.ts" + ] +} diff --git a/types/github-url-to-object/tslint.json b/types/github-url-to-object/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/github-url-to-object/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/globalize/dist/globalize.d.ts b/types/globalize/dist/globalize.d.ts new file mode 100644 index 0000000000..4d04f2f7b6 --- /dev/null +++ b/types/globalize/dist/globalize.d.ts @@ -0,0 +1,113 @@ +import * as Cldr from "cldrjs"; + +declare namespace Globalize { + interface CommonNumberFormatterOptions { + /** + * Non-negative integer Number value indicating the minimum integer digits to be used. Numbers will be padded with leading zeroes if necessary. + */ + minimumIntegerDigits?: number; + /** + * Non-negative integer Number values indicating the minimum and maximum fraction digits to be used. + * Numbers will be rounded or padded with trailing zeroes if necessary. + * Either one or both of these properties must be present. + * If they are, they will override minimum and maximum fraction digits derived from the CLDR patterns. + */ + minimumFractionDigits?: number; + /** + * Non-negative integer Number values indicating the minimum and maximum fraction digits to be used. + * Numbers will be rounded or padded with trailing zeroes if necessary. + * Either one or both of these properties must be present. + * If they are, they will override minimum and maximum fraction digits derived from the CLDR patterns. + */ + maximumFractionDigits?: number; + /** + * Positive integer Number values indicating the minimum and maximum fraction digits to be shown. + * Either none or both of these properties are present + * If they are, they override minimum and maximum integer and fraction digits. + * The formatter uses however many integer and fraction digits are required to display the specified number of significant digits. + */ + minimumSignificantDigits?: number; + /** + * Positive integer Number values indicating the minimum and maximum fraction digits to be shown. + * Either none or both of these properties are present. + * If they are, they override minimum and maximum integer and fraction digits. + * The formatter uses however many integer and fraction digits are required to display the specified number of significant digits. + */ + maximumSignificantDigits?: number; + /** + * String with rounding method ceil, floor, round (default), or truncate. + */ + round?: "ceil" | "floor" | "round" | "truncate"; + /** + * Boolean (default is true) value indicating whether a grouping separator should be used. + */ + useGrouping?: boolean; + } + + interface Shared { + cldr: Cldr.CldrStatic; + } + + interface Static extends Shared { + /** + * Globalize.load( json, ... ) + * @param {Object} [JSON] + * Load resolved or unresolved cldr data. + * Somewhat equivalent to previous Globalize.addCultureInfo(...). + */ + load(json: Object): void; + + /** + * Globalize.locale() + * Return the default Cldr instance. + */ + locale(): Cldr.CldrStatic; + + /** + * Globalize.locale( [locale] ) + * @param {string} locale + * Set default Cldr instance + * Return the default Cldr instance. + */ + locale(locale: string): Cldr.CldrStatic; + /** + * Globalize.locale( cldr ) + * @param {Cldr} cldr [Cldr instance] + * Set default Cldr instance + * Return the default Cldr instance. + */ + locale(cldr: Cldr.CldrStatic): Cldr.CldrStatic; + + /** + * Create a Globalize instance. + * @param {string} Locale string of the instance. + * @returns {Globalize} A Globalize instance + */ + new (locale: string): Globalize; + /** + * Create a Globalize instance. + * @param cldr Cldr instance of the instance. + * @returns {Globalize} A Globalize instance + */ + new (cldr: Cldr.CldrStatic): Globalize; + /** + * Create a Globalize instance. + * @param {string} Locale string of the instance. + * @returns {Globalize} A Globalize instance + */ + (locale: string): Globalize; + /** + * Create a Globalize instance. + * @param cldr Cldr instance of the instance. + * @returns {Globalize} A Globalize instance + */ + (cldr: Cldr.CldrStatic): Globalize; + } +} + +interface Globalize extends Globalize.Shared { +} + +declare const Globalize: Globalize.Static; + +export = Globalize; diff --git a/types/globalize/dist/globalize/currency.d.ts b/types/globalize/dist/globalize/currency.d.ts new file mode 100644 index 0000000000..46564648c8 --- /dev/null +++ b/types/globalize/dist/globalize/currency.d.ts @@ -0,0 +1,32 @@ +import * as Globalize from "../globalize"; + +declare module "../globalize" { + interface CurrencyFormatterOptions extends CommonNumberFormatterOptions { + /** + * symbol (default), accounting, code or name. + */ + style?: "symbol" | "accounting" | "code" | "name"; + } + + interface Shared { + /** + * Return a function that formats a currency according to the given options or locale's defaults. + * The returned function is invoked with one argument: the Number value to be formatted. + * @param {string} currency 3-letter currency code as defined by ISO 4217, eg. USD. + * @param {CurrencyFormatterOptions} options A JSON object including none or any of the following options. + * @returns {Function} Return a function that formats a currency + */ + currencyFormatter(currency: string, options?: CurrencyFormatterOptions): (value: number) => string; + + /** + * Return a currency formatted according to the given options or locale's defaults. + * @param {number} value The value to format. + * @param {string} currency 3-letter currency code as defined by ISO 4217, eg. USD. + * @param {CurrencyFormatterOptions} options A JSON object including none or any of the following options. + * @returns {string} Return a string formatted in the currency according to the value and the options + */ + formatCurrency(value: number, currency: string, options?: CurrencyFormatterOptions): string; + } +} + +export = Globalize; diff --git a/types/globalize/dist/globalize/date.d.ts b/types/globalize/dist/globalize/date.d.ts new file mode 100644 index 0000000000..f4465a3761 --- /dev/null +++ b/types/globalize/dist/globalize/date.d.ts @@ -0,0 +1,67 @@ +import * as Globalize from "./number"; + +declare module "../globalize" { + interface DateFormatterOptions { + /** + * String value indicating a skeleton (see description above), eg. { skeleton: "GyMMMd" }. + * Skeleton provides a more flexible formatting mechanism than the predefined list full, long, medium, or short represented by date, time, or datetime. + * Instead, they are an open-ended list of patterns containing only date field information, and in a canonical order. + */ + skeleton?: string; + /** + * One of the following String values: full, long, medium, or short, eg. { date: "full" }. + */ + date?: "full" | "long" | "medium" | "short"; + /** + * One of the following String values: full, long, medium, or short, eg. { time: "full" }. + */ + time?: "full" | "long" | "medium" | "short"; + /** + * One of the following String values: full, long, medium, or short, eg. { datetime: "full" } + */ + datetime?: "full" | "long" | "medium" | "short"; + /** + * String value indicating a machine raw pattern (anything in the "Sym." column) eg. { raw: "dd/mm" }. + * Note this is NOT recommended for i18n in general. Use skeleton instead. + */ + raw?: string; + + /** + * String based on the time zone names of the IANA time zone database, + * such as "Asia/Shanghai", "Asia/Kolkata", "America/New_York". + */ + timeZone?: string; + } + interface Static { + /** + * Globalize.loadTimeZone ( ianaTzData, ... ) + * This method allows you to load IANA time zone data to enable options.timeZone feature on date formatters and parsers. + * @param {Object} ianaTzData A JSON object with zdumped IANA timezone data. Get the data via https://github.com/rxaviers/iana-tz-data + */ + loadTimeZone(ianaTzData: Object): void; + } + + interface Shared { + /** + * .dateFormatter( options ) + * @param {DateFormatterOptions} options see date/expand_pattern for more info. + * @returns {Function} Return a function that formats a date according to the given `options` and the default/instance locale. + */ + dateFormatter(options?: DateFormatterOptions): (value: Date) => string; + + //Return a function that parses a string representing a date into a JavaScript Date object according to the given options. The default parsing assumes numeric year, month, and day (i.e., { skeleton: "yMd" }). + dateParser(options?: DateFormatterOptions): (value: string) => Date; + + //Alias for .dateFormatter( [options] )( value ). + formatDate(value: Date, options?: DateFormatterOptions): string; + /** + * Alias for .dateParser( [options] )( value ). + * @param {string} value The object whose module id you wish to determine. + * @param {DateFormatterOptions} options The object whose module id you wish to determine. + * @returns {Date} Return the value as a Date. + */ + parseDate(value: string, options?: DateFormatterOptions): Date; + } +} + +export = Globalize; diff --git a/types/globalize/dist/globalize/message.d.ts b/types/globalize/dist/globalize/message.d.ts new file mode 100644 index 0000000000..7e9004be6f --- /dev/null +++ b/types/globalize/dist/globalize/message.d.ts @@ -0,0 +1,29 @@ +import * as Globalize from "../globalize"; + +declare module "../globalize" { + interface Static { + /** + * Load messages data. + * @param {Object} json JSON object of messages data. Keys can use any character, except /, { and }. Values (i.e., the message content itself) can contain any character. + * @returns {void} + */ + loadMessages(json: Object): void; + } + interface Shared { + /** + * Return a function that formats a message (using ICU message format pattern) given its path and a set of variables into a user-readable string. It supports pluralization and gender inflections. + * @param path String or Array containing the path of the message content, eg. "greetings/bye", or [ "greetings", "bye" ]. + * @returns {Function} Return A function that formats a message (using ICU message format pattern) given its path and a set of variables into a user-readable string. It supports pluralization and gender inflections. + */ + messageFormatter(path: string | string[]): (variables?: string | string[] | Object) => string; + /** + * Formats a message (using ICU message format pattern) given its path and a set of variables into a user-readable string + * @param path String or Array containing the path of the message content, eg. "greetings/bye", or [ "greetings", "bye" ]. + * @param variables Variables can be Objects, where each property can be referenced by name inside a message; or Arrays, where each entry of the Array can be used inside a message, using numeric indices. When passing one or more arguments of other types, they're converted to an Array and used as such. + * @returns {string} Return a user-readable string. + */ + formatMessage(path: string | string[], variables?: string | string[] | Object): string + } +} + +export = Globalize; diff --git a/types/globalize/dist/globalize/number.d.ts b/types/globalize/dist/globalize/number.d.ts new file mode 100644 index 0000000000..99b1659164 --- /dev/null +++ b/types/globalize/dist/globalize/number.d.ts @@ -0,0 +1,56 @@ +import * as Globalize from "../globalize"; + +declare module "../globalize" { + interface NumberFormatterOptions extends CommonNumberFormatterOptions, NumberParserOptions { } + interface NumberParserOptions { + /** + * decimal (default), or percent. + */ + style?: "decimal" | "percent"; + } + interface Shared { + /** + * Return a function that formats a number according to the given options or locale's defaults. + * @param {NumberFormatterOptions} options A JSON object including none or any of the following options. + * style Optional String decimal (default), or percent. + * minimumIntegerDigits Optional Non-negative integer Number value indicating the minimum integer digits to be used. Numbers will be padded with leading zeroes if necessary. + * minimumFractionDigits and maximumFractionDigits Optional Non-negative integer Number values indicating the minimum and maximum fraction digits to be used. Numbers will be rounded or padded with trailing zeroes if necessary. Either one or both of these properties must be present. If they are, they will override minimum and maximum fraction digits derived from the CLDR patterns. + * minimumSignificantDigits and maximumSignificantDigits Optional Positive integer Number values indicating the minimum and maximum fraction digits to be shown. Either none or both of these properties are present. If they are, they override minimum and maximum integer and fraction digits. The formatter uses however many integer and fraction digits are required to display the specified number of significant digits. + * round Optional String with rounding method ceil, floor, round (default), or truncate. + * useGrouping Optional Boolean (default is true) value indicating whether a grouping separator should be used. + * @returns {Function} Return a function that formats a number according to the given options. + */ + numberFormatter(options?: NumberFormatterOptions): (value: number) => string; + /** + * Return a function that parses a string representing a number according to the given options or locale's defaults. + * @param {NumberParserOptions} options A JSON object including none or any of the following options. + * style Optional String decimal (default), or percent. + * @returns {Function} Return a function that parses a String representing a number according to the given options. If value is invalid, NaN is returned. + */ + numberParser(options?: NumberParserOptions): (value: string) => number + /** + * Return a number formatted according to the given options or locale's defaults. + * @param {number} value The number to format + * @param {NumberFormatterOptions} options A JSON object including none or any of the following options. + * style Optional String decimal (default), or percent. + * minimumIntegerDigits Optional Non-negative integer Number value indicating the minimum integer digits to be used. Numbers will be padded with leading zeroes if necessary. + * minimumFractionDigits and maximumFractionDigits Optional Non-negative integer Number values indicating the minimum and maximum fraction digits to be used. Numbers will be rounded or padded with trailing zeroes if necessary. Either one or both of these properties must be present. If they are, they will override minimum and maximum fraction digits derived from the CLDR patterns. + * minimumSignificantDigits and maximumSignificantDigits Optional Positive integer Number values indicating the minimum and maximum fraction digits to be shown. Either none or both of these properties are present. If they are, they override minimum and maximum integer and fraction digits. The formatter uses however many integer and fraction digits are required to display the specified number of significant digits. + * round Optional String with rounding method ceil, floor, round (default), or truncate. + * useGrouping Optional Boolean (default is true) value indicating whether a grouping separator should be used. + * @returns {string} Return the number formatted + */ + formatNumber(value: number, options?: NumberFormatterOptions): string; + + /** + * A function that parses a string representing a number according to the given options or locale's defaults. + * @param {string} value The number as string to parse + * @param {NumberParserOptions} options A JSON object including none or any of the following options. + * style Optional String decimal (default), or percent. + * @returns {number} Return a number according to the given options. If value is invalid, NaN is returned. + */ + parseNumber(value: string, options?: NumberParserOptions): number; + } +} + +export = Globalize; diff --git a/types/globalize/dist/globalize/plural.d.ts b/types/globalize/dist/globalize/plural.d.ts new file mode 100644 index 0000000000..5899afbba9 --- /dev/null +++ b/types/globalize/dist/globalize/plural.d.ts @@ -0,0 +1,31 @@ +import * as Globalize from "../globalize"; + +declare module "../globalize" { + interface PluralGeneratorOptions { + /** + * cardinal (default), or ordinal. + */ + type?: "cardinal" | "ordinal"; + } + interface Shared { + /** + * Return a function that returns the value's corresponding plural group: zero, one, two, few, many, or other. + * The returned function is invoked with one argument: the Number value for which to return the plural group. + * @param {PluralGeneratorOptions} options A JSON object including none or any of the following options. + * type Optional String cardinal (default), or ordinal. + * @returns {Function} Return a function that returns the value's corresponding plural group: zero, one, two, few, many, or other. + */ + pluralGenerator(options?: PluralGeneratorOptions): (value: number) => string; + + /** + * Returns the value's corresponding plural group: zero, one, two, few, many, or other. + * @param {number} value A Number for which to return the plural group. + * @param {PluralGeneratorOptions} options A JSON object including none or any of the following options. + * type Optional String cardinal (default), or ordinal. + * @returns {string} Returns the value's corresponding plural group: zero, one, two, few, many, or other. + */ + plural(value: number, options?: PluralGeneratorOptions): string; + } +} + +export = Globalize; diff --git a/types/globalize/dist/globalize/relative-time.d.ts b/types/globalize/dist/globalize/relative-time.d.ts new file mode 100644 index 0000000000..759dc990d4 --- /dev/null +++ b/types/globalize/dist/globalize/relative-time.d.ts @@ -0,0 +1,33 @@ +import * as Globalize from "../globalize"; +import "./number"; +import "./plural"; + +declare module "../globalize" { + interface RelativeTimeFormatterOptions { + /** + * eg. "short" or "narrow". Or falsy for default long form + */ + form?: "short" | "narrow"; + } + interface Shared { + /** + * Returns a function that formats a relative time according to the given unit, options, and the default/instance locale. + * The returned function is invoked with one argument: the number value to be formatted. + * @param unit String value indicating the unit to be formatted. eg. "day", "week", "month", etc. + * @param options form: [String] eg. "short" or "narrow". Or falsy for default long form. + * @returns {Function} Returns a function that formats a relative time according to the given unit. + */ + relativeTimeFormatter(unit: string, options?: RelativeTimeFormatterOptions): (value: number) => string; + + /** + * Return a relative time according to the given unit + * @param {number} value The number to be formatted. + * @param {string} unit String value indicating the unit to be formatted. eg. "day", "week", "month", etc. + * @param options form: [String] eg. "short" or "narrow". Or falsy for default long form. + * @returns {string} Return a relative time according to the given unit. + */ + formatRelativeTime(value: number, unit: string, options?: RelativeTimeFormatterOptions): string; + } +} + +export = Globalize; diff --git a/types/globalize/dist/globalize/unit.d.ts b/types/globalize/dist/globalize/unit.d.ts new file mode 100644 index 0000000000..736f086369 --- /dev/null +++ b/types/globalize/dist/globalize/unit.d.ts @@ -0,0 +1,39 @@ +import * as Globalize from "../globalize"; +import "./number"; +import "./plural"; + +declare module "../globalize" { + interface UnitFormatterOptions { + /** + * form: [String] eg. "long", "short" or "narrow". + */ + form?: "long" | "short" | "narrow"; + + /** + * numberFormatter: [Function] a number formatter function. Defaults to Globalize .numberFormatter() for the current locale using the default options. + */ + numberFormatter?: NumberFormatterOptions; + } + + interface Shared { + /** + * Returns a function that formats a unit according to the given unit, options, and the default/instance locale. + * The returned function is invoked with one argument: the number value to be formatted. + * @param unit String value indicating the unit to be formatted. eg. "day", "week", "month", etc. Could also be a compound unit, eg. "mile-per-hour" or "mile/hour" + * @param options form: [String] eg. "long", "short" or "narrow". + * @returns {Function} Returns a function that formats a unit according to the given unit, options, and the default/instance locale. + */ + unitFormatter(unit: string, options?: UnitFormatterOptions): (value: number) => string; + + /** + * Alias for .unitFormatter( unit, options )( value ). + * @param {number} value The number to be formatted. + * @param {string} unit String value indicating the unit to be formatted. eg. "day", "week", "month", etc. Could also be a compound unit, eg. "mile-per-hour" or "mile/hour" + * @param {UnitFormatterOptions} options form: [String] eg. "long", "short" or "narrow". + * @returns {string} Returns the unit formatted. + */ + formatUnit(value: number, unit: string, options?: UnitFormatterOptions): string + } +} + +export = Globalize; diff --git a/types/globalize/globalize-tests.ts b/types/globalize/globalize-tests.ts index 1c4abbec41..cb431cba9f 100644 --- a/types/globalize/globalize-tests.ts +++ b/types/globalize/globalize-tests.ts @@ -1,135 +1,111 @@ +let en = new Globalize("en"); +en = new Globalize(new Cldr("en")); +Globalize( "de-Latn-CH" ).cldr.main( "test-bundle" ) +Globalize( new Cldr("de-Latn-CH") ).cldr.main( "test-bundle" ) -/*Globalize.culture("fr"); -console.log(Globalize.culture().name); +let locale = Globalize.locale(); +locale = Globalize.locale("en"); +locale = Globalize.locale(new Cldr("en")); -Globalize.culture("fr-FR"); -console.log(Globalize.culture().name); +let strOutput: string; -Globalize.culture(["es-MX", "fr-FR"]); -console.log(Globalize.culture().name); +let currencyFormatter = en.currencyFormatter("USD", { style: "symbol" }); +strOutput = currencyFormatter(20); -Globalize.culture("fr;q=0.4, es;q=0.5, he"); +currencyFormatter = Globalize.currencyFormatter("USD"); +strOutput = currencyFormatter(20); -Globalize.format(1234.567, "n"); -Globalize.format(1234.567, "n1"); -Globalize.format(1234.567, "n0"); +strOutput = en.formatCurrency(20, "USD", { style: "code" }); +strOutput = Globalize.formatCurrency(20, "USD"); -Globalize.format(new Date(1955, 10, 5), "yyyy/MM/dd"); -Globalize.format(new Date(1955, 10, 5), "dddd MMMM d, yyyy"); +Globalize.loadTimeZone({}); -Globalize.addCultureInfo("fr", { messages: { "translate": "traduire" } }); -console.log(Globalize.localize("translate", "fr")); +let dateOutput: Date; -Globalize.parseInt("1,234.56"); -Globalize.parseInt("1.234,56", 10); -Globalize.parseInt("1.234,56", 10, "de"); -Globalize.parseFloat("1,234.56"); -Globalize.parseFloat("1.234,56", 10); -Globalize.parseFloat("1.234,56", 10, "de"); -Globalize.parseDate("1/2/2003"); -Globalize.parseDate("15 Jun 2012", "dd MMM yyyy"); -Globalize.parseDate("15 Jun 2012", ["dd MMM yyyy"]); -Globalize.culture("fr"); -Globalize.parseDate("1/2/2003"); +let dateFormatter = en.dateFormatter({ + skeleton: "", + date: "full", + time: "full", + datetime: "full", + raw: "", + timeZone: "" +}); +strOutput = dateFormatter(new Date()); -Globalize.addCultureInfo({ numberFormat: { billionZeroes: 12 } }); -Globalize.addCultureInfo("fr", { numberFormat: { billionZeroes: 12 } }); -Globalize.addCultureInfo("de-DE", "de", { numberFormat: { billionZeroes: 12 } }); +dateFormatter = Globalize.dateFormatter({}); +strOutput = dateFormatter(new Date()); -//Globalize.culture().calendar = Globalize.culture().calendars.SomeOtherCalendar; -//Globalize.culture().calendar = Globalize.culture().calendars.standard; +let dateParser = en.dateParser({ + skeleton: "", + date: "full", + time: "full", + datetime: "full", + raw: "", + timeZone: "" +}); +dateOutput = dateParser(""); -Globalize.format(123.45, "n"); -Globalize.format(123.45, "n0"); -Globalize.format(123.45, "n1"); +dateParser = Globalize.dateParser({}); +dateOutput = dateParser(""); -Globalize.format(123.45, "d"); -Globalize.format(12, "d3"); +strOutput = en.formatDate(new Date(), {}); +strOutput = Globalize.formatDate(new Date(), {}); +dateOutput = en.parseDate("", {}); +dateOutput = Globalize.parseDate("", {}); -Globalize.format(123.45, "c"); -Globalize.format(123.45, "c0"); -Globalize.format(123.45, "c1"); -Globalize.format(-123.45, "c"); +Globalize.loadMessages({}); -Globalize.format(0.12345, "p"); -Globalize.format(0.12345, "p0"); -Globalize.format(0.12345, "p4"); +let messageFormatter = en.messageFormatter("foo.bar"); +strOutput = messageFormatter("blah"); -Globalize.format(1234.56, "c"); -Globalize.culture("en-US").numberFormat.currency.symbol = '\u20ac'; +messageFormatter = Globalize.messageFormatter(["foo.bar", "baz.blah"]); +strOutput = messageFormatter(["ham", "spam"]); -var currSym; -Globalize.culture().numberFormat.currency.symbol = currSym; +strOutput = en.formatMessage(["foo.bar", "baz.blah"], {}); +strOutput = Globalize.formatMessage("ham.spam"); -Globalize.format(new Date(2012, 1, 20), 'd'); -Globalize.format(new Date(2012, 1, 20), 'D'); +let numberFormatter = en.numberFormatter(); +strOutput = numberFormatter(20); +numberFormatter = Globalize.numberFormatter({ style: "decimal" }); +strOutput = numberFormatter(20.2); -Globalize.load[ "default" ] = { - name: "English", - englishName: "English", - nativeName: "English", - isRTL: false, - language: "en", - numberFormat: { - pattern: [ "-n" ], - decimals: 2, - ",": ",", - ".": ".", - groupSizes: [ 3 ], - "+": "+", - "-": "-", - percent: { - pattern: [ "-n %", "n %" ], - decimals: 2, - groupSizes: [ 3 ], - ",": ",", - ".": ".", - symbol: "%" - }, - currency: { - pattern: [ "($n)", "$n" ], - decimals: 2, - groupSizes: [ 3 ], - ",": ",", - ".": ".", - symbol: "$" - } - }, - calendars: { - standard: { - name: "Gregorian_USEnglish", - "/": "/", - ":": ":", - firstDay: 0, - days: { - names: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], - namesAbbr: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], - namesShort: [ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" ] - }, - //months: [ - // names: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" ], - // namesAbbr: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" ] - //], - AM: [ "AM", "am", "AM" ], - PM: [ "PM", "pm", "PM" ], - eras: [ - {"name":"A.D.","start":null,"offset":0} - ], - twoDigitYearMax: 2029, - patterns: { - d: "M/d/yyyy", - D: "dddd, MMMM dd, yyyy", - t: "h:mm tt", - T: "h:mm:ss tt", - f: "dddd, MMMM dd, yyyy h:mm tt", - F: "dddd, MMMM dd, yyyy h:mm:ss tt", - M: "MMMM dd", - Y: "yyyy MMMM", - S: "yyyy\u0027-\u0027MM\u0027-\u0027dd\u0027T\u0027HH\u0027:\u0027mm\u0027:\u0027ss" - } - } - }, - messages: {} -}*/ \ No newline at end of file +let numberParser = en.numberParser(); +let numOutput = numberParser("20"); + +numberParser = Globalize.numberParser({ style: "percent" }); +numOutput = numberParser("20.4"); + +strOutput = en.formatNumber(20); +strOutput = Globalize.formatNumber(20, { style: "decimal" }); + +numOutput = en.parseNumber("20"); +numOutput = Globalize.parseNumber("20", { style: "percent" }); + +let pluralGenerator = en.pluralGenerator(); +strOutput = pluralGenerator(20); + +pluralGenerator = Globalize.pluralGenerator({ type: "cardinal" }); +strOutput = pluralGenerator(20); + +strOutput = en.plural(20); +strOutput = Globalize.plural(20, { type: "ordinal" }); + +let relativeTimeFormatter = en.relativeTimeFormatter("week"); +strOutput = relativeTimeFormatter(20); + +relativeTimeFormatter = Globalize.relativeTimeFormatter("day", { form: "short" }); +strOutput = relativeTimeFormatter(20); + +strOutput = en.formatRelativeTime(20, "day"); +strOutput = Globalize.formatRelativeTime(20, "week"); + +let unitFormatter = en.unitFormatter("day"); +strOutput = unitFormatter(10); + +unitFormatter = Globalize.unitFormatter("week", { form: "narrow" }); +strOutput = unitFormatter(10); + +strOutput = en.formatUnit(10, "day"); +strOutput = Globalize.formatUnit(10, "week", { numberFormatter: { style: "decimal" } }); diff --git a/types/globalize/index.d.ts b/types/globalize/index.d.ts index 0e6b8537fd..8fffce11db 100644 --- a/types/globalize/index.d.ts +++ b/types/globalize/index.d.ts @@ -1,345 +1,20 @@ // Type definitions for Globalize // Project: https://github.com/jquery/globalize -// Definitions by: Grégoire Castre , Aram Taieb +// Definitions by: Grégoire Castre +// Aram Taieb +// Bryan Forbes // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import * as Cldr from "cldrjs"; +import * as Globalize from "./dist/globalize"; + +import "./dist/globalize/message"; +import "./dist/globalize/number"; +import "./dist/globalize/plural"; +import "./dist/globalize/currency"; +import "./dist/globalize/date"; +import "./dist/globalize/relative-time"; +import "./dist/globalize/unit"; -declare var globalize: globalize.Static; export as namespace Globalize; -export = globalize; - -declare namespace globalize { - interface DateFormatterOptions { - /** - * String value indicating a skeleton (see description above), eg. { skeleton: "GyMMMd" }. - * Skeleton provides a more flexible formatting mechanism than the predefined list full, long, medium, or short represented by date, time, or datetime. - * Instead, they are an open-ended list of patterns containing only date field information, and in a canonical order. - */ - skeleton?: string; - /** - * One of the following String values: full, long, medium, or short, eg. { date: "full" }. - */ - date?: "full" | "long" | "medium" | "short"; - /** - * One of the following String values: full, long, medium, or short, eg. { time: "full" }. - */ - time?: "full" | "long" | "medium" | "short"; - /** - * One of the following String values: full, long, medium, or short, eg. { datetime: "full" } - */ - datetime?: "full" | "long" | "medium" | "short"; - /** - * String value indicating a machine raw pattern (anything in the "Sym." column) eg. { raw: "dd/mm" }. - * Note this is NOT recommended for i18n in general. Use skeleton instead. - */ - raw?: string; - - /** - * String based on the time zone names of the IANA time zone database, - * such as "Asia/Shanghai", "Asia/Kolkata", "America/New_York". - */ - timeZone?: string; - } - - interface CommonNumberFormatterOptions { - /** - * Non-negative integer Number value indicating the minimum integer digits to be used. Numbers will be padded with leading zeroes if necessary. - */ - minimumIntegerDigits?: number; - /** - * Non-negative integer Number values indicating the minimum and maximum fraction digits to be used. - * Numbers will be rounded or padded with trailing zeroes if necessary. - * Either one or both of these properties must be present. - * If they are, they will override minimum and maximum fraction digits derived from the CLDR patterns. - */ - minimumFractionDigits?: number; - /** - * Non-negative integer Number values indicating the minimum and maximum fraction digits to be used. - * Numbers will be rounded or padded with trailing zeroes if necessary. - * Either one or both of these properties must be present. - * If they are, they will override minimum and maximum fraction digits derived from the CLDR patterns. - */ - maximumFractionDigits?: number; - /** - * Positive integer Number values indicating the minimum and maximum fraction digits to be shown. - * Either none or both of these properties are present - * If they are, they override minimum and maximum integer and fraction digits. - * The formatter uses however many integer and fraction digits are required to display the specified number of significant digits. - */ - minimumSignificantDigits?: number; - /** - * Positive integer Number values indicating the minimum and maximum fraction digits to be shown. - * Either none or both of these properties are present. - * If they are, they override minimum and maximum integer and fraction digits. - * The formatter uses however many integer and fraction digits are required to display the specified number of significant digits. - */ - maximumSignificantDigits?: number; - /** - * String with rounding method ceil, floor, round (default), or truncate. - */ - round?: "ceil" | "floor" | "round" | "truncate"; - /** - * Boolean (default is true) value indicating whether a grouping separator should be used. - */ - useGrouping?: boolean; - } - - interface NumberFormatterOptions extends CommonNumberFormatterOptions { - /** - * decimal (default), or percent - */ - style?: "decimal" | "percent"; - } - - interface CurrencyFormatterOptions extends CommonNumberFormatterOptions { - /** - * symbol (default), accounting, code or name. - */ - style?: "symbol" | "accounting" | "code" | "name"; - } - - interface NumberParserOptions { - /** - * decimal (default), or percent. - */ - style?: "decimal" | "percent"; - } - - interface PluralGeneratorOptions { - /** - * cardinal (default), or ordinal. - */ - type?: "cardinal" | "ordinal"; - } - - interface RelativeTimeFormatterOptions { - /** - * eg. "short" or "narrow". Or falsy for default long form - */ - form?: "short" | "narrow"; - } - - interface UnitFormatterOptions { - /** - * form: [String] eg. "long", "short" or "narrow". - */ - form?: "long" | "short" | "narrow"; - - /** - * numberFormatter: [Function] a number formatter function. Defaults to Globalize .numberFormatter() for the current locale using the default options. - */ - numberFormatter?: NumberFormatterOptions; - } - - interface Static { - cldr: Cldr.CldrStatic; - - /** - * Globalize.loadTimeZone ( ianaTzData, ... ) - * This method allows you to load IANA time zone data to enable options.timeZone feature on date formatters and parsers. - * @param {Object} ianaTzData A JSON object with zdumped IANA timezone data. Get the data via https://github.com/rxaviers/iana-tz-data - */ - loadTimeZone(ianaTzData: Object): void; - - /** - * Globalize.load( json, ... ) - * @param {Object} [JSON] - * Load resolved or unresolved cldr data. - * Somewhat equivalent to previous Globalize.addCultureInfo(...). - */ - load(json: Object): void; - - /** - * Globalize.locale() - * Return the default Cldr instance. - */ - locale(): Cldr.CldrStatic; - - /** - * Globalize.locale( [locale] ) - * @param {string} locale - * Set default Cldr instance - * Return the default Cldr instance. - */ - - locale(locale: string): Cldr.CldrStatic; - /** - * Globalize.locale( cldr ) - * @param {Cldr} cldr [Cldr instance] - * Set default Cldr instance - * Return the default Cldr instance. - */ - locale(cldr: Cldr.CldrStatic): Cldr.CldrStatic; - - /** - * .dateFormatter( options ) - * @param {DateFormatterOptions} options see date/expand_pattern for more info. - * @returns {Function} Return a function that formats a date according to the given `options` and the default/instance locale. - */ - dateFormatter(options?: DateFormatterOptions): (value: Date) => string; - - //Return a function that parses a string representing a date into a JavaScript Date object according to the given options. The default parsing assumes numeric year, month, and day (i.e., { skeleton: "yMd" }). - dateParser(options?: DateFormatterOptions): (value: string) => Date; - - //Alias for .dateFormatter( [options] )( value ). - formatDate(value: Date, options?: DateFormatterOptions): string; - /** - * Alias for .dateParser( [options] )( value ). - * @param {string} value The object whose module id you wish to determine. - * @param {DateFormatterOptions} options The object whose module id you wish to determine. - * @returns {Date} Return the value as a Date. - */ - parseDate(value: string, options?: DateFormatterOptions): Date; - - /** - * Load messages data. - * @param {Object} json JSON object of messages data. Keys can use any character, except /, { and }. Values (i.e., the message content itself) can contain any character. - * @returns {void} - */ - loadMessages(json: Object): void; - /** - * Return a function that formats a message (using ICU message format pattern) given its path and a set of variables into a user-readable string. It supports pluralization and gender inflections. - * @param path String or Array containing the path of the message content, eg. "greetings/bye", or [ "greetings", "bye" ]. - * @returns {Function} Return A function that formats a message (using ICU message format pattern) given its path and a set of variables into a user-readable string. It supports pluralization and gender inflections. - */ - messageFormatter(path: string | string[]): (variables?: string | string[] | Object) => string; - - /** - * Formats a message (using ICU message format pattern) given its path and a set of variables into a user-readable string - * @param path String or Array containing the path of the message content, eg. "greetings/bye", or [ "greetings", "bye" ]. - * @param variables Variables can be Objects, where each property can be referenced by name inside a message; or Arrays, where each entry of the Array can be used inside a message, using numeric indices. When passing one or more arguments of other types, they're converted to an Array and used as such. - * @returns {string} Return a user-readable string. - */ - formatMessage(path: string | string[], variables?: string | string[] | Object): string - - /** - * Return a function that formats a number according to the given options or locale's defaults. - * @param {NumberFormatterOptions} options A JSON object including none or any of the following options. - * style Optional String decimal (default), or percent. - * minimumIntegerDigits Optional Non-negative integer Number value indicating the minimum integer digits to be used. Numbers will be padded with leading zeroes if necessary. - * minimumFractionDigits and maximumFractionDigits Optional Non-negative integer Number values indicating the minimum and maximum fraction digits to be used. Numbers will be rounded or padded with trailing zeroes if necessary. Either one or both of these properties must be present. If they are, they will override minimum and maximum fraction digits derived from the CLDR patterns. - * minimumSignificantDigits and maximumSignificantDigits Optional Positive integer Number values indicating the minimum and maximum fraction digits to be shown. Either none or both of these properties are present. If they are, they override minimum and maximum integer and fraction digits. The formatter uses however many integer and fraction digits are required to display the specified number of significant digits. - * round Optional String with rounding method ceil, floor, round (default), or truncate. - * useGrouping Optional Boolean (default is true) value indicating whether a grouping separator should be used. - * @returns {Function} Return a function that formats a number according to the given options. - */ - numberFormatter(options?: NumberFormatterOptions): (value: number) => string; - - /** - * Return a function that parses a string representing a number according to the given options or locale's defaults. - * @param {NumberParserOptions} options A JSON object including none or any of the following options. - * style Optional String decimal (default), or percent. - * @returns {Function} Return a function that parses a String representing a number according to the given options. If value is invalid, NaN is returned. - */ - numberParser(options?: NumberParserOptions): (value: string) => number - - /** - * Return a number formatted according to the given options or locale's defaults. - * @param {number} value The number to format - * @param {NumberFormatterOptions} options A JSON object including none or any of the following options. - * style Optional String decimal (default), or percent. - * minimumIntegerDigits Optional Non-negative integer Number value indicating the minimum integer digits to be used. Numbers will be padded with leading zeroes if necessary. - * minimumFractionDigits and maximumFractionDigits Optional Non-negative integer Number values indicating the minimum and maximum fraction digits to be used. Numbers will be rounded or padded with trailing zeroes if necessary. Either one or both of these properties must be present. If they are, they will override minimum and maximum fraction digits derived from the CLDR patterns. - * minimumSignificantDigits and maximumSignificantDigits Optional Positive integer Number values indicating the minimum and maximum fraction digits to be shown. Either none or both of these properties are present. If they are, they override minimum and maximum integer and fraction digits. The formatter uses however many integer and fraction digits are required to display the specified number of significant digits. - * round Optional String with rounding method ceil, floor, round (default), or truncate. - * useGrouping Optional Boolean (default is true) value indicating whether a grouping separator should be used. - * @returns {string} Return the number formatted - */ - formatNumber(value: number, options?: NumberFormatterOptions): string; - - /** - * A function that parses a string representing a number according to the given options or locale's defaults. - * @param {string} value The number as string to parse - * @param {NumberParserOptions} options A JSON object including none or any of the following options. - * style Optional String decimal (default), or percent. - * @returns {number} Return a number according to the given options. If value is invalid, NaN is returned. - */ - parseNumber(value: string, options?: NumberParserOptions): number; - - /** - * Return a function that formats a currency according to the given options or locale's defaults. - * The returned function is invoked with one argument: the Number value to be formatted. - * @param {string} currency 3-letter currency code as defined by ISO 4217, eg. USD. - * @param {CurrencyFormatterOptions} options A JSON object including none or any of the following options. - * @returns {Function} Return a function that formats a currency - */ - currencyFormatter(currency: string, options?: CurrencyFormatterOptions): (value: number) => string; - - /** - * Return a currency formatted according to the given options or locale's defaults. - * @param {number} value The value to format. - * @param {string} currency 3-letter currency code as defined by ISO 4217, eg. USD. - * @param {CurrencyFormatterOptions} options A JSON object including none or any of the following options. - * @returns {string} Return a string formatted in the currency according to the value and the options - */ - formatCurrency(value: number, currency: string, options?: CurrencyFormatterOptions): string; - - /** - * Return a function that returns the value's corresponding plural group: zero, one, two, few, many, or other. - * The returned function is invoked with one argument: the Number value for which to return the plural group. - * @param {PluralGeneratorOptions} options A JSON object including none or any of the following options. - * type Optional String cardinal (default), or ordinal. - * @returns {Function} Return a function that returns the value's corresponding plural group: zero, one, two, few, many, or other. - */ - pluralGenerator(options?: PluralGeneratorOptions): (value: number) => string; - - /** - * Returns the value's corresponding plural group: zero, one, two, few, many, or other. - * @param {number} value A Number for which to return the plural group. - * @param {PluralGeneratorOptions} options A JSON object including none or any of the following options. - * type Optional String cardinal (default), or ordinal. - * @returns {string} Returns the value's corresponding plural group: zero, one, two, few, many, or other. - */ - plural(value: number, options?: PluralGeneratorOptions): string; - - /** - * Returns a function that formats a relative time according to the given unit, options, and the default/instance locale. - * The returned function is invoked with one argument: the number value to be formatted. - * @param unit String value indicating the unit to be formatted. eg. "day", "week", "month", etc. - * @param options form: [String] eg. "short" or "narrow". Or falsy for default long form. - * @returns {Function} Returns a function that formats a relative time according to the given unit. - */ - relativeTimeFormatter(unit: string, options?: RelativeTimeFormatterOptions): (value: number) => string; - - /** - * Return a relative time according to the given unit - * @param {number} value The number to be formatted. - * @param {string} unit String value indicating the unit to be formatted. eg. "day", "week", "month", etc. - * @param options form: [String] eg. "short" or "narrow". Or falsy for default long form. - * @returns {string} Return a relative time according to the given unit. - */ - formatRelativeTime(value: number, unit: string, options?: RelativeTimeFormatterOptions): string; - - /** - * Returns a function that formats a unit according to the given unit, options, and the default/instance locale. - * The returned function is invoked with one argument: the number value to be formatted. - * @param unit String value indicating the unit to be formatted. eg. "day", "week", "month", etc. Could also be a compound unit, eg. "mile-per-hour" or "mile/hour" - * @param options form: [String] eg. "long", "short" or "narrow". - * @returns {Function} Returns a function that formats a unit according to the given unit, options, and the default/instance locale. - */ - unitFormatter(unit: string, options?: UnitFormatterOptions): (value: number) => string; - - /** - * Alias for .unitFormatter( unit, options )( value ). - * @param {number} value The number to be formatted. - * @param {string} unit String value indicating the unit to be formatted. eg. "day", "week", "month", etc. Could also be a compound unit, eg. "mile-per-hour" or "mile/hour" - * @param {UnitFormatterOptions} options form: [String] eg. "long", "short" or "narrow". - * @returns {string} Returns the unit formatted. - */ - formatUnit(value: number, unit: string, options?: UnitFormatterOptions): string - - /** - * Create a Globalize instance. - * @param {string} Locale string of the instance. - * @returns {Globalize} A Globalize instance - */ - new (locale: string): Static; - /** - * Create a Globalize instance. - * @param cldr Cldr instance of the instance. - * @returns {Globalize} A Globalize instance - */ - new (cldr: Cldr.CldrStatic): Static; - } -} +export = Globalize; diff --git a/types/globalize/tsconfig.json b/types/globalize/tsconfig.json index b83bbf7b09..4ef65615a9 100644 --- a/types/globalize/tsconfig.json +++ b/types/globalize/tsconfig.json @@ -18,6 +18,14 @@ }, "files": [ "index.d.ts", + "dist/globalize.d.ts", + "dist/globalize/currency.d.ts", + "dist/globalize/date.d.ts", + "dist/globalize/message.d.ts", + "dist/globalize/number.d.ts", + "dist/globalize/plural.d.ts", + "dist/globalize/relative-time.d.ts", + "dist/globalize/unit.d.ts", "globalize-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/google-apps-script/google-apps-script-tests.ts b/types/google-apps-script/google-apps-script-tests.ts index 17de10a2fc..2c2c74cbc9 100644 --- a/types/google-apps-script/google-apps-script-tests.ts +++ b/types/google-apps-script/google-apps-script-tests.ts @@ -1,8 +1,4 @@ - - - // from https://developers.google.com/apps-script/overview - function createAndSendDocument() { // Create a new Google Doc named 'Hello, world!' var doc = DocumentApp.create('Hello, world!'); @@ -27,7 +23,5 @@ function createAndSendDocument() { } // Regression - ScriptApp.getService().getUrl(); - CalendarApp.GuestStatus.NO; 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 82f92078dd..7558263306 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 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // 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 { @@ -42,7 +42,7 @@ declare namespace GoogleAppsScript { * * DocumentA document, containing rich text and elements such as tables and lists. * - * EmbeddedChartRepresents a chart that has been embedded into a Spreadsheet. + * EmbeddedChartRepresents a chart that has been embedded into a spreadsheet. * * FileA file in Google Drive. * @@ -52,15 +52,19 @@ declare namespace GoogleAppsScript { * * HtmlOutputAn HtmlOutput object that can be served from a script. * + * ImageA PageElement representing an image. + * * InlineImageAn element representing an embedded image. * * JdbcBlobA JDBC Blob. * * JdbcClobA JDBC Clob. * + * PictureFillA fill that renders an image that's stretched to the dimensions of its container. + * * PositionedImageFixed position image anchored to a Paragraph. * - * SpreadsheetThis class allows users to access and modify Google Sheets files. + * SpreadsheetAccess and modify Google Sheets files. * * StaticMapAllows for the creation and decoration of static map images. */ @@ -72,7 +76,7 @@ declare namespace GoogleAppsScript { /** * This class provides access to G Suite specific dialog boxes. * - * The methods in this class are only available for use in the context of a Google Spreadsheet. + * The methods in this class are only available for use in the context of a Google Spreadsheet. * See also * * ButtonSet @@ -88,41 +92,38 @@ declare namespace GoogleAppsScript { } /** - * An enum representing predetermined, localized dialog buttons returned by an - * alert or PromptResponse.getSelectedButton() to - * indicate which button in a dialog the user clicked. These values cannot be set; to add buttons to - * an alert or - * prompt, use ButtonSet instead. + * An enum representing predetermined, localized dialog buttons returned by an alert or PromptResponse.getSelectedButton() to indicate + * which button in a dialog the user clicked. These values cannot be set; to add buttons to an + * alert or prompt, use ButtonSet instead. * - * // Display a dialog box with a message and "Yes" and "No" buttons. - * var ui = DocumentApp.getUi(); - * var response = ui.alert('Are you sure you want to continue?', ui.ButtonSet.YES_NO); + * // Display a dialog box with a message and "Yes" and "No" buttons. + * var ui = DocumentApp.getUi(); + * var response = ui.alert('Are you sure you want to continue?', ui.ButtonSet.YES_NO); * - * // Process the user's response. - * if (response == ui.Button.YES) { - * Logger.log('The user clicked "Yes."'); - * } else { - * Logger.log('The user clicked "No" or the dialog\'s close button.'); - * } + * // Process the user's response. + * if (response == ui.Button.YES) { + * Logger.log('The user clicked "Yes."'); + * } else { + * Logger.log('The user clicked "No" or the dialog\'s close button.'); + * } */ export enum Button { CLOSE, OK, CANCEL, YES, NO } /** * An enum representing predetermined, localized sets of one or more dialog buttons that can be - * added to an alert or a - * prompt. To determine which button the user - * clicked, use Button. + * added to an alert or a prompt. To determine which button the user clicked, + * use Button. * - * // Display a dialog box with a message and "Yes" and "No" buttons. - * var ui = DocumentApp.getUi(); - * var response = ui.alert('Are you sure you want to continue?', ui.ButtonSet.YES_NO); + * // Display a dialog box with a message and "Yes" and "No" buttons. + * var ui = DocumentApp.getUi(); + * var response = ui.alert('Are you sure you want to continue?', ui.ButtonSet.YES_NO); * - * // Process the user's response. - * if (response == ui.Button.YES) { - * Logger.log('The user clicked "Yes."'); - * } else { - * Logger.log('The user clicked "No" or the dialog\'s close button.'); - * } + * // Process the user's response. + * if (response == ui.Button.YES) { + * Logger.log('The user clicked "Yes."'); + * } else { + * Logger.log('The user clicked "No" or the dialog\'s close button.'); + * } */ export enum ButtonSet { OK, OK_CANCEL, YES_NO, YES_NO_CANCEL } @@ -138,21 +139,20 @@ declare namespace GoogleAppsScript { /** * A custom menu in an instance of the user interface for a Google App. A script can only interact - * with the UI for the current instance of an open document or form, and only if the script is - * container-bound to the document or form. For more - * information, see the guide to menus. + * with the UI for the current instance of an open document or form, and only if the script is container-bound to the document or form. For more + * information, see the guide to menus. * - * // Add a custom menu to the active spreadsheet, including a separator and a sub-menu. - * function onOpen(e) { - * SpreadsheetApp.getUi() - * .createMenu('My Menu') - * .addItem('My Menu Item', 'myFunction') - * .addSeparator() - * .addSubMenu(SpreadsheetApp.getUi().createMenu('My Submenu') - * .addItem('One Submenu Item', 'mySecondFunction') - * .addItem('Another Submenu Item', 'myThirdFunction')) - * .addToUi(); - * } + * // Add a custom menu to the active spreadsheet, including a separator and a sub-menu. + * function onOpen(e) { + * SpreadsheetApp.getUi() + * .createMenu('My Menu') + * .addItem('My Menu Item', 'myFunction') + * .addSeparator() + * .addSubMenu(SpreadsheetApp.getUi().createMenu('My Submenu') + * .addItem('One Submenu Item', 'mySecondFunction') + * .addItem('Another Submenu Item', 'myThirdFunction')) + * .addToUi(); + * } */ export interface Menu { addItem(caption: string, functionName: string): Menu; @@ -163,25 +163,25 @@ 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. 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. * - * // Use MimeType enum to log the name of every Google Doc in the user's Drive. - * var docs = DriveApp.getFilesByType(MimeType.GOOGLE_DOCS); - * while (docs.hasNext()) { - * var doc = docs.next(); - * Logger.log(doc.getName()) - * } + * // Use MimeType enum to log the name of every Google Doc in the user's Drive. + * var docs = DriveApp.getFilesByType(MimeType.GOOGLE_DOCS); + * while (docs.hasNext()) { + * var doc = docs.next(); + * Logger.log(doc.getName()) + * } * - * // Use plain string to log the size of every PNG in the user's Drive. - * var pngs = DriveApp.getFilesByType('image/png'); - * while (pngs.hasNext()) { - * var png = pngs.next(); - * Logger.log(png.getSize()); - * } + * // Use plain string to log the size of every PNG in the user's Drive. + * var pngs = DriveApp.getFilesByType('image/png'); + * while (pngs.hasNext()) { + * var png = pngs.next(); + * Logger.log(png.getSize()); + * } */ - export enum MimeType { GOOGLE_APPS_SCRIPT, GOOGLE_DRAWINGS, GOOGLE_DOCS, GOOGLE_FORMS, GOOGLE_SHEETS, GOOGLE_SLIDES, FOLDER, BMP, GIF, JPEG, PNG, SVG, PDF, CSS, CSV, HTML, JAVASCRIPT, PLAIN_TEXT, RTF, OPENDOCUMENT_GRAPHICS, OPENDOCUMENT_PRESENTATION, OPENDOCUMENT_SPREADSHEET, OPENDOCUMENT_TEXT, MICROSOFT_EXCEL, MICROSOFT_EXCEL_LEGACY, MICROSOFT_POWERPOINT, MICROSOFT_POWERPOINT_LEGACY, MICROSOFT_WORD, MICROSOFT_WORD_LEGACY, ZIP } + export enum MimeType { GOOGLE_APPS_SCRIPT, GOOGLE_DRAWINGS, GOOGLE_DOCS, GOOGLE_FORMS, GOOGLE_SHEETS, GOOGLE_SITES, GOOGLE_SLIDES, FOLDER, BMP, GIF, JPEG, PNG, SVG, PDF, CSS, CSV, HTML, JAVASCRIPT, PLAIN_TEXT, RTF, OPENDOCUMENT_GRAPHICS, OPENDOCUMENT_PRESENTATION, OPENDOCUMENT_SPREADSHEET, OPENDOCUMENT_TEXT, MICROSOFT_EXCEL, MICROSOFT_EXCEL_LEGACY, MICROSOFT_POWERPOINT, MICROSOFT_POWERPOINT_LEGACY, MICROSOFT_WORD, MICROSOFT_WORD_LEGACY, ZIP } /** * An enum representing the months of the year. @@ -190,22 +190,22 @@ declare namespace GoogleAppsScript { /** * A response to a prompt dialog displayed in the - * user-interface environment for a Google App. The response contains any text the user entered in - * the dialog's input field and indicates which button the user clicked to dismiss the dialog. + * user-interface environment for a Google App. The response contains any text the user entered in + * the dialog's input field and indicates which button the user clicked to dismiss the dialog. * - * // Display a dialog box with a title, message, input field, and "Yes" and "No" buttons. The - * // user can also close the dialog by clicking the close button in its title bar. - * var ui = DocumentApp.getUi(); - * var response = ui.prompt('Getting to know you', 'May I know your name?', ui.ButtonSet.YES_NO); + * // Display a dialog box with a title, message, input field, and "Yes" and "No" buttons. The + * // user can also close the dialog by clicking the close button in its title bar. + * var ui = DocumentApp.getUi(); + * var response = ui.prompt('Getting to know you', 'May I know your name?', ui.ButtonSet.YES_NO); * - * // Process the user's response. - * if (response.getSelectedButton() == ui.Button.YES) { - * Logger.log('The user\'s name is %s.', response.getResponseText()); - * } else if (response.getSelectedButton() == ui.Button.NO) { - * Logger.log('The user didn\'t want to provide a name.'); - * } else { - * Logger.log('The user clicked the close button in the dialog\'s title bar.'); - * } + * // Process the user's response. + * if (response.getSelectedButton() == ui.Button.YES) { + * Logger.log('The user\'s name is %s.', response.getResponseText()); + * } else if (response.getSelectedButton() == ui.Button.NO) { + * Logger.log('The user didn\'t want to provide a name.'); + * } else { + * Logger.log('The user clicked the close button in the dialog\'s title bar.'); + * } */ export interface PromptResponse { getResponseText(): string; @@ -214,7 +214,7 @@ declare namespace GoogleAppsScript { /** * The Session class provides access to session information, such as the user's email address (in - * some circumstances) and language setting. + * some circumstances) and language setting. */ export interface Session { getActiveUser(): User; @@ -228,23 +228,22 @@ declare namespace GoogleAppsScript { /** * An instance of the user-interface environment for a Google App that allows the script to add - * features like menus, dialogs, and sidebars. A script can only interact with the UI for the - * current instance of an open editor, and only if the script is - * container-bound to the editor. + * features like menus, dialogs, and sidebars. A script can only interact with the UI for the + * current instance of an open editor, and only if the script is container-bound to the editor. * - * // Display a dialog box with a title, message, input field, and "Yes" and "No" buttons. The - * // user can also close the dialog by clicking the close button in its title bar. - * var ui = SpreadsheetApp.getUi(); - * var response = ui.prompt('Getting to know you', 'May I know your name?', ui.ButtonSet.YES_NO); + * // Display a dialog box with a title, message, input field, and "Yes" and "No" buttons. The + * // user can also close the dialog by clicking the close button in its title bar. + * var ui = SpreadsheetApp.getUi(); + * var response = ui.prompt('Getting to know you', 'May I know your name?', ui.ButtonSet.YES_NO); * - * // Process the user's response. - * if (response.getSelectedButton() == ui.Button.YES) { - * Logger.log('The user\'s name is %s.', response.getResponseText()); - * } else if (response.getSelectedButton() == ui.Button.NO) { - * Logger.log('The user didn\'t want to provide a name.'); - * } else { - * Logger.log('The user clicked the close button in the dialog\'s title bar.'); - * } + * // Process the user's response. + * if (response.getSelectedButton() == ui.Button.YES) { + * Logger.log('The user\'s name is %s.', response.getResponseText()); + * } else if (response.getSelectedButton() == ui.Button.NO) { + * Logger.log('The user didn\'t want to provide a name.'); + * } else { + * Logger.log('The user clicked the close button in the dialog\'s title bar.'); + * } */ export interface Ui { Button: typeof Button; @@ -276,6 +275,44 @@ declare namespace GoogleAppsScript { */ export enum Weekday { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY } + /** + * This class allows the developer to write logs to the Google Cloud Platform's Stackdriver Logging service. The following + * shows some logging examples: + * + * function measuringExecutionTime() { + * // 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". + * var parameters = { + * isValid: true, + * content: 'some string', + * timestamp: new Date() + * }; + * console.log({message: 'Function Input', initialData: parameters}); + * + * var label = 'myFunction() time'; // Labels the timing log entry. + * console.time(label); // Starts the timer. + * try { + * myFunction(parameters); // Function to time. + * } catch (e) { + * // Logs an ERROR message. + * console.error('myFunction() yielded an error: ' + e); + * } + * console.timeEnd(label); // Stops the timer, logs execution duration. + * } + */ + export interface console { + error(formatOrObject: Object, ...values: Object[]): void; + info(formatOrObject: Object, ...values: Object[]): void; + log(formatOrObject: Object, ...values: Object[]): void; + time(label: string): void; + timeEnd(label: string): void; + warn(formatOrObject: Object, ...values: Object[]): void; + } + } } 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 23a9b19c34..7056dc0b08 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 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,22 +10,22 @@ declare namespace GoogleAppsScript { /** * A reference to a particular cache. * - * This class allows you to insert, retrieve, and remove items from a cache. This can be - * particularly useful when you want frequent access to an expensive or slow resource. For - * example, say you have an RSS feed at example.com that takes 20 seconds to fetch, but you want - * to speed up access on an average request. + * This class allows you to insert, retrieve, and remove items from a cache. This can be + * particularly useful when you want frequent access to an expensive or slow resource. For example, + * say you have an RSS feed at example.com that takes 20 seconds to fetch, but you want to speed up + * access on an average request. * - * function getRssFeed() { - * var cache = CacheService.getScriptCache(); - * var cached = cache.get("rss-feed-contents"); - * if (cached != null) { - * return cached; - * } - * var result = UrlFetchApp.fetch("http://example.com/my-slow-rss-feed.xml"); // takes 20 seconds - * var contents = result.getContentText(); - * cache.put("rss-feed-contents", contents, 1500); // cache for 25 minutes - * return contents; - * } + * function getRssFeed() { + * var cache = CacheService.getScriptCache(); + * var cached = cache.get("rss-feed-contents"); + * if (cached != null) { + * return cached; + * } + * var result = UrlFetchApp.fetch("http://example.com/my-slow-rss-feed.xml"); // takes 20 seconds + * var contents = result.getContentText(); + * cache.put("rss-feed-contents", contents, 1500); // cache for 25 minutes + * return contents; + * } */ export interface Cache { get(key: string): string; @@ -41,9 +41,9 @@ declare namespace GoogleAppsScript { /** * CacheService allows you to access a cache for short term storage of data. * - * 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. + * 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. */ export interface CacheService { getDocumentCache(): Cache; diff --git a/types/google-apps-script/google-apps-script.calendar.d.ts b/types/google-apps-script/google-apps-script.calendar.d.ts index 21770b6efb..3665b30e9e 100644 --- a/types/google-apps-script/google-apps-script.calendar.d.ts +++ b/types/google-apps-script/google-apps-script.calendar.d.ts @@ -1,7 +1,6 @@ -// Type definitions for Google Apps Script 2018-05-03 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen -// linlex // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -14,6 +13,8 @@ declare namespace GoogleAppsScript { */ export interface Calendar { createAllDayEvent(title: string, date: Date): CalendarEvent; + createAllDayEvent(title: string, startDate: Date, endDate: Date): CalendarEvent; + createAllDayEvent(title: string, startDate: Date, endDate: Date, options: Object): CalendarEvent; createAllDayEvent(title: string, date: Date, options: Object): CalendarEvent; createAllDayEventSeries(title: string, startDate: Date, recurrence: EventRecurrence): CalendarEventSeries; createAllDayEventSeries(title: string, startDate: Date, recurrence: EventRecurrence, options: Object): CalendarEventSeries; @@ -48,9 +49,9 @@ declare namespace GoogleAppsScript { } /** - * Allows a script to read and update the user's Google Calendar. This class provides direct - * access to the user's default calendar, as well as the ability to retrieve additional calendars - * that the user owns or is subscribed to. + * Allows a script to read and update the user's Google Calendar. This class provides direct access + * to the user's default calendar, as well as the ability to retrieve additional calendars that the + * user owns or is subscribed to. */ export interface CalendarApp { Color: typeof Color; @@ -60,6 +61,8 @@ declare namespace GoogleAppsScript { Visibility: typeof Visibility; Weekday: typeof Base.Weekday; createAllDayEvent(title: string, date: Date): CalendarEvent; + createAllDayEvent(title: string, startDate: Date, endDate: Date): CalendarEvent; + createAllDayEvent(title: string, startDate: Date, endDate: Date, options: Object): CalendarEvent; createAllDayEvent(title: string, date: Date, options: Object): CalendarEvent; createAllDayEventSeries(title: string, startDate: Date, recurrence: EventRecurrence): CalendarEventSeries; createAllDayEventSeries(title: string, startDate: Date, recurrence: EventRecurrence, options: Object): CalendarEventSeries; @@ -77,6 +80,7 @@ declare namespace GoogleAppsScript { getColor(): string; getDefaultCalendar(): Calendar; getDescription(): string; + getEventById(iCalId: string): CalendarEvent; getEventSeriesById(iCalId: string): CalendarEventSeries; getEvents(startTime: Date, endTime: Date): CalendarEvent[]; getEvents(startTime: Date, endTime: Date, options: Object): CalendarEvent[]; @@ -147,6 +151,7 @@ declare namespace GoogleAppsScript { removeGuest(email: string): CalendarEvent; resetRemindersToDefault(): CalendarEvent; setAllDayDate(date: Date): CalendarEvent; + setAllDayDates(startDate: Date, endDate: Date): CalendarEvent; setAnyoneCanAddSelf(anyoneCanAddSelf: boolean): CalendarEvent; setColor(color: string): CalendarEvent; setDescription(description: string): CalendarEvent; @@ -259,10 +264,10 @@ declare namespace GoogleAppsScript { /** * Represents a recurrence rule for an event series. * - * Note that this class also behaves like the EventRecurrence that it belongs - * to, allowing you to chain rule creation together like so: + * Note that this class also behaves like the EventRecurrence that it belongs to, + * allowing you to chain rule creation together like so: * - * recurrence.addDailyRule().times(3).interval(2).addWeeklyExclusion().times(2); + * recurrence.addDailyRule().times(3).interval(2).addWeeklyExclusion().times(2); * * times(times) * interval(interval) diff --git a/types/google-apps-script/google-apps-script.card-service.d.ts b/types/google-apps-script/google-apps-script.card-service.d.ts new file mode 100644 index 0000000000..8e33747bbc --- /dev/null +++ b/types/google-apps-script/google-apps-script.card-service.d.ts @@ -0,0 +1,660 @@ +// Type definitions for Google Apps Script 2018-07-11 +// Project: https://developers.google.com/apps-script/ +// Definitions by: motemen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare namespace GoogleAppsScript { + 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. + * + * var image = CardService.newImage() + * .setOnClickAction(CardService.newAction() + * .setFunctionName("handleImageClick") + * .setParameters({imageSrc: 'carImage'})); + */ + export interface Action { + setFunctionName(functionName: string): Action; + setLoadIndicator(loadIndicator: LoadIndicator): Action; + setParameters(parameters: Object): Action; + setMethodName(functionName: string): Action; + } + + /** + * The response object that may be returned from a callback function (e.g., a form response handler) + * to perform one or more actions on the client. Some combinations of actions are not supported. + * + * // An action that opens a link + * var actionResponse = CardService.newActionResponseBuilder() + * .setOpenLink(CardService.newOpenLink() + * .setUrl("https://www.google.com")) + * .build(); + * + * // An action that shows a notification. + * var actionResponse = CardService.newActionResponseBuilder() + * .setNotification(CardService.newNotification() + * .setType(CardService.Notification.INFO) + * .setText("Some info to display to user")) + * .build(); + * + * // An action that shows an additional card. It also sets a flag to indicate that the original + * // state data has changed. + * + * var cardBuilder = CardService.newCardBuilder(); + * // Build card ... + * var actionResponse = CardService.newActionResponseBuilder() + * .setNavigation(CardService.newNavigation() + * .pushCard(cardBuilder.build())) + * .setStateChanged(true) + * .build(); + */ + export interface ActionResponse { + printJson(): string; + } + + /** + * A builder for ActionResponse objects. + */ + export interface ActionResponseBuilder { + build(): ActionResponse; + setNavigation(navigation: Navigation): ActionResponseBuilder; + setNotification(notification: Notification): ActionResponseBuilder; + setOpenLink(openLink: OpenLink): ActionResponseBuilder; + setStateChanged(stateChanged: boolean): ActionResponseBuilder; + } + + /** + * An authorization action that will send the user to the AuthorizationUrl when clicked. + * + * CardService.newAuthorizationAction() + * .setAuthorizationUrl("http://google.com/"); + */ + export interface AuthorizationAction { + setAuthorizationUrl(authorizationUrl: string): AuthorizationAction; + } + + /** + * An error that can be returned to trigger an authorization card to be shown to the user. + * + * CardService.newAuthorizationException() + * .setAuthorizationUrl("http://auth.com/") + * .setResourceDisplayName("Example Resource") + * .throwException(); + */ + export interface AuthorizationException { + printJson(): string; + setAuthorizationUrl(authUrl: string): AuthorizationException; + setCustomUiCallback(callback: string): AuthorizationException; + setResourceDisplayName(name: string): AuthorizationException; + throwException(): void; + } + + /** + * A base class for all buttons. + */ + export interface Button { + setAuthorizationAction(action: AuthorizationAction): Button; + setComposeAction(action: Action, composedEmailType: ComposedEmailType): Button; + setOnClickAction(action: Action): Button; + setOnClickOpenLinkAction(action: Action): Button; + setOpenLink(openLink: OpenLink): Button; + } + + /** + * Holds a set of Button objects that are displayed in a row. + * + * var textButton = CardService.newTextButton(); + * // Finish building the text button... + * + * var imageButton = CardService.newImageButton(); + * // Finish building the image button... + * + * var buttonSet = CardService.newButtonSet() + * .addButton(textButton) + * .addButton(imageButton); + */ + export interface ButtonSet { + addButton(button: Button): ButtonSet; + } + + /** + * A context card that represents a single view in the + * UI. + * + * var cardSection = CardService.newCardSection(); + * // Finish building the card section ... + * + * var card = CardService.newCardBuilder() + * .setName("Card name") + * .setHeader(CardService.newCardHeader().setTitle("Card title")) + * .addSection(cardSection) + * .build(); + */ + export interface Card { + printJson(): string; + } + + /** + * A clickable menu item that is added to the card header menu. + * + * var action = CardService.newAction(); + * // Finish building the action... + * + * var cardAction = CardService.newCardAction() + * .setText("Card action") + * .setOnClickAction(action); + */ + export interface CardAction { + setAuthorizationAction(action: AuthorizationAction): CardAction; + setComposeAction(action: Action, composedEmailType: ComposedEmailType): CardAction; + setOnClickAction(action: Action): CardAction; + setOnClickOpenLinkAction(action: Action): CardAction; + setOpenLink(openLink: OpenLink): CardAction; + setText(text: string): CardAction; + } + + /** + * A builder for Card objects. + */ + export interface CardBuilder { + addCardAction(cardAction: CardAction): CardBuilder; + addSection(section: CardSection): CardBuilder; + build(): Card; + setHeader(cardHeader: CardHeader): CardBuilder; + setName(name: string): CardBuilder; + } + + /** + * The header of a Card. + * + * var cardHeader = CardService.newCardHeader() + * .setTitle("Card header title") + * .setSubtitle("Card header subtitle") + * .setImageStyle(CardService.ImageStyle.CIRCLE) + * .setImageUrl("https://image.png"); + */ + export interface CardHeader { + setImageAltText(imageAltText: string): CardHeader; + setImageStyle(imageStyle: ImageStyle): CardHeader; + setImageUrl(imageUrl: string): CardHeader; + setSubtitle(subtitle: string): CardHeader; + setTitle(title: string): CardHeader; + } + + /** + * A card section holds groups of widgets and provides visual separation between them. + * + * var image = CardService.newImage(); + * // Build image ... + * var textParagraph = CardService.newTextParagraph(); + * // Build text paragraph ... + * + * var cardSection = CardService.newCardSection() + * .setHeader("Section header") + * .addWidget(image) + * .addWidget(textParagraph); + */ + export interface CardSection { + addWidget(widget: Widget): CardSection; + setCollapsible(collapsible: boolean): CardSection; + setHeader(header: string): CardSection; + setNumUncollapsibleWidgets(numUncollapsibleWidgets: Integer): CardSection; + } + + /** + * CardService provides the ability to create generic cards used across different Google + * extensibility products, such as Gmail add-ons. + * + * Currently you can only use this service to construct Gmail add-ons. + * + * return CardService.newCardBuilder() + * .setHeader(CardService.newCardHeader().setTitle("CardTitle")) + * .build(); + * + * Or you can return multiple Cards like so: + * + * return [ + * CardService.newCardBuilder().build(), + * CardService.newCardBuilder().build(), + * CardService.newCardBuilder().build() + * ] + * + * The following shows how you could define a card with a header, text, an image and a menu item: + * + * function createWidgetDemoCard() { + * return CardService + * .newCardBuilder() + * .setHeader( + * CardService.newCardHeader() + * .setTitle('Widget demonstration') + * .setSubtitle('Check out these widgets') + * .setImageStyle(CardService.ImageStyle.SQUARE) + * .setImageUrl( + * 'https://www.example.com/images/headerImage.png')) + * .addSection( + * CardService.newCardSection() + * .setHeader('Simple widgets') // optional + * .addWidget(CardService.newTextParagraph().setText( + * 'These widgets are display-only. ' + + * 'A text paragraph can have multiple lines and ' + + * 'formatting.')) + * .addWidget(CardService.newImage().setImageUrl( + * 'https://www.example.com/images/mapsImage.png'))) + * .addCardAction(CardService.newCardAction().setText('Gmail').setOpenLink( + * CardService.newOpenLink().setUrl('https://mail.google.com/mail'))) + * .build(); + * } + */ + export interface CardService { + ComposedEmailType: typeof ComposedEmailType; + Icon: typeof Icon; + ImageStyle: typeof ImageStyle; + LoadIndicator: typeof LoadIndicator; + NotificationType: typeof NotificationType; + OnClose: typeof OnClose; + OpenAs: typeof OpenAs; + SelectionInputType: typeof SelectionInputType; + newAction(): Action; + newActionResponseBuilder(): ActionResponseBuilder; + newAuthorizationAction(): AuthorizationAction; + newAuthorizationException(): AuthorizationException; + newButtonSet(): ButtonSet; + newCardAction(): CardAction; + newCardBuilder(): CardBuilder; + newCardHeader(): CardHeader; + newCardSection(): CardSection; + newComposeActionResponseBuilder(): ComposeActionResponseBuilder; + newImage(): Image; + newImageButton(): ImageButton; + newKeyValue(): KeyValue; + newNavigation(): Navigation; + newNotification(): Notification; + newOpenLink(): OpenLink; + newSelectionInput(): SelectionInput; + newSuggestions(): Suggestions; + newSuggestionsResponseBuilder(): SuggestionsResponseBuilder; + newSwitch(): Switch; + newTextButton(): TextButton; + newTextInput(): TextInput; + newTextParagraph(): TextParagraph; + newUniversalActionResponseBuilder(): UniversalActionResponseBuilder; + } + + /** + * The response object that may be returned from a callback method for compose action in a Gmail add-on. + * + * var composeActionResponse = CardService.newComposeActionResponseBuilder() + * .setGmailDraft(GmailApp.createDraft("recipient", "subject", "body")) + * .build(); + */ + export interface ComposeActionResponse { + printJson(): string; + } + + /** + * A builder for ComposeActionResponse objects. + */ + export interface ComposeActionResponseBuilder { + build(): ComposeActionResponse; + setGmailDraft(draft: Gmail.GmailDraft): ComposeActionResponseBuilder; + } + + /** + * An enum value that specifies whether the composed email is a standalone or reply draft. + */ + export enum ComposedEmailType { REPLY_AS_DRAFT, STANDALONE_DRAFT } + + /** + * Predefined icons that can be used in various UI objects, such as ImageButton or KeyValue widgets. + */ + export enum Icon { NONE, AIRPLANE, BOOKMARK, BUS, CAR, CLOCK, CONFIRMATION_NUMBER_ICON, DOLLAR, DESCRIPTION, EMAIL, EVENT_PERFORMER, EVENT_SEAT, FLIGHT_ARRIVAL, FLIGHT_DEPARTURE, HOTEL, HOTEL_ROOM_TYPE, INVITE, MAP_PIN, MEMBERSHIP, MULTIPLE_PEOPLE, OFFER, PERSON, PHONE, RESTAURANT_ICON, SHOPPING_CART, STAR, STORE, TICKET, TRAIN, VIDEO_CAMERA, VIDEO_PLAY } + + /** + * A widget that shows a single image. + * + * var image = CardService.newImage().setAltText("A nice image").setImageUrl("https://image.png"); + */ + export interface Image { + setAltText(altText: string): Image; + setAuthorizationAction(action: AuthorizationAction): Image; + setComposeAction(action: Action, composedEmailType: ComposedEmailType): Image; + setImageUrl(url: string): Image; + setOnClickAction(action: Action): Image; + setOnClickOpenLinkAction(action: Action): Image; + setOpenLink(openLink: OpenLink): Image; + } + + /** + * A ImageButton with an image displayed on it. + * + * var imageButton = CardService.newImageButton() + * .setAltText("An image button with an airplane icon.") + * .setIcon(CardService.Icon.AIRPLANE) + * .setOpenLink(CardService.newOpenLink() + * .setUrl("https://airplane.com")); + */ + export interface ImageButton { + setAltText(altText: string): ImageButton; + setAuthorizationAction(action: AuthorizationAction): ImageButton; + setComposeAction(action: Action, composedEmailType: ComposedEmailType): ImageButton; + setIcon(icon: Icon): ImageButton; + setIconUrl(url: string): ImageButton; + setOnClickAction(action: Action): ImageButton; + setOnClickOpenLinkAction(action: Action): ImageButton; + setOpenLink(openLink: OpenLink): ImageButton; + } + + /** + * An enum that defines an image cropping style. + */ + export enum ImageStyle { SQUARE, CIRCLE } + + /** + * A widget that displays one or more "keys" around a text "value". The possible keys include an + * icon, a label above and a label below. Setting the text content and one of the keys is required + * using setContent(text) and one of setIcon(icon), setIconUrl(url), setTopLabel(text), + * or setBottomLabel(text). + * + * var imageKeyValue = CardService.newKeyValue() + * .setIconUrl("https://icon.png") + * .setContent("KeyValue widget with an image on the left and text on the right"); + * + * var textKeyValue = CardService.newKeyValue() + * .setTopLabel("Text key") + * .setContent("KeyValue widget with text key on top and cotent below"); + * + * var multilineKeyValue = CardService.newKeyValue() + * .setTopLabel("Top label - single line)") + * .setContent("Content can be multiple lines") + * .setMultiline(true) + * .setBottomLabel("Bottom label - single line"); + */ + export interface KeyValue { + setAuthorizationAction(action: AuthorizationAction): KeyValue; + setBottomLabel(text: string): KeyValue; + setButton(button: Button): KeyValue; + setComposeAction(action: Action, composedEmailType: ComposedEmailType): KeyValue; + setContent(text: string): KeyValue; + setIcon(icon: Icon): KeyValue; + setIconAltText(altText: string): KeyValue; + setIconUrl(url: string): KeyValue; + setMultiline(multiline: boolean): KeyValue; + setOnClickAction(action: Action): KeyValue; + setOnClickOpenLinkAction(action: Action): KeyValue; + setOpenLink(openLink: OpenLink): KeyValue; + setSwitch(switchToSet: Switch): KeyValue; + setTopLabel(text: string): KeyValue; + } + + /** + * An enum type that specifies the type of loading or progress indicator to display while an Action is being processed. + */ + export enum LoadIndicator { SPINNER, NONE } + + /** + * A helper object that controls card navigation. See the card navigation guide for more details. + */ + export interface Navigation { + popCard(): Navigation; + popToNamedCard(cardName: string): Navigation; + popToRoot(): Navigation; + printJson(): string; + pushCard(card: Card): Navigation; + updateCard(card: Card): Navigation; + } + + /** + * A notification shown to the user as a response to interacting with a UI element. + * + * var action = CardService.newAction().setFunctionName("notificationCallback"); + * CardService.newTextButton().setText('Save').setOnClickAction(action); + * + * // ... + * + * function notificationCallback() { + * return CardService.newActionResponseBuilder() + * .setNotification(CardService.newNotification() + * .setType(CardService.NotificationType.WARNING) + * .setText("Some info to display to user")) + * .build(); + * } + */ + export interface Notification { + setText(text: string): Notification; + setType(type: NotificationType): Notification; + } + + /** + * Type of notification to show. + */ + export enum NotificationType { INFO, ERROR, WARNING } + + /** + * An enum that specifies what to do when a URL opened through an OpenLink is closed. + * + * When a link is opened, the client either forgets about it or waits until the window is closed. + * The implementation depends on the client platform capabilities. OnClose may cause OpenAs to be ignored; if the client platform cannot support both selected values together, + * OnClose takes precedence. + */ + export enum OnClose { NOTHING, RELOAD_ADD_ON } + + /** + * An enum that specifies how to open a URL. + * + * The client can open a URL as either a full size window (if that is the frame used by the + * client), or an overlay (such as a pop-up). The implementation depends on the client platform + * capabilities, and the value selected may be ignored if the client does not support it. FULL_SIZE is supported by all clients. + * + * Using OnClose may cause OpenAs to be ignored; if the client platform cannot + * support both selected values together, OnClose takes precedence. + */ + export enum OpenAs { FULL_SIZE, OVERLAY } + + /** + * Represents an action to open a link with some options. + * + * // A button that opens as a link in an overlay and + * // requires a reload when closed. + * var button = CardService.newTextButton() + * .setText("This button opens a link in an overlay window") + * .setOpenLink(CardService.newOpenLink() + * .setUrl("https://www.google.com") + * .setOpenAs(CardService.OpenAs.OVERLAY) + * .setOnClose(CardService.OnClose.RELOAD_ADD_ON)); + * + * // An action response that opens a link in full screen and + * // requires no action when closed. + * var actionResponse = CardService.newActionResponseBuilder() + * .setOpenLink(CardService.newOpenLink() + * .setUrl("https://www.google.com") + * .setOpenAs(CardService.OpenAs.FULL_SIZE) + * .setOnClose(CardService.OnClose.NOTHING)); + * .build(); + */ + export interface OpenLink { + setOnClose(onClose: OnClose): OpenLink; + setOpenAs(openAs: OpenAs): OpenLink; + setUrl(url: string): OpenLink; + } + + /** + * An input field that allows choosing between a set of predefined options. + * + * var checkboxGroup = CardService.newSelectionInput() + * .setType(CardService.SelectionInputType.CHECK_BOX) + * .setTitle("A group of checkboxes. Multiple selections are allowed.") + * .setFieldName("checkbox_field") + * .addItem("checkbox one title", "checkbox_one_value", false) + * .addItem("checkbox two title", "checkbox_two_value", true) + * .addItem("checkbox three title", "checkbox_three_value", false) + * .setOnChangeAction(CardService.newAction() + * .setFunctionName("handleCheckboxChange")); + * + * var radioGroup = CardService.newSelectionInput() + * .setType(CardService.SelectionInputType.RADIO_BUTTON) + * .setTitle("A group of radio buttons. Only a single selection is allowed.") + * .setFieldName("checkbox_field") + * .addItem("radio button one title", "radio_one_value", true) + * .addItem("radio button two title", "radio_two_value", true) + * .addItem("radio button three title", "radio_three_value", false); + */ + export interface SelectionInput { + addItem(text: Object, value: Object, selected: boolean): SelectionInput; + setFieldName(fieldName: string): SelectionInput; + setOnChangeAction(action: Action): SelectionInput; + setTitle(title: string): SelectionInput; + setType(type: SelectionInputType): SelectionInput; + } + + /** + * Type of selection input. + */ + export enum SelectionInputType { CHECK_BOX, RADIO_BUTTON, DROPDOWN } + + /** + * Autocomplete suggestions to supplement a TextInput widget. + * + * var textInput = CardService.newTextInput() + * .setSuggestions(CardService.newSuggestions() + * .addSuggestion("First suggestion") + * .addSuggestion("Second suggestion")) + */ + export interface Suggestions { + addSuggestion(suggestion: string): Suggestions; + addSuggestions(suggestions: Object[]): Suggestions; + } + + /** + * A response object that can be returned from a suggestions callback function. This is used with + * TextInput widgets that implement autocomplete. + * + * var suggestionsResponse = CardService.newSuggestionsResponseBuilder() + * .setSuggestions(CardService.newSuggestions() + * .addSuggestion("First suggestion") + * .addSuggestion("Second suggestion")) + * .build(); + */ + export interface SuggestionsResponse { + printJson(): string; + } + + /** + * A builder for SuggestionsResponse objects. + */ + export interface SuggestionsResponseBuilder { + build(): SuggestionsResponse; + setSuggestions(suggestions: Suggestions): SuggestionsResponseBuilder; + } + + /** + * A UI element that supports being toggled on or off. This can only be used within a KeyValue widget. + * + * var switchKeyValue = CardService.newKeyValue() + * .setTopLabel("Switch key value widget label") + * .setContent("This is a key value widget with a switch on the right") + * .setSwitch(CardService.newSwitch() + * .setFieldName("form_input_switch_key") + * .setValue("form_input_switch_value") + * .setOnChangeAction(CardService.newAction() + * .setFunctionName("handleSwitchChange"))); + */ + export interface Switch { + setFieldName(fieldName: string): Switch; + setOnChangeAction(action: Action): Switch; + setSelected(selected: boolean): Switch; + setValue(value: string): Switch; + } + + /** + * A TextButton with a text label. + * + * var textButton = CardService.newTextButton() + * .setText("Open Link") + * .setOpenLink(CardService.newOpenLink() + * .setUrl("https://www.google.com")); + */ + export interface TextButton { + setAuthorizationAction(action: AuthorizationAction): TextButton; + setComposeAction(action: Action, composedEmailType: ComposedEmailType): TextButton; + setOnClickAction(action: Action): TextButton; + setOnClickOpenLinkAction(action: Action): TextButton; + setOpenLink(openLink: OpenLink): TextButton; + setText(text: string): TextButton; + } + + /** + * A input field widget that accepts text input. + * + * var textInput = CardService.newTextInput() + * .setFieldName("text_input_form_input_key") + * .setTitle("Text input title") + * .setHint("Text input hint"); + */ + export interface TextInput { + setFieldName(fieldName: string): TextInput; + setHint(hint: string): TextInput; + setMultiline(multiline: boolean): TextInput; + setOnChangeAction(action: Action): TextInput; + setSuggestions(suggestions: Suggestions): TextInput; + setSuggestionsAction(suggestionsAction: Action): TextInput; + setTitle(title: string): TextInput; + setValue(value: string): TextInput; + } + + /** + * A widget that displays text and supports basic HTML formatting. + * + * var textParagraph = CardService.newTextParagraph() + * .setText("This is a text paragraph widget. Multiple lines are allowed if needed."); + */ + export interface TextParagraph { + setText(text: string): TextParagraph; + } + + /** + * The response object that may be returned from a method that creates universal action. + * + * // A universal action that opens a link. + * var openLinkUniversalAction = CardService.newUniversalActionResponseBuilder() + * .setOpenLink(CardService.newOpenLink() + * .setUrl("https://www.google.com")) + * .build(); + * + * var cardBuilder1 = CardService.newCardBuilder(); + * var cardBuilder2 = CardService.newCardBuilder(); + * // Finish building the cards ... + * + * // A universal action that shows two static cards. + * var cardsUniversalAction = CardService.newUniversalActionResponseBuilder() + * .displayAddOnCards([ + * cardBuilder1.build(); + * cardBuilder2.build(); + * ]).build(); + */ + export interface UniversalActionResponse { + printJson(): string; + } + + /** + * A builder for the UniversalActionResponse objects. + */ + export interface UniversalActionResponseBuilder { + build(): UniversalActionResponse; + displayAddOnCards(cardObjects: Object[]): UniversalActionResponseBuilder; + setOpenLink(openLink: OpenLink): UniversalActionResponseBuilder; + } + + /** + * Base class for all widgets that can be added to a Card. + */ + export interface Widget { + } + + } +} + +declare var CardService: GoogleAppsScript.Card_Service.CardService; diff --git a/types/google-apps-script/google-apps-script.card.d.ts b/types/google-apps-script/google-apps-script.card.d.ts deleted file mode 100644 index d879d30091..0000000000 --- a/types/google-apps-script/google-apps-script.card.d.ts +++ /dev/null @@ -1,661 +0,0 @@ -// Type definitions for Google Apps Script 2017-10-30 -// Project: https://developers.google.com/apps-script/ -// Definitions by: dhayab -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// -/// - -declare namespace GoogleAppsScript { - export module Card { - export interface Action { - /** - * Sets the name of the callback function to be called. - */ - setFunctionName(functionName: string): Action; - /** - * Sets the loading indicator that displays while the action is in progress. - */ - setLoadIndicator(loadIndicator: LoadIndicator): Action; - /** - * Allows custom parameters to be passed to the callback function. - */ - setParameters(parameters: { [key: string]: string }): Action; - } - - export interface ActionEvent { - messageMetadata: { - /** - * An access token. You can use this to enable access to user data using temporary Gmail add-on scopes. - */ - accessToken: string; - /** - * The message ID of the thread open in the Gmail UI. - */ - messageId: string; - } - /** - * Indicates where the event originates (web, iOS, or Android). - */ - clientPlatform: string; - /** - * The current values of all form widgets in the card, restricted to one value per widget. The keys are the string IDs associated with the widgets. - * - * The event object provides `formInput` as a convenience for when you need to read data from multiple widgets with expected singular values, such as text inputs and switches. - * - * For multi-valued widgets such as checkboxes, you can read each value from `formInputs` instead. - */ - formInput: { [key: string]: string }; - /** - * The current values of widgets in the card, presented in arrays. The keys are the string IDs associated with the widget. - * - * For single-valued widgets, the value is presented in a single-element array. For multi-valued widgets such as checkboxes, all the values are presented in an array. - */ - formInputs: { [key: string]: string[] }; - /** - * Any additional parameters you supply to the `Action` using `Action.setParameters()`. - */ - parameters: { [key: string]: string }; - } - - export interface ActionResponse { - /** - * Prints the JSON representation of this object. - */ - printJson(): string; - } - - export interface ActionResponseBuilder { - /** - * Builds the current action response and validates it. - */ - build(): ActionResponse; - /** - * Sets the response to `Navigation` action. - */ - setNavigation(navigation: Navigation): ActionResponseBuilder; - /** - * Sets the notification to display when the action is activated. - */ - setNotification(notification: Notification): ActionResponseBuilder; - /** - * Sets the URL to navigate to when the action is activated. - */ - setOpenLink(openLink: OpenLink): ActionResponseBuilder; - /** - * Sets a flag to indicate that this action changed the existing data state. - */ - setStateChanged(stateChanged: boolean): ActionResponseBuilder; - } - - export interface AuthorizationAction { - /** - * Sets the authorization URL that user is taken to from the authorization prompt. - */ - setAuthorizationUrl(authorizationUrl: string): AuthorizationAction; - } - - export interface AuthorizationException { - /** - * Prints the JSON representation of this object. - */ - printJson(): string; - /** - * Sets the authorization URL that user is taken to from the authorization prompt. - */ - setAuthorizationUrl(authUrl: string): AuthorizationException; - /** - * The name of a function to call to generate a custom authorization prompt. - */ - setCustomUiCallback(callback: string): AuthorizationException; - /** - * Sets the name that is displayed to the user when asking for authorization. - */ - setResourceDisplayName(name: string): AuthorizationException; - /** - * Triggers this exception to be thrown. - */ - throwException(): void; - } - - interface Button extends Widget { - /** - * Sets an authorization action that opens a URL to the authorization flow when the object is clicked. - */ - setAuthorizationAction(action: AuthorizationAction): T; - /** - * Sets an action that composes a draft email when the object is clicked. - */ - setComposeAction(action: Action, composedEmailType: ComposedEmailType): T; - /** - * Sets an action that executes when the object is clicked. - */ - setOnClickAction(action: Action): T; - /** - * Sets an action that opens a URL in a tab when the object is clicked. - */ - setOnClickOpenLinkAction(action: Action): T; - /** - * Sets a URL to be opened when the object is clicked. - */ - setOpenLink(openLink: OpenLink): T; - } - - export interface ButtonSet extends Widget { - /** - * Adds a button. - */ - addButton(button: Button): ButtonSet; - } - - export interface Card { - /** - * Prints the JSON representation of this object. - */ - printJson(): string; - } - - export interface CardAction extends Button { - /** - * Sets the menu text for this action. - */ - setText(text: string): CardAction; - } - - export interface CardBuilder { - /** - * Adds a CardAction to this Card. - */ - addCardAction(cardAction: CardAction): CardBuilder; - /** - * Adds a section to this card. - */ - addSection(section: CardSection): CardBuilder; - /** - * Builds the current card and validates it. - */ - build(): Card; - /** - * Sets the header for this card. - */ - setHeader(cardHeader: CardHeader): CardBuilder; - /** - * Sets the name for this card. - */ - setName(name: string): CardBuilder; - } - - export interface CardHeader { - /** - * Sets the alternative text for the header image. - */ - setImageAltText(imageAltText: string): CardHeader; - /** - * Sets the cropping of the icon in the card header. - */ - setImageStyle(imageStyle: ImageStyle): CardHeader; - /** - * Sets the image to use in the header by providing its URL. - */ - setImageUrl(imageUrl: string): CardHeader; - /** - * Sets the subtitle of the card header. - */ - setSubtitle(subtitle: string): CardHeader; - /** - * Sets the title of the card header. - */ - setTitle(title: string): CardHeader; - } - - export interface CardSection { - /** - * Adds the given widget to this section. - */ - addWidget(widget: Widget): CardSection; - /** - * Sets whether the section can be collapsed. - */ - setCollapsible(collapsible: boolean): CardSection; - /** - * Sets the header of the section. - */ - setHeader(header: string): CardSection; - /** - * Sets the number of widgets that are still shown when this section is collapsed. - */ - setNumUncollapsibleWidgets(numUncollapsibleWidgets: Integer): CardSection; - } - - export interface CardService { - /** - * Specifies whether the composed email is a standalone or reply draft. - */ - ComposedEmailType: typeof ComposedEmailType; - /** - * Predefined icons that can be used in various UI objects, such as ImageButton or KeyValue widgets. - */ - Icon: typeof Icon; - /** - * Defines an image cropping style. - */ - ImageStyle: typeof ImageStyle; - /** - * Specifies the type of loading or progress indicator to display while an Action is being processed. - */ - LoadIndicator: typeof LoadIndicator; - /** - * Type of notification to show. - */ - NotificationType: typeof NotificationType; - /** - * Specifies what to do when a URL opened through an OpenLink is closed. - * - * When a link is opened, the client either forgets about it or waits until the window is closed. The implementation depends on the client platform capabilities. OnClose may cause OpenAs to be ignored; if the client platform cannot support both selected values together, OnClose takes precedence. - */ - OnClose: typeof OnClose; - /** - * Specifies how to open a URL. - * - * The client can open a URL as either a full size window (if that is the frame used by the client), or an overlay (such as a pop-up). The implementation depends on the client platform capabilities, and the value selected may be ignored if the client does not support it. FULL_SIZE is supported by all clients. - * - * Using OnClose may cause OpenAs to be ignored; if the client platform cannot support both selected values together, OnClose takes precedence. - */ - OpenAs: typeof OpenAs; - /** - * Type of selection input. - */ - SelectionInputType: typeof SelectionInputType; - /** - * Creates a new `Action`. - */ - newAction(): Action; - /** - * Creates a new `ActionResponseBuilder`. - */ - newActionResponseBuilder(): ActionResponseBuilder; - /** - * Creates a new `AuthorizationAction`. - */ - newAuthorizationAction(): AuthorizationAction; - /** - * Creates a new `AuthorizationException`. - */ - newAuthorizationException(): AuthorizationException; - /** - * Creates a new `ButtonSet`. - */ - newButtonSet(): ButtonSet; - /** - * Creates a new `CardAction`. - */ - newCardAction(): CardAction; - /** - * Creates a new `CardBuilder`. - */ - newCardBuilder(): CardBuilder; - /** - * Creates a new `CardHeader`. - */ - newCardHeader(): CardHeader; - /** - * Creates a new `CardSection`. - */ - newCardSection(): CardSection; - /** - * Creates a new `ComposeActionResponseBuilder`. - */ - newComposeActionResponseBuilder(): ComposeActionResponseBuilder; - /** - * Creates a new `Image`. - */ - newImage(): Image; - /** - * Creates a new `ImageButton`. - */ - newImageButton(): ImageButton; - /** - * Creates a new `KeyValue`. - */ - newKeyValue(): KeyValue; - /** - * Creates a new `Navigation`. - */ - newNavigation(): Navigation; - /** - * Creates a new `Notification`. - */ - newNotification(): Notification; - /** - * Creates a new `OpenLink`. - */ - newOpenLink(): OpenLink; - /** - * Creates a new `SelectionInput`. - */ - newSelectionInput(): SelectionInput; - /** - * Creates a new `Suggestions`. - */ - newSuggestions(): Suggestions; - /** - * Creates a new `SuggestionsResponseBuilder`. - */ - newSuggestionsResponseBuilder(): SuggestionsResponseBuilder; - /** - * Creates a new `Switch`. - */ - newSwitch(): Switch; - /** - * Creates a new `TextButton`. - */ - newTextButton(): TextButton; - /** - * Creates a new `TextInput`. - */ - newTextInput(): TextInput; - /** - * Creates a new `TextParagraph`. - */ - newTextParagraph(): TextParagraph; - /** - * Creates a new `UniversalActionResponseBuilder`. - */ - newUniversalActionResponseBuilder(): UniversalActionResponseBuilder; - } - - export interface ComposeActionResponse { - /** - * Prints the JSON representation of this object. - */ - printJson(): string; - } - - export interface ComposeActionResponseBuilder { - /** - * Builds the current compose action response and validates it. - */ - build(): ComposeActionResponse; - /** - * Sets the draft `GmailMessage` created using `GmailMessage.createDraftReply(body)` or similar functions. - */ - setGmailDraft(draft: Gmail.GmailDraft): ComposeActionResponseBuilder; - } - - export interface Image extends Button { - /** - * Sets the alternative text of the image for accessibility. - */ - setAltText(altText: string): Image; - /** - * Sets the URL of the image. - */ - setImageUrl(url: string): Image; - } - - export interface ImageButton extends Button { - /** - * Sets the alternative text of the button for accessibility. - */ - setAltText(altText: string): ImageButton; - /** - * Sets a predefined Icon to display on the button. - */ - setIcon(icon: Icon): ImageButton; - /** - * Sets the URL of an image to use as this button's icon. - */ - setIconUrl(url: string): ImageButton; - } - - export interface KeyValue extends Button { - /** - * Sets the label text to be used as the key. - */ - setBottomLabel(text: string): KeyValue; - /** - * Sets the Button that is displayed to the right of the context. - */ - setButton(button: Button): KeyValue; - /** - * Sets the text to be used as the value. - */ - setContent(text: string): KeyValue; - /** - * Sets the icon to be used as the key. - */ - setIcon(icon: Icon): KeyValue; - /** - * Sets the alternative text for the icon. - */ - setIconAltText(altText: string): KeyValue; - /** - * Sets the URL of the icon to be used as the key. - */ - setIconUrl(url: string): KeyValue; - /** - * Sets whether the value text should be displayed on a single line or multiple lines. - */ - setMultiline(multiline: boolean): KeyValue; - /** - * Sets the Switch that is displayed to the right of the content. - */ - setSwitch(switchToSet: Switch): KeyValue; - /** - * Sets the label text to be used as the key. - */ - setTopLabel(text: string): KeyValue; - } - - export interface Navigation { - /** - * Pops a card from the navigation stack. - */ - popCard(): Navigation; - /** - * Pops to the specified card by its card name. - */ - popToNamedCard(cardName: string): Navigation; - /** - * Pops the card stack to the root card. - */ - popToRoot(): Navigation; - /** - * Prints the JSON representation of this object. - */ - printJson(): string; - /** - * Pushes the given card onto the stack. - */ - pushCard(card: Card): Navigation; - /** - * Does an in-place replacement of the current card. - */ - updateCard(card: Card): Navigation; - } - - export interface Notification { - /** - * Sets the text to show in the notification. - */ - setText(text: string): Notification; - /** - * Sets the notification type to show. - */ - setType(type: NotificationType): Notification; - } - - export interface OpenLink { - /** - * Sets the behavior of the URL action when the URL window or tab is closed. - */ - setOnClose(onClose: OnClose): OpenLink; - /** - * Sets the behavior of URL when it is opened. - */ - setOpenAs(openAs: OpenAs): OpenLink; - /** - * Sets the URL to be opened. - */ - setUrl(url: string): OpenLink; - } - - export interface SelectionInput extends Widget { - /** - * Adds a new item that can be selected. - */ - addItem(text: Object, value: Object, selected: boolean): SelectionInput; - /** - * Sets the key that identifies this selection input in the event object that is generated when there is a UI interaction. - */ - setFieldName(fieldName: string): SelectionInput; - /** - * Sets an Action to be performed whenever the selection input changes. - */ - setOnChangeAction(action: Action): SelectionInput; - /** - * Sets the title to be shown ahead of the input field. - */ - setTitle(title: string): SelectionInput; - /** - * Sets the type of this input. - */ - setType(type: SelectionInputType): SelectionInput; - } - - export interface Suggestions { - /** - * Add a text suggestion. - */ - addSuggestion(suggestion: string): Suggestions; - /** - * Add a list of text suggestions. - */ - addSuggestions(suggestions: string[]): Suggestions; - } - - export interface SuggestionsResponse { - /** - * Prints the JSON representation of this object. - */ - printJson(): string; - } - - export interface SuggestionsResponseBuilder { - /** - * Builds the current suggestions response and validates it. - */ - build(): SuggestionsResponse; - /** - * Sets the suggestions used in auto complete in text fields. - */ - setSuggestions(suggestions: Suggestions): SuggestionsResponseBuilder; - } - - export interface Switch extends Widget { - /** - * Sets the key that identified this switch in the event object that is generated when there is a UI interaction. - */ - setFieldName(fieldName: string): Switch; - /** - * Sets the action to take when the switch is toggled. - */ - setOnChangeAction(action: Action): Switch; - /** - * Sets whether this switch should start as selected or unselected. - */ - setSelected(selected: boolean): Switch; - /** - * Sets the value that is sent as the form input when this switch is toggled on. - */ - setValue(value: string): Switch; - } - - export interface TextButton extends Button { - /** - * Sets the text to be displayed on the button. - */ - setText(text: string): TextButton; - } - - export interface TextInput extends Widget { - /** - * Sets the key that identifies this text input in the event object that is generated when there is a UI interaction. - */ - setFieldName(fieldName: string): TextInput; - /** - * Sets a hint for the text input. - */ - setHint(hint: string): TextInput; - /** - * Sets whether the input text shows on one line or multiple lines. - */ - setMultiline(multiline: boolean): TextInput; - /** - * Sets an action to be performed whenever the text input changes. - */ - setOnChangeAction(action: Action): TextInput; - /** - * Sets the suggestions for autocompletion in the text field. - */ - setSuggestions(suggestions: Suggestions): TextInput; - /** - * Sets the callback action to fetch suggestions based on user input for autocompletion. - */ - setSuggestionsAction(suggestionsAction: Action): TextInput - /** - * Sets the title to be shown above the input field. - */ - setTitle(title: string): TextInput; - /** - * Sets the pre-filled value to be set in the input field. - */ - setValue(value: string): TextInput; - } - - export interface TextParagraph extends Widget { - /** - * Sets the text of the paragraph. - */ - setText(text: string): TextParagraph; - } - - export interface UniversalActionResponse { - /** - * Prints the JSON representation of this object. - */ - printJson(): string; - } - - export interface UniversalActionResponseBuilder { - /** - * Builds the current universal action response and validates it. - */ - build(): UniversalActionResponse; - /** - * Displays the add-on with the specified cards. - */ - displayAddOnCards(cardObjects: Card[]): UniversalActionResponseBuilder; - /** - * Sets the URL to open when the universal action is selected. - */ - setOpenLink(openLink: OpenLink): UniversalActionResponseBuilder; - } - - export interface Widget { } - - export enum ComposedEmailType { REPLY_AS_DRAFT, STANDALONE_DRAFT } - export enum Icon { NONE, AIRPLANE, BOOKMARK, BUS, CAR, CLOCK, CONFIRMATION_NUMBER_ICON, DOLLAR, DESCRIPTION, EMAIL, EVENT_PERFORMER, EVENT_SEAT, FLIGHT_ARRIVAL, FLIGHT_DEPARTURE, HOTEL, HOTEL_ROOM_TYPE, INVITE, MAP_PIN, MEMBERSHIP, MULTIPLE_PEOPLE, OFFER, PERSON, PHONE, RESTAURANT_ICON, SHOPPING_CART, STAR, STORE, TICKET, TRAIN, VIDEO_CAMERA, VIDEO_PLAY } - export enum ImageStyle { SQUARE, CIRCLE } - export enum LoadIndicator { SPINNER, NONE } - export enum NotificationType { INFO, ERROR, WARNING } - export enum OnClose { NOTHING, RELOAD_ADD_ON } - export enum OpenAs { FULL_SIZE, OVERLAY } - export enum SelectionInputType { CHECK_BOX, RADIO_BUTTON, DROPDOWN } - } -} - -/** - * CardService provides the ability to create generic cards used across different Google extensibility products, such as [Gmail add-ons](https://developers.google.com/gmail/add-ons). - */ -declare var CardService: GoogleAppsScript.Card.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 5e3b51436c..50013a36d0 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 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,43 +10,42 @@ declare namespace GoogleAppsScript { export module Charts { /** - * Builder for area charts. For more details, see the - * Google Charts documentation. + * Builder for area charts. For more details, see the Google Charts documentation. * - * Here is an example that shows how to build an area chart. + * Here is an example that shows how to build an area chart. * - * function doGet() { - * // Create a data table with some sample data. - * var sampleData = Charts.newDataTable() - * .addColumn(Charts.ColumnType.STRING, "Month") - * .addColumn(Charts.ColumnType.NUMBER, "Dining") - * .addColumn(Charts.ColumnType.NUMBER, "Total") - * .addRow(["Jan", 60, 520]) - * .addRow(["Feb", 50, 430]) - * .addRow(["Mar", 53, 440]) - * .addRow(["Apr", 70, 410]) - * .addRow(["May", 80, 390]) - * .addRow(["Jun", 60, 500]) - * .addRow(["Jul", 100, 450]) - * .addRow(["Aug", 140, 431]) - * .addRow(["Sep", 75, 488]) - * .addRow(["Oct", 70, 521]) - * .addRow(["Nov", 58, 388]) - * .addRow(["Dec", 63, 400]) - * .build(); + * function doGet() { + * // Create a data table with some sample data. + * var sampleData = Charts.newDataTable() + * .addColumn(Charts.ColumnType.STRING, "Month") + * .addColumn(Charts.ColumnType.NUMBER, "Dining") + * .addColumn(Charts.ColumnType.NUMBER, "Total") + * .addRow(["Jan", 60, 520]) + * .addRow(["Feb", 50, 430]) + * .addRow(["Mar", 53, 440]) + * .addRow(["Apr", 70, 410]) + * .addRow(["May", 80, 390]) + * .addRow(["Jun", 60, 500]) + * .addRow(["Jul", 100, 450]) + * .addRow(["Aug", 140, 431]) + * .addRow(["Sep", 75, 488]) + * .addRow(["Oct", 70, 521]) + * .addRow(["Nov", 58, 388]) + * .addRow(["Dec", 63, 400]) + * .build(); * - * var chart = Charts.newAreaChart() - * .setTitle('Yearly Spending') - * .setXAxisTitle('Month') - * .setYAxisTitle('Spending (USD)') - * .setDimensions(600, 500) - * .setStacked() - * .setColors(['red', 'green']) - * .setDataTable(sampleData) - * .build(); + * var chart = Charts.newAreaChart() + * .setTitle('Yearly Spending') + * .setXAxisTitle('Month') + * .setYAxisTitle('Spending (USD)') + * .setDimensions(600, 500) + * .setStacked() + * .setColors(['red', 'green']) + * .setDataTable(sampleData) + * .build(); * - * return UiApp.createApplication().add(chart); - * } + * return UiApp.createApplication().add(chart); + * } */ export interface AreaChartBuilder { build(): Chart; @@ -76,29 +75,27 @@ declare namespace GoogleAppsScript { } /** - * Builder for bar charts. For more details, see the - * Google Charts documentation. + * Builder for bar charts. For more details, see the Google Charts documentation. * - * Here is an example that shows how to build a bar chart. The data is + * Here is an example that shows how to build a bar chart. The data is imported from a + * Google spreadsheet. * - * imported from a Google spreadsheet. + * function doGet() { + * // Get sample data from a spreadsheet. + * var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=B1%3AC11' + + * '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=0&headers=-1'; * - * function doGet() { - * // Get sample data from a spreadsheet. - * var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=B1%3AC11' + - * '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=0&headers=-1'; + * var chartBuilder = Charts.newBarChart() + * .setTitle('Top Grossing Films in US and Canada') + * .setXAxisTitle('USD') + * .setYAxisTitle('Film') + * .setDimensions(600, 500) + * .setLegendPosition(Charts.Position.BOTTOM) + * .setDataSourceUrl(dataSourceUrl); * - * var chartBuilder = Charts.newBarChart() - * .setTitle('Top Grossing Films in US and Canada') - * .setXAxisTitle('USD') - * .setYAxisTitle('Film') - * .setDimensions(600, 500) - * .setLegendPosition(Charts.Position.BOTTOM) - * .setDataSourceUrl(dataSourceUrl); - * - * var chart = chartBuilder.build(); - * return UiApp.createApplication().add(chart); - * } + * var chart = chartBuilder.build(); + * return UiApp.createApplication().add(chart); + * } */ export interface BarChartBuilder { build(): Chart; @@ -130,59 +127,59 @@ declare namespace GoogleAppsScript { /** * A builder for category filter controls. * - * A category filter is a picker to choose one or more between a set of defined values. - * Given a column of type string, this control will filter out the rows that - * don't match any of the picked values. + * A category filter is a picker to choose one or more between a set of defined values. Given a + * column of type string, this control will filter out the rows that don't match any of the picked + * values. * - * Here is an example that creates a table chart a binds a category filter to it. This allows the - * user to filter the data the table displays. + * Here is an example that creates a table chart a binds a category filter to it. This allows the + * user to filter the data the table displays. * - * function doGet() { - * var app = UiApp.createApplication(); - * var sampleData = Charts.newDataTable() - * .addColumn(Charts.ColumnType.STRING, "Month") - * .addColumn(Charts.ColumnType.NUMBER, "Dining") - * .addColumn(Charts.ColumnType.NUMBER, "Total") - * .addRow(["Jan", 60, 520]) - * .addRow(["Feb", 50, 430]) - * .addRow(["Mar", 53, 440]) - * .addRow(["Apr", 70, 410]) - * .addRow(["May", 80, 390]) - * .addRow(["Jun", 60, 500]) - * .addRow(["Jul", 100, 450]) - * .addRow(["Aug", 140, 431]) - * .addRow(["Sep", 75, 488]) - * .addRow(["Oct", 70, 521]) - * .addRow(["Nov", 58, 388]) - * .addRow(["Dec", 63, 400]) - * .build(); + * function doGet() { + * var app = UiApp.createApplication(); + * var sampleData = Charts.newDataTable() + * .addColumn(Charts.ColumnType.STRING, "Month") + * .addColumn(Charts.ColumnType.NUMBER, "Dining") + * .addColumn(Charts.ColumnType.NUMBER, "Total") + * .addRow(["Jan", 60, 520]) + * .addRow(["Feb", 50, 430]) + * .addRow(["Mar", 53, 440]) + * .addRow(["Apr", 70, 410]) + * .addRow(["May", 80, 390]) + * .addRow(["Jun", 60, 500]) + * .addRow(["Jul", 100, 450]) + * .addRow(["Aug", 140, 431]) + * .addRow(["Sep", 75, 488]) + * .addRow(["Oct", 70, 521]) + * .addRow(["Nov", 58, 388]) + * .addRow(["Dec", 63, 400]) + * .build(); * - * var chart = Charts.newTableChart() - * .setDimensions(600, 500) - * .build(); + * var chart = Charts.newTableChart() + * .setDimensions(600, 500) + * .build(); * - * var categoryFilter = Charts.newCategoryFilter() - * .setFilterColumnLabel("Month") - * .setAllowMultiple(true) - * .setSortValues(true) - * .setLabelStacking(Charts.Orientation.VERTICAL) - * .setCaption('Choose categories...') - * .build(); + * var categoryFilter = Charts.newCategoryFilter() + * .setFilterColumnLabel("Month") + * .setAllowMultiple(true) + * .setSortValues(true) + * .setLabelStacking(Charts.Orientation.VERTICAL) + * .setCaption('Choose categories...') + * .build(); * - * var panel = app.createVerticalPanel().setSpacing(10); - * panel.add(categoryFilter).add(chart); + * var panel = app.createVerticalPanel().setSpacing(10); + * panel.add(categoryFilter).add(chart); * - * var dashboard = Charts.newDashboardPanel() - * .setDataTable(sampleData) - * .bind(categoryFilter, chart) - * .build(); + * var dashboard = Charts.newDashboardPanel() + * .setDataTable(sampleData) + * .bind(categoryFilter, chart) + * .build(); * - * dashboard.add(panel); - * app.add(dashboard); - * return app; - * } + * dashboard.add(panel); + * app.add(dashboard); + * return app; + * } * - * documentation + * documentation */ export interface CategoryFilterBuilder { build(): Control; @@ -204,8 +201,7 @@ declare namespace GoogleAppsScript { /** * A Chart object, which can be embedded into documents, UI elements, or used as a static image. For - * charts embedded in spreadsheets, see - * EmbeddedChart. + * charts embedded in spreadsheets, see EmbeddedChart. */ export interface Chart { getAs(contentType: string): Base.Blob; @@ -216,14 +212,24 @@ declare namespace GoogleAppsScript { setId(id: string): Chart; } + /** + * An enumeration of how hidden dimensions in a source are expressed in a chart. + */ + export enum ChartHiddenDimensionStrategy { IGNORE_BOTH, IGNORE_ROWS, IGNORE_COLUMNS, SHOW_BOTH } + + /** + * An enumeration of how multiple ranges in the source are expressed in a chart. + */ + export enum ChartMergeStrategy { MERGE_COLUMNS, MERGE_ROWS } + /** * Exposes options currently configured for a Chart, such as height, color, etc. * - * Please see the visualization - * reference documentation for information on what options are available. Specific options for - * each chart can be found by clicking on the specific chart in the chart gallery. + * Please see the visualization + * reference documentation for information on what options are available. Specific options for + * each chart can be found by clicking on the specific chart in the chart gallery. * - * These options are immutable. + * These options are immutable. */ export interface ChartOptions { get(option: string): Object; @@ -232,39 +238,44 @@ declare namespace GoogleAppsScript { /** * Chart types supported by the Charts service. */ - export enum ChartType { AREA, BAR, COLUMN, COMBO, HISTOGRAM, LINE, PIE, SCATTER, TABLE } + export enum ChartType { TIMELINE, AREA, BAR, BUBBLE, CANDLESTICK, COLUMN, COMBO, GAUGE, GEO, HISTOGRAM, RADAR, LINE, ORG, PIE, SCATTER, SPARKLINE, STEPPED_AREA, TABLE, TREEMAP, WATERFALL } /** * Entry point for creating Charts in scripts. * - * This example creates a basic data table, populates an area chart with the data, and adds it into - * a UiApp: + * This example creates a basic data table, populates an area chart with the data, and adds it + * into a web page as an image: * - * function doGet() { - * var data = Charts.newDataTable() - * .addColumn(Charts.ColumnType.STRING, "Month") - * .addColumn(Charts.ColumnType.NUMBER, "In Store") - * .addColumn(Charts.ColumnType.NUMBER, "Online") - * .addRow(["January", 10, 1]) - * .addRow(["February", 12, 1]) - * .addRow(["March", 20, 2]) - * .addRow(["April", 25, 3]) - * .addRow(["May", 30, 4]) - * .build(); + * function doGet() { + * var data = Charts.newDataTable() + * .addColumn(Charts.ColumnType.STRING, "Month") + * .addColumn(Charts.ColumnType.NUMBER, "In Store") + * .addColumn(Charts.ColumnType.NUMBER, "Online") + * .addRow(["January", 10, 1]) + * .addRow(["February", 12, 1]) + * .addRow(["March", 20, 2]) + * .addRow(["April", 25, 3]) + * .addRow(["May", 30, 4]) + * .build(); * - * var chart = Charts.newAreaChart() - * .setDataTable(data) - * .setStacked() - * .setRange(0, 40) - * .setTitle("Sales per Month") - * .build(); + * var chart = Charts.newAreaChart() + * .setDataTable(data) + * .setStacked() + * .setRange(0, 40) + * .setTitle("Sales per Month") + * .build(); * - * var uiApp = UiApp.createApplication().setTitle("My Chart"); - * uiApp.add(chart); - * return uiApp; - * } + * var htmlOutput = HtmlService.createHtmlOutput().setTitle('My Chart'); + * var imageData = Utilities.base64Encode(chart.getAs('image/png').getBytes()); + * var imageUrl = "data:image/png;base64," + encodeURI(imageData); + * htmlOutput.append("Render chart server side:
"); + * htmlOutput.append(""); + * return htmlOutput; + * } */ export interface Charts { + ChartHiddenDimensionStrategy: typeof ChartHiddenDimensionStrategy; + ChartMergeStrategy: typeof ChartMergeStrategy; ChartType: typeof ChartType; ColumnType: typeof ColumnType; CurveStyle: typeof CurveStyle; @@ -290,37 +301,36 @@ declare namespace GoogleAppsScript { } /** - * Builder for column charts. For more details, see the - * Google Charts documentation. + * Builder for column charts. For more details, see the Google Charts documentation. * - * This example shows how to create a column chart with data from a data table. + * This example shows how to create a column chart with data from a data table. * - * function doGet() { - * var sampleData = Charts.newDataTable() - * .addColumn(Charts.ColumnType.STRING, "Year") - * .addColumn(Charts.ColumnType.NUMBER, "Sales") - * .addColumn(Charts.ColumnType.NUMBER, "Expenses") - * .addRow(["2004", 1000, 400]) - * .addRow(["2005", 1170, 460]) - * .addRow(["2006", 660, 1120]) - * .addRow(["2007", 1030, 540]) - * .addRow(["2008", 800, 600]) - * .addRow(["2009", 943, 678]) - * .addRow(["2010", 1020, 550]) - * .addRow(["2011", 910, 700]) - * .addRow(["2012", 1230, 840]) - * .build(); + * function doGet() { + * var sampleData = Charts.newDataTable() + * .addColumn(Charts.ColumnType.STRING, "Year") + * .addColumn(Charts.ColumnType.NUMBER, "Sales") + * .addColumn(Charts.ColumnType.NUMBER, "Expenses") + * .addRow(["2004", 1000, 400]) + * .addRow(["2005", 1170, 460]) + * .addRow(["2006", 660, 1120]) + * .addRow(["2007", 1030, 540]) + * .addRow(["2008", 800, 600]) + * .addRow(["2009", 943, 678]) + * .addRow(["2010", 1020, 550]) + * .addRow(["2011", 910, 700]) + * .addRow(["2012", 1230, 840]) + * .build(); * - * var chart = Charts.newColumnChart() - * .setTitle('Sales vs. Expenses') - * .setXAxisTitle('Year') - * .setYAxisTitle('Amount (USD)') - * .setDimensions(600, 500) - * .setDataTable(sampleData) - * .build(); + * var chart = Charts.newColumnChart() + * .setTitle('Sales vs. Expenses') + * .setXAxisTitle('Year') + * .setYAxisTitle('Amount (USD)') + * .setDimensions(600, 500) + * .setDataTable(sampleData) + * .build(); * - * return UiApp.createApplication().add(chart); - * } + * return UiApp.createApplication().add(chart); + * } */ export interface ColumnChartBuilder { build(): Chart; @@ -356,18 +366,15 @@ declare namespace GoogleAppsScript { /** * A user interface control object, that drives the data displayed by a DashboardPanel. * - * A control can be embedded in a UI application. Controls are user interface widgets (category - * pickers, range sliders, autocompleters, etc.) users interact with in order to drive the data - * managed by a dashboard and the charts that are part of it. - * Controls collect user input and use the information to decide which of the data the - * dashboard is managing should be made available to the charts that are part of it. - * Given a data table, a control will filter out the data that doesn't comply with the - * conditions implied by its current state, and will expose the filtered data table as - * an output. + * A control can be embedded in a UI application. Controls are user interface widgets (category + * pickers, range sliders, autocompleters, etc.) users interact with in order to drive the data + * managed by a dashboard and the charts that are part of it. Controls collect user input and use + * the information to decide which of the data the dashboard is managing should be made available to + * the charts that are part of it. Given a data table, a control will filter out the data that + * doesn't comply with the conditions implied by its current state, and will expose the filtered + * data table as an output. * - * For more details, see the Gviz - * - * documentation. + * For more details, see the Gviz documentation. */ export interface Control { getId(): string; @@ -381,69 +388,67 @@ declare namespace GoogleAppsScript { export enum CurveStyle { NORMAL, SMOOTH } /** - * A dashboard is a visual structure that enables the organization and management - * of multiple charts that share the same underlying data. + * A dashboard is a visual structure that enables the organization and management of multiple charts + * that share the same underlying data. * - * Controls are user interface widgets (category pickers, range sliders, autocompleters, etc.) - * users interact with in order to drive the data managed by a dashboard and the charts that - * are part of it. For example, a string filter control is a simple text input field that lets - * the user filter data via string matching. Given a column and matching options, the control - * will filter out the rows that don't match the term that's in the input field. + * Controls are user interface widgets (category pickers, range sliders, autocompleters, etc.) + * users interact with in order to drive the data managed by a dashboard and the charts that are + * part of it. For example, a string filter control is a simple text input field that lets the user + * filter data via string matching. Given a column and matching options, the control will filter out + * the rows that don't match the term that's in the input field. * - * The Gviz API defines a dashboard as a set of charts and controls bound together. The - * bindings between the different components define the data flow, the state of the - * controls filters views of the data which propagate in the dashboard and are - * eventually visualized with charts. For more details, see the Gviz + * The Gviz API defines a dashboard as a set of charts and controls bound together. The bindings + * between the different components define the data flow, the state of the controls filters views of + * the data which propagate in the dashboard and are eventually visualized with charts. For more + * details, see the Gviz documentation. * - * documentation. + * The dashboard panel has two purposes, one is being a container for the charts and controls + * objects that compose the dashboard, and the other is holding the data and use as an interface for + * binding controls to charts. * - * The dashboard panel has two purposes, one is being a container for the charts and - * controls objects that compose the dashboard, and the other is holding the data and use - * as an interface for binding controls to charts. + * Here's an example of creating a dashboard and showing it in a UI app: * - * Here's an example of creating a dashboard and showing it in a UI app: + * function doGet() { + * // Create a data table with some sample data. + * var data = Charts.newDataTable() + * .addColumn(Charts.ColumnType.STRING, "Name") + * .addColumn(Charts.ColumnType.NUMBER, "Age") + * .addRow(["Michael", 18]) + * .addRow(["Elisa", 12]) + * .addRow(["John", 20]) + * .addRow(["Jessica", 25]) + * .addRow(["Aaron", 14]) + * .addRow(["Margareth", 19]) + * .addRow(["Miranda", 22]) + * .addRow(["May", 20]) + * .build(); * - * function doGet() { - * // Create a data table with some sample data. - * var data = Charts.newDataTable() - * .addColumn(Charts.ColumnType.STRING, "Name") - * .addColumn(Charts.ColumnType.NUMBER, "Age") - * .addRow(["Michael", 18]) - * .addRow(["Elisa", 12]) - * .addRow(["John", 20]) - * .addRow(["Jessica", 25]) - * .addRow(["Aaron", 14]) - * .addRow(["Margareth", 19]) - * .addRow(["Miranda", 22]) - * .addRow(["May", 20]) - * .build(); + * var chart = Charts.newBarChart() + * .setTitle("Ages") + * .build(); * - * var chart = Charts.newBarChart() - * .setTitle("Ages") - * .build(); + * var control = Charts.newStringFilter() + * .setFilterColumnLabel("Name") + * .build(); * - * var control = Charts.newStringFilter() - * .setFilterColumnLabel("Name") - * .build(); + * // Bind the control to the chart in a dashboard panel. + * var dashboard = Charts.newDashboardPanel() + * .setDataTable(data) + * .bind(control, chart) + * .build(); * - * // Bind the control to the chart in a dashboard panel. - * var dashboard = Charts.newDashboardPanel() - * .setDataTable(data) - * .bind(control, chart) - * .build(); + * var uiApp = UiApp.createApplication().setTitle("My Dashboard"); * - * var uiApp = UiApp.createApplication().setTitle("My Dashboard"); + * var panel = uiApp.createHorizontalPanel() + * .setVerticalAlignment(UiApp.VerticalAlignment.MIDDLE) + * .setSpacing(50); * - * var panel = uiApp.createHorizontalPanel() - * .setVerticalAlignment(UiApp.VerticalAlignment.MIDDLE) - * .setSpacing(50); - * - * panel.add(control); - * panel.add(chart); - * dashboard.add(panel); - * uiApp.add(dashboard); - * return uiApp; - * } + * panel.add(control); + * panel.add(chart); + * dashboard.add(panel); + * uiApp.add(dashboard); + * return uiApp; + * } */ export interface DashboardPanel { getId(): string; @@ -453,12 +458,10 @@ declare namespace GoogleAppsScript { } /** - * A builder for a dashboard panel object. For an example of how to use - * DashboardPanelBuilder, refer to DashboardPanel. + * A builder for a dashboard panel object. For an example of how to use DashboardPanelBuilder, refer to DashboardPanel. * - * For more details, see the Gviz - * - * documentation. + * For more details, see the Gviz + * documentation. */ export interface DashboardPanelBuilder { bind(control: Control, chart: Chart, controls: Control[], charts: Chart[]): DashboardPanelBuilder; @@ -470,26 +473,26 @@ declare namespace GoogleAppsScript { /** * A Data Table to be used in charts. A DataTable can come from sources such as Google - * Sheets or specified data-table URLs, or can be filled in by hand. This class intentionally has no - * methods: a DataTable can be passed around, but not manipulated directly. + * Sheets or specified data-table URLs, or can be filled in by hand. This class intentionally has no + * methods: a DataTable can be passed around, but not manipulated directly. */ export interface DataTable { } /** - * Builder of DataTable objects. Building a data table consists of first specifying its columns, - * and then adding its rows, one at a time. Example: + * Builder of DataTable objects. Building a data table consists of first specifying its columns, and + * then adding its rows, one at a time. Example: * - * var data = Charts.newDataTable() - * .addColumn(Charts.ColumnType.STRING, "Month") - * .addColumn(Charts.ColumnType.NUMBER, "In Store") - * .addColumn(Charts.ColumnType.NUMBER, "Online") - * .addRow(["January", 10, 1]) - * .addRow(["February", 12, 1]) - * .addRow(["March", 20, 2]) - * .addRow(["April", 25, 3]) - * .addRow(["May", 30, 4]) - * .build(); + * var data = Charts.newDataTable() + * .addColumn(Charts.ColumnType.STRING, "Month") + * .addColumn(Charts.ColumnType.NUMBER, "In Store") + * .addColumn(Charts.ColumnType.NUMBER, "Online") + * .addRow(["January", 10, 1]) + * .addRow(["February", 12, 1]) + * .addRow(["March", 20, 2]) + * .addRow(["April", 25, 3]) + * .addRow(["May", 30, 4]) + * .build(); */ export interface DataTableBuilder { addColumn(type: ColumnType, label: string): DataTableBuilder; @@ -515,11 +518,11 @@ declare namespace GoogleAppsScript { /** * A data view definition for visualizing chart data. * - * Data view definition can be set for charts to visualize a view derived from the given data table - * and not the data table itself. For example if the view definition of a chart states that the view - * columns are [0, 3], only the first and the third columns of the data table will be taken into - * consideration when drawing the chart. See DataViewDefinitionBuilder for an example on how - * to define and use a DataViewDefinition. + * Data view definition can be set for charts to visualize a view derived from the given data + * table and not the data table itself. For example if the view definition of a chart states that + * the view columns are [0, 3], only the first and the third columns of the data table will be taken + * into consideration when drawing the chart. See DataViewDefinitionBuilder for an example + * on how to define and use a DataViewDefinition. */ export interface DataViewDefinition { } @@ -527,34 +530,35 @@ declare namespace GoogleAppsScript { /** * Builder for DataViewDefinition objects. * - * Here's an example of using the builder. The data is imported from a Google spreadsheet. + * Here's an example of using the builder. The data is imported + * from a Google spreadsheet. * - * 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'; + * 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'; * - * // Create a chart to display all of the data. - * var originalChart = Charts.newTableChart() - * .setDimensions(600, 500) - * .setDataSourceUrl(dataSourceUrl) - * .build(); + * // Create a chart to display all of the data. + * var originalChart = Charts.newTableChart() + * .setDimensions(600, 500) + * .setDataSourceUrl(dataSourceUrl) + * .build(); * - * // Create another chart to display a subset of the data (only columns 1 and 4). - * var dataViewDefinition = Charts.newDataViewDefinition().setColumns([0, 3]); - * var limitedChart = Charts.newTableChart() - * .setDimensions(200, 500) - * .setDataSourceUrl(dataSourceUrl) - * .setDataViewDefinition(dataViewDefinition) - * .build(); + * // Create another chart to display a subset of the data (only columns 1 and 4). + * var dataViewDefinition = Charts.newDataViewDefinition().setColumns([0, 3]); + * var limitedChart = Charts.newTableChart() + * .setDimensions(200, 500) + * .setDataSourceUrl(dataSourceUrl) + * .setDataViewDefinition(dataViewDefinition) + * .build(); * - * var panel = app.createHorizontalPanel().setSpacing(15); - * panel.add(originalChart).add(limitedChart); - * return app.add(panel); - * } + * var panel = app.createHorizontalPanel().setSpacing(15); + * panel.add(originalChart).add(limitedChart); + * return app.add(panel); + * } */ export interface DataViewDefinitionBuilder { build(): DataViewDefinition; @@ -562,29 +566,27 @@ declare namespace GoogleAppsScript { } /** - * Builder for line charts. For more details, see the - * Google Charts documentation. + * Builder for line charts. For more details, see the Google Charts documentation. * - * Here is an example that shows how to build a line chart. The data is - * imported from a Google spreadsheet. + * Here is an example that shows how to build a line chart. The data is imported from a Google spreadsheet. * - * function doGet() { - * // Get sample data from a spreadsheet. - * var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=A1%3AG5' + - * '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=2&headers=-1'; + * function doGet() { + * // Get sample data from a spreadsheet. + * var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=A1%3AG5' + + * '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=2&headers=-1'; * - * var chartBuilder = Charts.newLineChart() - * .setTitle('Yearly Rainfall') - * .setXAxisTitle('Month') - * .setYAxisTitle('Rainfall (in)') - * .setDimensions(600, 500) - * .setCurveStyle(Charts.CurveStyle.SMOOTH) - * .setPointStyle(Charts.PointStyle.MEDIUM) - * .setDataSourceUrl(dataSourceUrl); + * var chartBuilder = Charts.newLineChart() + * .setTitle('Yearly Rainfall') + * .setXAxisTitle('Month') + * .setYAxisTitle('Rainfall (in)') + * .setDimensions(600, 500) + * .setCurveStyle(Charts.CurveStyle.SMOOTH) + * .setPointStyle(Charts.PointStyle.MEDIUM) + * .setDataSourceUrl(dataSourceUrl); * - * var chart = chartBuilder.build(); - * return UiApp.createApplication().add(chart); - * } + * var chart = chartBuilder.build(); + * return UiApp.createApplication().add(chart); + * } */ export interface LineChartBuilder { build(): Chart; @@ -614,61 +616,63 @@ declare namespace GoogleAppsScript { } /** - * An enumeration of how a string value should be matched. - * Matching a string is a boolean operation. Given a string, a match term (string), and a match - * type, the operation will output true in the following cases: + * An enumeration of how a string value should be matched. Matching a string is a boolean operation. + * Given a string, a match term (string), and a match type, the operation will output true in the + * following cases: * * If the match type equals EXACT and the match term equals the string. + * * If the match type equals PREFIX and the match term is a prefix of the string. + * * If the match type equals ANY and the match term is a substring of the string. * * This enumeration can be used in by a string filter control to decide which rows to filter out - * of the data table. Given a column to filter on, leave only the rows that match the value - * entered in the filter input box, using one of the above matching types. + * of the data table. Given a column to filter on, leave only the rows that match the value entered + * in the filter input box, using one of the above matching types. */ export enum MatchType { EXACT, PREFIX, ANY } /** * A builder for number range filter controls. * - * A number range filter is a slider with two thumbs that lets the user select ranges of - * numeric values. Given a column of type number and matching options, this control will - * filter out the rows that don't match the range that was selected. + * A number range filter is a slider with two thumbs that lets the user select ranges of numeric + * values. Given a column of type number and matching options, this control will filter out the rows + * that don't match the range that was selected. * - * This example creates a table chart bound to a number range filter: + * This example creates a table chart bound to a number range filter: * - * function doGet() { - * 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'; - * var data = SpreadsheetApp.openByUrl(dataSourceUrl).getSheetByName('US_GDP').getRange("A1:F"); + * function doGet() { + * 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'; + * var data = SpreadsheetApp.openByUrl(dataSourceUrl).getSheetByName('US_GDP').getRange("A1:F"); * - * var chart = Charts.newTableChart() - * .setDimensions(600, 500) - * .build(); + * var chart = Charts.newTableChart() + * .setDimensions(600, 500) + * .build(); * - * var numberRangeFilter = Charts.newNumberRangeFilter() - * .setFilterColumnLabel("Year") - * .setShowRangeValues(true) - * .setLabel("Restrict year range") - * .build(); + * var numberRangeFilter = Charts.newNumberRangeFilter() + * .setFilterColumnLabel("Year") + * .setShowRangeValues(true) + * .setLabel("Restrict year range") + * .build(); * - * var panel = app.createVerticalPanel().setSpacing(10); - * panel.add(numberRangeFilter).add(chart); + * var panel = app.createVerticalPanel().setSpacing(10); + * panel.add(numberRangeFilter).add(chart); * - * // Create a new dashboard panel to bind the filter and chart together. - * var dashboard = Charts.newDashboardPanel() - * .setDataTable(data) - * .bind(numberRangeFilter, chart) - * .build(); + * // Create a new dashboard panel to bind the filter and chart together. + * var dashboard = Charts.newDashboardPanel() + * .setDataTable(data) + * .bind(numberRangeFilter, chart) + * .build(); * - * dashboard.add(panel); - * app.add(dashboard); - * return app; - * } + * dashboard.add(panel); + * app.add(dashboard); + * return app; + * } * - * documentation + * documentation */ export interface NumberRangeFilterBuilder { build(): Control; @@ -697,26 +701,24 @@ declare namespace GoogleAppsScript { export enum PickerValuesLayout { ASIDE, BELOW, BELOW_WRAPPING, BELOW_STACKED } /** - * A builder for pie charts. For more details, see the - * Google Charts documentation. + * A builder for pie charts. For more details, see the Google Charts documentation. * - * Here is an example that shows how to build a pie chart. The data is - * imported from a Google spreadsheet. + * Here is an example that shows how to build a pie chart. The data is imported from a Google spreadsheet. * - * function doGet() { - * // Get sample data from a spreadsheet. - * var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=A1%3AB8' + - * '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=3&headers=-1'; + * function doGet() { + * // Get sample data from a spreadsheet. + * var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=A1%3AB8' + + * '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=3&headers=-1'; * - * var chartBuilder = Charts.newPieChart() - * .setTitle('World Population by Continent') - * .setDimensions(600, 500) - * .set3D() - * .setDataSourceUrl(dataSourceUrl); + * var chartBuilder = Charts.newPieChart() + * .setTitle('World Population by Continent') + * .setDimensions(600, 500) + * .set3D() + * .setDataSourceUrl(dataSourceUrl); * - * var chart = chartBuilder.build(); - * return UiApp.createApplication().add(chart); - * } + * var chart = chartBuilder.build(); + * return UiApp.createApplication().add(chart); + * } */ export interface PieChartBuilder { build(): Chart; @@ -747,28 +749,26 @@ declare namespace GoogleAppsScript { export enum Position { TOP, RIGHT, BOTTOM, NONE } /** - * Builder for scatter charts. For more details, see the - * Google Charts documentation. + * Builder for scatter charts. For more details, see the Google Charts documentation. * - * Here is an example that shows how to build a scatter chart. The data is - * imported from a Google spreadsheet. + * Here is an example that shows how to build a scatter chart. The data is imported from a Google spreadsheet. * - * function doGet() { - * // Get sample data from a spreadsheet. - * var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=C1%3AD' + - * '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=4&headers=-1'; + * function doGet() { + * // Get sample data from a spreadsheet. + * var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=C1%3AD' + + * '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=4&headers=-1'; * - * var chartBuilder = Charts.newScatterChart() - * .setTitle('Adjusted GDP vs. U.S. Population') - * .setXAxisTitle('U.S. Population (millions)') - * .setYAxisTitle('Adjusted GDP ($ billions)') - * .setDimensions(600, 500) - * .setLegendPosition(Charts.Position.NONE) - * .setDataSourceUrl(dataSourceUrl); + * var chartBuilder = Charts.newScatterChart() + * .setTitle('Adjusted GDP vs. U.S. Population') + * .setXAxisTitle('U.S. Population (millions)') + * .setYAxisTitle('Adjusted GDP ($ billions)') + * .setDimensions(600, 500) + * .setLegendPosition(Charts.Position.NONE) + * .setDataSourceUrl(dataSourceUrl); * - * var chart = chartBuilder.build(); - * return UiApp.createApplication().add(chart); - * } + * var chart = chartBuilder.build(); + * return UiApp.createApplication().add(chart); + * } */ export interface ScatterChartBuilder { build(): Chart; @@ -800,59 +800,59 @@ declare namespace GoogleAppsScript { /** * A builder for string filter controls. * - * A string filter is a simple text input field that lets the user filter data via string matching. - * Given a column of type string and matching options, this control will filter out the rows that - * don't match the term that's in the input field. + * A string filter is a simple text input field that lets the user filter data via string + * matching. Given a column of type string and matching options, this control will filter out the + * rows that don't match the term that's in the input field. * - * This example creates a table chart and binds it to a string filter. Using the filter, it is - * possible to change the table chart to display a subset of its data. + * This example creates a table chart and binds it to a string filter. Using the filter, it is + * possible to change the table chart to display a subset of its data. * - * function doGet() { - * var app = UiApp.createApplication(); - * var sampleData = Charts.newDataTable() - * .addColumn(Charts.ColumnType.STRING, "Month") - * .addColumn(Charts.ColumnType.NUMBER, "Dining") - * .addColumn(Charts.ColumnType.NUMBER, "Total") - * .addRow(["Jan", 60, 520]) - * .addRow(["Feb", 50, 430]) - * .addRow(["Mar", 53, 440]) - * .addRow(["Apr", 70, 410]) - * .addRow(["May", 80, 390]) - * .addRow(["Jun", 60, 500]) - * .addRow(["Jul", 100, 450]) - * .addRow(["Aug", 140, 431]) - * .addRow(["Sep", 75, 488]) - * .addRow(["Oct", 70, 521]) - * .addRow(["Nov", 58, 388]) - * .addRow(["Dec", 63, 400]) - * .build(); + * function doGet() { + * var app = UiApp.createApplication(); + * var sampleData = Charts.newDataTable() + * .addColumn(Charts.ColumnType.STRING, "Month") + * .addColumn(Charts.ColumnType.NUMBER, "Dining") + * .addColumn(Charts.ColumnType.NUMBER, "Total") + * .addRow(["Jan", 60, 520]) + * .addRow(["Feb", 50, 430]) + * .addRow(["Mar", 53, 440]) + * .addRow(["Apr", 70, 410]) + * .addRow(["May", 80, 390]) + * .addRow(["Jun", 60, 500]) + * .addRow(["Jul", 100, 450]) + * .addRow(["Aug", 140, 431]) + * .addRow(["Sep", 75, 488]) + * .addRow(["Oct", 70, 521]) + * .addRow(["Nov", 58, 388]) + * .addRow(["Dec", 63, 400]) + * .build(); * - * var chart = Charts.newTableChart() - * .setDimensions(600, 500) - * .build(); + * var chart = Charts.newTableChart() + * .setDimensions(600, 500) + * .build(); * - * var stringFilter = Charts.newStringFilter() - * .setFilterColumnLabel("Month") - * .setRealtimeTrigger(true) - * .setCaseSensitive(true) - * .setLabel("Filter months shown") - * .build(); + * var stringFilter = Charts.newStringFilter() + * .setFilterColumnLabel("Month") + * .setRealtimeTrigger(true) + * .setCaseSensitive(true) + * .setLabel("Filter months shown") + * .build(); * - * var panel = app.createVerticalPanel().setSpacing(10); - * panel.add(stringFilter).add(chart); + * var panel = app.createVerticalPanel().setSpacing(10); + * panel.add(stringFilter).add(chart); * - * // Create a dashboard panel to bind the filter and the chart together. - * var dashboard = Charts.newDashboardPanel() - * .setDataTable(sampleData) - * .bind(stringFilter, chart) - * .build(); + * // Create a dashboard panel to bind the filter and the chart together. + * var dashboard = Charts.newDashboardPanel() + * .setDataTable(sampleData) + * .bind(stringFilter, chart) + * .build(); * - * dashboard.add(panel); - * app.add(dashboard); - * return app; - * } + * dashboard.add(panel); + * app.add(dashboard); + * return app; + * } * - * documentation + * documentation */ export interface StringFilterBuilder { build(): Control; @@ -869,25 +869,23 @@ declare namespace GoogleAppsScript { } /** - * A builder for table charts. For more details, see the - * Google Charts documentation. + * A builder for table charts. For more details, see the Google Charts documentation. * - * Here is an example that shows how to build a table chart. The data is - * imported from a Google spreadsheet. + * Here is an example that shows how to build a table chart. The data is imported from a Google spreadsheet. * - * function doGet() { - * // Get sample data from a spreadsheet. - * var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=A1%3AF' + - * '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=4&headers=-1'; + * function doGet() { + * // Get sample data from a spreadsheet. + * var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=A1%3AF' + + * '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=4&headers=-1'; * - * var chartBuilder = Charts.newTableChart() - * .setDimensions(600, 500) - * .enablePaging(20) - * .setDataSourceUrl(dataSourceUrl); + * var chartBuilder = Charts.newTableChart() + * .setDimensions(600, 500) + * .enablePaging(20) + * .setDataSourceUrl(dataSourceUrl); * - * var chart = chartBuilder.build(); - * return UiApp.createApplication().add(chart); - * } + * var chart = chartBuilder.build(); + * return UiApp.createApplication().add(chart); + * } */ export interface TableChartBuilder { build(): Chart; @@ -910,39 +908,39 @@ declare namespace GoogleAppsScript { } /** - * A text style configuration object. Used in charts options to configure text style for - * elements that accepts it, such as title, horizontal axis, vertical axis, legend and tooltip. + * A text style configuration object. Used in charts options to configure text style for elements + * that accepts it, such as title, horizontal axis, vertical axis, legend and tooltip. * - * // This example creates a chart specifying different text styles for the title and axes. - * function doGet() { - * var sampleData = Charts.newDataTable() - * .addColumn(Charts.ColumnType.STRING, "Seasons") - * .addColumn(Charts.ColumnType.NUMBER, "Rainy Days") - * .addRow(["Winter", 5]) - * .addRow(["Spring", 12]) - * .addRow(["Summer", 8]) - * .addRow(["Fall", 8]) - * .build(); + * // This example creates a chart specifying different text styles for the title and axes. + * function doGet() { + * var sampleData = Charts.newDataTable() + * .addColumn(Charts.ColumnType.STRING, "Seasons") + * .addColumn(Charts.ColumnType.NUMBER, "Rainy Days") + * .addRow(["Winter", 5]) + * .addRow(["Spring", 12]) + * .addRow(["Summer", 8]) + * .addRow(["Fall", 8]) + * .build(); * - * var titleTextStyleBuilder = Charts.newTextStyle() - * .setColor('#0000FF').setFontSize(26).setFontName('Ariel'); - * var axisTextStyleBuilder = Charts.newTextStyle() - * .setColor('#3A3A3A').setFontSize(20).setFontName('Ariel'); - * var titleTextStyle = titleTextStyleBuilder.build(); - * var axisTextStyle = axisTextStyleBuilder.build(); + * var titleTextStyleBuilder = Charts.newTextStyle() + * .setColor('#0000FF').setFontSize(26).setFontName('Ariel'); + * var axisTextStyleBuilder = Charts.newTextStyle() + * .setColor('#3A3A3A').setFontSize(20).setFontName('Ariel'); + * var titleTextStyle = titleTextStyleBuilder.build(); + * var axisTextStyle = axisTextStyleBuilder.build(); * - * var chart = Charts.newLineChart() - * .setTitleTextStyle(titleTextStyle) - * .setXAxisTitleTextStyle(axisTextStyle) - * .setYAxisTitleTextStyle(axisTextStyle) - * .setTitle('Rainy Days Per Season') - * .setXAxisTitle('Season') - * .setYAxisTitle('Number of Rainy Days') - * .setDataTable(sampleData) - * .build(); + * var chart = Charts.newLineChart() + * .setTitleTextStyle(titleTextStyle) + * .setXAxisTitleTextStyle(axisTextStyle) + * .setYAxisTitleTextStyle(axisTextStyle) + * .setTitle('Rainy Days Per Season') + * .setXAxisTitle('Season') + * .setYAxisTitle('Number of Rainy Days') + * .setDataTable(sampleData) + * .build(); * - * return UiApp.createApplication().add(chart); - * } + * return UiApp.createApplication().add(chart); + * } */ export interface TextStyle { getColor(): string; @@ -952,15 +950,15 @@ declare namespace GoogleAppsScript { /** * A builder used to create TextStyle objects. It allows configuration of the text's - * properties such as name, color, and size. + * properties such as name, color, and size. * - * The following example shows how to create a text style using the builder. For a more complete - * example, refer to the documentation for TextStyle. + * The following example shows how to create a text style using the builder. For a more complete + * example, refer to the documentation for TextStyle. * - * // Creates a new text style that uses 26-point, blue, Ariel font. - * var textStyleBuilder = Charts.newTextStyle() - * .setColor('#0000FF').setFontName('Ariel').setFontSize(26); - * var style = textStyleBuilder.build(); + * // Creates a new text style that uses 26-point, blue, Ariel font. + * var textStyleBuilder = Charts.newTextStyle() + * .setColor('#0000FF').setFontName('Ariel').setFontSize(26); + * var style = textStyleBuilder.build(); */ export interface TextStyleBuilder { build(): TextStyle; diff --git a/types/google-apps-script/google-apps-script.contacts.d.ts b/types/google-apps-script/google-apps-script.contacts.d.ts index e0fa82d371..db794b543c 100644 --- a/types/google-apps-script/google-apps-script.contacts.d.ts +++ b/types/google-apps-script/google-apps-script.contacts.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -133,7 +133,7 @@ declare namespace GoogleAppsScript { /** * This class allows users to access their own Google Contacts and create, remove, and update - * contacts listed therein. + * contacts listed therein. */ export interface ContactsApp { ExtendedField: typeof ExtendedField; @@ -199,9 +199,8 @@ declare namespace GoogleAppsScript { * A date field in a Contact. * * This class is only used by the Contacts service, and dates used elsewhere in App Script use - * JavaScript's standard - * - * Date object. + * JavaScript's standard + * Date object. */ export interface DateField { deleteDateField(): void; diff --git a/types/google-apps-script/google-apps-script.content.d.ts b/types/google-apps-script/google-apps-script.content.d.ts index eaa3057a49..538a49aaf5 100644 --- a/types/google-apps-script/google-apps-script.content.d.ts +++ b/types/google-apps-script/google-apps-script.content.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,11 +10,11 @@ declare namespace GoogleAppsScript { /** * Service for returning text content from a script. * - * You can serve up text in various forms. For example, publish this script as a web app. + * You can serve up text in various forms. For example, publish this script as a web app. * - * function doGet() { - * return ContentService.createTextOutput("Hello World"); - * } + * function doGet() { + * return ContentService.createTextOutput("Hello World"); + * } */ export interface ContentService { MimeType: typeof MimeType; @@ -30,15 +30,15 @@ declare namespace GoogleAppsScript { /** * A TextOutput object that can be served from a script. * - * Due to security considerations, scripts cannot directly return text content to a browser. - * Instead, the browser is redirected to googleusercontent.com, which will display it without any - * further sanitization or manipulation. + * Due to security considerations, scripts cannot directly return text content to a browser. + * Instead, the browser is redirected to googleusercontent.com, which will display it without any + * further sanitization or manipulation. * - * You can return text content like this: + * You can return text content like this: * - * function doGet() { - * return ContentService.createTextOutput("hello world!"); - * } + * function doGet() { + * return ContentService.createTextOutput("hello world!"); + * } * * ContentService */ diff --git a/types/google-apps-script/google-apps-script.document.d.ts b/types/google-apps-script/google-apps-script.document.d.ts index b0cc1c4e2a..7910710beb 100644 --- a/types/google-apps-script/google-apps-script.document.d.ts +++ b/types/google-apps-script/google-apps-script.document.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -13,33 +13,31 @@ declare namespace GoogleAppsScript { * * Use attributes to compose custom styles. For example: * - * // Define a style with yellow background. - * var highlightStyle = {}; - * highlightStyle[DocumentApp.Attribute.BACKGROUND_COLOR] = '#FFFF00'; - * highlightStyle[DocumentApp.Attribute.BOLD] = true; + * // Define a style with yellow background. + * var highlightStyle = {}; + * highlightStyle[DocumentApp.Attribute.BACKGROUND_COLOR] = '#FFFF00'; + * highlightStyle[DocumentApp.Attribute.BOLD] = true; * - * // Insert "Hello", highlighted. - * DocumentApp.getActiveDocument().editAsText() - * .insertText(0, 'Hello\n') - * .setAttributes(0, 4, highlightStyle); + * // Insert "Hello", highlighted. + * DocumentApp.getActiveDocument().editAsText() + * .insertText(0, 'Hello\n') + * .setAttributes(0, 4, highlightStyle); */ export enum Attribute { BACKGROUND_COLOR, BOLD, BORDER_COLOR, BORDER_WIDTH, CODE, FONT_FAMILY, FONT_SIZE, FOREGROUND_COLOR, HEADING, HEIGHT, HORIZONTAL_ALIGNMENT, INDENT_END, INDENT_FIRST_LINE, INDENT_START, ITALIC, GLYPH_TYPE, LEFT_TO_RIGHT, LINE_SPACING, LINK_URL, LIST_ID, MARGIN_BOTTOM, MARGIN_LEFT, MARGIN_RIGHT, MARGIN_TOP, NESTING_LEVEL, MINIMUM_HEIGHT, PADDING_BOTTOM, PADDING_LEFT, PADDING_RIGHT, PADDING_TOP, PAGE_HEIGHT, PAGE_WIDTH, SPACING_AFTER, SPACING_BEFORE, STRIKETHROUGH, UNDERLINE, VERTICAL_ALIGNMENT, WIDTH } /** - * An element representing a document body. The Body may contain ListItem, - * Paragraph, Table, and TableOfContents elements. For more information on - * document structure, see the - * guide to extending Google Docs. + * An element representing a document body. The Body may contain ListItem, Paragraph, Table, and TableOfContents elements. For more information on document + * structure, see the guide to extending + * Google Docs. * - * The Body typically contains the full document contents except for the - * HeaderSection, FooterSection, and any FootnoteSection elements. + * The Body typically contains the full document contents except for the HeaderSection, FooterSection, and any FootnoteSection elements. * - * var doc = DocumentApp.getActiveDocument(); - * var body = doc.getBody(); + * var doc = DocumentApp.getActiveDocument(); + * var body = doc.getBody(); * - * // Append a paragraph and a page break to the document body section directly. - * body.appendParagraph("A paragraph."); - * body.appendPageBreak(); + * // Append a paragraph and a page break to the document body section directly. + * body.appendParagraph("A paragraph."); + * body.appendPageBreak(); */ export interface Body { appendHorizontalRule(): HorizontalRule; @@ -115,11 +113,11 @@ declare namespace GoogleAppsScript { /** * An object representing a bookmark. * - * // Insert a bookmark at the cursor position and log its ID. - * var doc = DocumentApp.getActiveDocument(); - * var cursor = doc.getCursor(); - * var bookmark = doc.addBookmark(cursor); - * Logger.log(bookmark.getId()); + * // Insert a bookmark at the cursor position and log its ID. + * var doc = DocumentApp.getActiveDocument(); + * var cursor = doc.getCursor(); + * var bookmark = doc.addBookmark(cursor); + * Logger.log(bookmark.getId()); */ export interface Bookmark { getId(): string; @@ -129,7 +127,7 @@ declare namespace GoogleAppsScript { /** * A generic element that may contain other elements. All elements that may contain child elements, - * such as Paragraph, inherit from ContainerElement. + * such as Paragraph, inherit from ContainerElement. */ export interface ContainerElement { asBody(): Body; @@ -175,11 +173,11 @@ declare namespace GoogleAppsScript { * * Documents may be opened or created using DocumentApp. * - * // Open a document by ID. - * var doc = DocumentApp.openById(""); + * // Open a document by ID. + * var doc = DocumentApp.openById(""); * - * // Create and open a document. - * doc = DocumentApp.create("Document Title"); + * // Create and open a document. + * doc = DocumentApp.create("Document Title"); */ export interface Document { addBookmark(position: Position): Bookmark; @@ -225,11 +223,11 @@ declare namespace GoogleAppsScript { /** * The document service creates and opens Documents that can be edited. * - * // Open a document by ID. - * var doc = DocumentApp.openById('DOCUMENT_ID_GOES_HERE'); + * // Open a document by ID. + * var doc = DocumentApp.openById('DOCUMENT_ID_GOES_HERE'); * - * // Create and open a document. - * doc = DocumentApp.create('Document Name'); + * // Create and open a document. + * doc = DocumentApp.create('Document Name'); */ export interface DocumentApp { Attribute: typeof Attribute; @@ -250,9 +248,8 @@ declare namespace GoogleAppsScript { /** * A generic element. Document contents are - * represented as elements. For example, ListItem, Paragraph, and Table - * are elements and inherit all of the methods defined by Element, such as - * getType(). + * represented as elements. For example, ListItem, Paragraph, and Table are + * elements and inherit all of the methods defined by Element, such as getType(). * Implementing classes * * NameBrief description @@ -300,7 +297,7 @@ declare namespace GoogleAppsScript { * TextAn element representing a rich text region. * * UnsupportedElementAn element representing a region that is unknown or cannot be affected by a script, such as a - * page number. + * page number. */ export interface Element { asBody(): Body; @@ -338,22 +335,20 @@ declare namespace GoogleAppsScript { /** * An enumeration of all the element types. * - * Use the ElementType enumeration to check the type of a given - * element, for instance: + * Use the ElementType enumeration to check the type of a given element, for instance: * - * var firstChild = DocumentApp.getActiveDocument().getBody().getChild(0); - * if (firstChild.getType() == DocumentApp.ElementType.PARAGRAPH) { - * // It's a paragraph, apply a paragraph heading. - * firstChild.asParagraph().setHeading(DocumentApp.ParagraphHeading.HEADING1); - * } + * var firstChild = DocumentApp.getActiveDocument().getBody().getChild(0); + * if (firstChild.getType() == DocumentApp.ElementType.PARAGRAPH) { + * // It's a paragraph, apply a paragraph heading. + * firstChild.asParagraph().setHeading(DocumentApp.ParagraphHeading.HEADING1); + * } */ export enum ElementType { BODY_SECTION, COMMENT_SECTION, DOCUMENT, EQUATION, EQUATION_FUNCTION, EQUATION_FUNCTION_ARGUMENT_SEPARATOR, EQUATION_SYMBOL, FOOTER_SECTION, FOOTNOTE, FOOTNOTE_SECTION, HEADER_SECTION, HORIZONTAL_RULE, INLINE_DRAWING, INLINE_IMAGE, LIST_ITEM, PAGE_BREAK, PARAGRAPH, TABLE, TABLE_CELL, TABLE_OF_CONTENTS, TABLE_ROW, TEXT, UNSUPPORTED } /** - * An element representing a mathematical expression. An Equation may contain - * EquationFunction, EquationSymbol, and Text elements. For more - * information on document structure, see the - * guide to extending Google Docs. + * An element representing a mathematical expression. An Equation may contain EquationFunction, EquationSymbol, and Text elements. For more information on + * document structure, see the guide to + * extending Google Docs. */ export interface Equation { clear(): Equation; @@ -384,11 +379,8 @@ declare namespace GoogleAppsScript { } /** - * An element representing a function in a mathematical Equation. An - * EquationFunction may contain EquationFunction, - * EquationFunctionArgumentSeparator, EquationSymbol, and Text elements. For - * more information on document structure, see the - * guide to extending Google Docs. + * An element representing a function in a mathematical Equation. An EquationFunction may contain EquationFunction, EquationFunctionArgumentSeparator, EquationSymbol, and Text elements. For more + * information on document structure, see the guide to extending Google Docs. */ export interface EquationFunction { clear(): EquationFunction; @@ -420,10 +412,9 @@ declare namespace GoogleAppsScript { } /** - * An element representing a function separator in a mathematical Equation. An - * EquationFunctionArgumentSeparator cannot contain any other element. For more information - * on document structure, see the - * guide to extending Google Docs. + * An element representing a function separator in a mathematical Equation. An EquationFunctionArgumentSeparator cannot contain any other element. For more information on + * document structure, see the guide to + * extending Google Docs. */ export interface EquationFunctionArgumentSeparator { copy(): EquationFunctionArgumentSeparator; @@ -440,8 +431,7 @@ declare namespace GoogleAppsScript { /** * An element representing a symbol in a mathematical Equation. An EquationSymbol - * cannot contain any other element. For more information on document structure, see the - * guide to extending Google Docs. + * cannot contain any other element. For more information on document structure, see the guide to extending Google Docs. */ export interface EquationSymbol { copy(): EquationSymbol; @@ -459,39 +449,36 @@ declare namespace GoogleAppsScript { /** * - * Deprecated. The methods getFontFamily() and setFontFamily(string) now use string - * names for fonts instead of this enum. Although this enum is deprecated, it will remain - * available for compatibility with older scripts. + * Deprecated. The methods getFontFamily() and setFontFamily(String) now use string + * names for fonts instead of this enum. Although this enum is deprecated, it will remain + * available for compatibility with older scripts. * An enumeration of the supported fonts. * - * Use the FontFamily enumeration to set the font for a range of - * text, element or document. + * Use the FontFamily enumeration to set the font for a range of text, element or + * document. * - * var body = DocumentApp.getActiveDocument().getBody(); + * var body = DocumentApp.getActiveDocument().getBody(); * - * // Insert a paragraph at the start of the document. - * body.insertParagraph(0, "Hello, Apps Script!"); + * // Insert a paragraph at the start of the document. + * body.insertParagraph(0, "Hello, Apps Script!"); * - * // Set the document font to Calibri. - * body.editAsText().setFontFamily(DocumentApp.FontFamily.CALIBRI); + * // Set the document font to Calibri. + * body.editAsText().setFontFamily(DocumentApp.FontFamily.CALIBRI); * - * // Set the first paragraph font to Arial. - * body.getParagraphs()[0].setFontFamily(DocumentApp.FontFamily.ARIAL); + * // Set the first paragraph font to Arial. + * body.getParagraphs()[0].setFontFamily(DocumentApp.FontFamily.ARIAL); * - * // Set "Apps Script" to Comic Sans MS. - * var text = 'Apps Script'; - * var a = body.getText().indexOf(text); - * var b = a + text.length - 1; - * body.editAsText().setFontFamily(a, b, DocumentApp.FontFamily.COMIC_SANS_MS); + * // Set "Apps Script" to Comic Sans MS. + * var text = 'Apps Script'; + * var a = body.getText().indexOf(text); + * var b = a + text.length - 1; + * body.editAsText().setFontFamily(a, b, DocumentApp.FontFamily.COMIC_SANS_MS); */ export enum FontFamily { AMARANTH, ARIAL, ARIAL_BLACK, ARIAL_NARROW, ARVO, CALIBRI, CAMBRIA, COMIC_SANS_MS, CONSOLAS, CORSIVA, COURIER_NEW, DANCING_SCRIPT, DROID_SANS, DROID_SERIF, GARAMOND, GEORGIA, GLORIA_HALLELUJAH, GREAT_VIBES, LOBSTER, MERRIWEATHER, PACIFICO, PHILOSOPHER, POIRET_ONE, QUATTROCENTO, ROBOTO, SHADOWS_INTO_LIGHT, SYNCOPATE, TAHOMA, TIMES_NEW_ROMAN, TREBUCHET_MS, UBUNTU, VERDANA } /** - * An element representing a footer section. A - * Document typically contains at most one - * FooterSection. The FooterSection may contain ListItem, Paragraph, - * and Table elements. For more information on document structure, see the - * guide to extending Google Docs. + * An element representing a footer section. A Document typically contains at most one FooterSection. The FooterSection may contain ListItem, Paragraph, and + * Table elements. For more information on document structure, see the guide to extending Google Docs. */ export interface FooterSection { appendHorizontalRule(): HorizontalRule; @@ -549,10 +536,10 @@ declare namespace GoogleAppsScript { /** * An element representing a footnote. Each Footnote is contained within a ListItem - * or Paragraph and has a corresponding FootnoteSection element for the footnote's - * contents. The Footnote itself cannot contain any other element. For more information on - * document structure, see the - * guide to extending Google Docs. + * or Paragraph and has a corresponding FootnoteSection element for the footnote's + * contents. The Footnote itself cannot contain any other element. For more information on + * document structure, see the guide to + * extending Google Docs. */ export interface Footnote { copy(): Footnote; @@ -569,9 +556,8 @@ declare namespace GoogleAppsScript { /** * An element representing a footnote section. A FootnoteSection contains the text that - * corresponds to a Footnote. The FootnoteSection may contain ListItem or - * Paragraph elements. For more information on document structure, see the - * guide to extending Google Docs. + * corresponds to a Footnote. The FootnoteSection may contain ListItem or + * Paragraph elements. For more information on document structure, see the guide to extending Google Docs. */ export interface FootnoteSection { appendParagraph(paragraph: Paragraph): Paragraph; @@ -611,28 +597,23 @@ declare namespace GoogleAppsScript { /** * An enumeration of the supported glyph types. * - * Use the GlyphType enumeration to set the bullet type for list - * items. + * Use the GlyphType enumeration to set the bullet type for list items. * - * var body = DocumentApp.getActiveDocument().getBody(); + * var body = DocumentApp.getActiveDocument().getBody(); * - * // Insert at list item, with the default nesting level of zero. - * body.appendListItem("Item 1"); + * // Insert at list item, with the default nesting level of zero. + * body.appendListItem("Item 1"); * - * // Append a second list item, with a nesting level of one, indented one inch. - * // The two items will have different bullet glyphs. - * body.appendListItem("Item 2").setNestingLevel(1).setIndentStart(72) - * .setGlyphType(DocumentApp.GlyphType.SQUARE_BULLET); + * // Append a second list item, with a nesting level of one, indented one inch. + * // The two items will have different bullet glyphs. + * body.appendListItem("Item 2").setNestingLevel(1).setIndentStart(72) + * .setGlyphType(DocumentApp.GlyphType.SQUARE_BULLET); */ export enum GlyphType { BULLET, HOLLOW_BULLET, SQUARE_BULLET, NUMBER, LATIN_UPPER, LATIN_LOWER, ROMAN_UPPER, ROMAN_LOWER } /** - * An element representing a header section. A - * Document typically - * contains at most one HeaderSection. The HeaderSection may contain - * ListItem, Paragraph, and Table elements. For more information on document - * structure, see the - * guide to extending Google Docs. + * An element representing a header section. A Document typically contains at most one HeaderSection. The HeaderSection may contain ListItem, Paragraph, and + * Table elements. For more information on document structure, see the guide to extending Google Docs. */ export interface HeaderSection { appendHorizontalRule(): HorizontalRule; @@ -691,33 +672,31 @@ declare namespace GoogleAppsScript { /** * An enumeration of the supported horizontal alignment types. * - * Use the HorizontalAlignment enumeration to manipulate the - * alignment of Paragraph contents. + * Use the HorizontalAlignment enumeration to manipulate the alignment of Paragraph contents. * - * var body = DocumentApp.getActiveDocument().getBody(); + * var body = DocumentApp.getActiveDocument().getBody(); * - * // Insert a paragraph and a table at the start of document. - * var par1 = body.insertParagraph(0, "Center"); - * var table = body.insertTable(1, [['Left', 'Right']]); - * var par2 = table.getCell(0, 0).getChild(0).asParagraph(); - * var par3 = table.getCell(0, 0).getChild(0).asParagraph(); + * // Insert a paragraph and a table at the start of document. + * var par1 = body.insertParagraph(0, "Center"); + * var table = body.insertTable(1, [['Left', 'Right']]); + * var par2 = table.getCell(0, 0).getChild(0).asParagraph(); + * var par3 = table.getCell(0, 0).getChild(0).asParagraph(); * - * // Center align the first paragraph. - * par1.setAlignment(DocumentApp.HorizontalAlignment.CENTER); + * // Center align the first paragraph. + * par1.setAlignment(DocumentApp.HorizontalAlignment.CENTER); * - * // Left align the first cell. - * par2.setAlignment(DocumentApp.HorizontalAlignment.LEFT); + * // Left align the first cell. + * par2.setAlignment(DocumentApp.HorizontalAlignment.LEFT); * - * // Right align the second cell. - * par3.setAlignment(DocumentApp.HorizontalAlignment.RIGHT); + * // Right align the second cell. + * par3.setAlignment(DocumentApp.HorizontalAlignment.RIGHT); */ export enum HorizontalAlignment { LEFT, CENTER, RIGHT, JUSTIFY } /** * An element representing an horizontal rule. A HorizontalRule can be contained within a - * ListItem or Paragraph, but cannot itself contain any other element. For more - * information on document structure, see the - * guide to extending Google Docs. + * ListItem or Paragraph, but cannot itself contain any other element. For more + * information on document structure, see the guide to extending Google Docs. */ export interface HorizontalRule { copy(): HorizontalRule; @@ -733,10 +712,9 @@ declare namespace GoogleAppsScript { /** * An element representing an embedded drawing. An InlineDrawing can be contained within a - * ListItem or Paragraph, unless the ListItem or Paragraph is within - * a FootnoteSection. An InlineDrawing cannot itself contain any other element. For - * more information on document structure, see the - * guide to extending Google Docs. + * ListItem or Paragraph, unless the ListItem or Paragraph is within + * a FootnoteSection. An InlineDrawing cannot itself contain any other element. For + * more information on document structure, see the guide to extending Google Docs. */ export interface InlineDrawing { copy(): InlineDrawing; @@ -757,10 +735,9 @@ declare namespace GoogleAppsScript { /** * An element representing an embedded image. An InlineImage can be contained within a - * ListItem or Paragraph, unless the ListItem or Paragraph is within - * a FootnoteSection. An InlineImage cannot itself contain any other element. For - * more information on document structure, see the - * guide to extending Google Docs. + * ListItem or Paragraph, unless the ListItem or Paragraph is within + * a FootnoteSection. An InlineImage cannot itself contain any other element. For + * more information on document structure, see the guide to extending Google Docs. */ export interface InlineImage { copy(): InlineImage; @@ -788,37 +765,35 @@ declare namespace GoogleAppsScript { } /** - * An element representing a list item. A ListItem is a Paragraph that is - * associated with a list ID. A ListItem may contain Equation, Footnote, - * HorizontalRule, InlineDrawing, InlineImage, PageBreak, and - * Text elements. For more information on document structure, see the - * guide to extending Google Docs. + * An element representing a list item. A ListItem is a Paragraph that is associated + * with a list ID. A ListItem may contain Equation, Footnote, HorizontalRule, InlineDrawing, InlineImage, PageBreak, and Text + * elements. For more information on document structure, see the guide to extending Google Docs. * * ListItems may not contain new-line characters. New-line characters ("\n") are - * converted to line-break characters ("\r"). + * converted to line-break characters ("\r"). * * ListItems with the same list ID belong to the same list and are numbered accordingly. - * The ListItems for a given list are not required to be adjacent in the document or even - * have the same parent element. Two items belonging to the same list may exist anywhere in the - * document while maintaining consecutive numbering, as the following example illustrates: + * The ListItems for a given list are not required to be adjacent in the document or even + * have the same parent element. Two items belonging to the same list may exist anywhere in the + * document while maintaining consecutive numbering, as the following example illustrates: * - * var body = DocumentApp.getActiveDocument().getBody(); + * var body = DocumentApp.getActiveDocument().getBody(); * - * // Append a new list item to the body. - * var item1 = body.appendListItem('Item 1'); + * // Append a new list item to the body. + * var item1 = body.appendListItem('Item 1'); * - * // Log the new list item's list ID. - * Logger.log(item1.getListId()); + * // Log the new list item's list ID. + * Logger.log(item1.getListId()); * - * // Append a table after the list item. - * body.appendTable([ - * ['Cell 1', 'Cell 2'] - * ]); + * // Append a table after the list item. + * body.appendTable([ + * ['Cell 1', 'Cell 2'] + * ]); * - * // Append a second list item with the same list ID. The two items are treated as the same list, - * // despite not being consecutive. - * var item2 = body.appendListItem('Item 2'); - * item2.setListId(item1); + * // Append a second list item with the same list ID. The two items are treated as the same list, + * // despite not being consecutive. + * var item2 = body.appendListItem('Item 2'); + * item2.setListId(item1); */ export interface ListItem { addPositionedImage(image: Base.BlobSource): PositionedImage; @@ -894,21 +869,21 @@ declare namespace GoogleAppsScript { /** * A Range that has a name and ID to allow later retrieval. Names are not - * necessarily unique; several different ranges in the same document may share the same name, much - * like a class in HTML. By contrast, IDs are unique within the document, like an ID in HTML. Once a - * NamedRange has been added to a document, it cannot be modified, only removed. + * necessarily unique; several different ranges in the same document may share the same name, much + * like a class in HTML. By contrast, IDs are unique within the document, like an ID in HTML. Once a + * NamedRange has been added to a document, it cannot be modified, only removed. * * A NamedRange can be accessed by any script that accesses the document. To avoid - * unintended conflicts between scripts, consider prefixing range names with a unique string. + * unintended conflicts between scripts, consider prefixing range names with a unique string. * - * // Create a named range that includes every table in the document. - * var doc = DocumentApp.getActiveDocument(); - * var rangeBuilder = doc.newRange(); - * var tables = doc.getBody().getTables(); - * for (var i = 0; i < tables.length; i++) { - * rangeBuilder.addElement(tables[i]); - * } - * doc.addNamedRange('myUniquePrefix-tables', rangeBuilder.build()); + * // Create a named range that includes every table in the document. + * var doc = DocumentApp.getActiveDocument(); + * var rangeBuilder = doc.newRange(); + * var tables = doc.getBody().getTables(); + * for (var i = 0; i < tables.length; i++) { + * rangeBuilder.addElement(tables[i]); + * } + * doc.addNamedRange('myUniquePrefix-tables', rangeBuilder.build()); */ export interface NamedRange { getId(): string; @@ -918,12 +893,10 @@ declare namespace GoogleAppsScript { } /** - * An element representing a page break. A PageBreak can be contained within a - * ListItem or Paragraph, unless the ListItem or Paragraph is within - * a Table, HeaderSection, FooterSection, or FootnoteSection. A - * PageBreak cannot itself contain any other element. For more information on document - * structure, see the - * guide to extending Google Docs. + * An element representing a page break. A PageBreak can be contained within a ListItem or Paragraph, unless the ListItem or Paragraph is within a + * Table, HeaderSection, FooterSection, or FootnoteSection. A PageBreak cannot itself contain any other element. For more information on document structure, + * see the guide to extending Google + * Docs. */ export interface PageBreak { copy(): PageBreak; @@ -938,26 +911,24 @@ declare namespace GoogleAppsScript { } /** - * An element representing a paragraph. A Paragraph may contain Equation, - * Footnote, HorizontalRule, InlineDrawing, InlineImage, - * PageBreak, and Text elements. For more information on document structure, see the - * guide to extending Google Docs. + * An element representing a paragraph. A Paragraph may contain Equation, Footnote, HorizontalRule, InlineDrawing, InlineImage, PageBreak, + * and Text elements. For more information on document structure, see the guide to extending Google Docs. * * Paragraphs may not contain new-line characters. New-line characters ("\n") are - * converted to line-break characters ("\r"). + * converted to line-break characters ("\r"). * - * var body = DocumentApp.getActiveDocument().getBody(); + * var body = DocumentApp.getActiveDocument().getBody(); * - * // Append a document header paragraph. - * var header = body.appendParagraph("A Document"); - * header.setHeading(DocumentApp.ParagraphHeading.HEADING1); + * // Append a document header paragraph. + * var header = body.appendParagraph("A Document"); + * header.setHeading(DocumentApp.ParagraphHeading.HEADING1); * - * // Append a section header paragraph. - * var section = body.appendParagraph("Section 1"); - * section.setHeading(DocumentApp.ParagraphHeading.HEADING2); + * // Append a section header paragraph. + * var section = body.appendParagraph("Section 1"); + * section.setHeading(DocumentApp.ParagraphHeading.HEADING2); * - * // Append a regular paragraph. - * body.appendParagraph("This is a typical paragraph."); + * // Append a regular paragraph. + * body.appendParagraph("This is a typical paragraph."); */ export interface Paragraph { addPositionedImage(image: Base.BlobSource): PositionedImage; @@ -1028,45 +999,43 @@ declare namespace GoogleAppsScript { /** * An enumeration of the standard paragraph headings. * - * Use the ParagraphHeading enumeration to configure - * the heading style for ParagraphElement. + * Use the ParagraphHeading enumeration to configure the heading style for ParagraphElement. * - * var body = DocumentApp.getActiveDocument().getBody(); + * var body = DocumentApp.getActiveDocument().getBody(); * - * // Append a paragraph, with heading 1. - * var par1 = body.appendParagraph("Title"); - * par1.setHeading(DocumentApp.ParagraphHeading.HEADING1); + * // Append a paragraph, with heading 1. + * var par1 = body.appendParagraph("Title"); + * par1.setHeading(DocumentApp.ParagraphHeading.HEADING1); * - * // Append a paragraph, with heading 2. - * var par2 = body.appendParagraph("SubTitle"); - * par2.setHeading(DocumentApp.ParagraphHeading.HEADING2); + * // Append a paragraph, with heading 2. + * var par2 = body.appendParagraph("SubTitle"); + * par2.setHeading(DocumentApp.ParagraphHeading.HEADING2); * - * // Append a paragraph, with normal heading. - * var par3 = body.appendParagraph("Text"); - * par3.setHeading(DocumentApp.ParagraphHeading.NORMAL); + * // Append a paragraph, with normal heading. + * var par3 = body.appendParagraph("Text"); + * par3.setHeading(DocumentApp.ParagraphHeading.NORMAL); */ export enum ParagraphHeading { NORMAL, HEADING1, HEADING2, HEADING3, HEADING4, HEADING5, HEADING6, TITLE, SUBTITLE } /** * A reference to a location in the document, relative to a specific element. The user's cursor is - * represented as a Position, among other uses. Scripts can only access the cursor of the - * user who is running the script, and only if the script is - * bound to the document. + * represented as a Position, among other uses. Scripts can only access the cursor of the + * user who is running the script, and only if the script is bound to the document. * - * // Insert some text at the cursor position and make it bold. - * var cursor = DocumentApp.getActiveDocument().getCursor(); - * if (cursor) { - * // Attempt to insert text at the cursor position. If the insertion returns null, the cursor's - * // containing element doesn't allow insertions, so show the user an error message. - * var element = cursor.insertText('ಠ‿ಠ'); - * if (element) { - * element.setBold(true); - * } else { - * DocumentApp.getUi().alert('Cannot insert text here.'); - * } - * } else { - * DocumentApp.getUi().alert('Cannot find a cursor.'); - * } + * // Insert some text at the cursor position and make it bold. + * var cursor = DocumentApp.getActiveDocument().getCursor(); + * if (cursor) { + * // Attempt to insert text at the cursor position. If the insertion returns null, the cursor's + * // containing element doesn't allow insertions, so show the user an error message. + * var element = cursor.insertText('ಠ‿ಠ'); + * if (element) { + * element.setBold(true); + * } else { + * DocumentApp.getUi().alert('Cannot insert text here.'); + * } + * } else { + * DocumentApp.getUi().alert('Cannot find a cursor.'); + * } */ export interface Position { getElement(): Element; @@ -1079,29 +1048,24 @@ declare namespace GoogleAppsScript { } /** - * Fixed position image anchored to a Paragraph. - * Unlike an InlineImage, - * a PositionedImage is not an - * Element. - * It does not have a parent or sibling - * Element. - * Instead, it is anchored to a Paragraph - * or ListItem, - * and is placed via offsets from that anchor. A PositionedImage - * has an ID that can be used to reference it. + * Fixed position image anchored to a Paragraph. Unlike an InlineImage, a PositionedImage is + * not an Element. It does not have a + * parent or sibling Element. Instead, + * it is anchored to a Paragraph or ListItem, and is placed via offsets from + * that anchor. A PositionedImage has an ID that can be used to reference it. * - * var body = DocumentApp.getActiveDocument().getBody(); + * var body = DocumentApp.getActiveDocument().getBody(); * - * // Append a new paragraph. - * var paragraph = body.appendParagraph("New paragraph to anchor the image to."); + * // Append a new paragraph. + * var paragraph = body.appendParagraph("New paragraph to anchor the image to."); + * * + * // Get an image in Drive from its ID. + * var image = DriveApp.getFileById('ENTER_IMAGE_FILE_ID_HERE').getBlob(); * - * // Get an image in Drive from its ID. - * var image = DriveApp.getFileById('ENTER_IMAGE_FILE_ID_HERE').getBlob(); - * - * // Add the PositionedImage with offsets (in points). - * var posImage = paragraph.addPositionedImage(image) - * .setTopOffset(60) - * .setLeftOffset(40); + * // Add the PositionedImage with offsets (in points). + * var posImage = paragraph.addPositionedImage(image) + * .setTopOffset(60) + * .setLeftOffset(40); */ export interface PositionedImage { getAs(contentType: string): Base.Blob; @@ -1121,37 +1085,36 @@ declare namespace GoogleAppsScript { } /** - * An enumeration that specifies how to lay out a PositionedImage in - * relation to surrounding text. + * An enumeration that specifies how to lay out a PositionedImage in relation to surrounding + * text. */ export enum PositionedLayout { ABOVE_TEXT, BREAK_BOTH, BREAK_LEFT, BREAK_RIGHT, WRAP_TEXT } /** - * A range of elements in a document. The user's selection is represented as a - * Range, among other uses. Scripts can only access the selection of the user who is running - * the script, and only if the script is - * bound to the document. + * A range of elements in a document. The user's selection is represented as a Range, among + * other uses. Scripts can only access the selection of the user who is running the script, and only + * if the script is bound to the document. * - * // Bold all selected text. - * var selection = DocumentApp.getActiveDocument().getSelection(); - * if (selection) { - * var elements = selection.getRangeElements(); - * for (var i = 0; i < elements.length; i++) { - * var element = elements[i]; + * // Bold all selected text. + * var selection = DocumentApp.getActiveDocument().getSelection(); + * if (selection) { + * var elements = selection.getRangeElements(); + * for (var i = 0; i < elements.length; i++) { + * var element = elements[i]; * - * // Only modify elements that can be edited as text; skip images and other non-text elements. - * if (element.getElement().editAsText) { - * var text = element.getElement().editAsText(); + * // Only modify elements that can be edited as text; skip images and other non-text elements. + * if (element.getElement().editAsText) { + * var text = element.getElement().editAsText(); * - * // Bold the selected part of the element, or the full element if it's completely selected. - * if (element.isPartial()) { - * text.setBold(element.getStartOffset(), element.getEndOffsetInclusive(), true); - * } else { - * text.setBold(true); - * } - * } - * } - * } + * // Bold the selected part of the element, or the full element if it's completely selected. + * if (element.isPartial()) { + * text.setBold(element.getStartOffset(), element.getEndOffsetInclusive(), true); + * } else { + * text.setBold(true); + * } + * } + * } + * } */ export interface Range { getRangeElements(): RangeElement[]; @@ -1161,14 +1124,14 @@ declare namespace GoogleAppsScript { /** * A builder used to construct Range objects from document elements. * - * // Change the user's selection to a range that includes every table in the document. - * var doc = DocumentApp.getActiveDocument(); - * var rangeBuilder = doc.newRange(); - * var tables = doc.getBody().getTables(); - * for (var i = 0; i < tables.length; i++) { - * rangeBuilder.addElement(tables[i]); - * } - * doc.setSelection(rangeBuilder.build()); + * // Change the user's selection to a range that includes every table in the document. + * var doc = DocumentApp.getActiveDocument(); + * var rangeBuilder = doc.newRange(); + * var tables = doc.getBody().getTables(); + * for (var i = 0; i < tables.length; i++) { + * rangeBuilder.addElement(tables[i]); + * } + * doc.setSelection(rangeBuilder.build()); */ export interface RangeBuilder { addElement(element: Element): RangeBuilder; @@ -1183,8 +1146,8 @@ declare namespace GoogleAppsScript { /** * A wrapper around an Element with a possible start and end offset. These offsets allow a - * range of characters within a Text - * element to be represented in search results, document selections, and named ranges. + * range of characters within a Text + * element to be represented in search results, document selections, and named ranges. */ export interface RangeElement { getElement(): Element; @@ -1195,22 +1158,21 @@ declare namespace GoogleAppsScript { /** * An element representing a table. A Table may only contain TableRow elements. For - * more information on document structure, see the - * guide to extending Google Docs. + * more information on document structure, see the guide to extending Google Docs. * * When creating a Table that contains a large number of rows or cells, consider building - * it from a string array, as shown in the following example. + * it from a string array, as shown in the following example. * - * var body = DocumentApp.getActiveDocument().getBody(); + * var body = DocumentApp.getActiveDocument().getBody(); * - * // Create a two-dimensional array containing the cell contents. - * var cells = [ - * ['Row 1, Cell 1', 'Row 1, Cell 2'], - * ['Row 2, Cell 1', 'Row 2, Cell 2'] - * ]; + * // Create a two-dimensional array containing the cell contents. + * var cells = [ + * ['Row 1, Cell 1', 'Row 1, Cell 2'], + * ['Row 2, Cell 1', 'Row 2, Cell 2'] + * ]; * - * // Build a table from the array. - * body.appendTable(cells); + * // Build a table from the array. + * body.appendTable(cells); */ export interface Table { appendTableRow(): TableRow; @@ -1255,10 +1217,8 @@ declare namespace GoogleAppsScript { } /** - * An element representing a table cell. A TableCell is always contained within a - * TableRow and may contain ListItem, Paragraph, or Table elements. - * For more information on document structure, see the - * guide to extending Google Docs. + * An element representing a table cell. A TableCell is always contained within a TableRow and may contain ListItem, Paragraph, or Table elements. For + * more information on document structure, see the guide to extending Google Docs. */ export interface TableCell { appendHorizontalRule(): HorizontalRule; @@ -1329,11 +1289,9 @@ declare namespace GoogleAppsScript { } /** - * An element containing a table of contents. A TableOfContents may contain - * ListItem, Paragraph, and Table elements, although the contents of a - * TableOfContents are usually generated automatically by Google Docs. For more information - * on document structure, see the - * guide to extending Google Docs. + * An element containing a table of contents. A TableOfContents may contain ListItem, Paragraph, and Table elements, although the contents of a TableOfContents are usually generated automatically by Google Docs. For more information on + * document structure, see the guide to + * extending Google Docs. */ export interface TableOfContents { clear(): TableOfContents; @@ -1363,10 +1321,9 @@ declare namespace GoogleAppsScript { } /** - * An element representing a table row. A TableRow is always contained within a - * Table and may only contain TableCell elements. For more information on document - * structure, see the - * guide to extending Google Docs. + * An element representing a table row. A TableRow is always contained within a Table and may only contain TableCell elements. For more information on document + * structure, see the guide to extending + * Google Docs. */ export interface TableRow { appendTableCell(): TableCell; @@ -1410,27 +1367,25 @@ declare namespace GoogleAppsScript { } /** - * An element representing a rich text region. All text in a - * Document is contained within Text - * elements. A Text element can be contained within an Equation, - * EquationFunction, ListItem, or Paragraph, but cannot itself contain any - * other element. For more information on document structure, see the - * guide to extending Google Docs. + * An element representing a rich text region. All text in a Document is contained within Text elements. + * A Text element can be contained within an Equation, EquationFunction, + * ListItem, or Paragraph, but cannot itself contain any other element. For more + * information on document structure, see the guide to extending Google Docs. * - * var body = DocumentApp.getActiveDocument().getBody(); + * var body = DocumentApp.getActiveDocument().getBody(); * - * // Use editAsText to obtain a single text element containing - * // all the characters in the document. - * var text = body.editAsText(); + * // Use editAsText to obtain a single text element containing + * // all the characters in the document. + * var text = body.editAsText(); * - * // Insert text at the beginning of the document. - * text.insertText(0, 'Inserted text.\n'); + * // Insert text at the beginning of the document. + * text.insertText(0, 'Inserted text.\n'); * - * // Insert text at the end of the document. - * text.appendText('\nAppended text.'); + * // Insert text at the end of the document. + * text.appendText('\nAppended text.'); * - * // Make the first half of the document blue. - * text.setForegroundColor(0, text.getText().length / 2, '#00FFFF'); + * // Make the first half of the document blue. + * text.setForegroundColor(0, text.getText().length / 2, '#00FFFF'); */ export interface Text { appendText(text: string): Text; @@ -1500,15 +1455,15 @@ declare namespace GoogleAppsScript { /** * An enumeration of the type of text alignments. * - * // Make the first character in the first paragraph be superscript. - * var text = DocumentApp.getActiveDocument().getBody().getParagraphs()[0].editAsText(); - * text.setTextAlignment(0, 0, DocumentApp.TextAlignment.SUPERSCRIPT); + * // Make the first character in the first paragraph be superscript. + * var text = DocumentApp.getActiveDocument().getBody().getParagraphs()[0].editAsText(); + * text.setTextAlignment(0, 0, DocumentApp.TextAlignment.SUPERSCRIPT); */ export enum TextAlignment { NORMAL, SUPERSCRIPT, SUBSCRIPT } /** * An element representing a region that is unknown or cannot be affected by a script, such as a - * page number. + * page number. */ export interface UnsupportedElement { copy(): UnsupportedElement; @@ -1526,22 +1481,21 @@ declare namespace GoogleAppsScript { /** * An enumeration of the supported vertical alignment types. * - * Use the VerticalAlignment enumeration to set the vertical - * alignment of table cells. + * Use the VerticalAlignment enumeration to set the vertical alignment of table cells. * - * var body = DocumentApp.getActiveDocument().getBody(); + * var body = DocumentApp.getActiveDocument().getBody(); * - * // Append table containing two cells. - * var table = body.appendTable([['Top', 'Center', 'Bottom']]); + * // Append table containing two cells. + * var table = body.appendTable([['Top', 'Center', 'Bottom']]); * - * // Align the first cell's contents to the top. - * table.getCell(0, 0).setVerticalAlignment(DocumentApp.VerticalAlignment.TOP); + * // Align the first cell's contents to the top. + * table.getCell(0, 0).setVerticalAlignment(DocumentApp.VerticalAlignment.TOP); * - * // Align the second cell's contents to the center. - * table.getCell(0, 1).setVerticalAlignment(DocumentApp.VerticalAlignment.CENTER); + * // Align the second cell's contents to the center. + * table.getCell(0, 1).setVerticalAlignment(DocumentApp.VerticalAlignment.CENTER); * - * // Align the third cell's contents to the bottom. - * table.getCell(0, 2).setVerticalAlignment(DocumentApp.VerticalAlignment.BOTTOM); + * // Align the third cell's contents to the bottom. + * table.getCell(0, 2).setVerticalAlignment(DocumentApp.VerticalAlignment.BOTTOM); */ export enum VerticalAlignment { BOTTOM, CENTER, TOP } diff --git a/types/google-apps-script/google-apps-script.drive.d.ts b/types/google-apps-script/google-apps-script.drive.d.ts index 6d5e6d3da3..89ef2032d5 100644 --- a/types/google-apps-script/google-apps-script.drive.d.ts +++ b/types/google-apps-script/google-apps-script.drive.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,153 +10,65 @@ declare namespace GoogleAppsScript { export module Drive { /** * An enum representing classes of users who can access a file or folder, besides any individual - * users who have been explicitly given access. These properties can be accessed from - * DriveApp.Access. + * users who have been explicitly given access. These properties can be accessed from DriveApp.Access. * - * // Creates a folder that anyone on the Internet can read from and write to. (Domain - * // administrators can prohibit this setting for users of a G Suite domain.) - * var folder = DriveApp.createFolder('Shared Folder'); - * folder.setSharing(DriveApp.Access.ANYONE, DriveApp.Permission.EDIT); + * // Creates a folder that anyone on the Internet can read from and write to. (Domain + * // administrators can prohibit this setting for users of a G Suite domain.) + * var folder = DriveApp.createFolder('Shared Folder'); + * folder.setSharing(DriveApp.Access.ANYONE, DriveApp.Permission.EDIT); */ export enum Access { ANYONE, ANYONE_WITH_LINK, DOMAIN, DOMAIN_WITH_LINK, PRIVATE } - /** - * An enum representing the permissions granted to users who can access a file or folder, besides - * any individual users who have been explicitly given access. These properties can be accessed from - * DriveApp.Permission. - * - * // Creates a folder that anyone on the Internet can read from and write to. (Domain - * // administrators can prohibit this setting for users of a G Suite domain.) - * var folder = DriveApp.createFolder('Shared Folder'); - * folder.setSharing(DriveApp.Access.ANYONE, DriveApp.Permission.EDIT); - */ - export enum Permission { VIEW, EDIT, COMMENT, OWNER, ORGANIZER, NONE } - /** * Allows scripts to create, find, and modify files and folders in Google Drive. * - * // Log the name of every file in the user's Drive. - * var files = DriveApp.getFiles(); - * while (files.hasNext()) { - * var file = files.next(); - * Logger.log(file.getName()); - * } + * // Log the name of every file in the user's Drive. + * var files = DriveApp.getFiles(); + * while (files.hasNext()) { + * var file = files.next(); + * Logger.log(file.getName()); + * } */ export interface DriveApp { Access: typeof Access; Permission: typeof Permission; - /** - * Adds the given file to the root of the user's Drive. - * This method does not move the file out of its existing parent folder; - * a file can have more than one parent simultaneously. - */ addFile(child: File): Folder; - /** - * Adds the given folder to the root of the user's Drive. - * This method does not move the folder out of its existing parent folder; - * a folder can have more than one parent simultaneously. - */ addFolder(child: Folder): Folder; - /** - * Resumes a file iteration using a continuation token from a previous iterator. - * This method is useful if processing an iterator in one execution would exceed - * the maximum execution time. Continuation tokens are generally valid for one week. - */ continueFileIterator(continuationToken: string): FileIterator; - /** - * Resumes a folder iteration using a continuation token from a previous iterator. - * This method is useful if processing an iterator in one execution would exceed - * the maximum execution time. Continuation tokens are generally valid for one week. - */ continueFolderIterator(continuationToken: string): FolderIterator; - /** Creates a file in the root of the user's Drive from a given Blob of arbitrary data. */ createFile(blob: Base.BlobSource): File; - /** - * Creates a text file in the root of the user's Drive with the given name - * and contents. Throws an exception if content is larger than 50 MB. - */ createFile(name: string, content: string): File; - /** - * Creates a file in the root of the user's Drive with the given name, contents, and MIME type. - * Throws an exception if content is larger than 10MB. - */ createFile(name: string, content: string, mimeType: string): File; - /** Creates a folder in the root of the user's Drive with the given name. */ createFolder(name: string): Folder; - /** - * Gets the file with the given ID. - * Throws a scripting exception if the file does not exist or - * the user does not have permission to access it. - */ getFileById(id: string): File; - /** Gets a collection of all files in the user's Drive. */ getFiles(): FileIterator; - /** Gets a collection of all files in the user's Drive that have the given name. */ getFilesByName(name: string): FileIterator; - /** Gets a collection of all files in the user's Drive that have the given MIME type. */ getFilesByType(mimeType: string): FileIterator; - /** - * Gets the folder with the given ID. Throws a scripting exception if the folder - * does not exist or the user does not have permission to access it. - */ getFolderById(id: string): Folder; - /** Gets a collection of all folders in the user's Drive. */ getFolders(): FolderIterator; - /** Gets a collection of all folders in the user's Drive that have the given name. */ getFoldersByName(name: string): FolderIterator; - /** Gets the folder at the root of the user's Drive. */ getRootFolder(): Folder; - /** Gets the number of bytes the user is allowed to store in Drive. */ getStorageLimit(): Integer; - /** Gets the number of bytes the user is currently storing in Drive. */ getStorageUsed(): Integer; - /** Gets a collection of all the files in the trash of the user's Drive. */ getTrashedFiles(): FileIterator; - /** Gets a collection of all the folders in the trash of the user's Drive. */ getTrashedFolders(): FolderIterator; - /** - * Removes the given file from the root of the user's Drive. - * This method does not delete the file, but if a file is removed from all - * of its parents, it cannot be seen in Drive except by searching for it - * or using the "All items" view. - */ removeFile(child: File): Folder; - /** - * Removes the given folder from the root of the user's Drive. - * This method does not delete the folder or its contents, but if a folder - * is removed from all of its parents, it cannot be seen in Drive except - * by searching for it or using the "All items" view. - */ removeFolder(child: Folder): Folder; - /** - * Gets a collection of all files in the user's Drive that match the given search criteria. - * The search criteria are detailed the Google Drive SDK documentation. - * Note that the params argument is a query string that may contain string values, - * so take care to escape quotation marks correctly - * (for example "title contains 'Gulliver\\'s Travels'" or 'title contains "Gulliver\'s Travels"'). - */ searchFiles(params: string): FileIterator; - /** - * Gets a collection of all folders in the user's Drive that match the given search criteria. - * The search criteria are detailed the Google Drive SDK documentation. - * Note that the params argument is a query string that may contain string values, - * so take care to escape quotation marks correctly - * (for example "title contains 'Gulliver\\'s Travels'" or 'title contains "Gulliver\'s Travels"'). - */ searchFolders(params: string): FolderIterator; } /** * A file in Google Drive. Files can be accessed or created from DriveApp. * - * // Trash every untitled spreadsheet that hasn't been updated in a week. - * var files = DriveApp.getFilesByName('Untitled spreadsheet'); - * while (files.hasNext()) { - * var file = files.next(); - * if (new Date() - file.getLastUpdated() > 7 * 24 * 60 * 60 * 1000) { - * file.setTrashed(true); - * } - * } + * // Trash every untitled spreadsheet that hasn't been updated in a week. + * var files = DriveApp.getFilesByName('Untitled spreadsheet'); + * while (files.hasNext()) { + * var file = files.next(); + * if (new Date() - file.getLastUpdated() > 7 * 24 * 60 * 60 * 1000) { + * file.setTrashed(true); + * } + * } */ export interface File { addCommenter(emailAddress: string): File; @@ -216,40 +128,30 @@ declare namespace GoogleAppsScript { /** * An iterator that allows scripts to iterate over a potentially large collection of files. File - * iterators can be acccessed from DriveApp or a Folder. + * iterators can be acccessed from DriveApp or a Folder. * - * // Log the name of every file in the user's Drive. - * var files = DriveApp.getFiles(); - * while (files.hasNext()) { - * var file = files.next(); - * Logger.log(file.getName()); - * } + * // Log the name of every file in the user's Drive. + * var files = DriveApp.getFiles(); + * while (files.hasNext()) { + * var file = files.next(); + * Logger.log(file.getName()); + * } */ export interface FileIterator { - /** - * Gets a token that can be used to resume this iteration at a later time. - * This method is useful if processing an iterator in one execution would - * exceed the maximum execution time. Continuation tokens are generally valid for one week. - */ getContinuationToken(): string; - /** Determines whether calling next() will return an item. */ hasNext(): boolean; - /** - * Gets the next item in the collection of files or folders. - * Throws an exception if no items remain. - */ next(): File; } /** * A folder in Google Drive. Folders can be accessed or created from DriveApp. * - * // Log the name of every folder in the user's Drive. - * var folders = DriveApp.getFolders(); - * while (folders.hasNext()) { - * var folder = folders.next(); - * Logger.log(folder.getName()); - * } + * // Log the name of every folder in the user's Drive. + * var folders = DriveApp.getFolders(); + * while (folders.hasNext()) { + * var folder = folders.next(); + * Logger.log(folder.getName()); + * } */ export interface Folder { addEditor(emailAddress: string): Folder; @@ -309,61 +211,48 @@ declare namespace GoogleAppsScript { /** * An object that allows scripts to iterate over a potentially large collection of folders. Folder - * iterators can be acccessed from DriveApp, a File, or a Folder. + * iterators can be acccessed from DriveApp, a File, or a Folder. * - * // Log the name of every folder in the user's Drive. - * var folders = DriveApp.getFolders(); - * while (folders.hasNext()) { - * var folder = folders.next(); - * Logger.log(folder.getName()); - * } + * // Log the name of every folder in the user's Drive. + * var folders = DriveApp.getFolders(); + * while (folders.hasNext()) { + * var folder = folders.next(); + * Logger.log(folder.getName()); + * } */ export interface FolderIterator { - /** - * Gets a token that can be used to resume this iteration at a later time. - * This method is useful if processing an iterator in one execution would - * exceed the maximum execution time. Continuation tokens are generally valid for one week. - */ getContinuationToken(): string; - /** Determines whether calling next() will return an item. */ hasNext(): boolean; - /** - * Gets the next item in the collection of files or folders. - * Throws an exception if no items remain. - */ next(): Folder; } /** - * A user associated with a file in Google Drive. Users can be accessed from - * File.getEditors(), Folder.getViewers(), and other methods. + * An enum representing the permissions granted to users who can access a file or folder, besides + * any individual users who have been explicitly given access. These properties can be accessed from + * DriveApp.Permission. * - * // Log the email address of all users who have edit access to a file. - * var file = DriveApp.getFileById('1234567890abcdefghijklmnopqrstuvwxyz'); - * var editors = file.getEditors(); - * for (var i = 0; i < editors.length; i++) { - * Logger.log(editors[i].getEmail()); - * } + * // Creates a folder that anyone on the Internet can read from and write to. (Domain + * // administrators can prohibit this setting for G Suite users.) + * var folder = DriveApp.createFolder('Shared Folder'); + * folder.setSharing(DriveApp.Access.ANYONE, DriveApp.Permission.EDIT); + */ + export enum Permission { VIEW, EDIT, COMMENT, OWNER, ORGANIZER, NONE } + + /** + * A user associated with a file in Google Drive. Users can be accessed from File.getEditors(), Folder.getViewers(), and other methods. + * + * // Log the email address of all users who have edit access to a file. + * var file = DriveApp.getFileById('1234567890abcdefghijklmnopqrstuvwxyz'); + * var editors = file.getEditors(); + * for (var i = 0; i < editors.length; i++) { + * Logger.log(editors[i].getEmail()); + * } */ export interface User { - /** Gets the domain name associated with the user's account. */ getDomain(): string; - /** - * Gets the user's email address. The user's email address is only available - * if the user has chosen to share the address from the Google+ account settings - * page, or if the user belongs to the same domain as the user running the script - * and the domain administrator has allowed all users within the domain to see - * other users' email addresses. - */ getEmail(): string; - /** Gets the user's name. This method returns null if the user's name is not available. */ - getName(): string | null; - /** Gets the URL for the user's photo. This method returns null if the user's photo is not available. */ - getPhotoUrl(): string | null; - /** - * Gets the user's email address. - * @deprecated As of June 24, 2013, replaced by getEmail() - */ + getName(): string; + getPhotoUrl(): string; getUserLoginId(): string; } 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 cdfbfbd1ef..e7698ea67e 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 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,32 +10,99 @@ declare namespace GoogleAppsScript { export module Forms { /** * An enum representing the supported types of image alignment. Alignment types can be accessed from - * FormApp.Alignment. + * FormApp.Alignment. * - * // Open a form by ID and add a new image item with alignment - * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); - * var img = UrlFetchApp.fetch('https://www.google.com/images/srpr/logo4w.png'); - * form.addImageItem() - * .setImage(img) - * .setAlignment(FormApp.Alignment.CENTER); + * // Open a form by ID and add a new image item with alignment + * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); + * var img = UrlFetchApp.fetch('https://www.google.com/images/srpr/logo4w.png'); + * form.addImageItem() + * .setImage(img) + * .setAlignment(FormApp.Alignment.CENTER); */ export enum Alignment { LEFT, CENTER, RIGHT } /** - * A question item that allows the respondent to select one or more checkboxes, as well - * as an optional "other" field. Items can be accessed or created from a Form. When used in - * a quiz, these items are autograded. + * A question item, presented as a grid of columns and rows, that allows the respondent to select + * multiple choices per row from a sequence of checkboxes. Items can be accessed or created from a + * Form. * - * // Open a form by ID and add a new checkbox item. - * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); - * var item = form.addCheckboxItem(); - * item.setTitle('What condiments would you like on your hot dog?') - * .setChoices([ - * item.createChoice('Ketchup'), - * item.createChoice('Mustard'), - * item.createChoice('Relish') - * ]) - * .showOtherOption(true); + * // Open a form by ID and add a new checkgox grid item. + * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); + * var item = form.addCheckboxGridItem(); + * item.setTitle('Where did you celebrate New Years?') + * .setRows(['New York', 'San Francisco', 'London']) + * .setColumns(['2014', '2015', '2016', '2017']); + */ + export interface CheckboxGridItem { + clearValidation(): CheckboxGridItem; + createResponse(responses: string[][]): ItemResponse; + duplicate(): CheckboxGridItem; + getColumns(): string[]; + getHelpText(): string; + getId(): Integer; + getIndex(): Integer; + getRows(): string[]; + getTitle(): string; + getType(): ItemType; + isRequired(): boolean; + setColumns(columns: string[]): CheckboxGridItem; + setHelpText(text: string): CheckboxGridItem; + setRequired(enabled: boolean): CheckboxGridItem; + setRows(rows: string[]): CheckboxGridItem; + setTitle(title: string): CheckboxGridItem; + setValidation(validation: CheckboxGridValidation): CheckboxGridItem; + } + + /** + * A DataValidation for a CheckboxGridItem. + * + * // Add a checkbox grid item to a form and require one response per column. + * var checkboxGridItem = form.addCheckboxGridItem(); + * checkboxGridItem.setTitle('Where did you celebrate New Years?') + * .setRows(['New York', 'San Francisco', 'London']) + * .setColumns(['2014', '2015', '2016', '2017']); + * var checkboxGridValidation = FormApp.createCheckboxGridValidation() + * .setHelpText(“Select one item per column.”) + * .requireLimitOneResponsePerColumn() + * .build(); + * checkboxGridItem.setValidation(checkboxGridValidation); + */ + export interface CheckboxGridValidation { + } + + /** + * A DataValidationBuilder for a CheckboxGridValidation. + * + * // Add a checkbox grid item to a form and restrict it to one response per column. + * var checkboxGridItem = form.addCheckboxGridItem(); + * checkboxGridItem.setTitle('Where did you celebrate New Years?') + * .setRows(['New York', 'San Francisco', 'London']) + * .setColumns(['2014', '2015', '2016', '2017']); + * var checkboxGridValidation = FormApp.createcheckboxGridValidation() + * .setHelpText(“Select one item per column.”) + * .requireLimitOneResponsePerColumn() + * .build(); + * checkboxGridItem.setValidation(checkboxGridValidation); + */ + export interface CheckboxGridValidationBuilder { + requireLimitOneResponsePerColumn(): CheckboxGridValidationBuilder; + } + + /** + * A question item that allows the respondent to select one or more checkboxes, as well as an + * optional "other" field. Items can be accessed or created from a Form. When used in a + * quiz, these items are autograded. + * + * // Open a form by ID and add a new checkbox item. + * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); + * var item = form.addCheckboxItem(); + * item.setTitle('What condiments would you like on your hot dog?') + * .setChoices([ + * item.createChoice('Ketchup'), + * item.createChoice('Mustard'), + * item.createChoice('Relish') + * ]) + * .showOtherOption(true); */ export interface CheckboxItem { clearValidation(): CheckboxItem; @@ -69,73 +136,68 @@ declare namespace GoogleAppsScript { /** * A DataValidation for a CheckboxItem. * - * // Add a checkBox item to a form and require exactly two selections. - * var checkBoxItem = form.addCheckboxItem(); - * checkBoxItem.setTitle('What two condiments would you like on your hot dog?'); - * checkBoxItem.setChoices([ - * checkBoxItem.createChoice('Ketchup'), - * checkBoxItem.createChoice('Mustard'), - * checkBoxItem.createChoice('Relish') - * ]); - * var checkBoxValidation = FormApp.createCheckboxValidation() - * .setHelpText(“Select two condiments.”) - * .requireSelectExactly(2) - * .build(); - * checkBoxItem.setValidation(checkBoxValidation); + * // Add a checkBox item to a form and require exactly two selections. + * var checkBoxItem = form.addCheckboxItem(); + * checkBoxItem.setTitle('What two condiments would you like on your hot dog?'); + * checkBoxItem.setChoices([ + * checkBoxItem.createChoice('Ketchup'), + * checkBoxItem.createChoice('Mustard'), + * checkBoxItem.createChoice('Relish') + * ]); + * var checkBoxValidation = FormApp.createCheckboxValidation() + * .setHelpText(“Select two condiments.”) + * .requireSelectExactly(2) + * .build(); + * checkBoxItem.setValidation(checkBoxValidation); */ export interface CheckboxValidation { - getHelpText(): string; } /** * A DataValidationBuilder for a CheckboxValidation. * - * // Add a checkBox item to a form and require exactly two selections. - * var checkBoxItem = form.addCheckboxItem(); - * checkBoxItem.setTitle('What two condiments would you like on your hot dog?'); - * checkBoxItem.setChoices([ - * checkBoxItem.createChoice('Ketchup'), - * checkBoxItem.createChoice('Mustard'), - * checkBoxItem.createChoice('Relish') - * ]); - * var checkBoxValidation = FormApp.createCheckboxValidation() - * .setHelpText(“Select two condiments.”) - * .requireSelectExactly(2) - * .build(); - * checkBoxItem.setValidation(checkBoxValidation); + * // Add a checkBox item to a form and require exactly two selections. + * var checkBoxItem = form.addCheckboxItem(); + * checkBoxItem.setTitle('What two condiments would you like on your hot dog?'); + * checkBoxItem.setChoices([ + * checkBoxItem.createChoice('Ketchup'), + * checkBoxItem.createChoice('Mustard'), + * checkBoxItem.createChoice('Relish') + * ]); + * var checkBoxValidation = FormApp.createCheckboxValidation() + * .setHelpText(“Select two condiments.”) + * .requireSelectExactly(2) + * .build(); + * checkBoxItem.setValidation(checkBoxValidation); */ export interface CheckboxValidationBuilder { - build(): CheckboxValidation; - copy(): CheckboxValidationBuilder; requireSelectAtLeast(number: Integer): CheckboxValidationBuilder; requireSelectAtMost(number: Integer): CheckboxValidationBuilder; requireSelectExactly(number: Integer): CheckboxValidationBuilder; - setHelpText(text: string): CheckboxValidationBuilder; } /** - * A single choice associated with a type of Item that supports choices, like - * CheckboxItem, ListItem, or MultipleChoiceItem. + * A single choice associated with a type of Item that supports choices, like CheckboxItem, ListItem, or MultipleChoiceItem. * - * // Create a new form and add a multiple-choice item. - * var form = FormApp.create('Form Name'); - * var item = form.addMultipleChoiceItem(); - * item.setTitle('Do you prefer cats or dogs?') - * .setChoices([ - * item.createChoice('Cats', FormApp.PageNavigationType.CONTINUE), - * item.createChoice('Dogs', FormApp.PageNavigationType.RESTART) - * ]); + * // Create a new form and add a multiple-choice item. + * var form = FormApp.create('Form Name'); + * var item = form.addMultipleChoiceItem(); + * item.setTitle('Do you prefer cats or dogs?') + * .setChoices([ + * item.createChoice('Cats', FormApp.PageNavigationType.CONTINUE), + * item.createChoice('Dogs', FormApp.PageNavigationType.RESTART) + * ]); * - * // Add another page because navigation has no effect on the last page. - * form.addPageBreakItem().setTitle('You chose well!'); + * // Add another page because navigation has no effect on the last page. + * form.addPageBreakItem().setTitle('You chose well!'); * - * // Log the navigation types that each choice results in. - * var choices = item.getChoices(); - * for (var i = 0; i < choices.length; i++) { - * Logger.log('If the respondent chooses "%s", the form will %s.', - * choices[i].getValue(), - * choices[i].getPageNavigationType()); - * } + * // Log the navigation types that each choice results in. + * var choices = item.getChoices(); + * for (var i = 0; i < choices.length; i++) { + * Logger.log('If the respondent chooses "%s", the form will %s.', + * choices[i].getValue(), + * choices[i].getPageNavigationType()); + * } */ export interface Choice { getGotoPage(): PageBreakItem; @@ -145,46 +207,13 @@ declare namespace GoogleAppsScript { } /** - * The base DataValidation that contains properties common to all validations, such as help text. - * Validations can be added to certain Form items. + * A question item that allows the respondent to indicate a date. Items can be accessed or created + * from a Form. When used in a quiz, these items are graded. * - * // Add a text item to a form and require it to be a number within a range. - * var textItem = form.addTextItem().setTitle('Pick a number between 1 and 100?'); - * var textValidation = FormApp.createTextValidation() - * .setHelpText(“Input was not a number between 1 and 100.”) - * .requireNumberBetween(1, 100); - * textItem.setValidation(textValidation); - */ - export interface DataValidation { - getHelpText(): string; - } - - /** - * The base DataValidationBuilder that contains setters for properties common to all validations, - * such as help text. Used to build DataValadation objects. - * - * // Add a text item to a form and require it to be a number within a range. - * var textItem = form.addTextItem().setTitle('Pick a number between 1 and 100?'); - * var textValidation = FormApp.createTextValidation() - * .setHelpText(“Input was not a number between 1 and 100.”) - * .requireNumberBetween(1, 100) - * .build(); - * textItem.setValidation(textValidation); - */ - export interface DataValidationBuilder { - build(): DataValidation; - copy(): DataValidationBuilder; - setHelpText(text: string): DataValidationBuilder; - } - - /** - * A question item that allows the respondent to indicate a date. Items can be accessed or - * created from a Form. When used in a quiz, these items are graded. - * - * // Open a form by ID and add a new date item. - * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); - * var item = form.addDateItem(); - * item.setTitle('When were you born?'); + * // Open a form by ID and add a new date item. + * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); + * var item = form.addDateItem(); + * item.setTitle('When were you born?'); */ export interface DateItem { createResponse(response: Date): ItemResponse; @@ -207,13 +236,13 @@ declare namespace GoogleAppsScript { } /** - * A question item that allows the respondent to indicate a date and time. Items can be - * accessed or created from a Form. When used in a quiz, these items are graded. + * A question item that allows the respondent to indicate a date and time. Items can be accessed or + * created from a Form. When used in a quiz, these items are graded. * - * // Open a form by ID and add a new date-time item. - * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); - * var item = form.addDateTimeItem(); - * item.setTitle('When do you want to meet?'); + * // Open a form by ID and add a new date-time item. + * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); + * var item = form.addDateTimeItem(); + * item.setTitle('When do you want to meet?'); */ export interface DateTimeItem { createResponse(response: Date): ItemResponse; @@ -237,28 +266,26 @@ declare namespace GoogleAppsScript { /** * An enum representing the supported types of form-response destinations. All forms, including - * those that do not have a destination set explicitly, - * save - * a copy of responses in the form's response store. Destination types can be accessed from - * FormApp.DestinationType. + * those that do not have a destination set explicitly, save a copy of responses in the form's + * response store. Destination types can be accessed from FormApp.DestinationType. * - * // Open a form by ID and create a new spreadsheet. - * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); - * var ss = SpreadsheetApp.create('Spreadsheet Name'); + * // Open a form by ID and create a new spreadsheet. + * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); + * var ss = SpreadsheetApp.create('Spreadsheet Name'); * - * // Update the form's response destination. - * form.setDestination(FormApp.DestinationType.SPREADSHEET, ss.getId()); + * // Update the form's response destination. + * form.setDestination(FormApp.DestinationType.SPREADSHEET, ss.getId()); */ export enum DestinationType { SPREADSHEET } /** - * A question item that allows the respondent to indicate a length of time. Items can be - * accessed or created from a Form. When used in a quiz, these items are graded. + * A question item that allows the respondent to indicate a length of time. Items can be accessed or + * created from a Form. When used in a quiz, these items are graded. * - * // Open a form by ID and add a new duration item. - * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); - * var item = form.addDurationItem(); - * item.setTitle('How long can you hold your breath?'); + * // Open a form by ID and add a new duration item. + * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); + * var item = form.addDurationItem(); + * item.setTitle('How long can you hold your breath?'); */ export interface DurationItem { createResponse(hours: Integer, minutes: Integer, seconds: Integer): ItemResponse; @@ -279,44 +306,43 @@ declare namespace GoogleAppsScript { } /** - * An enum representing the supported types of feedback. Feedback types can be accessed from - * FormApp.FeedbackType. + * An enum representing the supported types of feedback. Feedback types can be accessed from FormApp.FeedbackType. * - * // Open a form by ID and add a new list item. - * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); - * var item = form.addListItem(); - * item.setTitle('Do you prefer cats or dogs?'); - * // Set "Dogs" as the correct answer to this question. - * item.setChoices([ - * item.createChoice('Dogs', true), - * item.createChoice('Cats', false)]); - * // Add feedback which will be shown for correct responses; ie "Dogs". - * item.setFeedbackForCorrect( - * FormApp.createFeedback().setDisplayText("Dogs rule, cats drool.").build()); + * // Open a form by ID and add a new list item. + * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); + * var item = form.addListItem(); + * item.setTitle('Do you prefer cats or dogs?'); + * // Set "Dogs" as the correct answer to this question. + * item.setChoices([ + * item.createChoice('Dogs', true), + * item.createChoice('Cats', false)]); + * // Add feedback which will be shown for correct responses; ie "Dogs". + * item.setFeedbackForCorrect( + * FormApp.createFeedback().setDisplayText("Dogs rule, cats drool.").build()); */ export enum FeedbackType { CORRECT, INCORRECT, GENERAL } /** - * A form that contains overall properties and items. Properties include title, settings, and - * where responses are stored. Items include question items like checkboxes or radio items, while - * layout items refer to things like page breaks. Forms can be accessed or created from - * FormApp. + * A form that contains overall properties and items. Properties include title, settings, and where + * responses are stored. Items include question items like checkboxes or radio items, while layout + * items refer to things like page breaks. Forms can be accessed or created from FormApp. * - * // Open a form by ID and create a new spreadsheet. - * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); - * var ss = SpreadsheetApp.create('Spreadsheet Name'); + * // Open a form by ID and create a new spreadsheet. + * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); + * var ss = SpreadsheetApp.create('Spreadsheet Name'); * - * // Update form properties via chaining. - * form.setTitle('Form Name') - * .setDescription('Description of form') - * .setConfirmationMessage('Thanks for responding!') - * .setAllowResponseEdits(true) - * .setAcceptingResponses(false); + * // Update form properties via chaining. + * form.setTitle('Form Name') + * .setDescription('Description of form') + * .setConfirmationMessage('Thanks for responding!') + * .setAllowResponseEdits(true) + * .setAcceptingResponses(false); * - * // Update the form's response destination. - * form.setDestination(FormApp.DestinationType.SPREADSHEET, ss.getId()); + * // Update the form's response destination. + * form.setDestination(FormApp.DestinationType.SPREADSHEET, ss.getId()); */ export interface Form { + addCheckboxGridItem(): CheckboxGridItem; addCheckboxItem(): CheckboxItem; addDateItem(): DateItem; addDateTimeItem(): DateTimeItem; @@ -341,6 +367,7 @@ declare namespace GoogleAppsScript { deleteAllResponses(): Form; deleteItem(index: Integer): void; deleteItem(item: Item): void; + deleteResponse(responseId: string): Form; getConfirmationMessage(): string; getCustomClosedFormMessage(): string; getDescription(): string; @@ -393,11 +420,11 @@ declare namespace GoogleAppsScript { /** * Allows a script to open an existing Form or create a new one. * - * // Open a form by ID. - * var existingForm = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); + * // Open a form by ID. + * var existingForm = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); * - * // Create and open a form. - * var newForm = FormApp.create('Form Name'); + * // Create and open a form. + * var newForm = FormApp.create('Form Name'); */ export interface FormApp { Alignment: typeof Alignment; @@ -406,6 +433,7 @@ declare namespace GoogleAppsScript { ItemType: typeof ItemType; PageNavigationType: typeof PageNavigationType; create(title: string): Form; + createCheckboxGridValidation(): CheckboxGridValidationBuilder; createCheckboxValidation(): CheckboxValidationBuilder; createFeedback(): QuizFeedbackBuilder; createGridValidation(): GridValidationBuilder; @@ -418,26 +446,25 @@ declare namespace GoogleAppsScript { } /** - * A response to the form as a whole. A FormResponse can be used in three ways: to - * access the answers submitted by a respondent (see getItemResponses()), to - * programmatically submit a response to the form (see withItemResponse(response) and - * submit()), and to generate a URL for the form which pre-fills fields using the - * provided answers. FormResponses can be created or accessed from a Form. + * A response to the form as a whole. A FormResponse can be used in three ways: to access + * the answers submitted by a respondent (see getItemResponses()), to programmatically + * submit a response to the form (see withItemResponse(response) and submit()), and to generate a URL for the form which pre-fills fields using the provided + * answers. FormResponses can be created or accessed from a Form. * - * // Open a form by ID and log the responses to each question. - * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); - * var formResponses = form.getResponses(); - * for (var i = 0; i < formResponses.length; i++) { - * var formResponse = formResponses[i]; - * var itemResponses = formResponse.getItemResponses(); - * for (var j = 0; j < itemResponses.length; j++) { - * var itemResponse = itemResponses[j]; - * Logger.log('Response #%s to the question "%s" was "%s"', - * (i + 1).toString(), - * itemResponse.getItem().getTitle(), - * itemResponse.getResponse()); - * } - * } + * // Open a form by ID and log the responses to each question. + * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); + * var formResponses = form.getResponses(); + * for (var i = 0; i < formResponses.length; i++) { + * var formResponse = formResponses[i]; + * var itemResponses = formResponse.getItemResponses(); + * for (var j = 0; j < itemResponses.length; j++) { + * var itemResponse = itemResponses[j]; + * Logger.log('Response #%s to the question "%s" was "%s"', + * (i + 1).toString(), + * itemResponse.getItem().getTitle(), + * itemResponse.getResponse()); + * } + * } */ export interface FormResponse { getEditResponseUrl(): string; @@ -456,15 +483,15 @@ declare namespace GoogleAppsScript { /** * A question item, presented as a grid of columns and rows, that allows the respondent to select - * one choice per row from a sequence of radio buttons. Items can be accessed or created from a - * Form. + * one choice per row from a sequence of radio buttons. Items can be accessed or created from a + * Form. * - * // Open a form by ID and add a new grid item. - * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); - * var item = form.addGridItem(); - * item.setTitle('Rate your interests') - * .setRows(['Cars', 'Computers', 'Celebrities']) - * .setColumns(['Boring', 'So-so', 'Interesting']); + * // Open a form by ID and add a new grid item. + * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); + * var item = form.addGridItem(); + * item.setTitle('Rate your interests') + * .setRows(['Cars', 'Computers', 'Celebrities']) + * .setColumns(['Boring', 'So-so', 'Interesting']); */ export interface GridItem { clearValidation(): GridItem; @@ -489,52 +516,48 @@ declare namespace GoogleAppsScript { /** * A DataValidation for a GridItem. * - * // Add a grid item to a form and require one response per column. - * var gridItem = form.addGridItem(); - * gridItem.setTitle('Rate your interests') - * .setRows(['Cars', 'Computers', 'Celebrities']) - * .setColumns(['Boring', 'So-so', 'Interesting']); - * var gridValidation = FormApp.createGridValidation() - * .setHelpText(“Select one item per column.”) - * .requireLimitOneResponsePerColumn() - * .build(); - * gridItem.setValidation(gridValidation); + * // Add a grid item to a form and require one response per column. + * var gridItem = form.addGridItem(); + * gridItem.setTitle('Rate your interests') + * .setRows(['Cars', 'Computers', 'Celebrities']) + * .setColumns(['Boring', 'So-so', 'Interesting']); + * var gridValidation = FormApp.createGridValidation() + * .setHelpText(“Select one item per column.”) + * .requireLimitOneResponsePerColumn() + * .build(); + * gridItem.setValidation(gridValidation); */ export interface GridValidation { - getHelpText(): string; } /** * A DataValidationBuilder for a GridValidation. * - * // Add a grid item to a form and require one response per column. - * var gridItem = form.addGridItem(); - * gridItem.setTitle('Rate your interests') - * .setRows(['Cars', 'Computers', 'Celebrities']) - * .setColumns(['Boring', 'So-so', 'Interesting']); - * var gridValidation = FormApp.createGridValidation() - * .setHelpText(“Select one item per column.”) - * .requireLimitOneResponsePerColumn() - * .build(); - * gridItem.setValidation(gridValidation); + * // Add a grid item to a form and require one response per column. + * var gridItem = form.addGridItem(); + * gridItem.setTitle('Rate your interests') + * .setRows(['Cars', 'Computers', 'Celebrities']) + * .setColumns(['Boring', 'So-so', 'Interesting']); + * var gridValidation = FormApp.createGridValidation() + * .setHelpText(“Select one item per column.”) + * .requireLimitOneResponsePerColumn() + * .build(); + * gridItem.setValidation(gridValidation); */ export interface GridValidationBuilder { - build(): GridValidation; - copy(): GridValidationBuilder; requireLimitOneResponsePerColumn(): GridValidationBuilder; - setHelpText(text: string): GridValidationBuilder; } /** * A layout item that displays an image. Items can be accessed or created from a Form. * - * // Open a form by ID and add a new image item - * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); - * var img = UrlFetchApp.fetch('https://www.google.com/images/srpr/logo4w.png'); - * form.addImageItem() - * .setTitle('Google') - * .setHelpText('Google Logo') // The help text is the image description - * .setImage(img); + * // Open a form by ID and add a new image item + * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); + * var img = UrlFetchApp.fetch('https://www.google.com/images/srpr/logo4w.png'); + * form.addImageItem() + * .setTitle('Google') + * .setHelpText('Google Logo') // The help text is the image description + * .setImage(img); */ export interface ImageItem { duplicate(): ImageItem; @@ -555,27 +578,31 @@ declare namespace GoogleAppsScript { /** * A generic form item that contains properties common to all items, such as title and help text. - * Items can be accessed or created from a Form. + * Items can be accessed or created from a Form. * - * To operate on type-specific properties, use getType() to check the item's - * ItemType, then cast the item to the - * appropriate class using a method like asCheckboxItem(). + * To operate on type-specific properties, use getType() to check the item's ItemType, then cast the item to the + * appropriate class using a method like asCheckboxItem(). * - * // Create a new form and add a text item. - * var form = FormApp.create('Form Name'); - * form.addTextItem(); + * // Create a new form and add a text item. + * var form = FormApp.create('Form Name'); + * form.addTextItem(); * - * // Access the text item as a generic item. - * var items = form.getItems(); - * var item = items[0]; + * // Access the text item as a generic item. + * var items = form.getItems(); + * var item = items[0]; * - * // Cast the generic item to the text-item class. - * if (item.getType() == 'TEXT') { - * var textItem = item.asTextItem(); - * textItem.setRequired(false); - * } + * // Cast the generic item to the text-item class. + * if (item.getType() == 'TEXT') { + * var textItem = item.asTextItem(); + * textItem.setRequired(false); + * } + * + * Implementing classes + * + * NameBrief description */ export interface Item { + asCheckboxGridItem(): CheckboxGridItem; asCheckboxItem(): CheckboxItem; asDateItem(): DateItem; asDateTimeItem(): DateTimeItem; @@ -602,24 +629,22 @@ declare namespace GoogleAppsScript { } /** - * A response to one question item within a form. Item responses can be accessed from - * FormResponse and created from any Item that asks the respondent to answer a - * question. + * A response to one question item within a form. Item responses can be accessed from FormResponse and created from any Item that asks the respondent to answer a question. * - * // Open a form by ID and log the responses to each question. - * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); - * var formResponses = form.getResponses(); - * for (var i = 0; i < formResponses.length; i++) { - * var formResponse = formResponses[i]; - * var itemResponses = formResponse.getItemResponses(); - * for (var j = 0; j < itemResponses.length; j++) { - * var itemResponse = itemResponses[j]; - * Logger.log('Response #%s to the question "%s" was "%s"', - * (i + 1).toString(), - * itemResponse.getItem().getTitle(), - * itemResponse.getResponse()); - * } - * } + * // Open a form by ID and log the responses to each question. + * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); + * var formResponses = form.getResponses(); + * for (var i = 0; i < formResponses.length; i++) { + * var formResponse = formResponses[i]; + * var itemResponses = formResponse.getItemResponses(); + * for (var j = 0; j < itemResponses.length; j++) { + * var itemResponse = itemResponses[j]; + * Logger.log('Response #%s to the question "%s" was "%s"', + * (i + 1).toString(), + * itemResponse.getItem().getTitle(), + * itemResponse.getResponse()); + * } + * } */ export interface ItemResponse { getFeedback(): Object; @@ -631,33 +656,32 @@ declare namespace GoogleAppsScript { } /** - * An enum representing the supported types of form items. Item types can be accessed from - * FormApp.ItemType. + * An enum representing the supported types of form items. Item types can be accessed from FormApp.ItemType. * - * // Open a form by ID and add a new section header. - * var form = FormApp.create('Form Name'); - * var item = form.addSectionHeaderItem(); - * item.setTitle('Title of new section'); + * // Open a form by ID and add a new section header. + * var form = FormApp.create('Form Name'); + * var item = form.addSectionHeaderItem(); + * item.setTitle('Title of new section'); * - * // Check the item type. - * if (item.getType() == FormApp.ItemType.SECTION_HEADER) { - * item.setHelpText('Description of new section.'); - * } + * // Check the item type. + * if (item.getType() == FormApp.ItemType.SECTION_HEADER) { + * item.setHelpText('Description of new section.'); + * } */ - export enum ItemType { CHECKBOX, 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 } /** * A question item that allows the respondent to select one choice from a drop-down list. Items can - * be accessed or created from a Form. + * be accessed or created from a Form. * - * // Open a form by ID and add a new list item. - * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); - * var item = form.addListItem(); - * item.setTitle('Do you prefer cats or dogs?') - * .setChoices([ - * item.createChoice('Cats'), - * item.createChoice('Dogs') - * ]); + * // Open a form by ID and add a new list item. + * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); + * var item = form.addListItem(); + * item.setTitle('Do you prefer cats or dogs?') + * .setChoices([ + * item.createChoice('Cats'), + * item.createChoice('Dogs') + * ]); */ export interface ListItem { createChoice(value: string): Choice; @@ -687,19 +711,19 @@ declare namespace GoogleAppsScript { } /** - * A question item that allows the respondent to select one choice from a list of radio - * buttons or an optional "other" field. Items can be accessed or created from a Form. - * When used in a quiz, these items are autograded. + * A question item that allows the respondent to select one choice from a list of radio buttons or + * an optional "other" field. Items can be accessed or created from a Form. When used in a + * quiz, these items are autograded. * - * // Open a form by ID and add a new multiple choice item. - * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); - * var item = form.addMultipleChoiceItem(); - * item.setTitle('Do you prefer cats or dogs?') - * .setChoices([ - * item.createChoice('Cats'), - * item.createChoice('Dogs') - * ]) - * .showOtherOption(true); + * // Open a form by ID and add a new multiple choice item. + * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); + * var item = form.addMultipleChoiceItem(); + * item.setTitle('Do you prefer cats or dogs?') + * .setChoices([ + * item.createChoice('Cats'), + * item.createChoice('Dogs') + * ]) + * .showOtherOption(true); */ export interface MultipleChoiceItem { createChoice(value: string): Choice; @@ -731,17 +755,16 @@ declare namespace GoogleAppsScript { } /** - * A layout item that marks the start of a page. Items can be accessed or - * created from a Form. + * A layout item that marks the start of a page. Items can be accessed or created from a Form. * - * // Create a form and add three page-break items. - * var form = FormApp.create('Form Name'); - * var pageTwo = form.addPageBreakItem().setTitle('Page Two'); - * var pageThree = form.addPageBreakItem().setTitle('Page Three'); + * // Create a form and add three page-break items. + * var form = FormApp.create('Form Name'); + * var pageTwo = form.addPageBreakItem().setTitle('Page Two'); + * var pageThree = form.addPageBreakItem().setTitle('Page Three'); * - * // Make the first two pages navigate elsewhere upon completion. - * pageTwo.setGoToPage(pageThree); // At end of page one (start of page two), jump to page three - * pageThree.setGoToPage(FormApp.PageNavigationType.RESTART); // At end of page two, restart form + * // Make the first two pages navigate elsewhere upon completion. + * pageTwo.setGoToPage(pageThree); // At end of page one (start of page two), jump to page three + * pageThree.setGoToPage(FormApp.PageNavigationType.RESTART); // At end of page two, restart form */ export interface PageBreakItem { duplicate(): PageBreakItem; @@ -760,40 +783,41 @@ declare namespace GoogleAppsScript { /** * An enum representing the supported types of page navigation. Page navigation types can be - * accessed from FormApp.PageNavigationType. + * accessed from FormApp.PageNavigationType. * * The page navigation occurs after the respondent completes a page that contains the option, and - * only if the respondent chose that option. If the respondent chose multiple options with - * page-navigation instructions on the same page, only the last navigation option has any effect. - * Page navigation also has no effect on the last page of a form. + * only if the respondent chose that option. If the respondent chose multiple options with + * page-navigation instructions on the same page, only the last navigation option has any effect. + * Page navigation also has no effect on the last page of a form. + * * Choices that use page navigation cannot be combined in the same item with choices that do not - * use page navigation. + * use page navigation. * - * // Create a form and add a new multiple-choice item and a page-break item. - * var form = FormApp.create('Form Name'); - * var item = form.addMultipleChoiceItem(); - * var pageBreak = form.addPageBreakItem(); + * // Create a form and add a new multiple-choice item and a page-break item. + * var form = FormApp.create('Form Name'); + * var item = form.addMultipleChoiceItem(); + * var pageBreak = form.addPageBreakItem(); * - * // Set some choices with go-to-page logic. - * var rightChoice = item.createChoice('Vanilla', FormApp.PageNavigationType.SUBMIT); - * var wrongChoice = item.createChoice('Chocolate', FormApp.PageNavigationType.RESTART); + * // Set some choices with go-to-page logic. + * var rightChoice = item.createChoice('Vanilla', FormApp.PageNavigationType.SUBMIT); + * var wrongChoice = item.createChoice('Chocolate', FormApp.PageNavigationType.RESTART); * - * // For GO_TO_PAGE, just pass in the page break item. For CONTINUE (normally the default), pass in - * // CONTINUE explicitly because page navigation cannot be mixed with non-navigation choices. - * var iffyChoice = item.createChoice('Peanut', pageBreak); - * var otherChoice = item.createChoice('Strawberry', FormApp.PageNavigationType.CONTINUE); - * item.setChoices([rightChoice, wrongChoice, iffyChoice, otherChoice]); + * // For GO_TO_PAGE, just pass in the page break item. For CONTINUE (normally the default), pass in + * // CONTINUE explicitly because page navigation cannot be mixed with non-navigation choices. + * var iffyChoice = item.createChoice('Peanut', pageBreak); + * var otherChoice = item.createChoice('Strawberry', FormApp.PageNavigationType.CONTINUE); + * item.setChoices([rightChoice, wrongChoice, iffyChoice, otherChoice]); */ export enum PageNavigationType { CONTINUE, GO_TO_PAGE, RESTART, SUBMIT } /** - * A question item that allows the respondent to enter a block of text. Items can be - * accessed or created from a Form. When used in a quiz, these items are graded. + * A question item that allows the respondent to enter a block of text. Items can be accessed or + * created from a Form. When used in a quiz, these items are graded. * - * // Open a form by ID and add a new paragraph text item. - * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); - * var item = form.addParagraphTextItem(); - * item.setTitle('What is your address?'); + * // Open a form by ID and add a new paragraph text item. + * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); + * var item = form.addParagraphTextItem(); + * item.setTitle('What is your address?'); */ export interface ParagraphTextItem { clearValidation(): ParagraphTextItem; @@ -818,53 +842,49 @@ declare namespace GoogleAppsScript { /** * A DataValidation for a ParagraphTextItem. * - * // Add a paragraph text item to a form and require the answer to be at least 100 characters. - * var paragraphTextItem = form.addParagraphTextItem().setTitle('Describe yourself:'); - * var paragraphtextValidation = FormApp.createParagraphTextValidation() - * .setHelpText(“Answer must be more than 100 characters.”) - * .requireTextLengthGreatherThan(100); - * paragraphTextItem.setValidation(paragraphtextValidation); + * // Add a paragraph text item to a form and require the answer to be at least 100 characters. + * var paragraphTextItem = form.addParagraphTextItem().setTitle('Describe yourself:'); + * var paragraphtextValidation = FormApp.createParagraphTextValidation() + * .setHelpText(“Answer must be more than 100 characters.”) + * .requireTextLengthGreatherThan(100); + * paragraphTextItem.setValidation(paragraphtextValidation); */ export interface ParagraphTextValidation { - getHelpText(): string; } /** * A DataValidationBuilder for a ParagraphTextValidation. * - * // Add a paragraph text item to a form and require the answer to be at least 100 characters. - * var paragraphTextItem = form.addParagraphTextItem().setTitle('Describe yourself:'); - * var paragraphtextValidation = FormApp.createParagraphTextValidation() - * .setHelpText(“Answer must be more than 100 characters.”) - * .requireTextLengthGreatherThan(100); - * paragraphTextItem.setValidation(paragraphtextValidation); + * // Add a paragraph text item to a form and require the answer to be at least 100 characters. + * var paragraphTextItem = form.addParagraphTextItem().setTitle('Describe yourself:'); + * var paragraphtextValidation = FormApp.createParagraphTextValidation() + * .setHelpText(“Answer must be more than 100 characters.”) + * .requireTextLengthGreatherThan(100); + * paragraphTextItem.setValidation(paragraphtextValidation); */ export interface ParagraphTextValidationBuilder { - build(): ParagraphTextValidation; - copy(): ParagraphTextValidationBuilder; requireTextContainsPattern(pattern: string): ParagraphTextValidationBuilder; requireTextDoesNotContainPattern(pattern: string): ParagraphTextValidationBuilder; requireTextDoesNotMatchPattern(pattern: string): ParagraphTextValidationBuilder; requireTextLengthGreaterThanOrEqualTo(number: Integer): ParagraphTextValidationBuilder; requireTextLengthLessThanOrEqualTo(number: Integer): ParagraphTextValidationBuilder; requireTextMatchesPattern(pattern: string): ParagraphTextValidationBuilder; - setHelpText(text: string): ParagraphTextValidationBuilder; } /** * The bean implementation of a Feedback, which contains properties common to all feedback, such as - * display text or links. + * display text or links. * - * Feedback can be added to gradeable Form items. + * Feedback can be added to gradeable Form items. * - * // Setting feedback which should be automatically shown when a user responds to a question - * // incorrectly. - * var textItem = form.addTextItem().setTitle('Re-hydrating dried fruit is an example of what?'); - * var feedback = FormApp.createFeedback() - * .setDisplayText( - * “Good answer, but not quite right. Please review chapter 4 before next time.”) - * .addLink("http://wikipedia.com/osmosis"); - * textItem.setFeedbackForIncorrect(feedback); + * // Setting feedback which should be automatically shown when a user responds to a question + * // incorrectly. + * var textItem = form.addTextItem().setTitle('Re-hydrating dried fruit is an example of what?'); + * var feedback = FormApp.createFeedback() + * .setDisplayText( + * “Good answer, but not quite right. Please review chapter 4 before next time.”) + * .addLink("http://wikipedia.com/osmosis"); + * textItem.setFeedbackForIncorrect(feedback); */ export interface QuizFeedback { getLinkUrls(): string[]; @@ -872,18 +892,18 @@ declare namespace GoogleAppsScript { } /** - * The base FeedbackBuilder that contains setters for properties common to all feedback, - * such as display text. Used to build Feedback objects. + * The base FeedbackBuilder that contains setters for properties common to all feedback, such as + * display text. Used to build Feedback objects. * - * // Open a form by ID and add a new list item. - * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); - * var item = form.addListItem(); - * item.setTitle('Do you prefer cats or dogs?'); - * item.setChoices([ - * item.createChoice('Dogs', true), - * item.createChoice('Cats', false)]); - * // Add feedback which will be shown for correct responses; ie "Dogs". - * item.setFeedbackForCorrect(FormApp.createFeedback().setText("Dogs rule, cats drool.").build()); + * // Open a form by ID and add a new list item. + * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); + * var item = form.addListItem(); + * item.setTitle('Do you prefer cats or dogs?'); + * item.setChoices([ + * item.createChoice('Dogs', true), + * item.createChoice('Cats', false)]); + * // Add feedback which will be shown for correct responses; ie "Dogs". + * item.setFeedbackForCorrect(FormApp.createFeedback().setText("Dogs rule, cats drool.").build()); */ export interface QuizFeedbackBuilder { addLink(url: string): QuizFeedbackBuilder; @@ -894,15 +914,15 @@ declare namespace GoogleAppsScript { } /** - * A question item that allows the respondent to choose one option from a numbered sequence - * of radio buttons. Items can be accessed or created from a Form. When used in a quiz, - * these items are graded. + * A question item that allows the respondent to choose one option from a numbered sequence of radio + * buttons. Items can be accessed or created from a Form. When used in a quiz, these items + * are graded. * - * // Open a form by ID and add a new scale item. - * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); - * var item = form.addScaleItem(); - * item.setTitle('Pick a number between 1 and 10') - * .setBounds(1, 10); + * // Open a form by ID and add a new scale item. + * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); + * var item = form.addScaleItem(); + * item.setTitle('Pick a number between 1 and 10') + * .setBounds(1, 10); */ export interface ScaleItem { createResponse(response: Integer): ItemResponse; @@ -930,12 +950,12 @@ declare namespace GoogleAppsScript { /** * A layout item that visually indicates the start of a section. Items can be accessed or created - * from a Form. + * from a Form. * - * // Open a form by ID and add a new section header. - * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); - * var item = form.addSectionHeaderItem(); - * item.setTitle('Title of new section'); + * // Open a form by ID and add a new section header. + * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); + * var item = form.addSectionHeaderItem(); + * item.setTitle('Title of new section'); */ export interface SectionHeaderItem { duplicate(): SectionHeaderItem; @@ -949,13 +969,13 @@ declare namespace GoogleAppsScript { } /** - * A question item that allows the respondent to enter a single line of text. Items can be - * accessed or created from a Form. When used in a quiz, these items are graded. + * A question item that allows the respondent to enter a single line of text. Items can be accessed + * or created from a Form. When used in a quiz, these items are graded. * - * // Open a form by ID and add a new text item. - * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); - * var item = form.addTextItem(); - * item.setTitle('What is your name?'); + * // Open a form by ID and add a new text item. + * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); + * var item = form.addTextItem(); + * item.setTitle('What is your name?'); */ export interface TextItem { clearValidation(): TextItem; @@ -980,31 +1000,28 @@ declare namespace GoogleAppsScript { /** * A DataValidation for a TextItem. * - * // Add a text item to a form and require it to be a number within a range. - * var textItem = form.addTextItem().setTitle('Pick a number between 1 and 100?'); - * var textValidation = FormApp.createTextValidation() - * .setHelpText(“Input was not a number between 1 and 100.”) - * .requireNumberBetween(1, 100) - * .build(); - * textItem.setValidation(textValidation); + * // Add a text item to a form and require it to be a number within a range. + * var textItem = form.addTextItem().setTitle('Pick a number between 1 and 100?'); + * var textValidation = FormApp.createTextValidation() + * .setHelpText(“Input was not a number between 1 and 100.”) + * .requireNumberBetween(1, 100) + * .build(); + * textItem.setValidation(textValidation); */ export interface TextValidation { - getHelpText(): string; } /** * A DataValidationBuilder for a TextValidation. * - * // Add a text item to a form and require it to be a number within a range. - * var textItem = form.addTextItem().setTitle('Pick a number between 1 and 100?'); - * var textValidation = FormApp.createTextValidation() - * .setHelpText(“Input was not a number between 1 and 100.”) - * .requireNumberBetween(1, 100); - * textItem.setValidation(textValidation); + * // Add a text item to a form and require it to be a number within a range. + * var textItem = form.addTextItem().setTitle('Pick a number between 1 and 100?'); + * var textValidation = FormApp.createTextValidation() + * .setHelpText(“Input was not a number between 1 and 100.”) + * .requireNumberBetween(1, 100); + * textItem.setValidation(textValidation); */ export interface TextValidationBuilder { - build(): TextValidation; - copy(): TextValidationBuilder; requireNumber(): TextValidationBuilder; requireNumberBetween(start: Number, end: Number): TextValidationBuilder; requireNumberEqualTo(number: Number): TextValidationBuilder; @@ -1023,17 +1040,16 @@ declare namespace GoogleAppsScript { requireTextLengthLessThanOrEqualTo(number: Integer): TextValidationBuilder; requireTextMatchesPattern(pattern: string): TextValidationBuilder; requireWholeNumber(): TextValidationBuilder; - setHelpText(text: string): TextValidationBuilder; } /** - * A question item that allows the respondent to indicate a time of day. Items can be - * accessed or created from a Form. When used in a quiz, these items are graded. + * A question item that allows the respondent to indicate a time of day. Items can be accessed or + * created from a Form. When used in a quiz, these items are graded. * - * // Open a form by ID and add a new time item. - * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); - * var item = form.addTimeItem(); - * item.setTitle('What time do you usually wake up in the morning?'); + * // Open a form by ID and add a new time item. + * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); + * var item = form.addTimeItem(); + * item.setTitle('What time do you usually wake up in the morning?'); */ export interface TimeItem { createResponse(hour: Integer, minute: Integer): ItemResponse; @@ -1056,23 +1072,23 @@ declare namespace GoogleAppsScript { /** * A layout item that displays a video. Items can be accessed or created from a Form. * - * // Open a form by ID and add three new video items, using a long URL, - * // a short URL, and a video ID. - * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); - * form.addVideoItem() - * .setTitle('Video Title') - * .setHelpText('Video Caption') - * .setVideoUrl('www.youtube.com/watch?v=1234abcdxyz'); + * // Open a form by ID and add three new video items, using a long URL, + * // a short URL, and a video ID. + * var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); + * form.addVideoItem() + * .setTitle('Video Title') + * .setHelpText('Video Caption') + * .setVideoUrl('www.youtube.com/watch?v=1234abcdxyz'); * - * form.addVideoItem() - * .setTitle('Video Title') - * .setHelpText('Video Caption') - * .setVideoUrl('youtu.be/1234abcdxyz'); + * form.addVideoItem() + * .setTitle('Video Title') + * .setHelpText('Video Caption') + * .setVideoUrl('youtu.be/1234abcdxyz'); * - * form.addVideoItem() - * .setTitle('Video Title') - * .setHelpText('Video Caption') - * .setVideoUrl('1234abcdxyz'); + * form.addVideoItem() + * .setTitle('Video Title') + * .setHelpText('Video Caption') + * .setVideoUrl('1234abcdxyz'); */ export interface VideoItem { duplicate(): VideoItem; 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 4967f53394..94a10d2dfb 100644 --- a/types/google-apps-script/google-apps-script.gmail.d.ts +++ b/types/google-apps-script/google-apps-script.gmail.d.ts @@ -1,7 +1,6 @@ -// Type definitions for Google Apps Script 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen -// dhayab // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -14,7 +13,7 @@ declare namespace GoogleAppsScript { */ export interface GmailApp { createDraft(recipient: string, subject: string, body: string): GmailDraft; - createDraft(recipient: string, subject: string, body: string, options: GmailDraftOptions): GmailDraft; + createDraft(recipient: string, subject: string, body: string, options: Object): GmailDraft; createLabel(name: string): GmailLabel; deleteLabel(label: GmailLabel): GmailApp; getAliases(): string[]; @@ -81,23 +80,21 @@ declare namespace GoogleAppsScript { } /** - * An attachment from Gmail. This is a regular - * Blob except that it has an extra - * getSize() method that is faster than calling getBytes().length and does - * not count against the Gmail read quota. + * An attachment from Gmail. This is a regular Blob except that it has an extra getSize() method that is faster than calling + * getBytes().length and does not count against the Gmail read quota. * - * // Logs information about any attachments in the first 100 inbox threads. - * var threads = GmailApp.getInboxThreads(0, 100); - * var msgs = GmailApp.getMessagesForThreads(threads); - * for (var i = 0 ; i < msgs.length; i++) { - * for (var j = 0; j < msgs[i].length; j++) { - * var attachments = msgs[i][j].getAttachments(); - * for (var k = 0; k < attachments.length; k++) { - * Logger.log('Message "%s" contains the attachment "%s" (%s bytes)', - * msgs[i][j].getSubject(), attachments[k].getName(), attachments[k].getSize()); - * } - * } - * } + * // Logs information about any attachments in the first 100 inbox threads. + * var threads = GmailApp.getInboxThreads(0, 100); + * var msgs = GmailApp.getMessagesForThreads(threads); + * for (var i = 0 ; i < msgs.length; i++) { + * for (var j = 0; j < msgs[i].length; j++) { + * var attachments = msgs[i][j].getAttachments(); + * for (var k = 0; k < attachments.length; k++) { + * Logger.log('Message "%s" contains the attachment "%s" (%s bytes)', + * msgs[i][j].getSubject(), attachments[k].getName(), attachments[k].getSize()); + * } + * } + * } */ export interface GmailAttachment { copyBlob(): Base.Blob; @@ -118,70 +115,17 @@ declare namespace GoogleAppsScript { getAllBlobs(): Base.Blob[]; } + /** + * A user-created draft message in a user's Gmail account. + */ export interface GmailDraft { - /** - * Deletes this draft message. - */ deleteDraft(): void; - /** - * Gets the ID of this draft message. - */ getId(): string; - /** - * Returns a GmailMessage representing this draft. - */ getMessage(): GmailMessage; - /** - * Returns the ID of the `GmailMessage` representing this draft. - */ getMessageId(): string; - /** - * Sends this draft email message. - */ send(): GmailMessage; - /** - * Replaces the contents of this draft message. - */ update(recipient: string, subject: string, body: string): GmailDraft; - /** - * Replaces the contents of this draft message using optional arguments. - */ - update(recipient: string, subject: string, body: string, options: GmailDraftOptions): GmailDraft; - } - - export type GmailDraftOptions = { - /** - * An array of files to send with the email. - */ - attachments?: Base.BlobSource[]; - /** - * A comma-separated list of email addresses to BCC. - */ - bcc?: string; - /** - * A comma-separated list of email addresses to CC. - */ - cc?: string; - /** - * The address that the email should be sent from, which must be one of the values returned by `GmailApp.getAliases()`. - */ - from?: string; - /** - * If set, devices capable of rendering HTML will use it instead of the required body argument; you can add an optional `inlineImages` field in HTML body if you have inlined images for your email. - */ - htmlBody?: string; - /** - * A JavaScript object containing a mapping from image key (`String`) to image data (`BlobSource`) ; this assumes that the `htmlBody` parameter is used and contains references to these images in the format ``. - */ - inlineImages?: { [imageKey: string]: Base.BlobSource }; - /** - * The name of the sender of the email (default: the user's name). - */ - name?: string; - /** - * An email address to use as the default reply-to address (default: the user's email address). - */ - replyTo?: string; + update(recipient: string, subject: string, body: string, options: Object): GmailDraft; } /** @@ -204,9 +148,9 @@ declare namespace GoogleAppsScript { */ export interface GmailMessage { createDraftReply(body: string): GmailDraft; - createDraftReply(body: string, options: GmailDraftOptions): GmailDraft; + createDraftReply(body: string, options: Object): GmailDraft; createDraftReplyAll(body: string): GmailDraft; - createDraftReplyAll(body: string, options: GmailDraftOptions): GmailDraft; + createDraftReplyAll(body: string, options: Object): GmailDraft; forward(recipient: string): GmailMessage; forward(recipient: string, options: Object): GmailMessage; getAttachments(): GmailAttachment[]; @@ -225,6 +169,7 @@ declare namespace GoogleAppsScript { isDraft(): boolean; isInChats(): boolean; isInInbox(): boolean; + isInPriorityInbox(): boolean; isInTrash(): boolean; isStarred(): boolean; isUnread(): boolean; @@ -246,9 +191,9 @@ declare namespace GoogleAppsScript { export interface GmailThread { addLabel(label: GmailLabel): GmailThread; createDraftReply(body: string): GmailDraft; - createDraftReply(body: string, options: GmailDraftOptions): GmailDraft; + createDraftReply(body: string, options: Object): GmailDraft; createDraftReplyAll(body: string): GmailDraft; - createDraftReplyAll(body: string, options: GmailDraftOptions): GmailDraft; + createDraftReplyAll(body: string, options: Object): GmailDraft; getFirstMessageSubject(): string; getId(): string; getLabels(): GmailLabel[]; @@ -260,6 +205,7 @@ declare namespace GoogleAppsScript { isImportant(): boolean; isInChats(): boolean; isInInbox(): boolean; + isInPriorityInbox(): boolean; isInSpam(): boolean; isInTrash(): boolean; isUnread(): 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 e6833bb840..757029f044 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 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -9,41 +9,42 @@ declare namespace GoogleAppsScript { export module Groups { /** - * A group object whose members and those members' roles within the group - * can be queried. + * A group object whose members and those members' roles within the group can be queried. * - * Here's an example which shows the members of a group. Before running it, - * replace the email address of the group with that of one on your domain. + * Here's an example which shows the members of a group. Before running it, replace the email + * address of the group with that of one on your domain. * - * function listGroupMembers() { - * var group = GroupsApp.getGroupByEmail("example@googlegroups.com"); - * var s = group.getEmail() + ': '; - * var users = group.getUsers(); - * for (var i = 0; i < users.length; i++) { - * var user = users[i]; - * s = s + user.getEmail() + ", "; - * } - * Logger.log(s); - * } + * function listGroupMembers() { + * var group = GroupsApp.getGroupByEmail("example@googlegroups.com"); + * var s = group.getEmail() + ': '; + * var users = group.getUsers(); + * for (var i = 0; i < users.length; i++) { + * var user = users[i]; + * s = s + user.getEmail() + ", "; + * } + * Logger.log(s); + * } */ export interface Group { getEmail(): string; + getGroups(): Group[]; getRole(email: string): Role; getRole(user: Base.User): Role; getUsers(): Base.User[]; + hasGroup(group: Group): boolean; + hasGroup(email: string): boolean; hasUser(email: string): boolean; hasUser(user: Base.User): boolean; } /** - * This class provides access to Google Groups information. It can be used to - * query information such as a group's email address, or the list of groups in - * which the user is a direct member. + * This class provides access to Google Groups information. It can be used to query information such + * as a group's email address, or the list of groups in which the user is a direct member. * - * Here's an example that shows how many groups the current user is a member of: + * Here's an example that shows how many groups the current user is a member of: * - * var groups = GroupsApp.getGroups(); - * Logger.log('You belong to ' + groups.length + ' groups.'); + * var groups = GroupsApp.getGroups(); + * Logger.log('You belong to ' + groups.length + ' groups.'); */ export interface GroupsApp { Role: typeof Role; @@ -52,9 +53,8 @@ declare namespace GoogleAppsScript { } /** - * Possible roles of a user within a group, such as owner or ordinary member. - * Users subscribed to a group have exactly one role within the context of that - * group. + * Possible roles of a user within a group, such as owner or ordinary member. Users subscribed to a + * group have exactly one role within the context of that group. * See also * * Group.getRole(email) diff --git a/types/google-apps-script/google-apps-script.html.d.ts b/types/google-apps-script/google-apps-script.html.d.ts index f471d23eb3..a16a491d12 100644 --- a/types/google-apps-script/google-apps-script.html.d.ts +++ b/types/google-apps-script/google-apps-script.html.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,12 +10,12 @@ declare namespace GoogleAppsScript { export module HTML { /** * An HtmlOutput object that can be served from a script. Due to security considerations, - * scripts cannot directly return HTML to a browser. Instead, they must sanitize it so that it - * cannot perform malicious actions. You can return sanitized HTML like this: + * scripts cannot directly return HTML to a browser. Instead, they must sanitize it so that it + * cannot perform malicious actions. You can return sanitized HTML like this: * - * function doGet() { - * return HtmlService.createHtmlOutput('Hello, world!'); - * } + * function doGet() { + * return HtmlService.createHtmlOutput('Hello, world!'); + * } * * HtmlOutput * Google Caja @@ -45,14 +45,13 @@ declare namespace GoogleAppsScript { } /** - * An object that represents a meta tag added to the page by calling - * HtmlOutput.addMetaTag(name, content). + * An object that represents a meta tag added to the page by calling HtmlOutput.addMetaTag(name, content). * - * var output = HtmlService.createHtmlOutput('Hello, world!'); - * output.addMetaTag('viewport', 'width=device-width, initial-scale=1'); + * var output = HtmlService.createHtmlOutput('Hello, world!'); + * output.addMetaTag('viewport', 'width=device-width, initial-scale=1'); * - * var tags = output.getMetaTags(); - * Logger.log('', tags[0].getName(), tags[0].getContent()); + * var tags = output.getMetaTags(); + * Logger.log('', tags[0].getName(), tags[0].getContent()); */ export interface HtmlOutputMetaTag { getContent(): string; @@ -63,8 +62,8 @@ declare namespace GoogleAppsScript { * Service for returning HTML and other text content from a script. * * Due to security considerations, scripts cannot directly return content to a browser. Instead, - * they must sanitize the HTML so that it cannot perform malicious actions. See the description of - * HtmlOutput for what limitations this implies on what can be returned. + * they must sanitize the HTML so that it cannot perform malicious actions. See the description of + * HtmlOutput for what limitations this implies on what can be returned. */ export interface HtmlService { SandboxMode: typeof SandboxMode; @@ -80,8 +79,7 @@ declare namespace GoogleAppsScript { } /** - * A template object for dynamically constructing HTML. For more information, see the - * guide to templates. + * A template object for dynamically constructing HTML. For more information, see the guide to templates. */ export interface HtmlTemplate { evaluate(): HtmlOutput; @@ -92,44 +90,44 @@ declare namespace GoogleAppsScript { /** * An enum representing the sandbox modes that can be used for client-side HtmlService - * scripts. These values can be accessed from HtmlService.SandboxMode, and set by calling - * HtmlOutput.setSandboxMode(mode). + * scripts. These values can be accessed from HtmlService.SandboxMode, and set by calling + * HtmlOutput.setSandboxMode(mode). + * + * The NATIVE and EMULATED modes were deprecated on October 13, 2015 and both are now sunset. Only + * IFRAME mode is now supported. * - * The NATIVE and EMULATED modes were - * deprecated on October 13, 2015 and both are - * now sunset. - * Only IFRAME mode is now supported. * To protect users from being served malicious HTML or JavaScript, client-side code served from - * HTML service executes in a security sandbox that imposes restrictions on the code. The method - * HtmlOutput.setSandboxMode(mode) previously allowed script authors to choose - * between different versions of the sandbox, but now has no effect. For more information, see the - * guide to restrictions in HTML service. + * HTML service executes in a security sandbox that imposes restrictions on the code. The method + * HtmlOutput.setSandboxMode(mode) previously allowed script authors to choose + * between different versions of the sandbox, but now has no effect. For more information, see the + * guide to restrictions in HTML service. + * * The IFRAME mode imposes many fewer restrictions than the other sandbox modes and runs - * fastest, but does not work at all in certain older browsers, including Internet Explorer 9. + * fastest, but does not work at all in certain older browsers, including Internet Explorer 9. The + * sandbox mode can also be read in a client-side script by inspecting google.script.sandbox.mode. Note that this property returns the actual mode on the client, which + * may differ from the mode requested on the server if the requested mode is not supported in the + * user's browser. * - * google.script.sandbox.mode - * - * - * + * + * */ export enum SandboxMode { EMULATED, IFRAME, NATIVE } /** - * An enum representing the X-Frame-Options modes that can be used for client-side - * HtmlService scripts. These values can be accessed from - * HtmlService.XFrameOptionsMode, and set by calling - * HtmlOutput.setXFrameOptionsMode(mode). + * An enum representing the X-Frame-Options modes that can be used for client-side HtmlService scripts. These values can be accessed from HtmlService.XFrameOptionsMode, + * and set by calling HtmlOutput.setXFrameOptionsMode(mode). * * Setting XFrameOptionsMode.ALLOWALL will let any site iframe the page, so the developer - * should implement their own protection against clickjacking. - * If a script does not set an X-Frame-Options mode, Apps Script uses DEFAULT - * mode as the default. + * should implement their own protection against clickjacking. * - * // Serve HTML with no X-Frame-Options header (in Apps Script server-side code). - * var output = HtmlService.createHtmlOutput('Hello, world!'); - * output.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL); + * If a script does not set an X-Frame-Options mode, Apps Script uses DEFAULT + * mode as the default. + * + * // Serve HTML with no X-Frame-Options header (in Apps Script server-side code). + * var output = HtmlService.createHtmlOutput('Hello, world!'); + * output.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL); */ export enum XFrameOptionsMode { ALLOWALL, DEFAULT } diff --git a/types/google-apps-script/google-apps-script.jdbc.d.ts b/types/google-apps-script/google-apps-script.jdbc.d.ts index 96ae94abac..9f93cf3661 100644 --- a/types/google-apps-script/google-apps-script.jdbc.d.ts +++ b/types/google-apps-script/google-apps-script.jdbc.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,8 +10,7 @@ declare namespace GoogleAppsScript { export module JDBC { /** * The JDBC service allows scripts to connect to Google Cloud SQL, MySQL, - * Microsoft SQL Server, and Oracle databases. For more information, see the - * guide to JDBC. + * Microsoft SQL Server, and Oracle databases. For more information, see the guide to JDBC. */ export interface Jdbc { getCloudSqlConnection(url: string): JdbcConnection; @@ -60,11 +59,10 @@ declare namespace GoogleAppsScript { } /** - * A JDBC CallableStatement. For documentation of this class, see - * java.sql.CallableStatement. + * A JDBC CallableStatement. For documentation of this class, see java.sql.CallableStatement. * See also * - * CallableStatement + * CallableStatement */ export interface JdbcCallableStatement { addBatch(): void; @@ -299,8 +297,7 @@ declare namespace GoogleAppsScript { } /** - * A JDBC DatabaseMetaData. For documentation of this class, see - * java.sql.DatabaseMetaData. + * A JDBC DatabaseMetaData. For documentation of this class, see java.sql.DatabaseMetaData. */ export interface JdbcDatabaseMetaData { allProceduresAreCallable(): boolean; @@ -494,8 +491,7 @@ declare namespace GoogleAppsScript { } /** - * A JDBC ParameterMetaData. For documentation of this class, see - * java.sql.ParameterMetaData. + * A JDBC ParameterMetaData. For documentation of this class, see java.sql.ParameterMetaData. */ export interface JdbcParameterMetaData { getParameterClassName(param: Integer): string; @@ -510,8 +506,7 @@ declare namespace GoogleAppsScript { } /** - * A JDBC PreparedStatement. For documentation of this class, see - * java.sql.PreparedStatement. + * A JDBC PreparedStatement. For documentation of this class, see java.sql.PreparedStatement. */ export interface JdbcPreparedStatement { addBatch(): void; @@ -748,8 +743,7 @@ declare namespace GoogleAppsScript { } /** - * A JDBC ResultSetMetaData. For documentation of this class, see - * java.sql.ResultSetMetaData. + * A JDBC ResultSetMetaData. For documentation of this class, see java.sql.ResultSetMetaData. */ export interface JdbcResultSetMetaData { getCatalogName(column: Integer): string; diff --git a/types/google-apps-script/google-apps-script.language.d.ts b/types/google-apps-script/google-apps-script.language.d.ts index 488568feec..5462e2dd4a 100644 --- a/types/google-apps-script/google-apps-script.language.d.ts +++ b/types/google-apps-script/google-apps-script.language.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,9 +10,9 @@ declare namespace GoogleAppsScript { /** * The Language service provides scripts a way to compute automatic translations of text. * - * // The code below will write "Esta es una prueba" to the log. - * var spanish = LanguageApp.translate('This is a test', 'en', 'es'); - * Logger.log(spanish); + * // The code below will write "Esta es una prueba" to the log. + * var spanish = LanguageApp.translate('This is a test', 'en', 'es'); + * Logger.log(spanish); */ export interface LanguageApp { translate(text: string, sourceLanguage: string, targetLanguage: string): string; diff --git a/types/google-apps-script/google-apps-script.lock.d.ts b/types/google-apps-script/google-apps-script.lock.d.ts index f255efbc14..5b939755e9 100644 --- a/types/google-apps-script/google-apps-script.lock.d.ts +++ b/types/google-apps-script/google-apps-script.lock.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,29 +10,29 @@ declare namespace GoogleAppsScript { /** * A representation of a mutual-exclusion lock. * - * This class allows scripts to make sure that only one instance of the script is executing a given - * section of code at a time. This is particularly useful for callbacks and triggers, where a user - * action may cause changes to a shared resource and you want to ensure that aren't collisions. + * This class allows scripts to make sure that only one instance of the script is executing a + * given section of code at a time. This is particularly useful for callbacks and triggers, where a + * user action may cause changes to a shared resource and you want to ensure that aren't collisions. * - * The following examples shows how to use a lock in a form submit handler. + * The following examples shows how to use a lock in a form submit handler. * - * // Generates a unique ticket number for every form submission. - * function onFormSubmit(e) { - * var targetCell = e.range.offset(0, e.range.getNumColumns(), 1, 1); + * // Generates a unique ticket number for every form submission. + * function onFormSubmit(e) { + * var targetCell = e.range.offset(0, e.range.getNumColumns(), 1, 1); * - * // Get a script lock, because we're about to modify a shared resource. - * var lock = LockService.getScriptLock(); - * // Wait for up to 30 seconds for other processes to finish. - * lock.waitLock(30000); + * // Get a script lock, because we're about to modify a shared resource. + * var lock = LockService.getScriptLock(); + * // Wait for up to 30 seconds for other processes to finish. + * lock.waitLock(30000); * - * var ticketNumber = Number(ScriptProperties.getProperty('lastTicketNumber')) + 1; - * ScriptProperties.setProperty('lastTicketNumber', ticketNumber); + * var ticketNumber = Number(ScriptProperties.getProperty('lastTicketNumber')) + 1; + * ScriptProperties.setProperty('lastTicketNumber', ticketNumber); * - * // Release the lock so that other processes can continue. - * lock.releaseLock(); + * // Release the lock so that other processes can continue. + * lock.releaseLock(); * - * targetCell.setValue(ticketNumber); - * } + * targetCell.setValue(ticketNumber); + * } * * lastTicketNumber * ScriptProperties @@ -46,7 +46,7 @@ declare namespace GoogleAppsScript { /** * Prevents concurrent access to sections of code. This can be useful when you have multiple users - * or processes modifying a shared resource and want to prevent collisions. + * or processes modifying a shared resource and want to prevent collisions. */ export interface LockService { getDocumentLock(): Lock; diff --git a/types/google-apps-script/google-apps-script.mail.d.ts b/types/google-apps-script/google-apps-script.mail.d.ts index 2cb8b3cb5f..29c5fbf1e2 100644 --- a/types/google-apps-script/google-apps-script.mail.d.ts +++ b/types/google-apps-script/google-apps-script.mail.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,12 +10,12 @@ declare namespace GoogleAppsScript { /** * Sends email. * - * This service allows users to send emails with complete control over the - * content of the email. Unlike GmailApp, MailApp's sole purpose is sending email. MailApp cannot - * access a user's Gmail inbox. + * This service allows users to send emails with complete control over the content of the email. + * Unlike GmailApp, MailApp's sole purpose is sending email. MailApp cannot access a user's Gmail + * inbox. * * Changes to scripts written using GmailApp are more likely to trigger a re-authorization - * request from a user than MailApp scripts. + * request from a user than MailApp scripts. */ export interface MailApp { getRemainingDailyQuota(): Integer; diff --git a/types/google-apps-script/google-apps-script.maps.d.ts b/types/google-apps-script/google-apps-script.maps.d.ts index e9620ee144..ee5f185da4 100644 --- a/types/google-apps-script/google-apps-script.maps.d.ts +++ b/types/google-apps-script/google-apps-script.maps.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -20,51 +20,50 @@ declare namespace GoogleAppsScript { /** * Allows for the retrieval of directions between locations. + * The example below shows how you can use this class to get the directions from Times Square to + * Central Park, stopping first at Lincoln Center, plot the locations and path on a map, and send + * the map in an email. * - * The example below shows how you can use this class to get the directions from Times Square to - * Central Park, stopping first at Lincoln Center, plot the locations and path on a map, - * and send the map in an email. + * // Get the directions. + * var directions = Maps.newDirectionFinder() + * .setOrigin('Times Square, New York, NY') + * .addWaypoint('Lincoln Center, New York, NY') + * .setDestination('Central Park, New York, NY') + * .setMode(Maps.DirectionFinder.Mode.DRIVING) + * .getDirections(); + * var route = directions.routes[0]; * - * // Get the directions. - * var directions = Maps.newDirectionFinder() - * .setOrigin('Times Square, New York, NY') - * .addWaypoint('Lincoln Center, New York, NY') - * .setDestination('Central Park, New York, NY') - * .setMode(Maps.DirectionFinder.Mode.DRIVING) - * .getDirections(); - * var route = directions.routes[0]; + * // Set up marker styles. + * var markerSize = Maps.StaticMap.MarkerSize.MID; + * var markerColor = Maps.StaticMap.Color.GREEN + * var markerLetterCode = 'A'.charCodeAt(); * - * // Set up marker styles. - * var markerSize = Maps.StaticMap.MarkerSize.MID; - * var markerColor = Maps.StaticMap.Color.GREEN - * var markerLetterCode = 'A'.charCodeAt(); + * // Add markers to the map. + * var map = Maps.newStaticMap(); + * for (var i = 0; i < route.legs.length; i++) { + * var leg = route.legs[i]; + * if (i == 0) { + * // Add a marker for the start location of the first leg only. + * map.setMarkerStyle(markerSize, markerColor, String.fromCharCode(markerLetterCode)); + * map.addMarker(leg.start_location.lat, leg.start_location.lng); + * markerLetterCode++; + * } + * map.setMarkerStyle(markerSize, markerColor, String.fromCharCode(markerLetterCode)); + * map.addMarker(leg.end_location.lat, leg.end_location.lng); + * markerLetterCode++; + * } * - * // Add markers to the map. - * var map = Maps.newStaticMap(); - * for (var i = 0; i < route.legs.length; i++) { - * var leg = route.legs[i]; - * if (i == 0) { - * // Add a marker for the start location of the first leg only. - * map.setMarkerStyle(markerSize, markerColor, String.fromCharCode(markerLetterCode)); - * map.addMarker(leg.start_location.lat, leg.start_location.lng); - * markerLetterCode++; - * } - * map.setMarkerStyle(markerSize, markerColor, String.fromCharCode(markerLetterCode)); - * map.addMarker(leg.end_location.lat, leg.end_location.lng); - * markerLetterCode++; - * } + * // Add a path for the entire route. + * map.addPath(route.overview_polyline.points); * - * // Add a path for the entire route. - * map.addPath(route.overview_polyline.points); - * - * // Send the map in an email. - * var toAddress = Session.getActiveUser().getEmail(); - * MailApp.sendEmail(toAddress, 'Directions', 'Please open: ' + map.getMapUrl(), { - * htmlBody: 'See below.
', - * inlineImages: { - * mapImage: Utilities.newBlob(map.getMapImage(), 'image/png') - * } - * }); + * // Send the map in an email. + * var toAddress = Session.getActiveUser().getEmail(); + * MailApp.sendEmail(toAddress, 'Directions', 'Please open: ' + map.getMapUrl(), { + * htmlBody: 'See below.
', + * inlineImages: { + * mapImage: Utilities.newBlob(map.getMapImage(), 'image/png') + * } + * }); * * See also * @@ -99,41 +98,40 @@ declare namespace GoogleAppsScript { /** * Allows for the sampling of elevations at particular locations. + * The example below shows how you can use this class to determine the highest point along the route + * from Denver to Grand Junction in Colorado, plot it on a map, and save the map to Google Drive. * - * The example below shows how you can use this class to determine the highest point along the route - * from Denver to Grand Junction in Colorado, plot it on a map, and save the map to Google Drive. + * // Get directions from Denver to Grand Junction. + * var directions = Maps.newDirectionFinder() + * .setOrigin('Denver, CO') + * .setDestination('Grand Junction, CO') + * .setMode(Maps.DirectionFinder.Mode.DRIVING) + * .getDirections(); + * var route = directions.routes[0]; * - * // Get directions from Denver to Grand Junction. - * var directions = Maps.newDirectionFinder() - * .setOrigin('Denver, CO') - * .setDestination('Grand Junction, CO') - * .setMode(Maps.DirectionFinder.Mode.DRIVING) - * .getDirections(); - * var route = directions.routes[0]; + * // Get elevation samples along the route. + * var numberOfSamples = 30; + * var response = Maps.newElevationSampler() + * .samplePath(route.overview_polyline.points, numberOfSamples) * - * // Get elevation samples along the route. - * var numberOfSamples = 30; - * var response = Maps.newElevationSampler() - * .samplePath(route.overview_polyline.points, numberOfSamples) + * // Determine highest point. + * var maxElevation = Number.MIN_VALUE; + * var highestPoint = null; + * for (var i = 0; i < response.results.length; i++) { + * var sample = response.results[i]; + * if (sample.elevation > maxElevation) { + * maxElevation = sample.elevation; + * highestPoint = sample.location; + * } + * } * - * // Determine highest point. - * var maxElevation = Number.MIN_VALUE; - * var highestPoint = null; - * for (var i = 0; i < response.results.length; i++) { - * var sample = response.results[i]; - * if (sample.elevation > maxElevation) { - * maxElevation = sample.elevation; - * highestPoint = sample.location; - * } - * } + * // Add the path and marker to a map. + * var map = Maps.newStaticMap() + * .addPath(route.overview_polyline.points) + * .addMarker(highestPoint.lat, highestPoint.lng); * - * // Add the path and marker to a map. - * var map = Maps.newStaticMap() - * .addPath(route.overview_polyline.points) - * .addMarker(highestPoint.lat, highestPoint.lng); - * - * // Save the map to your drive - * DocsList.createFile(Utilities.newBlob(map.getMapImage(), 'image/png', 'map.png')); + * // Save the map to your drive + * DocsList.createFile(Utilities.newBlob(map.getMapImage(), 'image/png', 'map.png')); * * See also * @@ -157,30 +155,29 @@ declare namespace GoogleAppsScript { /** * Allows for the conversion between an address and geographical coordinates. + * The example below shows how you can use this class find the top nine matches for the location + * "Main St" in Colorado, add them to a map, and then embed it in a new Google Doc. * - * The example below shows how you can use this class find the top nine matches for the location - * "Main St" in Colorado, add them to a map, and then embed it in a new Google Doc. + * // Find the best matches for "Main St" in Colorado. + * var response = Maps.newGeocoder() + * // The latitudes and longitudes of southwest and northeast corners of Colorado, respectively. + * .setBounds(36.998166, -109.045486, 41.001666,-102.052002) + * .geocode('Main St'); * - * // Find the best matches for "Main St" in Colorado. - * var response = Maps.newGeocoder() - * // The latitudes and longitudes of southwest and northeast corners of Colorado, respectively. - * .setBounds(36.998166, -109.045486, 41.001666,-102.052002) - * .geocode('Main St'); + * // Create a Google Doc and map. + * var doc = DocumentApp.create('My Map'); + * var map = Maps.newStaticMap(); * - * // Create a Google Doc and map. - * var doc = DocumentApp.create('My Map'); - * var map = Maps.newStaticMap(); + * // Add each result to the map and doc. + * for (var i = 0; i < response.results.length && i < 9; i++) { + * var result = response.results[i]; + * map.setMarkerStyle(null, null, i + 1); + * map.addMarker(result.geometry.location.lat, result.geometry.location.lng); + * doc.appendListItem(result.formatted_address); + * } * - * // Add each result to the map and doc. - * for (var i = 0; i < response.results.length && i < 9; i++) { - * var result = response.results[i]; - * map.setMarkerStyle(null, null, i + 1); - * map.addMarker(result.geometry.location.lat, result.geometry.location.lng); - * doc.appendListItem(result.formatted_address); - * } - * - * // Add the finished map to the doc. - * doc.appendImage(Utilities.newBlob(map.getMapImage(), 'image/png')); + * // Add the finished map to the doc. + * doc.appendImage(Utilities.newBlob(map.getMapImage(), 'image/png')); * * See also * @@ -197,7 +194,7 @@ declare namespace GoogleAppsScript { /** * Allows for direction finding, geocoding, elevation sampling and the creation of static map - * images. + * images. */ export interface Maps { DirectionFinder: DirectionFinderEnums; @@ -226,39 +223,38 @@ declare namespace GoogleAppsScript { /** * Allows for the creation and decoration of static map images. + * The example below shows how you can use this class to create a map of New York City's Theatre + * District, including nearby train stations, and display it in a simple web app. * - * The example below shows how you can use this class to create a map of New York City's Theatre - * District, including nearby train stations, and display it in a simple web app. + * function doGet(event) { + * // Create a map centered on Times Square. + * var map = Maps.newStaticMap() + * .setSize(600, 600) + * .setCenter('Times Square, New York, NY'); * - * function doGet(event) { - * // Create a map centered on Times Square. - * var map = Maps.newStaticMap() - * .setSize(600, 600) - * .setCenter('Times Square, New York, NY'); + * // Add markers for the nearbye train stations. + * map.setMarkerStyle(Maps.StaticMap.MarkerSize.MID, Maps.StaticMap.Color.RED, 'T'); + * map.addMarker('Grand Central Station, New York, NY'); + * map.addMarker('Penn Station, New York, NY'); * - * // Add markers for the nearbye train stations. - * map.setMarkerStyle(Maps.StaticMap.MarkerSize.MID, Maps.StaticMap.Color.RED, 'T'); - * map.addMarker('Grand Central Station, New York, NY'); - * map.addMarker('Penn Station, New York, NY'); + * // Show the boundaries of the Theatre District. + * var corners = [ + * '8th Ave & 53rd St, New York, NY', + * '6th Ave & 53rd St, New York, NY', + * '6th Ave & 40th St, New York, NY', + * '8th Ave & 40th St, New York, NY' + * ]; + * map.setPathStyle(4, Maps.StaticMap.Color.BLACK, Maps.StaticMap.Color.BLUE); + * map.beginPath(); + * for (var i = 0; i < corners.length; i++) { + * map.addAddress(corners[i]); + * } * - * // Show the boundaries of the Theatre District. - * var corners = [ - * '8th Ave & 53rd St, New York, NY', - * '6th Ave & 53rd St, New York, NY', - * '6th Ave & 40th St, New York, NY', - * '8th Ave & 40th St, New York, NY' - * ]; - * map.setPathStyle(4, Maps.StaticMap.Color.BLACK, Maps.StaticMap.Color.BLUE); - * map.beginPath(); - * for (var i = 0; i < corners.length; i++) { - * map.addAddress(corners[i]); - * } - * - * // Create the user interface and add the map image. - * var app = UiApp.createApplication().setTitle('NYC Theatre District'); - * app.add(app.createImage(map.getMapUrl())); - * return app; - * } + * // Create the user interface and add the map image. + * var app = UiApp.createApplication().setTitle('NYC Theatre District'); + * app.add(app.createImage(map.getMapUrl())); + * return app; + * } * * See also * diff --git a/types/google-apps-script/google-apps-script.optimization.d.ts b/types/google-apps-script/google-apps-script.optimization.d.ts index 8ac192c1e6..92fecb8619 100644 --- a/types/google-apps-script/google-apps-script.optimization.d.ts +++ b/types/google-apps-script/google-apps-script.optimization.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -9,22 +9,22 @@ declare namespace GoogleAppsScript { export module Optimization { /** * Object storing a linear constraint of the form lowerBound ≤ Sum(a(i) x(i)) ≤ upperBound - * where lowerBound and upperBound are constants, a(i) are constant - * coefficients and x(i) are variables (unknowns). + * where lowerBound and upperBound are constants, a(i) are constant + * coefficients and x(i) are variables (unknowns). * - * The example below creates one variable x with values between 0 and 5 and - * creates the constraint 0 ≤ 2 * x ≤ 5. This is done by first creating a constraint with - * the lower bound 5 and upper bound 5. Then the coefficient for variable x - * in this constraint is set to 2. + * The example below creates one variable x with values between 0 and 5 + * and creates the constraint 0 ≤ 2 * x ≤ 5. This is done by first creating a constraint + * with the lower bound 5 and upper bound 5. Then the coefficient for variable + * x in this constraint is set to 2. * - * var engine = LinearOptimizationService.createEngine(); - * // Create a variable so we can add it to the constraint - * engine.addVariable('x', 0, 5); - * // Create a linear constraint with the bounds 0 and 10 - * var constraint = engine.addConstraint(0, 10); - * // Set the coefficient of the variable in the constraint. The constraint is now: - * // 0 <= 2 * x <= 5 - * constraint.setCoefficient('x', 2); + * var engine = LinearOptimizationService.createEngine(); + * // Create a variable so we can add it to the constraint + * engine.addVariable('x', 0, 5); + * // Create a linear constraint with the bounds 0 and 10 + * var constraint = engine.addConstraint(0, 10); + * // Set the coefficient of the variable in the constraint. The constraint is now: + * // 0 <= 2 * x <= 5 + * constraint.setCoefficient('x', 2); */ export interface LinearOptimizationConstraint { setCoefficient(variableName: string, coefficient: Number): LinearOptimizationConstraint; @@ -32,55 +32,55 @@ declare namespace GoogleAppsScript { /** * The engine used to model and solve a linear program. The example below solves the following - * linear program: + * linear program: * - * Two variables, x and y: + * Two variables, x and y: * * 0 ≤ x ≤ 10 * * 0 ≤ y ≤ 5 * - * Constraints: + * Constraints: * * 0 ≤ 2 * x + 5 * y ≤ 10 * * 0 ≤ 10 * x + 3 * y ≤ 20 * - * Objective: - * Maximize x + y + * Objective: + * Maximize x + y * - * var engine = LinearOptimizationService.createEngine(); + * var engine = LinearOptimizationService.createEngine(); * - * // Add variables, constraints and define the objective with addVariable(), addConstraint(), etc - * // Add two variables, 0 <= x <= 10 and 0 <= y <= 5 - * engine.addVariable('x', 0, 10); - * engine.addVariable('y', 0, 5); + * // Add variables, constraints and define the objective with addVariable(), addConstraint(), etc + * // Add two variables, 0 <= x <= 10 and 0 <= y <= 5 + * engine.addVariable('x', 0, 10); + * engine.addVariable('y', 0, 5); * - * // Create the constraint: 0 <= 2 * x + 5 * y <= 10 - * var constraint = engine.addConstraint(0, 10); - * constraint.setCoefficient('x', 2); - * constraint.setCoefficient('y', 5); + * // Create the constraint: 0 <= 2 * x + 5 * y <= 10 + * var constraint = engine.addConstraint(0, 10); + * constraint.setCoefficient('x', 2); + * constraint.setCoefficient('y', 5); * - * // Create the constraint: 0 <= 10 * x + 3 * y <= 20 - * var constraint = engine.addConstraint(0, 20); - * constraint.setCoefficient('x', 10); - * constraint.setCoefficient('y', 3); + * // Create the constraint: 0 <= 10 * x + 3 * y <= 20 + * var constraint = engine.addConstraint(0, 20); + * constraint.setCoefficient('x', 10); + * constraint.setCoefficient('y', 3); * - * // Set the objective to be x + y - * engine.setObjectiveCoefficient('x', 1); - * engine.setObjectiveCoefficient('y', 1); + * // Set the objective to be x + y + * engine.setObjectiveCoefficient('x', 1); + * engine.setObjectiveCoefficient('y', 1); * - * // Engine should maximize the objective - * engine.setMaximization(); + * // Engine should maximize the objective + * engine.setMaximization(); * - * // Solve the linear program - * var solution = engine.solve(); - * if (!solution.isValid()) { - * Logger.log('No solution ' + solution.getStatus()); - * } else { - * Logger.log('Value of x: ' + solution.getVariableValue('x')); - * Logger.log('Value of y: ' + solution.getVariableValue('y')); - * } + * // Solve the linear program + * var solution = engine.solve(); + * if (!solution.isValid()) { + * Logger.log('No solution ' + solution.getStatus()); + * } else { + * Logger.log('Value of x: ' + solution.getVariableValue('x')); + * Logger.log('Value of y: ' + solution.getVariableValue('y')); + * } */ export interface LinearOptimizationEngine { addConstraint(lowerBound: Number, upperBound: Number): LinearOptimizationConstraint; @@ -96,55 +96,55 @@ declare namespace GoogleAppsScript { /** * The linear optimization service, used to model and solve linear and mixed-integer linear - * programs. The example below solves the following linear program: + * programs. The example below solves the following linear program: * - * Two variables, x and y: + * Two variables, x and y: * * 0 ≤ x ≤ 10 * * 0 ≤ y ≤ 5 * - * Constraints: + * Constraints: * * 0 ≤ 2 * x + 5 * y ≤ 10 * * 0 ≤ 10 * x + 3 * y ≤ 20 * - * Objective: - * Maximize x + y + * Objective: + * Maximize x + y * - * var engine = LinearOptimizationService.createEngine(); + * var engine = LinearOptimizationService.createEngine(); * - * // Add variables, constraints and define the objective using addVariable(), addConstraint(), etc. - * // Add two variables, 0 <= x <= 10 and 0 <= y <= 5 - * engine.addVariable('x', 0, 10); - * engine.addVariable('y', 0, 5); + * // Add variables, constraints and define the objective using addVariable(), addConstraint(), etc. + * // Add two variables, 0 <= x <= 10 and 0 <= y <= 5 + * engine.addVariable('x', 0, 10); + * engine.addVariable('y', 0, 5); * - * // Create the constraint: 0 <= 2 * x + 5 * y <= 10 - * var constraint = engine.addConstraint(0, 10); - * constraint.setCoefficient('x', 2); - * constraint.setCoefficient('y', 5); + * // Create the constraint: 0 <= 2 * x + 5 * y <= 10 + * var constraint = engine.addConstraint(0, 10); + * constraint.setCoefficient('x', 2); + * constraint.setCoefficient('y', 5); * - * // Create the constraint: 0 <= 10 * x + 3 * y <= 20 - * var constraint = engine.addConstraint(0, 20); - * constraint.setCoefficient('x', 10); - * constraint.setCoefficient('y', 3); + * // Create the constraint: 0 <= 10 * x + 3 * y <= 20 + * var constraint = engine.addConstraint(0, 20); + * constraint.setCoefficient('x', 10); + * constraint.setCoefficient('y', 3); * - * // Set the objective to be x + y - * engine.setObjectiveCoefficient('x', 1); - * engine.setObjectiveCoefficient('y', 1); + * // Set the objective to be x + y + * engine.setObjectiveCoefficient('x', 1); + * engine.setObjectiveCoefficient('y', 1); * - * // Engine should maximize the objective. - * engine.setMaximization(); + * // Engine should maximize the objective. + * engine.setMaximization(); * - * // Solve the linear program - * var solution = engine.solve(); - * if (!solution.isValid()) { - * Logger.log('No solution ' + solution.getStatus()); - * } else { - * Logger.log('Value of x: ' + solution.getVariableValue('x')); - * Logger.log('Value of y: ' + solution.getVariableValue('y')); - * } + * // Solve the linear program + * var solution = engine.solve(); + * if (!solution.isValid()) { + * Logger.log('No solution ' + solution.getStatus()); + * } else { + * Logger.log('Value of x: ' + solution.getVariableValue('x')); + * Logger.log('Value of y: ' + solution.getVariableValue('y')); + * } */ export interface LinearOptimizationService { Status: typeof Status; @@ -155,54 +155,54 @@ declare namespace GoogleAppsScript { /** * The solution of a linear program. The example below solves the following linear program: * - * Two variables, x and y: + * Two variables, x and y: * * 0 ≤ x ≤ 10 * * 0 ≤ y ≤ 5 * - * Constraints: + * Constraints: * * 0 ≤ 2 * x + 5 * y ≤ 10 * * 0 ≤ 10 * x + 3 * y ≤ 20 * - * Objective: - * Maximize x + y + * Objective: + * Maximize x + y * - * var engine = LinearOptimizationService.createEngine(); + * var engine = LinearOptimizationService.createEngine(); * - * // Add variables, constraints and define the objective with addVariable(), addConstraint(), etc. - * // Add two variables, 0 <= x <= 10 and 0 <= y <= 5 - * engine.addVariable('x', 0, 10); - * engine.addVariable('y', 0, 5); + * // Add variables, constraints and define the objective with addVariable(), addConstraint(), etc. + * // Add two variables, 0 <= x <= 10 and 0 <= y <= 5 + * engine.addVariable('x', 0, 10); + * engine.addVariable('y', 0, 5); * - * // Create the constraint: 0 <= 2 * x + 5 * y <= 10 - * var constraint = engine.addConstraint(0, 10); - * constraint.setCoefficient('x', 2); - * constraint.setCoefficient('y', 5); + * // Create the constraint: 0 <= 2 * x + 5 * y <= 10 + * var constraint = engine.addConstraint(0, 10); + * constraint.setCoefficient('x', 2); + * constraint.setCoefficient('y', 5); * - * // Create the constraint: 0 <= 10 * x + 3 * y <= 20 - * var constraint = engine.addConstraint(0, 20); - * constraint.setCoefficient('x', 10); - * constraint.setCoefficient('y', 3); + * // Create the constraint: 0 <= 10 * x + 3 * y <= 20 + * var constraint = engine.addConstraint(0, 20); + * constraint.setCoefficient('x', 10); + * constraint.setCoefficient('y', 3); * - * // Set the objective to be x + y - * engine.setObjectiveCoefficient('x', 1); - * engine.setObjectiveCoefficient('y', 1); + * // Set the objective to be x + y + * engine.setObjectiveCoefficient('x', 1); + * engine.setObjectiveCoefficient('y', 1); * - * // Engine should maximize the objective - * engine.setMaximization(); + * // Engine should maximize the objective + * engine.setMaximization(); * - * // Solve the linear program - * var solution = engine.solve(); - * if (!solution.isValid()) { - * Logger.log('No solution ' + solution.getStatus()); - * } else { - * Logger.log('Objective value: ' + solution.getObjectiveValue()); - * Logger.log('Value of x: ' + solution.getVariableValue('x')); - * Logger.log('Value of y: ' + solution.getVariableValue('y')); - * } + * // Solve the linear program + * var solution = engine.solve(); + * if (!solution.isValid()) { + * Logger.log('No solution ' + solution.getStatus()); + * } else { + * Logger.log('Objective value: ' + solution.getObjectiveValue()); + * Logger.log('Value of x: ' + solution.getVariableValue('x')); + * Logger.log('Value of y: ' + solution.getVariableValue('y')); + * } */ export interface LinearOptimizationSolution { getObjectiveValue(): Number; @@ -213,8 +213,8 @@ declare namespace GoogleAppsScript { /** * Status of the solution. Before solving a problem the status will be NOT_SOLVED; - * afterwards it will take any of the other values depending if it successfully found a solution and - * if the solution is optimal. + * afterwards it will take any of the other values depending if it successfully found a solution and + * if the solution is optimal. */ export enum Status { OPTIMAL, FEASIBLE, INFEASIBLE, UNBOUNDED, ABNORMAL, MODEL_INVALID, NOT_SOLVED } diff --git a/types/google-apps-script/google-apps-script.properties.d.ts b/types/google-apps-script/google-apps-script.properties.d.ts index fada88d73b..184c46b28f 100644 --- a/types/google-apps-script/google-apps-script.properties.d.ts +++ b/types/google-apps-script/google-apps-script.properties.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -8,21 +8,18 @@ declare namespace GoogleAppsScript { export module Properties { /** - * The properties object acts as the interface to access user, document, or script properties. - * The specific property type depends on which of the three methods of - * PropertiesService the script called: - * PropertiesService.getDocumentProperties(), - * PropertiesService.getUserProperties(), or - * PropertiesService.getScriptProperties(). Properties cannot be shared between scripts. For - * more information about property types, see the - * guide to the Properties service. + * The properties object acts as the interface to access user, document, or script properties. The + * specific property type depends on which of the three methods of PropertiesService the + * script called: PropertiesService.getDocumentProperties(), PropertiesService.getUserProperties(), or PropertiesService.getScriptProperties(). + * Properties cannot be shared between scripts. For more information about property types, see the + * guide to the Properties service. */ export interface Properties { deleteAllProperties(): Properties; deleteProperty(key: string): Properties; getKeys(): string[]; getProperties(): Object; - getProperty(key: string): string | null; + getProperty(key: string): string; setProperties(properties: Object): Properties; setProperties(properties: Object, deleteAllOthers: boolean): Properties; setProperty(key: string, value: string): Properties; @@ -30,18 +27,17 @@ declare namespace GoogleAppsScript { /** * Allows scripts to store simple data in key-value pairs scoped to one script, one user of a - * script, or one document in which an add-on is used. Properties cannot be shared between scripts. - * For more information about when to use each type of property, see the - * guide to the Properties service. + * script, or one document in which an add-on is used. Properties cannot be shared between scripts. + * For more information about when to use each type of property, see the guide to the Properties service. * - * // Sets three properties of different types. - * var documentProperties = PropertiesService.getDocumentProperties(); - * var scriptProperties = PropertiesService.getScriptProperties(); - * var userProperties = PropertiesService.getUserProperties(); + * // Sets three properties of different types. + * var documentProperties = PropertiesService.getDocumentProperties(); + * var scriptProperties = PropertiesService.getScriptProperties(); + * var userProperties = PropertiesService.getUserProperties(); * - * documentProperties.setProperty('DAYS_TO_FETCH', '5'); - * scriptProperties.setProperty('SERVER_URL', 'http://www.example.com/MyWeatherService/'); - * userProperties.setProperty('DISPLAY_UNITS', 'metric'); + * documentProperties.setProperty('DAYS_TO_FETCH', '5'); + * scriptProperties.setProperty('SERVER_URL', 'http://www.example.com/MyWeatherService/'); + * userProperties.setProperty('DISPLAY_UNITS', 'metric'); */ export interface PropertiesService { getDocumentProperties(): Properties; @@ -53,14 +49,14 @@ declare namespace GoogleAppsScript { * * Deprecated. This class is deprecated and should not be used in new scripts. * Script Properties are key-value pairs stored by a script in a persistent store. Script Properties - * are scoped per script, regardless of which user runs the script. + * are scoped per script, regardless of which user runs the script. */ export interface ScriptProperties { deleteAllProperties(): ScriptProperties; deleteProperty(key: string): ScriptProperties; getKeys(): string[]; getProperties(): Object; - getProperty(key: string): string | null; + getProperty(key: string): string; setProperties(properties: Object): ScriptProperties; setProperties(properties: Object, deleteAllOthers: boolean): ScriptProperties; setProperty(key: string, value: string): ScriptProperties; @@ -70,14 +66,14 @@ declare namespace GoogleAppsScript { * * Deprecated. This class is deprecated and should not be used in new scripts. * User Properties are key-value pairs unique to a user. User Properties are scoped per user; any - * script running under the identity of a user can access User Properties for that user only. + * script running under the identity of a user can access User Properties for that user only. */ export interface UserProperties { deleteAllProperties(): UserProperties; deleteProperty(key: string): UserProperties; getKeys(): string[]; getProperties(): Object; - getProperty(key: string): string | null; + getProperty(key: string): string; setProperties(properties: Object): UserProperties; setProperties(properties: Object, deleteAllOthers: boolean): UserProperties; setProperty(key: string, value: string): UserProperties; 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 209feaa0a1..fbe95deb8c 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 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -12,49 +12,44 @@ declare namespace GoogleAppsScript { export module Script { /** - * 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. + * 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. * - * function onOpen(e) { - * var menu = SpreadsheetApp.getUi().createAddonMenu(); - * if (e && e.authMode == ScriptApp.AuthMode.NONE) { - * // Add a normal menu item (works in all authorization modes). - * menu.addItem('Start workflow', 'startWorkflow'); - * } else { - * // Add a menu item based on properties (doesn't work in AuthMode.NONE). - * var properties = PropertiesService.getDocumentProperties(); - * var workflowStarted = properties.getProperty('workflowStarted'); - * if (workflowStarted) { - * menu.addItem('Check workflow status', 'checkWorkflow'); - * } else { - * menu.addItem('Start workflow', 'startWorkflow'); - * } - * // Record analytics. - * UrlFetchApp.fetch('http://www.example.com/analytics?event=open'); - * } - * menu.addToUi(); - * } + * function onOpen(e) { + * var menu = SpreadsheetApp.getUi().createAddonMenu(); + * if (e && e.authMode == ScriptApp.AuthMode.NONE) { + * // Add a normal menu item (works in all authorization modes). + * menu.addItem('Start workflow', 'startWorkflow'); + * } else { + * // Add a menu item based on properties (doesn't work in AuthMode.NONE). + * var properties = PropertiesService.getDocumentProperties(); + * var workflowStarted = properties.getProperty('workflowStarted'); + * if (workflowStarted) { + * menu.addItem('Check workflow status', 'checkWorkflow'); + * } else { + * menu.addItem('Start workflow', 'startWorkflow'); + * } + * // Record analytics. + * UrlFetchApp.fetch('http://www.example.com/analytics?event=open'); + * } + * menu.addToUi(); + * } */ export enum AuthMode { NONE, CUSTOM_FUNCTION, LIMITED, FULL } /** - * An object used to determine whether the user needs to authorize this script to use - * one or more services, and to provide the URL for an authorization dialog. If the script - * is published as an add-on that uses - * installable triggers, this information - * can be used to control access to sections of code for which the user lacks the necessary - * authorization. Alternately, the add-on can ask the user to open the URL for the - * authorization dialog to resolve the problem. + * An object used to determine whether the user needs to authorize this script to use one or more + * services, and to provide the URL for an authorization dialog. If the script is published as an add-on that uses installable triggers, this information can be used + * to control access to sections of code for which the user lacks the necessary authorization. + * Alternately, the add-on can ask the user to open the URL for the authorization dialog to resolve + * the problem. * - * This object is returned by - * ScriptApp.getAuthorizationInfo(authMode). In almost all cases, - * scripts should call - * ScriptApp.getAuthorizationInfo(ScriptApp.AuthMode.FULL), since no other - * authorization mode requires that users grant authorization. + * This object is returned by ScriptApp.getAuthorizationInfo(authMode). In almost + * all cases, scripts should call ScriptApp.getAuthorizationInfo(ScriptApp.AuthMode.FULL), + * since no other authorization mode requires that users grant authorization. */ export interface AuthorizationInfo { getAuthorizationStatus(): AuthorizationStatus; @@ -66,6 +61,14 @@ declare namespace GoogleAppsScript { */ export enum AuthorizationStatus { REQUIRED, NOT_REQUIRED } + /** + * Builder for calendar triggers. + */ + export interface CalendarTriggerBuilder { + create(): Trigger; + onEventUpdated(): CalendarTriggerBuilder; + } + /** * A builder for clock triggers. */ @@ -96,7 +99,7 @@ declare namespace GoogleAppsScript { /** * An enumeration denoting the type of triggered event. */ - export enum EventType { CLOCK, ON_OPEN, ON_EDIT, ON_FORM_SUBMIT, ON_CHANGE } + export enum EventType { CLOCK, ON_OPEN, ON_EDIT, ON_FORM_SUBMIT, ON_CHANGE, ON_EVENT_UPDATED } /** * A builder for form triggers. @@ -108,14 +111,14 @@ declare namespace GoogleAppsScript { } /** - * An enumeration that indicates how the script came to be installed as an add-on for the - * current user. + * An enumeration that indicates how the script came to be installed as an add-on for the current + * user. */ export enum InstallationSource { APPS_MARKETPLACE_DOMAIN_ADD_ON, NONE, WEB_STORE_ADD_ON } /** * Access and manipulate script publishing and triggers. This class allows users to create script - * triggers and control publishing the script as a service. + * triggers and control publishing the script as a service. */ export interface ScriptApp { AuthMode: typeof AuthMode; @@ -145,18 +148,9 @@ declare namespace GoogleAppsScript { * Access and manipulate script publishing. */ export interface Service { - Restriction: typeof Service.Restriction; disable(): void; getUrl(): string; isEnabled(): boolean; - enable(restriction: Service.Restriction): void; - } - - /** - * - */ - namespace Service { - export enum Restriction { MYSELF, DOMAIN, ALL } } /** @@ -173,19 +167,19 @@ declare namespace GoogleAppsScript { /** * Allows scripts to create state tokens that can be used in callback APIs (like OAuth flows). * - * // Reusable function to generate a callback URL, assuming the script has been published as a - * // web app (necessary to obtain the URL programmatically). If the script has not been published - * // as a web app, set `var url` in the first line to the URL of your script project (which - * // cannot be obtained programmatically). - * function getCallbackURL(callbackFunction){ - * var url = ScriptApp.getService().getUrl(); // Ends in /exec (for a web app) - * url = url.slice(0, -4) + 'usercallback?state='; // Change /exec to /usercallback - * var stateToken = ScriptApp.newStateToken() - * .withMethod(callbackFunction) - * .withTimeout(120) - * .createToken(); - * return url + stateToken; - * } + * // Reusable function to generate a callback URL, assuming the script has been published as a + * // web app (necessary to obtain the URL programmatically). If the script has not been published + * // as a web app, set `var url` in the first line to the URL of your script project (which + * // cannot be obtained programmatically). + * function getCallbackURL(callbackFunction){ + * var url = ScriptApp.getService().getUrl(); // Ends in /exec (for a web app) + * url = url.slice(0, -4) + 'usercallback?state='; // Change /exec to /usercallback + * var stateToken = ScriptApp.newStateToken() + * .withMethod(callbackFunction) + * .withTimeout(120) + * .createToken(); + * return url + stateToken; + * } */ export interface StateTokenBuilder { createToken(): string; @@ -215,13 +209,14 @@ declare namespace GoogleAppsScript { forForm(key: string): FormTriggerBuilder; forSpreadsheet(sheet: Spreadsheet.Spreadsheet): SpreadsheetTriggerBuilder; forSpreadsheet(key: string): SpreadsheetTriggerBuilder; + forUserCalendar(emailId: string): CalendarTriggerBuilder; timeBased(): ClockTriggerBuilder; } /** * An enumeration denoting the source of the event that causes the trigger to fire. */ - export enum TriggerSource { SPREADSHEETS, CLOCK, FORMS, DOCUMENTS } + export enum TriggerSource { SPREADSHEETS, CLOCK, FORMS, DOCUMENTS, CALENDAR } } } 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 5bbe126750..b8e7fff5f0 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 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -11,20 +11,17 @@ 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 - * 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 + * 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. * - * classic Sites. + * var filesPage = SitesApp.getSite('example.com', 'mysite').getChildByName("files"); + * var attachments = filesPage.getAttachments(); * - * var filesPage = SitesApp.getSite('example.com', 'mysite').getChildByName("files"); - * var attachments = filesPage.getAttachments(); - * - * // DocsList.createFile accepts a blob input. Since an Attachment is just a blob, we can - * // just pass it directly to that method - * var file = DocsList.createFile(attachments[0]); + * // DocsList.createFile accepts a blob input. Since an Attachment is just a blob, we can + * // just pass it directly to that method + * var file = DocsList.createFile(attachments[0]); */ export interface Attachment { deleteAttachment(): void; @@ -47,24 +44,18 @@ declare namespace GoogleAppsScript { } /** - * 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. + * 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. */ export enum AttachmentType { WEB, HOSTED } /** - * 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. + * 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. */ export interface Column { deleteColumn(): void; @@ -74,13 +65,10 @@ declare namespace GoogleAppsScript { } /** - * 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. + * 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. */ export interface Comment { deleteComment(): void; @@ -95,13 +83,10 @@ declare namespace GoogleAppsScript { } /** - * 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. + * 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. */ export interface ListItem { deleteListItem(): void; @@ -116,13 +101,10 @@ declare namespace GoogleAppsScript { } /** - * 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. + * 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. */ export interface Page { addColumn(name: string): Column; @@ -180,24 +162,18 @@ declare namespace GoogleAppsScript { } /** - * 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. + * 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. */ export enum PageType { WEB_PAGE, LIST_PAGE, ANNOUNCEMENT, ANNOUNCEMENTS_PAGE, FILE_CABINET_PAGE } /** - * 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. + * 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. */ export interface Site { addEditor(emailAddress: string): Site; @@ -262,13 +238,10 @@ declare namespace GoogleAppsScript { } /** - * 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. + * 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. */ export interface SitesApp { AttachmentType: typeof AttachmentType; 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 494663f002..90e034ff60 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-02-14 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -11,16 +11,16 @@ declare namespace GoogleAppsScript { export module Slides { /** * A 3x3 matrix used to transform source coordinates (x1, y1) into destination coordinates (x2, y2) - * according to matrix multiplication: + * according to matrix multiplication: * - * [ x2 ] [ scaleX shearX translateX ] [ x1 ] - * [ y2 ] = [ shearY scaleY translateY ] [ y1 ] - * [ 1 ] [ 0 0 1 ] [ 1 ] + * [ x2 ] [ scaleX shearX translateX ] [ x1 ] + * [ y2 ] = [ shearY scaleY translateY ] [ y1 ] + * [ 1 ] [ 0 0 1 ] [ 1 ] * * After transformation, * - * x2 = scaleX * x1 + shearX * y1 + translateX - * y2 = scaleY * y1 + shearY * x1 + translateY + * x2 = scaleX * x1 + shearX * y1 + translateX + * y2 = scaleY * y1 + shearY * x1 + translateY */ export interface AffineTransform { getScaleX(): Number; @@ -37,13 +37,13 @@ declare namespace GoogleAppsScript { * * Call AffineTransformBuilder#build() to get the AffineTransform object. * - * var transform = - * SlidesApp.newAffineTransformBuilder().setScaleX(2.0).setShearY(1.1).build(); + * var transform = + * SlidesApp.newAffineTransformBuilder().setScaleX(2.0).setShearY(1.1).build(); * - * The resulting transform matrix is - * [ 2.0 0.0 0.0 ] - * [ 1.1 1.0 0.0 ] - * [ 0 0 1 ] + * The resulting transform matrix is + * [ 2.0 0.0 0.0 ] + * [ 1.1 1.0 0.0 ] + * [ 0 0 1 ] */ export interface AffineTransformBuilder { build(): AffineTransform; @@ -64,14 +64,14 @@ declare namespace GoogleAppsScript { * The kinds of start and end forms with which linear geometry can be rendered. * * Some values are based on the "ST_LineEndType" simple type described in section 20.1.10.33 of - * of "Office Open XML File Formats - Fundamentals and Markup Language Reference", part 1 of ECMA-376 4th - * edition. + * of "Office Open XML File Formats - Fundamentals and Markup Language Reference", part 1 of ECMA-376 4th + * edition. */ export enum ArrowStyle { UNSUPPORTED, NONE, STEALTH_ARROW, FILL_ARROW, FILL_CIRCLE, FILL_SQUARE, FILL_DIAMOND, OPEN_ARROW, OPEN_CIRCLE, OPEN_SQUARE, OPEN_DIAMOND } /** * An element of text that is dynamically replaced with content that can change over time, such as a - * slide number. + * slide number. */ export interface AutoText { getAutoTextType(): AutoTextType; @@ -113,7 +113,7 @@ declare namespace GoogleAppsScript { /** * A color scheme defines a mapping from members of ThemeColorType to the actual colors used - * to render them. + * to render them. */ export interface ColorScheme { getConcreteColor(theme: ThemeColorType): Color; @@ -127,20 +127,20 @@ declare namespace GoogleAppsScript { /** * The content alignments for a Shape or TableCell. The supported alignments - * correspond to predefined text anchoring types from the ECMA-376 standard. + * correspond to predefined text anchoring types from the ECMA-376 standard. * * More information on those alignments can be found in the description of - * the ST_TextAnchoringType simple type in section 20.1.10.59 of "Office Open XML File - * Formats - Fundamentals and Markup Language Reference", part 1 of ECMA-376 4th - * edition. + * the ST_TextAnchoringType simple type in section 20.1.10.59 of "Office Open XML File + * Formats - Fundamentals and Markup Language Reference", part 1 of ECMA-376 4th + * edition. */ export enum ContentAlignment { UNSUPPORTED, TOP, MIDDLE, BOTTOM } /** * The kinds of dashes with which linear geometry can be rendered. These values are based on the - * "ST_PresetLineDashVal" simple type described in section 20.1.10.48 of "Office Open XML File - * Formats - Fundamentals and Markup Language Reference", part 1 of ECMA-376 4th - * edition. + * "ST_PresetLineDashVal" simple type described in section 20.1.10.48 of "Office Open XML File + * Formats - Fundamentals and Markup Language Reference", part 1 of ECMA-376 4th + * edition. */ export enum DashStyle { UNSUPPORTED, SOLID, DOT, DASH, DASH_DOT, LONG_DASH, LONG_DASH_DOT } @@ -209,6 +209,8 @@ declare namespace GoogleAppsScript { export interface Image { alignOnPage(alignmentPosition: AlignmentPosition): Image; duplicate(): PageElement; + getAs(contentType: string): Base.Blob; + getBlob(): Base.Blob; getBorder(): Border; getContentUrl(): string; getDescription(): string; @@ -254,7 +256,7 @@ declare namespace GoogleAppsScript { * A layout in a presentation. * * Each layout serves as a template for slides that inherit from it, determining how content on - * those slides is arranged and styled. + * those slides is arranged and styled. */ export interface Layout { getBackground(): PageBackground; @@ -366,7 +368,7 @@ declare namespace GoogleAppsScript { * The line category. * * The exact LineType created is determined based on the category and how it's routed to - * connect to other page elements. + * connect to other page elements. */ export enum LineCategory { STRAIGHT, BENT, CURVED } @@ -395,10 +397,10 @@ declare namespace GoogleAppsScript { * The line types. * * Derived from a subset of the values of the "ST_ShapeType" simple type in section 20.1.10.55 of - * "Office Open XML File Formats - Fundamentals and Markup Language Reference", part 1 of ECMA-376 4th - * edition. + * "Office Open XML File Formats - Fundamentals and Markup Language Reference", part 1 of ECMA-376 4th + * edition. */ - export enum LineType { UNSUPPORTED, STRAIGHT_CONNECTOR_1, BENT_CONNECTOR_2, BENT_CONNECTOR_3, BENT_CONNECTOR_4, BENT_CONNECTOR_5, CURVED_CONNECTOR_2, CURVED_CONNECTOR_3, CURVED_CONNECTOR_4, CURVED_CONNECTOR_5 } + export enum LineType { UNSUPPORTED, STRAIGHT_CONNECTOR_1, BENT_CONNECTOR_2, BENT_CONNECTOR_3, BENT_CONNECTOR_4, BENT_CONNECTOR_5, CURVED_CONNECTOR_2, CURVED_CONNECTOR_3, CURVED_CONNECTOR_4, CURVED_CONNECTOR_5, STRAIGHT_LINE } /** * A hypertext link. @@ -457,14 +459,14 @@ declare namespace GoogleAppsScript { * DIGIT: A number, like '1', '2', or '3'. * * ZERODIGIT: A number where single digit numbers are prefixed with a zero, like '01', '02', - * or '03'. Numbers with more than one digit are not prefixed a zero. + * or '03'. Numbers with more than one digit are not prefixed a zero. * * ROMAN: A lowercase roman numeral, like 'i', 'ii', or 'iii'. * * UPPERROMAN: A uppercase roman numeral, like 'I', 'II', or 'III'. * * LEFTTRIANGLE: A triangle pointing left, ◄, corresponding to a Unicode U+25c4 code - * point + * point */ export enum ListPreset { DISC_CIRCLE_SQUARE, DIAMONDX_ARROW3D_SQUARE, CHECKBOX, ARROW_DIAMOND_DISC, STAR_CIRCLE_SQUARE, ARROW3D_CIRCLE_SQUARE, LEFTTRIANGLE_DIAMOND_DISC, DIAMONDX_HOLLOWDIAMOND_SQUARE, DIAMOND_CIRCLE_SQUARE, DIGIT_ALPHA_ROMAN, DIGIT_ALPHA_ROMAN_PARENS, DIGIT_NESTED, UPPERALPHA_ALPHA_ROMAN, UPPERROMAN_UPPERALPHA_DIGIT, ZERODIGIT_ALPHA_ROMAN } @@ -484,15 +486,15 @@ declare namespace GoogleAppsScript { * A master in a presentation. * * Masters contains all common page elements and the common properties for a set of layouts. They - * serve three purposes: + * serve three purposes: * * Placeholder shapes on a master contain the default text styles and shape properties of all - * placeholder shapes on pages that use that master. + * placeholder shapes on pages that use that master. * * The properties of a master page define the common page properties inherited by its layouts. * * Any other shapes on the master slide appear on all slides using that master, regardless of - * their layout. + * their layout. */ export interface Master { getBackground(): PageBackground; @@ -547,7 +549,7 @@ declare namespace GoogleAppsScript { * A notes master in a presentation. * * Notes masters define the default text styles and page elements for all notes pages. Notes - * masters are read-only. + * masters are read-only. */ export interface NotesMaster { getGroups(): Group[]; @@ -569,8 +571,8 @@ declare namespace GoogleAppsScript { * A notes page in a presentation. * * These pages contain the content for presentation handouts, including a a shape that contains - * the slide's speaker notes. Each slide has one corresponding notes page. Only the text in the - * speaker notes shape can be modified. + * the slide's speaker notes. Each slide has one corresponding notes page. Only the text in the + * speaker notes shape can be modified. */ export interface NotesPage { getGroups(): Group[]; @@ -754,8 +756,8 @@ declare namespace GoogleAppsScript { * The styles of text that apply to entire paragraphs. * * Read methods in this class return null if the corresponding TextRange spans - * multiple paragraphs, and those paragraphs have different values for the read method being called. - * To avoid this, query for paragraph styles using the TextRange returned by the Paragraph.getRange() method. + * multiple paragraphs, and those paragraphs have different values for the read method being called. + * To avoid this, query for paragraph styles using the TextRange returned by the Paragraph.getRange() method. */ export interface ParagraphStyle { getIndentEnd(): Number; @@ -782,16 +784,18 @@ declare namespace GoogleAppsScript { * A fill that renders an image that's stretched to the dimensions of its container. */ export interface PictureFill { + getAs(contentType: string): Base.Blob; + getBlob(): Base.Blob; getContentUrl(): string; getSourceUrl(): string; } /** * The placeholder types. Many of these placeholder types correspond to placeholder IDs from the - * ECMA-376 standard. More information on those shapes can be found in the description of the - * "ST_PlaceholderType" type in section 19.7.10 of "Office Open XML File Formats - Fundamentals and - * Markup Language Reference", part 1 of ECMA-376 5th - * edition. + * ECMA-376 standard. More information on those shapes can be found in the description of the + * "ST_PlaceholderType" type in section 19.7.10 of "Office Open XML File Formats - Fundamentals and + * Markup Language Reference", part 1 of ECMA-376 5th + * edition. */ export enum PlaceholderType { UNSUPPORTED, NONE, BODY, CHART, CLIP_ART, CENTERED_TITLE, DIAGRAM, DATE_AND_TIME, FOOTER, HEADER, MEDIA, OBJECT, PICTURE, SLIDE_NUMBER, SUBTITLE, TABLE, TITLE, SLIDE_IMAGE } @@ -805,8 +809,8 @@ declare namespace GoogleAppsScript { /** * Predefined layouts. These are commonly found layouts in presentations. However, there is no - * guarantee that these layouts are present in the current master as they could have been deleted or - * not part of the used theme. Additionally, the placeholders on each layout may have been changed. + * guarantee that these layouts are present in the current master as they could have been deleted or + * not part of the used theme. Additionally, the placeholders on each layout may have been changed. */ export enum PredefinedLayout { UNSUPPORTED, BLANK, CAPTION_ONLY, TITLE, TITLE_AND_BODY, TITLE_AND_TWO_COLUMNS, TITLE_ONLY, SECTION_HEADER, SECTION_TITLE_AND_DESCRIPTION, ONE_COLUMN_TEXT, MAIN_POINT, BIG_NUMBER } @@ -816,10 +820,10 @@ declare namespace GoogleAppsScript { export interface Presentation { addEditor(emailAddress: string): Presentation; addEditor(user: Base.User): Presentation; - addEditors(emailAddresses: String[]): Presentation; + addEditors(emailAddresses: string[]): Presentation; addViewer(emailAddress: string): Presentation; addViewer(user: Base.User): Presentation; - addViewers(emailAddresses: String[]): Presentation; + addViewers(emailAddresses: string[]): Presentation; appendSlide(): Slide; appendSlide(layout: Layout): Slide; appendSlide(predefinedLayout: PredefinedLayout): Slide; @@ -866,10 +870,10 @@ declare namespace GoogleAppsScript { /** * The user's selection in the active presentation. * - * var selection = SlidesApp.getActivePresentation().getSelection(); - * var currentPage = selection.getCurrentPage(); - * var selectionType = selection.getSelectionType(); - * } + * var selection = SlidesApp.getActivePresentation().getSelection(); + * var currentPage = selection.getCurrentPage(); + * var selectionType = selection.getSelectionType(); + * } */ export interface Selection { getCurrentPage(): Page; @@ -884,16 +888,16 @@ declare namespace GoogleAppsScript { * Type of Selection. * * The SelectionType represents the most specific type of one or more objects that are - * selected. As an example if one or more TableCell instances are selected in a Table, the selection type is SelectionType.TABLE_CELL. The TableCellRange can be - * retrieved by using the Selection.getTableCellRange. The Table can be retrieved by - * using the Selection.getPageElementRange and the Page can be retrieved from the - * Selection.getCurrentPage. + * selected. As an example if one or more TableCell instances are selected in a Table, the selection type is SelectionType.TABLE_CELL. The TableCellRange can be + * retrieved by using the Selection.getTableCellRange. The Table can be retrieved by + * using the Selection.getPageElementRange and the Page can be retrieved from the + * Selection.getCurrentPage. */ export enum SelectionType { UNSUPPORTED, NONE, TEXT, TABLE_CELL, PAGE, PAGE_ELEMENT, CURRENT_PAGE } /** * A PageElement representing a generic shape that does not have a more specific - * classification. Includes text boxes, rectangles, and other predefined shapes. + * classification. Includes text boxes, rectangles, and other predefined shapes. */ export interface Shape { alignOnPage(alignmentPosition: AlignmentPosition): Shape; @@ -949,10 +953,10 @@ declare namespace GoogleAppsScript { /** * The shape types. Many of these shapes correspond to predefined shapes from the ECMA-376 standard. - * More information on those shapes can be found in the description of the "ST_ShapeType" simple - * type in section 20.1.10.55 of "Office Open XML File Formats - Fundamentals and Markup Language - * Reference", part 1 of ECMA-376 4th - * edition. + * More information on those shapes can be found in the description of the "ST_ShapeType" simple + * type in section 20.1.10.55 of "Office Open XML File Formats - Fundamentals and Markup Language + * Reference", part 1 of ECMA-376 4th + * edition. */ export enum ShapeType { UNSUPPORTED, TEXT_BOX, RECTANGLE, ROUND_RECTANGLE, ELLIPSE, ARC, BENT_ARROW, BENT_UP_ARROW, BEVEL, BLOCK_ARC, BRACE_PAIR, BRACKET_PAIR, CAN, CHEVRON, CHORD, CLOUD, CORNER, CUBE, CURVED_DOWN_ARROW, CURVED_LEFT_ARROW, CURVED_RIGHT_ARROW, CURVED_UP_ARROW, DECAGON, DIAGONAL_STRIPE, DIAMOND, DODECAGON, DONUT, DOUBLE_WAVE, DOWN_ARROW, DOWN_ARROW_CALLOUT, FOLDED_CORNER, FRAME, HALF_FRAME, HEART, HEPTAGON, HEXAGON, HOME_PLATE, HORIZONTAL_SCROLL, IRREGULAR_SEAL_1, IRREGULAR_SEAL_2, LEFT_ARROW, LEFT_ARROW_CALLOUT, LEFT_BRACE, LEFT_BRACKET, LEFT_RIGHT_ARROW, LEFT_RIGHT_ARROW_CALLOUT, LEFT_RIGHT_UP_ARROW, LEFT_UP_ARROW, LIGHTNING_BOLT, MATH_DIVIDE, MATH_EQUAL, MATH_MINUS, MATH_MULTIPLY, MATH_NOT_EQUAL, MATH_PLUS, MOON, NO_SMOKING, NOTCHED_RIGHT_ARROW, OCTAGON, PARALLELOGRAM, PENTAGON, PIE, PLAQUE, PLUS, QUAD_ARROW, QUAD_ARROW_CALLOUT, RIBBON, RIBBON_2, RIGHT_ARROW, RIGHT_ARROW_CALLOUT, RIGHT_BRACE, RIGHT_BRACKET, ROUND_1_RECTANGLE, ROUND_2_DIAGONAL_RECTANGLE, ROUND_2_SAME_RECTANGLE, RIGHT_TRIANGLE, SMILEY_FACE, SNIP_1_RECTANGLE, SNIP_2_DIAGONAL_RECTANGLE, SNIP_2_SAME_RECTANGLE, SNIP_ROUND_RECTANGLE, STAR_10, STAR_12, STAR_16, STAR_24, STAR_32, STAR_4, STAR_5, STAR_6, STAR_7, STAR_8, STRIPED_RIGHT_ARROW, SUN, TRAPEZOID, TRIANGLE, UP_ARROW, UP_ARROW_CALLOUT, UP_DOWN_ARROW, UTURN_ARROW, VERTICAL_SCROLL, WAVE, WEDGE_ELLIPSE_CALLOUT, WEDGE_RECTANGLE_CALLOUT, WEDGE_ROUND_RECTANGLE_CALLOUT, FLOW_CHART_ALTERNATE_PROCESS, FLOW_CHART_COLLATE, FLOW_CHART_CONNECTOR, FLOW_CHART_DECISION, FLOW_CHART_DELAY, FLOW_CHART_DISPLAY, FLOW_CHART_DOCUMENT, FLOW_CHART_EXTRACT, FLOW_CHART_INPUT_OUTPUT, FLOW_CHART_INTERNAL_STORAGE, FLOW_CHART_MAGNETIC_DISK, FLOW_CHART_MAGNETIC_DRUM, FLOW_CHART_MAGNETIC_TAPE, FLOW_CHART_MANUAL_INPUT, FLOW_CHART_MANUAL_OPERATION, FLOW_CHART_MERGE, FLOW_CHART_MULTIDOCUMENT, FLOW_CHART_OFFLINE_STORAGE, FLOW_CHART_OFFPAGE_CONNECTOR, FLOW_CHART_ONLINE_STORAGE, FLOW_CHART_OR, FLOW_CHART_PREDEFINED_PROCESS, FLOW_CHART_PREPARATION, FLOW_CHART_PROCESS, FLOW_CHART_PUNCHED_CARD, FLOW_CHART_PUNCHED_TAPE, FLOW_CHART_SORT, FLOW_CHART_SUMMING_JUNCTION, FLOW_CHART_TERMINATOR, ARROW_EAST, ARROW_NORTH_EAST, ARROW_NORTH, SPEECH, STARBURST, TEARDROP, ELLIPSE_RIBBON, ELLIPSE_RIBBON_2, CLOUD_CALLOUT, CUSTOM } @@ -1010,7 +1014,7 @@ declare namespace GoogleAppsScript { * A slide in a presentation. * * These pages contain the content you are presenting to your audience. Most slides are based on - * a master and a layout. You can specify which layout to use for each slide when it is created. + * a master and a layout. You can specify which layout to use for each slide when it is created. */ export interface Slide { duplicate(): Slide; @@ -1072,11 +1076,11 @@ declare namespace GoogleAppsScript { /** * Creates and opens Presentations that can be edited. * - * // Open a presentation by ID. - * var preso = SlidesApp.openById('PRESENTATION_ID_GOES_HERE'); + * // Open a presentation by ID. + * var preso = SlidesApp.openById('PRESENTATION_ID_GOES_HERE'); * - * // Create and open a presentation. - * preso = SlidesApp.create('Presentation Name'); + * // Create and open a presentation. + * preso = SlidesApp.create('Presentation Name'); */ export interface SlidesApp { AlignmentPosition: typeof AlignmentPosition; @@ -1119,7 +1123,7 @@ declare namespace GoogleAppsScript { * A solid color fill. * * SolidFill objects are detached and immutable, so do not reflect changes made after - * they have been created. + * they have been created. */ export interface SolidFill { getAlpha(): Number; @@ -1202,7 +1206,7 @@ declare namespace GoogleAppsScript { /** * A column in a table. A column consists of a list of table cells. A column is identified by the - * column index. + * column index. */ export interface TableColumn { getCell(cellIndex: Integer): TableCell; @@ -1276,8 +1280,8 @@ declare namespace GoogleAppsScript { * The style of text. * * Read methods in this class return null if the corresponding TextRange spans - * multiple text runs, and those runs have different values for the read method being called. To - * avoid this, query for text styles using the TextRanges returned by the TextRange.getRuns() method. + * multiple text runs, and those runs have different values for the read method being called. To + * avoid this, query for text styles using the TextRanges returned by the TextRange.getRuns() method. */ export interface TextStyle { getBackgroundColor(): Color; 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 dd2bc1d9f3..4ac5c84d6b 100644 --- a/types/google-apps-script/google-apps-script.spreadsheet.d.ts +++ b/types/google-apps-script/google-apps-script.spreadsheet.d.ts @@ -1,8 +1,6 @@ -// Type definitions for Google Apps Script 2018-05-23 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen -// linlex -// agektmr // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -11,82 +9,178 @@ /// declare namespace GoogleAppsScript { - /** - * This service allows scripts to create, access, and modify Google Sheets files. See also the guide to storing data in spreadsheets. - * - * https://developers.google.com/apps-script/guides/sheets - */ export module Spreadsheet { /** - * Styles that can be set on a range using - * Range.setBorder(top, left, bottom, right, vertical, horizontal, color, style). + * An enumeration of the types of series used to calculate auto-filled values. The manner in which + * these series affect calculated values differs depending on the type and amount of source data. */ - export enum BorderStyle { DOTTED, DASHED, SOLID } + export enum AutoFillSeries { DEFAULT_SERIES, ALTERNATE_SERIES } /** - * Access boolean conditions in `ConditionalFormatRules`. Each conditional - * format rule may contain a single boolean condition. The boolean condition - * itself contains a boolean criteria (with values) and formatting settings. - * The criteria is evaluated against the content of a cell resulting in - * either a `true` or `false` value. If the criteria evaluates to `true`, - * the condition's formatting settings are applied to the cell. + * Access and modify bandings, the color patterns applied to rows or columns of a range. Each + * banding consists of a range and a set of colors for rows, columns, headers, and footers. + */ + export interface Banding { + copyTo(range: Range): Banding; + getFirstColumnColor(): string; + getFirstRowColor(): string; + getFooterColumnColor(): string; + getFooterRowColor(): string; + getHeaderColumnColor(): string; + getHeaderRowColor(): string; + getRange(): Range; + getSecondColumnColor(): string; + getSecondRowColor(): string; + remove(): void; + setFirstColumnColor(color: string): Banding; + setFirstRowColor(color: string): Banding; + setFooterColumnColor(color: string): Banding; + setFooterRowColor(color: string): Banding; + setHeaderColumnColor(color: string): Banding; + setHeaderRowColor(color: string): Banding; + setRange(range: Range): Banding; + setSecondColumnColor(color: string): Banding; + setSecondRowColor(color: string): Banding; + } + + /** + * An enumeration of banding themes. Each theme consists of several complementary colors that are + * applied to different cells based on the banding settings. + */ + export enum BandingTheme { LIGHT_GREY, CYAN, GREEN, YELLOW, ORANGE, BLUE, TEAL, GREY, BROWN, LIGHT_GREEN, INDIGO, PINK } + + /** + * Access boolean conditions in ConditionalFormatRules. Each + * conditional format rule may contain a single boolean condition. The boolean condition itself + * contains a boolean criteria (with values) and formatting settings. The criteria is evaluated + * against the content of a cell resulting in either a true or false value. If the + * criteria evaluates to true, the condition's formatting settings are applied to the cell. */ export interface BooleanCondition { getBackground(): string; getBold(): boolean; getCriteriaType(): BooleanCriteria; - getCriteriaValue(): Object[]; - getFontColor(): string, + getCriteriaValues(): Object[]; + getFontColor(): string; getItalic(): boolean; getStrikethrough(): boolean; getUnderline(): boolean; } /** - * The chart's position within a sheet. Can be updated using the EmbeddedChart.modify() - * function. + * An enumeration representing the boolean criteria that can be used in conditional format or + * filter. + */ + export enum BooleanCriteria { CELL_EMPTY, CELL_NOT_EMPTY, DATE_AFTER, DATE_BEFORE, DATE_EQUAL_TO, DATE_AFTER_RELATIVE, DATE_BEFORE_RELATIVE, DATE_EQUAL_TO_RELATIVE, 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_STARTS_WITH, TEXT_ENDS_WITH, CUSTOM_FORMULA } + + /** + * Styles that can be set on a range using Range.setBorder(top, left, bottom, right, vertical, horizontal, color, style). + */ + export enum BorderStyle { DOTTED, DASHED, SOLID, SOLID_MEDIUM, SOLID_THICK, DOUBLE } + + /** + * Access conditional formatting rules. To create a new rule, use SpreadsheetApp.newConditionalFormatRule() and ConditionalFormatRuleBuilder. + * You can use Sheet.setConditionalFormatRules(rules) to set the + * rules for a given sheet. + */ + export interface ConditionalFormatRule { + copy(): ConditionalFormatRuleBuilder; + getBooleanCondition(): BooleanCondition; + getGradientCondition(): GradientCondition; + getRanges(): Range[]; + } + + /** + * Builder for conditional format rules. * - * chart = chart.modify().setPosition(5, 5, 0, 0).build(); - * sheet.updateChart(chart); + * // Adds a conditional format rule to a sheet that causes cells in range A1:B3 to turn red if + * // they contain a number between 1 and 10. + * var sheet = SpreadsheetApp.getActiveSheet(); + * var range = sheet.getRange("A1:B3"); + * var rule = SpreadsheetApp.newConditionalFormatRule() + * .whenNumberBetween(1, 10) + * .setBackgroundColor("#FF0000") + * .setRanges([range]) + * .build(); + * var rules = sheet.getConditionalFormatRules(); + * rules.push(rule); + * sheet.setConditionalFormatRules(rules); + */ + export interface ConditionalFormatRuleBuilder { + build(): ConditionalFormatRule; + copy(): ConditionalFormatRuleBuilder; + getBooleanCondition(): BooleanCondition; + getGradientCondition(): GradientCondition; + getRanges(): Range[]; + setBackground(color: string): ConditionalFormatRuleBuilder; + setBold(bold: boolean): ConditionalFormatRuleBuilder; + setFontColor(color: string): ConditionalFormatRuleBuilder; + setGradientMaxpoint(color: string): ConditionalFormatRuleBuilder; + setGradientMaxpointWithValue(color: string, type: InterpolationType, value: string): ConditionalFormatRuleBuilder; + setGradientMidpointWithValue(color: string, type: InterpolationType, value: string): ConditionalFormatRuleBuilder; + setGradientMinpoint(color: string): ConditionalFormatRuleBuilder; + setGradientMinpointWithValue(color: string, type: InterpolationType, value: string): ConditionalFormatRuleBuilder; + setItalic(italic: boolean): ConditionalFormatRuleBuilder; + setRanges(ranges: Range[]): ConditionalFormatRuleBuilder; + setStrikethrough(strikethrough: boolean): ConditionalFormatRuleBuilder; + setUnderline(underline: boolean): ConditionalFormatRuleBuilder; + whenCellEmpty(): ConditionalFormatRuleBuilder; + whenCellNotEmpty(): ConditionalFormatRuleBuilder; + whenDateAfter(date: Date): ConditionalFormatRuleBuilder; + whenDateAfter(date: RelativeDate): ConditionalFormatRuleBuilder; + whenDateBefore(date: Date): ConditionalFormatRuleBuilder; + whenDateBefore(date: RelativeDate): ConditionalFormatRuleBuilder; + whenDateEqualTo(date: Date): ConditionalFormatRuleBuilder; + whenDateEqualTo(date: RelativeDate): ConditionalFormatRuleBuilder; + whenFormulaSatisfied(formula: string): ConditionalFormatRuleBuilder; + whenNumberBetween(start: Number, end: Number): ConditionalFormatRuleBuilder; + whenNumberEqualTo(number: Number): ConditionalFormatRuleBuilder; + whenNumberGreaterThan(number: Number): ConditionalFormatRuleBuilder; + whenNumberGreaterThanOrEqualTo(number: Number): ConditionalFormatRuleBuilder; + whenNumberLessThan(number: Number): ConditionalFormatRuleBuilder; + whenNumberLessThanOrEqualTo(number: Number): ConditionalFormatRuleBuilder; + whenNumberNotBetween(start: Number, end: Number): ConditionalFormatRuleBuilder; + whenNumberNotEqualTo(number: Number): ConditionalFormatRuleBuilder; + whenTextContains(text: string): ConditionalFormatRuleBuilder; + whenTextDoesNotContain(text: string): ConditionalFormatRuleBuilder; + whenTextEndsWith(text: string): ConditionalFormatRuleBuilder; + whenTextEqualTo(text: string): ConditionalFormatRuleBuilder; + whenTextStartsWith(text: string): ConditionalFormatRuleBuilder; + withCriteria(criteria: BooleanCriteria, args: Object[]): ConditionalFormatRuleBuilder; + } + + /** + * Access the chart's position within a sheet. Can be updated using the EmbeddedChart.modify() function. + * + * chart = chart.modify().setPosition(5, 5, 0, 0).build(); + * sheet.updateChart(chart); */ export interface ContainerInfo { - /** - * The chart's left side will be anchored to this column. - * @returns {Integer} 1-indexed column (i.e. column C will be 3) - */ getAnchorColumn(): Integer; - /** - * The chart's top side will be anchored to this row. - * @returns {Integer} 1-indexed row (i.e. row 5 will return 5) - */ getAnchorRow(): Integer; - /** - * The chart's upper left hand corner will be offset from the anchor column by this many pixels. - * @returns {Integer} the horizontal offset in pixels for the upper left hand corner of the chart - */ getOffsetX(): Integer; - /** - * Chart's upper left hand corner will be offset from the anchor row by this many pixels. - * @returns {Integer} the vertical offset in pixels for the upper left hand corner of the chart - */ getOffsetY(): Integer; } /** - * This class allows users to access existing data-validation rules. To create a new rule, see - * SpreadsheetApp.newDataValidation(), DataValidationBuilder, and - * Range.setDataValidation(rule). + * An enumeration of possible special paste types. + */ + export enum CopyPasteType { PASTE_NORMAL, PASTE_NO_BORDERS, PASTE_FORMAT, PASTE_FORMULA, PASTE_DATA_VALIDATION, PASTE_VALUES, PASTE_CONDITIONAL_FORMATTING, PASTE_COLUMN_WIDTHS } + + /** + * Access data validation rules. To create a new rule, use SpreadsheetApp.newDataValidation() and DataValidationBuilder. You can use + * Range.setDataValidation(rule) to set the validation rule for a range. * - * // Log information about the data-validation rule for cell A1. - * var cell = SpreadsheetApp.getActive().getRange('A1'); - * var rule = cell.getDataValidation(); - * if (rule != null) { - * var criteria = rule.getCriteriaType(); - * var args = rule.getCriteriaValues(); - * Logger.log('The data-validation rule is %s %s', criteria, args); - * } else { - * Logger.log('The cell does not have a data-validation rule.') - * } + * // Log information about the data validation rule for cell A1. + * var cell = SpreadsheetApp.getActive().getRange('A1'); + * var rule = cell.getDataValidation(); + * if (rule != null) { + * var criteria = rule.getCriteriaType(); + * var args = rule.getCriteriaValues(); + * Logger.log('The data validation rule is %s %s', criteria, args); + * } else { + * Logger.log('The cell does not have a data validation rule.') + * } */ export interface DataValidation { copy(): DataValidationBuilder; @@ -97,13 +191,13 @@ declare namespace GoogleAppsScript { } /** - * Builder for data-validation rules. + * Builder for data validation rules. * - * // Set the data validation for cell A1 to require a value from B1:B10. - * var cell = SpreadsheetApp.getActive().getRange('A1'); - * var range = SpreadsheetApp.getActive().getRange('B1:B10'); - * var rule = SpreadsheetApp.newDataValidation().requireValueInRange(range).build(); - * cell.setDataValidation(rule); + * // Set the data validation for cell A1 to require a value from B1:B10. + * var cell = SpreadsheetApp.getActive().getRange('A1'); + * var range = SpreadsheetApp.getActive().getRange('B1:B10'); + * var rule = SpreadsheetApp.newDataValidation().requireValueInRange(range).build(); + * cell.setDataValidation(rule); */ export interface DataValidationBuilder { build(): DataValidation; @@ -144,39 +238,50 @@ declare namespace GoogleAppsScript { } /** - * An enumeration representing the data-validation criteria that can be set on a range. + * An enumeration representing the data validation criteria that can be set on a range. * - * // Change existing data-validation rules that require a date in 2013 to require a date in 2014. - * var oldDates = [new Date('1/1/2013'), new Date('12/31/2013')]; - * var newDates = [new Date('1/1/2014'), new Date('12/31/2014')]; - * var sheet = SpreadsheetApp.getActiveSheet(); - * var range = sheet.getRange(1, 1, sheet.getMaxRows(), sheet.getMaxColumns()); - * var rules = range.getDataValidations(); + * // Change existing data-validation rules that require a date in 2013 to require a date in 2014. + * var oldDates = [new Date('1/1/2013'), new Date('12/31/2013')]; + * var newDates = [new Date('1/1/2014'), new Date('12/31/2014')]; + * var sheet = SpreadsheetApp.getActiveSheet(); + * var range = sheet.getRange(1, 1, sheet.getMaxRows(), sheet.getMaxColumns()); + * var rules = range.getDataValidations(); * - * for (var i = 0; i < rules.length; i++) { - * for (var j = 0; j < rules[i].length; j++) { - * var rule = rules[i][j]; + * for (var i = 0; i < rules.length; i++) { + * for (var j = 0; j < rules[i].length; j++) { + * var rule = rules[i][j]; * - * if (rule != null) { - * var criteria = rule.getCriteriaType(); - * var args = rule.getCriteriaValues(); + * if (rule != null) { + * var criteria = rule.getCriteriaType(); + * var args = rule.getCriteriaValues(); * - * if (criteria == SpreadsheetApp.DataValidationCriteria.DATE_BETWEEN - * && args[0].getTime() == oldDates[0].getTime() - * && args[1].getTime() == oldDates[1].getTime()) { - * // Create a builder from the existing rule, then change the dates. - * rules[i][j] = rule.copy().withCriteria(criteria, newDates).build(); - * } - * } - * } - * } - * range.setDataValidations(rules); + * if (criteria == SpreadsheetApp.DataValidationCriteria.DATE_BETWEEN + * && args[0].getTime() == oldDates[0].getTime() + * && args[1].getTime() == oldDates[1].getTime()) { + * // Create a builder from the existing rule, then change the dates. + * rules[i][j] = rule.copy().withCriteria(criteria, newDates).build(); + * } + * } + * } + * } + * range.setDataValidations(rules); */ - 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 } + 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 } + + /** + * An enumeration of possible directions along which data can be stored in a spreadsheet. + */ + export enum Dimension { COLUMNS, ROWS } + + /** + * An enumeration representing the possible directions that one can move within a spreadsheet using + * the arrow keys. + */ + export enum Direction { UP, DOWN, PREVIOUS, NEXT } /** * Builder for area charts. For more details, see the Gviz - * documentation. + * documentation. */ export interface EmbeddedAreaChartBuilder { addRange(range: Range): EmbeddedChartBuilder; @@ -198,8 +303,11 @@ declare namespace GoogleAppsScript { setBackgroundColor(cssValue: string): EmbeddedAreaChartBuilder; setChartType(type: Charts.ChartType): EmbeddedChartBuilder; setColors(cssValues: string[]): EmbeddedAreaChartBuilder; + setHiddenDimensionStrategy(strategy: Charts.ChartHiddenDimensionStrategy): EmbeddedChartBuilder; setLegendPosition(position: Charts.Position): EmbeddedAreaChartBuilder; setLegendTextStyle(textStyle: Charts.TextStyle): EmbeddedAreaChartBuilder; + setMergeStrategy(mergeStrategy: Charts.ChartMergeStrategy): EmbeddedChartBuilder; + setNumHeaders(headers: Integer): EmbeddedChartBuilder; setOption(option: string, value: Object): EmbeddedChartBuilder; setPointStyle(style: Charts.PointStyle): EmbeddedAreaChartBuilder; setPosition(anchorRowPos: Integer, anchorColPos: Integer, offsetX: Integer, offsetY: Integer): EmbeddedChartBuilder; @@ -207,6 +315,7 @@ declare namespace GoogleAppsScript { setStacked(): EmbeddedAreaChartBuilder; setTitle(chartTitle: string): EmbeddedAreaChartBuilder; setTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedAreaChartBuilder; + setTransposeRowsAndColumns(transpose: boolean): EmbeddedChartBuilder; setXAxisTextStyle(textStyle: Charts.TextStyle): EmbeddedAreaChartBuilder; setXAxisTitle(title: string): EmbeddedAreaChartBuilder; setXAxisTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedAreaChartBuilder; @@ -218,7 +327,7 @@ declare namespace GoogleAppsScript { /** * Builder for bar charts. For more details, see the Gviz - * documentation. + * documentation. */ export interface EmbeddedBarChartBuilder { addRange(range: Range): EmbeddedChartBuilder; @@ -241,14 +350,18 @@ declare namespace GoogleAppsScript { setBackgroundColor(cssValue: string): EmbeddedBarChartBuilder; setChartType(type: Charts.ChartType): EmbeddedChartBuilder; setColors(cssValues: string[]): EmbeddedBarChartBuilder; + setHiddenDimensionStrategy(strategy: Charts.ChartHiddenDimensionStrategy): EmbeddedChartBuilder; setLegendPosition(position: Charts.Position): EmbeddedBarChartBuilder; setLegendTextStyle(textStyle: Charts.TextStyle): EmbeddedBarChartBuilder; + setMergeStrategy(mergeStrategy: Charts.ChartMergeStrategy): EmbeddedChartBuilder; + setNumHeaders(headers: Integer): EmbeddedChartBuilder; setOption(option: string, value: Object): EmbeddedChartBuilder; setPosition(anchorRowPos: Integer, anchorColPos: Integer, offsetX: Integer, offsetY: Integer): EmbeddedChartBuilder; setRange(start: Number, end: Number): EmbeddedBarChartBuilder; setStacked(): EmbeddedBarChartBuilder; setTitle(chartTitle: string): EmbeddedBarChartBuilder; setTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedBarChartBuilder; + setTransposeRowsAndColumns(transpose: boolean): EmbeddedChartBuilder; setXAxisTextStyle(textStyle: Charts.TextStyle): EmbeddedBarChartBuilder; setXAxisTitle(title: string): EmbeddedBarChartBuilder; setXAxisTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedBarChartBuilder; @@ -259,58 +372,62 @@ declare namespace GoogleAppsScript { } /** - * Represents a chart that has been embedded into a Spreadsheet. + * Represents a chart that has been embedded into a spreadsheet. * * This example shows how to modify an existing chart: * - * var sheet = SpreadsheetApp.getActiveSheet(); - * var range = sheet.getRange("A2:B8") - * var chart = sheet.getCharts()[0]; - * chart = chart.modify() - * .addRange(range) - * .setOption('title', 'Updated!') - * .setOption('animation.duration', 500) - * .setPosition(2,2,0,0) - * .build(); - * sheet.updateChart(chart); + * var sheet = SpreadsheetApp.getActiveSheet(); + * var range = sheet.getRange("A2:B8") + * var chart = sheet.getCharts()[0]; + * chart = chart.modify() + * .addRange(range) + * .setOption('title', 'Updated!') + * .setOption('animation.duration', 500) + * .setPosition(2,2,0,0) + * .build(); + * sheet.updateChart(chart); * * This example shows how to create a new chart: * - * function newChart(range, sheet) { - * var sheet = SpreadsheetApp.getActiveSheet(); - * var chartBuilder = sheet.newChart(); - * chartBuilder.addRange(range) - * .setChartType(Charts.ChartType.LINE) - * .setOption('title', 'My Line Chart!'); - * sheet.insertChart(chartBuilder.build()); - * } + * function newChart(range, sheet) { + * var sheet = SpreadsheetApp.getActiveSheet(); + * var chartBuilder = sheet.newChart(); + * chartBuilder.addRange(range) + * .setChartType(Charts.ChartType.LINE) + * .setOption('title', 'My Line Chart!'); + * sheet.insertChart(chartBuilder.build()); + * } */ export interface EmbeddedChart { getAs(contentType: string): Base.Blob; getBlob(): Base.Blob; getContainerInfo(): ContainerInfo; + getHiddenDimensionStrategy(): Charts.ChartHiddenDimensionStrategy; getId(): string; + getMergeStrategy(): Charts.ChartMergeStrategy; + getNumHeaders(): Integer; getOptions(): Charts.ChartOptions; getRanges(): Range[]; + getTransposeRowsAndColumns(): boolean; getType(): string; modify(): EmbeddedChartBuilder; setId(id: string): Charts.Chart; } /** - * This builder allows you to edit an EmbeddedChart. Make sure to call - * sheet.updateChart(builder.build()) to save your changes. + * Builder used to edit an EmbeddedChart. Changes made to the chart are not saved until + * Sheet.updateChart(chart) is called on the rebuilt chart. * - * var sheet = SpreadsheetApp.getActiveSheet(); - * var range = sheet.getRange("A1:B8"); - * var chart = sheet.getCharts()[0]; - * chart = chart.modify() - * .addRange(range) - * .setOption('title', 'Updated!') - * .setOption('animation.duration', 500) - * .setPosition(2,2,0,0) - * .build(); - * sheet.updateChart(chart); + * var sheet = SpreadsheetApp.getActiveSheet(); + * var range = sheet.getRange("A1:B8"); + * var chart = sheet.getCharts()[0]; + * chart = chart.modify() + * .addRange(range) + * .setOption('title', 'Updated!') + * .setOption('animation.duration', 500) + * .setPosition(2,2,0,0) + * .build(); + * sheet.updateChart(chart); */ export interface EmbeddedChartBuilder { addRange(range: Range): EmbeddedChartBuilder; @@ -329,13 +446,17 @@ declare namespace GoogleAppsScript { getRanges(): Range[]; removeRange(range: Range): EmbeddedChartBuilder; setChartType(type: Charts.ChartType): EmbeddedChartBuilder; + setHiddenDimensionStrategy(strategy: Charts.ChartHiddenDimensionStrategy): EmbeddedChartBuilder; + setMergeStrategy(mergeStrategy: Charts.ChartMergeStrategy): EmbeddedChartBuilder; + setNumHeaders(headers: Integer): EmbeddedChartBuilder; setOption(option: string, value: Object): EmbeddedChartBuilder; setPosition(anchorRowPos: Integer, anchorColPos: Integer, offsetX: Integer, offsetY: Integer): EmbeddedChartBuilder; + setTransposeRowsAndColumns(transpose: boolean): EmbeddedChartBuilder; } /** * Builder for column charts. For more details, see the Gviz - * documentation. + * documentation. */ export interface EmbeddedColumnChartBuilder { addRange(range: Range): EmbeddedChartBuilder; @@ -357,14 +478,18 @@ declare namespace GoogleAppsScript { setBackgroundColor(cssValue: string): EmbeddedColumnChartBuilder; setChartType(type: Charts.ChartType): EmbeddedChartBuilder; setColors(cssValues: string[]): EmbeddedColumnChartBuilder; + setHiddenDimensionStrategy(strategy: Charts.ChartHiddenDimensionStrategy): EmbeddedChartBuilder; setLegendPosition(position: Charts.Position): EmbeddedColumnChartBuilder; setLegendTextStyle(textStyle: Charts.TextStyle): EmbeddedColumnChartBuilder; + setMergeStrategy(mergeStrategy: Charts.ChartMergeStrategy): EmbeddedChartBuilder; + setNumHeaders(headers: Integer): EmbeddedChartBuilder; setOption(option: string, value: Object): EmbeddedChartBuilder; setPosition(anchorRowPos: Integer, anchorColPos: Integer, offsetX: Integer, offsetY: Integer): EmbeddedChartBuilder; setRange(start: Number, end: Number): EmbeddedColumnChartBuilder; setStacked(): EmbeddedColumnChartBuilder; setTitle(chartTitle: string): EmbeddedColumnChartBuilder; setTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedColumnChartBuilder; + setTransposeRowsAndColumns(transpose: boolean): EmbeddedChartBuilder; setXAxisTextStyle(textStyle: Charts.TextStyle): EmbeddedColumnChartBuilder; setXAxisTitle(title: string): EmbeddedColumnChartBuilder; setXAxisTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedColumnChartBuilder; @@ -375,8 +500,7 @@ declare namespace GoogleAppsScript { } /** - * Builder for combo charts. For more details, see the Gviz - * documentation. + * Builder for combo charts. For more details, see the Gviz documentation. */ export interface EmbeddedComboChartBuilder { addRange(range: Range): EmbeddedChartBuilder; @@ -398,14 +522,18 @@ declare namespace GoogleAppsScript { setBackgroundColor(cssValue: string): EmbeddedComboChartBuilder; setChartType(type: Charts.ChartType): EmbeddedChartBuilder; setColors(cssValues: string[]): EmbeddedComboChartBuilder; + setHiddenDimensionStrategy(strategy: Charts.ChartHiddenDimensionStrategy): EmbeddedChartBuilder; setLegendPosition(position: Charts.Position): EmbeddedComboChartBuilder; setLegendTextStyle(textStyle: Charts.TextStyle): EmbeddedComboChartBuilder; + setMergeStrategy(mergeStrategy: Charts.ChartMergeStrategy): EmbeddedChartBuilder; + setNumHeaders(headers: Integer): EmbeddedChartBuilder; setOption(option: string, value: Object): EmbeddedChartBuilder; setPosition(anchorRowPos: Integer, anchorColPos: Integer, offsetX: Integer, offsetY: Integer): EmbeddedChartBuilder; setRange(start: Number, end: Number): EmbeddedComboChartBuilder; setStacked(): EmbeddedComboChartBuilder; setTitle(chartTitle: string): EmbeddedComboChartBuilder; setTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedComboChartBuilder; + setTransposeRowsAndColumns(transpose: boolean): EmbeddedChartBuilder; setXAxisTextStyle(textStyle: Charts.TextStyle): EmbeddedComboChartBuilder; setXAxisTitle(title: string): EmbeddedComboChartBuilder; setXAxisTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedComboChartBuilder; @@ -417,7 +545,7 @@ declare namespace GoogleAppsScript { /** * Builder for histogram charts. For more details, see the Gviz - * documentation. + * documentation. */ export interface EmbeddedHistogramChartBuilder { addRange(range: Range): EmbeddedChartBuilder; @@ -439,14 +567,18 @@ declare namespace GoogleAppsScript { setBackgroundColor(cssValue: string): EmbeddedHistogramChartBuilder; setChartType(type: Charts.ChartType): EmbeddedChartBuilder; setColors(cssValues: string[]): EmbeddedHistogramChartBuilder; + setHiddenDimensionStrategy(strategy: Charts.ChartHiddenDimensionStrategy): EmbeddedChartBuilder; setLegendPosition(position: Charts.Position): EmbeddedHistogramChartBuilder; setLegendTextStyle(textStyle: Charts.TextStyle): EmbeddedHistogramChartBuilder; + setMergeStrategy(mergeStrategy: Charts.ChartMergeStrategy): EmbeddedChartBuilder; + setNumHeaders(headers: Integer): EmbeddedChartBuilder; setOption(option: string, value: Object): EmbeddedChartBuilder; setPosition(anchorRowPos: Integer, anchorColPos: Integer, offsetX: Integer, offsetY: Integer): EmbeddedChartBuilder; setRange(start: Number, end: Number): EmbeddedHistogramChartBuilder; setStacked(): EmbeddedHistogramChartBuilder; setTitle(chartTitle: string): EmbeddedHistogramChartBuilder; setTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedHistogramChartBuilder; + setTransposeRowsAndColumns(transpose: boolean): EmbeddedChartBuilder; setXAxisTextStyle(textStyle: Charts.TextStyle): EmbeddedHistogramChartBuilder; setXAxisTitle(title: string): EmbeddedHistogramChartBuilder; setXAxisTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedHistogramChartBuilder; @@ -458,7 +590,7 @@ declare namespace GoogleAppsScript { /** * Builder for line charts. For more details, see the Gviz - * documentation. + * documentation. */ export interface EmbeddedLineChartBuilder { addRange(range: Range): EmbeddedChartBuilder; @@ -481,14 +613,18 @@ declare namespace GoogleAppsScript { setChartType(type: Charts.ChartType): EmbeddedChartBuilder; setColors(cssValues: string[]): EmbeddedLineChartBuilder; setCurveStyle(style: Charts.CurveStyle): EmbeddedLineChartBuilder; + setHiddenDimensionStrategy(strategy: Charts.ChartHiddenDimensionStrategy): EmbeddedChartBuilder; setLegendPosition(position: Charts.Position): EmbeddedLineChartBuilder; setLegendTextStyle(textStyle: Charts.TextStyle): EmbeddedLineChartBuilder; + setMergeStrategy(mergeStrategy: Charts.ChartMergeStrategy): EmbeddedChartBuilder; + setNumHeaders(headers: Integer): EmbeddedChartBuilder; setOption(option: string, value: Object): EmbeddedChartBuilder; setPointStyle(style: Charts.PointStyle): EmbeddedLineChartBuilder; setPosition(anchorRowPos: Integer, anchorColPos: Integer, offsetX: Integer, offsetY: Integer): EmbeddedChartBuilder; setRange(start: Number, end: Number): EmbeddedLineChartBuilder; setTitle(chartTitle: string): EmbeddedLineChartBuilder; setTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedLineChartBuilder; + setTransposeRowsAndColumns(transpose: boolean): EmbeddedChartBuilder; setXAxisTextStyle(textStyle: Charts.TextStyle): EmbeddedLineChartBuilder; setXAxisTitle(title: string): EmbeddedLineChartBuilder; setXAxisTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedLineChartBuilder; @@ -500,7 +636,7 @@ declare namespace GoogleAppsScript { /** * Builder for pie charts. For more details, see the Gviz - * documentation. + * documentation. */ export interface EmbeddedPieChartBuilder { addRange(range: Range): EmbeddedChartBuilder; @@ -523,17 +659,21 @@ declare namespace GoogleAppsScript { setBackgroundColor(cssValue: string): EmbeddedPieChartBuilder; setChartType(type: Charts.ChartType): EmbeddedChartBuilder; setColors(cssValues: string[]): EmbeddedPieChartBuilder; + setHiddenDimensionStrategy(strategy: Charts.ChartHiddenDimensionStrategy): EmbeddedChartBuilder; setLegendPosition(position: Charts.Position): EmbeddedPieChartBuilder; setLegendTextStyle(textStyle: Charts.TextStyle): EmbeddedPieChartBuilder; + setMergeStrategy(mergeStrategy: Charts.ChartMergeStrategy): EmbeddedChartBuilder; + setNumHeaders(headers: Integer): EmbeddedChartBuilder; setOption(option: string, value: Object): EmbeddedChartBuilder; setPosition(anchorRowPos: Integer, anchorColPos: Integer, offsetX: Integer, offsetY: Integer): EmbeddedChartBuilder; setTitle(chartTitle: string): EmbeddedPieChartBuilder; setTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedPieChartBuilder; + setTransposeRowsAndColumns(transpose: boolean): EmbeddedChartBuilder; } /** * Builder for scatter charts. For more details, see the Gviz - * documentation. + * documentation. */ export interface EmbeddedScatterChartBuilder { addRange(range: Range): EmbeddedChartBuilder; @@ -554,13 +694,17 @@ declare namespace GoogleAppsScript { setBackgroundColor(cssValue: string): EmbeddedScatterChartBuilder; setChartType(type: Charts.ChartType): EmbeddedChartBuilder; setColors(cssValues: string[]): EmbeddedScatterChartBuilder; + setHiddenDimensionStrategy(strategy: Charts.ChartHiddenDimensionStrategy): EmbeddedChartBuilder; setLegendPosition(position: Charts.Position): EmbeddedScatterChartBuilder; setLegendTextStyle(textStyle: Charts.TextStyle): EmbeddedScatterChartBuilder; + setMergeStrategy(mergeStrategy: Charts.ChartMergeStrategy): EmbeddedChartBuilder; + setNumHeaders(headers: Integer): EmbeddedChartBuilder; setOption(option: string, value: Object): EmbeddedChartBuilder; setPointStyle(style: Charts.PointStyle): EmbeddedScatterChartBuilder; setPosition(anchorRowPos: Integer, anchorColPos: Integer, offsetX: Integer, offsetY: Integer): EmbeddedChartBuilder; setTitle(chartTitle: string): EmbeddedScatterChartBuilder; setTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedScatterChartBuilder; + setTransposeRowsAndColumns(transpose: boolean): EmbeddedChartBuilder; setXAxisLogScale(): EmbeddedScatterChartBuilder; setXAxisRange(start: Number, end: Number): EmbeddedScatterChartBuilder; setXAxisTextStyle(textStyle: Charts.TextStyle): EmbeddedScatterChartBuilder; @@ -574,8 +718,7 @@ declare namespace GoogleAppsScript { } /** - * Builder for table charts. For more details, see the Gviz - * documentation. + * Builder for table charts. For more details, see the Gviz documentation. */ export interface EmbeddedTableChartBuilder { addRange(range: Range): EmbeddedChartBuilder; @@ -600,38 +743,100 @@ declare namespace GoogleAppsScript { removeRange(range: Range): EmbeddedChartBuilder; setChartType(type: Charts.ChartType): EmbeddedChartBuilder; setFirstRowNumber(number: Integer): EmbeddedTableChartBuilder; + setHiddenDimensionStrategy(strategy: Charts.ChartHiddenDimensionStrategy): EmbeddedChartBuilder; setInitialSortingAscending(column: Integer): EmbeddedTableChartBuilder; setInitialSortingDescending(column: Integer): EmbeddedTableChartBuilder; + setMergeStrategy(mergeStrategy: Charts.ChartMergeStrategy): EmbeddedChartBuilder; + setNumHeaders(headers: Integer): EmbeddedChartBuilder; setOption(option: string, value: Object): EmbeddedChartBuilder; setPosition(anchorRowPos: Integer, anchorColPos: Integer, offsetX: Integer, offsetY: Integer): EmbeddedChartBuilder; + setTransposeRowsAndColumns(transpose: boolean): EmbeddedChartBuilder; showRowNumberColumn(showRowNumber: boolean): EmbeddedTableChartBuilder; useAlternatingRowStyle(alternate: boolean): EmbeddedTableChartBuilder; } /** - * Access gradient (color) conditions in `ConditionalFormatRuleApis`. Each - * conditional format rule may contain a single gradient condition. A - * gradient condition is defined by three points along a number scale (min, - * mid, and max), each of which has a color, a value, and a - * `InterpolationType`. The content of a cell is compared to the values in - * the number scale and the color applied to the cell is interpolated based - * on the cell content's proximity to the gradient condition min, mid, and - * max points. - * - * // Logs all the information inside gradient conditional format rules on * a sheet. - * var sheet = SpreadsheetApp.getActiveSheet(); - * var rules = sheet.getConditionalFormatRules(); - * for (int i = 0; i < rules.length; i++) { - * var gradient = rules[i].getGradientCondition(); - * Logger.log("The conditional format gradient information for rule %d:\n - * MinColor %s, MinType %s, MinValue %s, \n - * MidColor %s, MidType %s, MidValue %s, \n - * MaxColor %s, MaxType %s, MaxValue %s \n", i, - * gradient.getMinColor(), gradient.getMinType(), gradient.getMinValue(), - * gradient.getMidColor(), gradient.getMidType(), gradient.getMidValue(), - * gradient.getMaxColor(), gradient.getMaxType(), gradient.getMaxValue()); - * } - **/ + * Access and modify existing filters. To create a new filter, use Range.createFilter(). + */ + export interface Filter { + getColumnFilterCriteria(columnPosition: Integer): FilterCriteria; + getRange(): Range; + remove(): void; + removeColumnFilterCriteria(columnPosition: Integer): Filter; + setColumnFilterCriteria(columnPosition: Integer, filterCriteria: FilterCriteria): Filter; + sort(columnPosition: Integer, ascending: boolean): Filter; + } + + /** + * Access filter criteria. To create a new criteria, use SpreadsheetApp.newFilterCriteria() and FilterCriteriaBuilder. + */ + export interface FilterCriteria { + copy(): FilterCriteriaBuilder; + getCriteriaType(): BooleanCriteria; + getCriteriaValues(): Object[]; + getHiddenValues(): string[]; + getVisibleValues(): string[]; + } + + /** + * Builder for FilterCriteria. + */ + export interface FilterCriteriaBuilder { + build(): FilterCriteria; + copy(): FilterCriteriaBuilder; + getCriteriaType(): BooleanCriteria; + getCriteriaValues(): Object[]; + getHiddenValues(): string[]; + getVisibleValues(): string[]; + setHiddenValues(values: string[]): FilterCriteriaBuilder; + setVisibleValues(values: string[]): FilterCriteriaBuilder; + whenCellEmpty(): FilterCriteriaBuilder; + whenCellNotEmpty(): FilterCriteriaBuilder; + whenDateAfter(date: Date): FilterCriteriaBuilder; + whenDateAfter(date: RelativeDate): FilterCriteriaBuilder; + whenDateBefore(date: Date): FilterCriteriaBuilder; + whenDateBefore(date: RelativeDate): FilterCriteriaBuilder; + whenDateEqualTo(date: Date): FilterCriteriaBuilder; + whenDateEqualTo(date: RelativeDate): FilterCriteriaBuilder; + whenFormulaSatisfied(formula: string): FilterCriteriaBuilder; + whenNumberBetween(start: Number, end: Number): FilterCriteriaBuilder; + whenNumberEqualTo(number: Number): FilterCriteriaBuilder; + whenNumberGreaterThan(number: Number): FilterCriteriaBuilder; + whenNumberGreaterThanOrEqualTo(number: Number): FilterCriteriaBuilder; + whenNumberLessThan(number: Number): FilterCriteriaBuilder; + whenNumberLessThanOrEqualTo(number: Number): FilterCriteriaBuilder; + whenNumberNotBetween(start: Number, end: Number): FilterCriteriaBuilder; + whenNumberNotEqualTo(number: Number): FilterCriteriaBuilder; + whenTextContains(text: string): FilterCriteriaBuilder; + whenTextDoesNotContain(text: string): FilterCriteriaBuilder; + whenTextEndsWith(text: string): FilterCriteriaBuilder; + whenTextEqualTo(text: string): FilterCriteriaBuilder; + whenTextStartsWith(text: string): FilterCriteriaBuilder; + withCriteria(criteria: BooleanCriteria, args: Object[]): FilterCriteriaBuilder; + } + + /** + * Access gradient (color) conditions in ConditionalFormatRuleApis. + * Each conditional format rule may contain a single gradient condition. A gradient condition is + * defined by three points along a number scale (min, mid, and max), each of which has a color, a + * value, and a InterpolationType. The content of a cell is + * compared to the values in the number scale and the color applied to the cell is interpolated + * based on the cell content's proximity to the gradient condition min, mid, and max points. + * + * // Logs all the information inside gradient conditional format rules on a sheet. + * var sheet = SpreadsheetApp.getActiveSheet(); + * var rules = sheet.getConditionalFormatRules(); + * for (int i = 0; i < rules.length; i++) { + * var gradient = rules[i].getGradientCondition(); + * Logger.log("The conditional format gradient information for rule %d:\n + * MinColor %s, MinType %s, MinValue %s, \n + * MidColor %s, MidType %s, MidValue %s, \n + * MaxColor %s, MaxType %s, MaxValue %s \n", i, + * gradient.getMinColor(), gradient.getMinType(), gradient.getMinValue(), + * gradient.getMidColor(), gradient.getMidType(), gradient.getMidValue(), + * gradient.getMaxColor(), gradient.getMaxType(), gradient.getMaxValue()); + * } + */ export interface GradientCondition { getMaxColor(): string; getMaxType(): InterpolationType; @@ -645,39 +850,57 @@ declare namespace GoogleAppsScript { } /** - * Create, access and modify named ranges in a spreadsheet. - * Named ranges are ranges that have associated string aliases. - * They can be viewed and edited via the Sheets UI under the - * Data > Named ranges... menu. + * Access and modify spreadsheet groups. Groups are an association between an interval of contiguous + * rows or columns that can be expanded or collapsed as a unit to hide/show the rows or columns. + * Each group has a control toggle on the row or column directly before or after the group + * (depending on settings) that can expand or collapse the group as a whole. + * + * The depth of a group refers to the nested position of the group and how many larger + * groups contain the group. The collapsed state of a group refers to whether the group + * should remain collapsed or expanded after a parent group has been expanded. Additionally, at the + * time that a group is collapsed or expanded, the rows or columns within the group are hidden or + * set visible, though individual rows or columns can be hidden or set visible irrespective of the + * collapsed state. + */ + export interface Group { + collapse(): Group; + expand(): Group; + getControlIndex(): Integer; + getDepth(): Integer; + getRange(): Range; + isCollapsed(): boolean; + remove(): void; + } + + /** + * An enumeration representing the possible positions that a group control toggle can have. + */ + export enum GroupControlTogglePosition { BEFORE, AFTER } + + /** + * An enumeration representing the interpolation options for calculating a value to be used in a + * GradientCondition in a ConditionalFormatRule. + */ + export enum InterpolationType { NUMBER, PERCENT, PERCENTILE, MIN, MAX } + + /** + * Create, access and modify named ranges in a spreadsheet. Named ranges are ranges that have + * associated string aliases. They can be viewed and edited via the Sheets UI under the Data > + * Named ranges... menu. */ export interface NamedRange { - /** - * Gets the name of this named range. - */ getName(): string; - /** - * Gets teh range referenced by this named range. - */ getRange(): Range; - /** - * Deletes this named range. - */ remove(): void; - /** - * Sets/updates the name of this named range. - */ setName(name: string): NamedRange; - /** - * Sets/updates the range for this named range. - */ setRange(range: Range): NamedRange; } /** - * @deprecated - * For spreadsheets created in the newer version of Google Sheets, use the more powerful - * Protection class instead. Although this class is deprecated, it will remain - * available for compatibility with the older version of Sheets. + * + * Deprecated. For spreadsheets created in the newer version of Google Sheets, use the more powerful + * Protection class instead. Although this class is deprecated, it remains available + * for compatibility with the older version of Sheets. * Access and modify protected sheets in the older version of Google Sheets. */ export interface PageProtection { @@ -688,48 +911,130 @@ declare namespace GoogleAppsScript { setProtected(protection: boolean): void; } + /** + * Access and modify pivot table filters. + */ + export interface PivotFilter { + getFilterCriteria(): FilterCriteria; + getPivotTable(): PivotTable; + getSourceDataColumn(): Integer; + remove(): void; + setFilterCriteria(filterCriteria: FilterCriteria): PivotFilter; + } + + /** + * Access and modify pivot table breakout groups. + */ + export interface PivotGroup { + addManualGroupingRule(groupName: string, groupMembers: Object[]): PivotGroup; + areLabelsRepeated(): boolean; + clearGroupingRule(): PivotGroup; + clearSort(): PivotGroup; + getDimension(): Dimension; + getIndex(): Integer; + getPivotTable(): PivotTable; + getSourceDataColumn(): Integer; + hideRepeatedLabels(): PivotGroup; + isSortAscending(): boolean; + moveToIndex(index: Integer): PivotGroup; + remove(): void; + removeManualGroupingRule(groupName: string): PivotGroup; + resetDisplayName(): PivotGroup; + setDisplayName(name: string): PivotGroup; + setHistogramGroupingRule(minValue: Integer, maxValue: Integer, intervalSize: Integer): PivotGroup; + showRepeatedLabels(): PivotGroup; + showTotals(showTotals: boolean): PivotGroup; + sortAscending(): PivotGroup; + sortBy(value: PivotValue, oppositeGroupValues: Object[]): PivotGroup; + sortDescending(): PivotGroup; + totalsAreShown(): boolean; + } + + /** + * Access and modify pivot tables. + */ + export interface PivotTable { + addCalculatedPivotValue(name: string, formula: string): PivotValue; + addColumnGroup(sourceDataColumn: Integer): PivotGroup; + addFilter(sourceDataColumn: Integer, filterCriteria: FilterCriteria): PivotFilter; + addPivotValue(sourceDataColumn: Integer, summarizeFunction: PivotTableSummarizeFunction): PivotValue; + addRowGroup(sourceDataColumn: Integer): PivotGroup; + getAnchorCell(): Range; + getColumnGroups(): PivotGroup[]; + getFilters(): PivotFilter[]; + getPivotValues(): PivotValue[]; + getRowGroups(): PivotGroup[]; + getValuesDisplayOrientation(): Dimension; + remove(): void; + setValuesDisplayOrientation(dimension: Dimension): PivotTable; + } + + /** + * An enumeration of functions that summarize pivot table data. + */ + export enum PivotTableSummarizeFunction { CUSTOM, SUM, COUNTA, COUNT, COUNTUNIQUE, AVERAGE, MAX, MIN, MEDIAN, PRODUCT, STDEV, STDEVP, VAR, VARP } + + /** + * Access and modify value groups in pivot tables. + */ + export interface PivotValue { + getDisplayType(): PivotValueDisplayType; + getFormula(): string; + getPivotTable(): PivotTable; + getSummarizedBy(): PivotTableSummarizeFunction; + setDisplayName(name: string): PivotValue; + setFormula(formula: string): PivotValue; + showAs(displayType: PivotValueDisplayType): PivotValue; + summarizeBy(summarizeFunction: PivotTableSummarizeFunction): PivotValue; + } + + /** + * An enumeration of ways to display a pivot value as a function of another value. + */ + export enum PivotValueDisplayType { DEFAULT, PERCENT_OF_ROW_TOTAL, PERCENT_OF_COLUMN_TOTAL, PERCENT_OF_GRAND_TOTAL } + /** * Access and modify protected ranges and sheets. A protected range can protect either a static - * range of cells or a named range. A protected sheet may include unprotected regions. For - * spreadsheets created with the older version of Google Sheets, use the PageProtection - * class instead. + * range of cells or a named range. A protected sheet may include unprotected regions. For + * spreadsheets created with the older version of Google Sheets, use the PageProtection + * class instead. * - * // Protect range A1:B10, then remove all other users from the list of editors. - * var ss = SpreadsheetApp.getActive(); - * var range = ss.getRange('A1:B10'); - * var protection = range.protect().setDescription('Sample protected range'); + * // Protect range A1:B10, then remove all other users from the list of editors. + * var ss = SpreadsheetApp.getActive(); + * var range = ss.getRange('A1:B10'); + * var protection = range.protect().setDescription('Sample protected range'); * - * // Ensure the current user is an editor before removing others. Otherwise, if the user's edit - * // permission comes from a group, the script will throw an exception upon removing the group. - * var me = Session.getEffectiveUser(); - * protection.addEditor(me); - * protection.removeEditors(protection.getEditors()); - * if (protection.canDomainEdit()) { - * protection.setDomainEdit(false); - * } + * // Ensure the current user is an editor before removing others. Otherwise, if the user's edit + * // permission comes from a group, the script throws an exception upon removing the group. + * var me = Session.getEffectiveUser(); + * protection.addEditor(me); + * protection.removeEditors(protection.getEditors()); + * if (protection.canDomainEdit()) { + * protection.setDomainEdit(false); + * } * - * // Remove all range protections in the spreadsheet that the user has permission to edit. - * var ss = SpreadsheetApp.getActive(); - * var protections = ss.getProtections(SpreadsheetApp.ProtectionType.RANGE); - * for (var i = 0; i < protections.length; i++) { - * var protection = protections[i]; - * if (protection.canEdit()) { - * protection.remove(); - * } - * } + * // Remove all range protections in the spreadsheet that the user has permission to edit. + * var ss = SpreadsheetApp.getActive(); + * var protections = ss.getProtections(SpreadsheetApp.ProtectionType.RANGE); + * for (var i = 0; i < protections.length; i++) { + * var protection = protections[i]; + * if (protection.canEdit()) { + * protection.remove(); + * } + * } * - * // Protect the active sheet, then remove all other users from the list of editors. - * var sheet = SpreadsheetApp.getActiveSheet(); - * var protection = sheet.protect().setDescription('Sample protected sheet'); + * // Protect the active sheet, then remove all other users from the list of editors. + * var sheet = SpreadsheetApp.getActiveSheet(); + * var protection = sheet.protect().setDescription('Sample protected sheet'); * - * // Ensure the current user is an editor before removing others. Otherwise, if the user's edit - * // permission comes from a group, the script will throw an exception upon removing the group. - * var me = Session.getEffectiveUser(); - * protection.addEditor(me); - * protection.removeEditors(protection.getEditors()); - * if (protection.canDomainEdit()) { - * protection.setDomainEdit(false); - * } + * // Ensure the current user is an editor before removing others. Otherwise, if the user's edit + * // permission comes from a group, the script throws an exception upon removing the group. + * var me = Session.getEffectiveUser(); + * protection.addEditor(me); + * protection.removeEditors(protection.getEditors()); + * if (protection.canDomainEdit()) { + * protection.setDomainEdit(false); + * } */ export interface Protection { addEditor(emailAddress: string): Protection; @@ -760,33 +1065,40 @@ declare namespace GoogleAppsScript { /** * An enumeration representing the parts of a spreadsheet that can be protected from edits. * - * // Remove all range protections in the spreadsheet that the user has permission to edit. - * var ss = SpreadsheetApp.getActive(); - * var protections = ss.getProtections(SpreadsheetApp.ProtectionType.RANGE); - * for (var i = 0; i < protections.length; i++) { - * var protection = protections[i]; - * if (protection.canEdit()) { - * protection.remove(); - * } - * } + * // Remove all range protections in the spreadsheet that the user has permission to edit. + * var ss = SpreadsheetApp.getActive(); + * var protections = ss.getProtections(SpreadsheetApp.ProtectionType.RANGE); + * for (var i = 0; i < protections.length; i++) { + * var protection = protections[i]; + * if (protection.canEdit()) { + * protection.remove(); + * } + * } * - * // Removes sheet protection from the active sheet, if the user has permission to edit it. - * var sheet = SpreadsheetApp.getActiveSheet(); - * var protection = sheet.getProtections(SpreadsheetApp.ProtectionType.SHEET)[0]; - * if (protection && protection.canEdit()) { - * protection.remove(); - * } + * // Removes sheet protection from the active sheet, if the user has permission to edit it. + * var sheet = SpreadsheetApp.getActiveSheet(); + * var protection = sheet.getProtections(SpreadsheetApp.ProtectionType.SHEET)[0]; + * if (protection && protection.canEdit()) { + * protection.remove(); + * } */ export enum ProtectionType { RANGE, SHEET } /** - * Access and modify spreadsheet ranges. - * - * This class allows users to access and modify ranges in Google Sheets. A range can be - * a single cell in a sheet or a range of cells in a sheet. + * Access and modify spreadsheet ranges. A range can be a single cell in a sheet or a group of + * adjacent cells in a sheet. */ export interface Range { activate(): Range; + activateAsCurrentCell(): Range; + applyColumnBanding(): Banding; + applyColumnBanding(bandingTheme: BandingTheme): Banding; + applyColumnBanding(bandingTheme: BandingTheme, showHeader: boolean, showFooter: boolean): Banding; + applyRowBanding(): Banding; + applyRowBanding(bandingTheme: BandingTheme): Banding; + applyRowBanding(bandingTheme: BandingTheme, showHeader: boolean, showFooter: boolean): Banding; + autoFill(destination: Range, series: AutoFillSeries): void; + autoFillToNeighbor(series: AutoFillSeries): void; breakApart(): Range; canEdit(): boolean; clear(): Range; @@ -795,18 +1107,24 @@ declare namespace GoogleAppsScript { clearDataValidations(): Range; clearFormat(): Range; clearNote(): Range; + collapseGroups(): Range; copyFormatToRange(gridId: Integer, column: Integer, columnEnd: Integer, row: Integer, rowEnd: Integer): void; copyFormatToRange(sheet: Sheet, column: Integer, columnEnd: Integer, row: Integer, rowEnd: Integer): void; copyTo(destination: Range): void; + copyTo(destination: Range, copyPasteType: CopyPasteType, transposed: boolean): void; 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; + createFilter(): Filter; + createPivotTable(sourceData: Range): PivotTable; + deleteCells(shiftDimension: Dimension): void; + expandGroups(): Range; getA1Notation(): string; getBackground(): string; getBackgrounds(): string[][]; + getBandings(): Banding[]; getCell(row: Integer, column: Integer): Range; getColumn(): Integer; - getColumnIndex(): Integer; getDataSourceUrl(): string; getDataTable(): Charts.DataTable; getDataTable(firstRowIsHeader: boolean): Charts.DataTable; @@ -814,6 +1132,7 @@ declare namespace GoogleAppsScript { getDataValidations(): DataValidation[][]; getDisplayValue(): string; getDisplayValues(): string[][]; + getFilter(): Filter; getFontColor(): string; getFontColors(): string[][]; getFontFamilies(): string[][]; @@ -837,6 +1156,7 @@ declare namespace GoogleAppsScript { getLastColumn(): Integer; getLastRow(): Integer; getMergedRanges(): Range[]; + getNextDataCell(direction: Direction): Range; getNote(): string; getNotes(): string[][]; getNumColumns(): Integer; @@ -846,13 +1166,20 @@ declare namespace GoogleAppsScript { getRow(): Integer; getRowIndex(): Integer; getSheet(): Sheet; + getTextDirection(): TextDirection; + getTextDirections(): TextDirection[][]; + getTextRotation(): TextRotation; + getTextRotations(): TextRotation[][]; getValue(): Object; getValues(): Object[][]; getVerticalAlignment(): string; getVerticalAlignments(): string[][]; getWidth(): Integer; getWrap(): boolean; + getWrapStrategies(): WrapStrategy[][]; + getWrapStrategy(): WrapStrategy; getWraps(): Boolean[][]; + insertCells(shiftDimension: Dimension): Range; isBlank(): boolean; isEndColumnBounded(): boolean; isEndRowBounded(): boolean; @@ -867,6 +1194,7 @@ declare namespace GoogleAppsScript { offset(rowOffset: Integer, columnOffset: Integer, numRows: Integer): Range; offset(rowOffset: Integer, columnOffset: Integer, numRows: Integer, numColumns: Integer): Range; protect(): Protection; + randomize(): Range; setBackground(color: string): Range; setBackgroundRGB(red: Integer, green: Integer, blue: Integer): Range; setBackgrounds(color: string[][]): Range; @@ -896,40 +1224,145 @@ declare namespace GoogleAppsScript { setNotes(notes: Object[][]): Range; setNumberFormat(numberFormat: string): Range; setNumberFormats(numberFormats: Object[][]): 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; setValue(value: Object): Range; setValues(values: Object[][]): Range; setVerticalAlignment(alignment: string): Range; setVerticalAlignments(alignments: Object[][]): Range; + setVerticalText(isVertical: boolean): Range; setWrap(isWrapEnabled: boolean): Range; + setWrapStrategies(strategies: WrapStrategy[][]): Range; + setWrapStrategy(strategy: WrapStrategy): Range; setWraps(isWrapEnabled: Object[][]): Range; + shiftColumnGroupDepth(delta: Integer): Range; + shiftRowGroupDepth(delta: Integer): Range; sort(sortSpecObj: Object): Range; + splitTextToColumns(): void; + splitTextToColumns(delimiter: string): void; + splitTextToColumns(delimiter: TextToColumnsDelimiter): void; } /** - * Access and modify spreadsheet sheets. Common operations - * are renaming a sheet and accessing range objects from the sheet. + * A collection of one or more Range instances in the same sheet. You can use this class + * to apply operations on collections of non-adjacent ranges or cells. + */ + export interface RangeList { + activate(): RangeList; + breakApart(): RangeList; + clear(): RangeList; + clear(options: Object): RangeList; + clearContent(): RangeList; + clearDataValidations(): RangeList; + clearFormat(): RangeList; + clearNote(): RangeList; + getRanges(): Range[]; + setBackground(color: string): RangeList; + setBackgroundRGB(red: Integer, green: Integer, blue: Integer): RangeList; + setBorder(top: boolean, left: boolean, bottom: boolean, right: boolean, vertical: boolean, horizontal: boolean): RangeList; + setBorder(top: boolean, left: boolean, bottom: boolean, right: boolean, vertical: boolean, horizontal: boolean, color: string, style: BorderStyle): RangeList; + setFontColor(color: string): RangeList; + setFontFamily(fontFamily: string): RangeList; + setFontLine(fontLine: string): RangeList; + setFontSize(size: Integer): RangeList; + setFontStyle(fontStyle: string): RangeList; + setFontWeight(fontWeight: string): RangeList; + setFormula(formula: string): RangeList; + setFormulaR1C1(formula: string): RangeList; + setHorizontalAlignment(alignment: string): RangeList; + setNote(note: string): RangeList; + setNumberFormat(numberFormat: string): RangeList; + setShowHyperlink(showHyperlink: boolean): RangeList; + setTextDirection(direction: TextDirection): RangeList; + setTextRotation(degrees: Integer): RangeList; + setValue(value: Object): RangeList; + setVerticalAlignment(alignment: string): RangeList; + setVerticalText(isVertical: boolean): RangeList; + setWrap(isWrapEnabled: boolean): RangeList; + setWrapStrategy(strategy: WrapStrategy): RangeList; + } + + /** + * An enumeration representing the relative date options for calculating a value to be used in + * date-based BooleanCriteria. + */ + export enum RelativeDate { TODAY, TOMORROW, YESTERDAY, PAST_WEEK, PAST_MONTH, PAST_YEAR } + + /** + * 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 + * current cell, where the user's current focus is. The current cell is highlighted with a + * darker border in the Google Sheets UI. + * + * var activeSheet = SpreadsheetApp.getActiveSheet(); + * var rangeList = activeSheet.getRangeList(['A1:B4', 'D1:E4']); + * rangeList.activate(); + * + * var selection = activeSheet.getSelection(); + * // Current Cell: D1 + * Logger.log('Current Cell: ' + selection.getCurrentCell().getA1Notation()); + * // Active Range: D1:E4 + * Logger.log('Active Range: ' + selection.getActiveRange().getA1Notation()); + * // Active Ranges: A1:B4, D1:E4 + * var ranges = selection.getActiveRangeList().getRanges(); + * for (var i = 0; i < ranges.length; i++) { + * Logger.log('Active Ranges: ' + ranges[i].getA1Notation()); + * } + * Logger.log('Active Sheet: ' + selection.getActiveSheet().getName()); + */ + export interface Selection { + getActiveRange(): Range; + getActiveRangeList(): RangeList; + getActiveSheet(): Sheet; + getCurrentCell(): Range; + getNextDataRange(direction: Direction): Range; + } + + /** + * Access and modify spreadsheet sheets. Common operations are renaming a sheet and accessing range + * objects from the sheet. */ export interface Sheet { activate(): Sheet; appendRow(rowContents: Object[]): Sheet; autoResizeColumn(columnPosition: Integer): Sheet; + autoResizeColumns(startColumn: Integer, numColumns: Integer): Sheet; + autoResizeRows(startRow: Integer, numRows: Integer): Sheet; clear(): Sheet; clear(options: Object): Sheet; clearConditionalFormatRules(): void; clearContents(): Sheet; clearFormats(): Sheet; clearNotes(): Sheet; + collapseAllColumnGroups(): Sheet; + collapseAllRowGroups(): Sheet; copyTo(spreadsheet: Spreadsheet): Sheet; deleteColumn(columnPosition: Integer): Sheet; deleteColumns(columnPosition: Integer, howMany: Integer): void; deleteRow(rowPosition: Integer): Sheet; deleteRows(rowPosition: Integer, howMany: Integer): void; + expandAllColumnGroups(): Sheet; + expandAllRowGroups(): Sheet; + expandColumnGroupsUpToDepth(groupDepth: Integer): Sheet; + expandRowGroupsUpToDepth(groupDepth: Integer): Sheet; getActiveCell(): Range; getActiveRange(): Range; + getActiveRangeList(): RangeList; + getBandings(): Banding[]; getCharts(): EmbeddedChart[]; + getColumnGroup(columnIndex: Integer, groupDepth: Integer): Group; + getColumnGroupControlPosition(): GroupControlTogglePosition; + getColumnGroupDepth(columnIndex: Integer): Integer; getColumnWidth(columnPosition: Integer): Integer; getConditionalFormatRules(): ConditionalFormatRule[]; + getCurrentCell(): Range; getDataRange(): Range; + getFilter(): Filter; + getFormUrl(): string; getFrozenColumns(): Integer; getFrozenRows(): Integer; getIndex(): Integer; @@ -940,16 +1373,23 @@ declare namespace GoogleAppsScript { getName(): string; getNamedRanges(): NamedRange[]; getParent(): Spreadsheet; + getPivotTables(): PivotTable[]; getProtections(type: ProtectionType): Protection[]; getRange(row: Integer, column: Integer): Range; getRange(row: Integer, column: Integer, numRows: Integer): Range; getRange(row: Integer, column: Integer, numRows: Integer, numColumns: Integer): Range; getRange(a1Notation: string): Range; + getRangeList(a1Notations: string[]): RangeList; + getRowGroup(rowIndex: Integer, groupDepth: Integer): Group; + getRowGroupControlPosition(): GroupControlTogglePosition; + getRowGroupDepth(rowIndex: Integer): Integer; getRowHeight(rowPosition: Integer): Integer; + getSelection(): Selection; getSheetId(): Integer; getSheetName(): string; getSheetValues(startRow: Integer, startColumn: Integer, numRows: Integer, numColumns: Integer): Object[][]; getTabColor(): string; + hasHiddenGridlines(): boolean; hideColumn(column: Range): void; hideColumns(columnIndex: Integer): void; hideColumns(columnIndex: Integer, numColumns: Integer): void; @@ -964,8 +1404,8 @@ declare namespace GoogleAppsScript { insertColumns(columnIndex: Integer, numColumns: Integer): void; insertColumnsAfter(afterPosition: Integer, howMany: Integer): Sheet; insertColumnsBefore(beforePosition: Integer, howMany: Integer): Sheet; - insertImage(blob: Base.Blob, column: Integer, row: Integer): void; - insertImage(blob: Base.Blob, column: Integer, row: Integer, offsetX: Integer, offsetY: Integer): void; + 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; insertRowAfter(afterPosition: Integer): Sheet; @@ -974,20 +1414,30 @@ declare namespace GoogleAppsScript { insertRows(rowIndex: Integer, numRows: Integer): void; insertRowsAfter(afterPosition: Integer, howMany: Integer): Sheet; insertRowsBefore(beforePosition: Integer, howMany: Integer): Sheet; + isRightToLeft(): boolean; isSheetHidden(): boolean; + moveColumns(columnSpec: Range, destinationIndex: Integer): void; + moveRows(rowSpec: Range, destinationIndex: Integer): void; newChart(): EmbeddedChartBuilder; protect(): Protection; removeChart(chart: EmbeddedChart): void; setActiveRange(range: Range): Range; + setActiveRangeList(rangeList: RangeList): RangeList; setActiveSelection(range: Range): Range; setActiveSelection(a1Notation: string): Range; + setColumnGroupControlPosition(position: GroupControlTogglePosition): Sheet; setColumnWidth(columnPosition: Integer, width: Integer): Sheet; - setConditionalFormatRules(rules: ReadonlyArray): void; - setCurrentCell(cell: Range): void; + setColumnWidths(startColumn: Integer, numColumns: Integer, width: Integer): Sheet; + setConditionalFormatRules(rules: ConditionalFormatRule[]): void; + setCurrentCell(cell: Range): Range; setFrozenColumns(columns: Integer): void; setFrozenRows(rows: Integer): void; + setHiddenGridlines(hideGridlines: boolean): Sheet; setName(name: string): Sheet; + setRightToLeft(rightToLeft: boolean): Sheet; + setRowGroupControlPosition(position: GroupControlTogglePosition): Sheet; setRowHeight(rowPosition: Integer, height: Integer): Sheet; + setRowHeights(startRow: Integer, numRows: Integer, height: Integer): Sheet; setTabColor(color: string): Sheet; showColumns(columnIndex: Integer): void; showColumns(columnIndex: Integer, numColumns: Integer): void; @@ -1004,8 +1454,8 @@ declare namespace GoogleAppsScript { } /** - * This class allows users to access and modify Google Sheets files. Common operations are adding - * new sheets and adding collaborators. + * Access and modify Google Sheets files. Common operations are adding new sheets and adding + * collaborators. */ export interface Spreadsheet { addEditor(emailAddress: string): Spreadsheet; @@ -1027,10 +1477,13 @@ declare namespace GoogleAppsScript { duplicateActiveSheet(): Sheet; getActiveCell(): Range; getActiveRange(): Range; + getActiveRangeList(): RangeList; getActiveSheet(): Sheet; getAs(contentType: string): Base.Blob; + getBandings(): Banding[]; getBlob(): Base.Blob; getColumnWidth(columnPosition: Integer): Integer; + getCurrentCell(): Range; getDataRange(): Range; getEditors(): Base.User[]; getFormUrl(): string; @@ -1046,7 +1499,9 @@ declare namespace GoogleAppsScript { getProtections(type: ProtectionType): Protection[]; getRange(a1Notation: string): Range; getRangeByName(name: string): Range; + getRangeList(a1Notations: string[]): RangeList; getRowHeight(rowPosition: Integer): Integer; + getSelection(): Selection; getSheetByName(name: string): Sheet; getSheetId(): Integer; getSheetName(): string; @@ -1062,8 +1517,8 @@ declare namespace GoogleAppsScript { insertColumnBefore(beforePosition: Integer): Sheet; insertColumnsAfter(afterPosition: Integer, howMany: Integer): Sheet; insertColumnsBefore(beforePosition: Integer, howMany: Integer): Sheet; - insertImage(blob: Base.Blob, column: Integer, row: Integer): void; - insertImage(blob: Base.Blob, column: Integer, row: Integer, offsetX: Integer, offsetY: Integer): void; + 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; insertRowAfter(afterPosition: Integer): Sheet; @@ -1088,10 +1543,13 @@ declare namespace GoogleAppsScript { rename(newName: string): void; renameActiveSheet(newName: string): void; setActiveRange(range: Range): Range; + setActiveRangeList(rangeList: RangeList): RangeList; setActiveSelection(range: Range): Range; setActiveSelection(a1Notation: string): Range; setActiveSheet(sheet: Sheet): Sheet; + setActiveSheet(sheet: Sheet, restoreSelection: boolean): Sheet; setColumnWidth(columnPosition: Integer, width: Integer): Sheet; + setCurrentCell(cell: Range): Range; setFrozenColumns(columns: Integer): void; setFrozenRows(rows: Integer): void; setNamedRange(name: string, range: Range): void; @@ -1115,478 +1573,76 @@ declare namespace GoogleAppsScript { } /** - * This class allows users to open Google Sheets files and to create new ones. This class is - * the parent class for the Spreadsheet service. + * Access and create Google Sheets files. This class is the parent class for the Spreadsheet service. */ export interface SpreadsheetApp { - /** - * An enumeration of the valid styles for setting borders on a Range. - */ - BorderStyle: typeof BorderStyle; - /** - * An enumeration representing the data-validation criteria that can be set on a range. - */ - DataValidationCriteria: typeof DataValidationCriteria; - /** - * An enumeration representing the interpolation options for calculating a value to be used in a GradientCondition in a ConditionalFormatRule. - */ - InterpolationType: typeof InterpolationType; - /** - * An enumeration representing the boolean criteria that can be used in conditional format or filter. - */ + AutoFillSeries: typeof AutoFillSeries; + BandingTheme: typeof BandingTheme; BooleanCriteria: typeof BooleanCriteria; - /** - * An enumeration representing the parts of a spreadsheet that can be protected from edits. - */ + BorderStyle: typeof BorderStyle; + CopyPasteType: typeof CopyPasteType; + DataValidationCriteria: typeof DataValidationCriteria; + Dimension: typeof Dimension; + Direction: typeof Direction; + GroupControlTogglePosition: typeof GroupControlTogglePosition; + InterpolationType: typeof InterpolationType; + PivotTableSummarizeFunction: typeof PivotTableSummarizeFunction; + PivotValueDisplayType: typeof PivotValueDisplayType; ProtectionType: typeof ProtectionType; - /** - * Creates a new spreadsheet with the given name. - */ + RelativeDate: typeof RelativeDate; + TextDirection: typeof TextDirection; + TextToColumnsDelimiter: typeof TextToColumnsDelimiter; + WrapStrategy: typeof WrapStrategy; create(name: string): Spreadsheet; - /** - * Creates a new spreadsheet with the given name and the specified number of rows and columns. - */ create(name: string, rows: Integer, columns: Integer): Spreadsheet; - /** - * Applies all pending Spreadsheet changes. - */ flush(): void; - /** - * Returns the currently active spreadsheet, or null if there is none. - */ - getActive(): Spreadsheet | null; - /** - * Returns the range of cells that is currently considered active. - */ + getActive(): Spreadsheet; getActiveRange(): Range; - /** - * Gets the active sheet in a spreadsheet. - */ + getActiveRangeList(): RangeList; getActiveSheet(): Sheet; - /** - * Returns the currently active spreadsheet, or null if there is none. - */ - getActiveSpreadsheet(): Spreadsheet | null; - /** - * Returns an instance of the spreadsheet's user-interface environment that allows the script to add features like menus, dialogs, and sidebars. - */ + getActiveSpreadsheet(): Spreadsheet; + getCurrentCell(): Range; + getSelection(): Selection; getUi(): Base.Ui; - /** - * Creates a builder for a data-validation rule. - */ - newDataValidation(): DataValidationBuilder; - /** - * Opens the spreadsheet that corresponds to the given File object. - */ - open(file: Drive.File): Spreadsheet; - /** - * Opens the spreadsheet with the given ID. - */ - openById(id: string): Spreadsheet; - /** - * Opens the spreadsheet with the given url. - */ - openByUrl(url: string): Spreadsheet; - /** - * Sets the active range for the application. - */ - setActiveRange(range: Range): Range; - /** - * Sets the active sheet in a spreadsheet. - */ - setActiveSheet(sheet: Sheet): Sheet; - /** - * Sets the active spreadsheet. - */ - setActiveSpreadsheet(newActiveSpreadsheet: Spreadsheet): void; - /** - * Creates a builder for a conditional formatting rule. - */ newConditionalFormatRule(): ConditionalFormatRuleBuilder; + newDataValidation(): DataValidationBuilder; + newFilterCriteria(): FilterCriteriaBuilder; + open(file: Drive.File): Spreadsheet; + openById(id: string): Spreadsheet; + openByUrl(url: string): Spreadsheet; + setActiveRange(range: Range): Range; + setActiveRangeList(rangeList: RangeList): RangeList; + setActiveSheet(sheet: Sheet): Sheet; + setActiveSheet(sheet: Sheet, restoreSelection: boolean): Sheet; + setActiveSpreadsheet(newActiveSpreadsheet: Spreadsheet): void; + setCurrentCell(cell: Range): Range; } /** - * Access conditional formatting rules. To create a new rule, use SpreadsheetApp.newConditionalFormatRule() and - * ConditionalFormatRuleBuilder. You can use Sheet.setConditionalFormatRules(rules) to set the rules for a given - * sheet. + * An enumerations of text directions. */ - export interface ConditionalFormatRule { - /** - * Returns a rule builder preset with this rule's settings. - */ - copy(): ConditionalFormatRuleBuilder; + export enum TextDirection { LEFT_TO_RIGHT, RIGHT_TO_LEFT } - /** - * Retrieves the rule's BooleanCondition information if this rule uses boolean condition criteria. - */ - getBooleanCondition(): BooleanCondition; - - /** - * Retrieves the rule's GradientCondition information, if this rule uses gradient condition criteria. - */ - getGradientCondition(): GradientCondition; - - /** - * Retrieves the ranges to which this conditional format rule is applied. - */ - getRanges(): Range[]; + /** + * Access the text rotation settings for a cell. + */ + export interface TextRotation { + getDegrees(): Integer; + isVertical(): boolean; } /** - * Builder for conditional format rules. + * An enumeration of the types of preset delimiters that can split a column of text into multiple + * columns. */ - export interface ConditionalFormatRuleBuilder { - - /** - * Constructs a conditional format rule from the settings applied to the builder. - */ - build(): ConditionalFormatRule; - - /** - * Returns a rule builder preset with this rule's settings. - */ - copy(): ConditionalFormatRuleBuilder; - - /** - * Retrieves the rule's BooleanCondition information if this rule uses boolean condition criteria. - */ - getBooleanCondition(): BooleanCondition; - - /** - * Retrieves the rule's GradientCondition information, if this rule uses gradient condition criteria. - */ - getGradientCondition(): GradientCondition; - - /** - * Retrieves the ranges to which this conditional format rule is applied. - */ - getRanges(): Range[]; - - /** - * Sets the background color for the conditional format rule's format. - */ - setBackground(color: string): ConditionalFormatRuleBuilder; - - /** - * Sets text bolding for the conditional format rule's format. - */ - setBold(bold: boolean): ConditionalFormatRuleBuilder; - - /** - * Sets the font color for the conditional format rule's format. - */ - setFontColor(color: string): ConditionalFormatRuleBuilder; - - /** - * Clears the conditional format rule's gradient maxpoint value, and instead uses the maximum value in the rule's ranges. - */ - setGradientMaxpoint(color: string): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule's gradient maxpoint fields. - */ - setGradientMaxpointWithValue(color: string, type: InterpolationType, value: string): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule's gradient midpoint fields. - */ - setGradientMidpointWithValue(color: string, type: InterpolationType, value: string): ConditionalFormatRuleBuilder; - - /** - * Clears the conditional format rule's gradient minpoint value, and instead uses the minimum value in the rule's ranges. - */ - setGradientMinpoint(color: string): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule's gradient minpoint fields. - */ - setGradientMinpointWithValue(color: string, type: InterpolationType, value: string): ConditionalFormatRuleBuilder; - - /** - * Sets text italics for the conditional format rule's format. - */ - setItalic(italic: boolean): ConditionalFormatRuleBuilder; - - /** - * Sets one or more ranges to which this conditional format rule is applied. - */ - setRanges(ranges: ReadonlyArray): ConditionalFormatRuleBuilder; - - /** - * Sets text strikethrough for the conditional format rule's format. - */ - setStrikethrough(strikethrough: boolean): ConditionalFormatRuleBuilder; - - /** - * Sets text underlining for the conditional format rule's format. - */ - setUnderline(underline: boolean): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule to trigger when the cell is empty. - */ - whenCellEmpty(): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule to trigger when the cell is not empty. - */ - whenCellNotEmpty(): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule to trigger when a date is after the given value. - */ - whenDateAfter(date: Date): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule to trigger when a date is after the given relative date. - */ - whenDateAfter(date: Date): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule to trigger when a date is before the given date. - */ - whenDateBefore(date: Date): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule to trigger when a date is before the given relative date. - */ - whenDateBefore(date: Date): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule to trigger when a date is equal to the given date. - */ - whenDateEqualTo(date: Date): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule to trigger when a date is equal to the given relative date. - */ - whenDateEqualTo(date: Date): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule to trigger when that the given formula evaluates to true. - */ - whenFormulaSatisfied(formula: string): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule to trigger when a number falls between, or is either of, two specified values. - */ - whenNumberBetween(start: number, end: number): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule to trigger when a number is equal to the given value. - */ - whenNumberEqualTo(number: number): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule to trigger when a number is greater than the given value. - */ - whenNumberGreaterThan(number: number): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule to trigger when a number is greater than or equal to the given value. - */ - whenNumberGreaterThanOrEqualTo(number: number): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional conditional format rule to trigger when a number less than the given value. - */ - whenNumberLessThan(number: number): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule to trigger when a number less than or equal to the given value. - */ - whenNumberLessThanOrEqualTo(number: number): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule to trigger when a number does not fall between, and is neither of, two specified values. - */ - whenNumberNotBetween(start: number, end: number): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule to trigger when a number is not equal to the given value. - */ - whenNumberNotEqualTo(number: number): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule to trigger when that the input contains the given value. - */ - whenTextContains(text: string): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule to trigger when that the input does not contain the given value. - */ - whenTextDoesNotContain(text: string): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule to trigger when that the input ends with the given value. - */ - whenTextEndsWith(text: string): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule to trigger when that the input is equal to the given value. - */ - whenTextEqualTo(text: string): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule to trigger when that the input starts with the given value. - */ - whenTextStartsWith(text: string): ConditionalFormatRuleBuilder; - - /** - * Sets the conditional format rule to criteria defined by BooleanCriteria values, typically taken from the criteria and arguments of an existing rule. - */ - withCriteria(criteria: BooleanCriteria, args: ReadonlyArray): ConditionalFormatRuleBuilder; - } + export enum TextToColumnsDelimiter { COMMA, SEMICOLON, PERIOD, SPACE } /** - * An enumeration representing the boolean criteria that can be used in conditional format or filter. + * An enumeration of the strategies used to handle cell text wrapping. */ - export enum BooleanCriteria { - /** - * The criteria is met when a cell is empty. - */ - CELL_EMPTY, + export enum WrapStrategy { WRAP, OVERFLOW, CLIP } - /** - * The criteria is met when a cell is not empty. - */ - CELL_NOT_EMPTY, - - /** - * The criteria is met when a date is after the given value. - */ - DATE_AFTER, - - /** - * The criteria is met when a date is before the given value. - */ - DATE_BEFORE, - - /** - * The criteria is met when a date is equal to the given value. - */ - DATE_EQUAL_TO, - - /** - * The criteria is met when a date is after the relative date value. - */ - DATE_AFTER_RELATIVE, - - /** - * The criteria is met when a date is before the relative date value. - */ - DATE_BEFORE_RELATIVE, - - /** - * The criteria is met when a date is equal to the relative date value. - */ - DATE_EQUAL_TO_RELATIVE, - - /** - * The criteria is met when a number that is between the given values. - */ - NUMBER_BETWEEN, - - /** - * The criteria is met when a number that is equal to the given value. - */ - NUMBER_EQUAL_TO, - - /** - * The criteria is met when a number that is greater than the given value. - */ - NUMBER_GREATER_THAN, - - /** - * The criteria is met when a number that is greater than or equal to the given value. - */ - NUMBER_GREATER_THAN_OR_EQUAL_TO, - - /** - * The criteria is met when a number that is less than the given value. - */ - NUMBER_LESS_THAN, - - /** - * The criteria is met when a number that is less than or equal to the given value. - */ - NUMBER_LESS_THAN_OR_EQUAL_TO, - - /** - * The criteria is met when a number that is not between the given values. - */ - NUMBER_NOT_BETWEEN, - - /** - * The criteria is met when a number that is not equal to the given value. - */ - NUMBER_NOT_EQUAL_TO, - - /** - * The criteria is met when the input contains the given value. - */ - TEXT_CONTAINS, - - /** - * The criteria is met when the input does not contain the given value. - */ - TEXT_DOES_NOT_CONTAIN, - - /** - * The criteria is met when the input is equal to the given value. - */ - TEXT_EQUAL_TO, - - /** - * The criteria is met when the input begins with the given value. - */ - TEXT_STARTS_WITH, - - /** - * The criteria is met when the input ends with the given value. - */ - TEXT_ENDS_WITH, - - /** - * The criteria is met when the input makes the given formula evaluate to true. - */ - CUSTOM_FORMULA - } - - /** - * An enumeration representing the interpolation options for calculating a value to be used in a GradientCondition in a ConditionalFormatRule. - */ - export enum InterpolationType { - /** - * Use the number as as specific interpolation point for a gradient condition. - */ - NUMBER, - - /** - * Use the number as a percentage interpolation point for a gradient condition. - */ - PERCENT, - - /** - * Use the number as a percentile interpolation point for a gradient condition. - */ - PERCENTILE, - - /** - * Infer the minimum number as a specific interpolation point for a gradient condition. - */ - MIN, - - /** - * Infer the maximum number as a specific interpolation point for a gradient condition. - */ - MAX - } } } -/** - * This class allows users to open Google Sheets files and to create new ones. This class is - * the parent class for the Spreadsheet service. - */ declare var SpreadsheetApp: GoogleAppsScript.Spreadsheet.SpreadsheetApp; diff --git a/types/google-apps-script/google-apps-script.ui.d.ts b/types/google-apps-script/google-apps-script.ui.d.ts index f44218a866..b2bb57bc2e 100644 --- a/types/google-apps-script/google-apps-script.ui.d.ts +++ b/types/google-apps-script/google-apps-script.ui.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,26 +10,23 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * An absolute panel positions all of its children absolutely, allowing them to overlap. * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * var button = app.createButton("a button"); - * var panel = app.createAbsolutePanel(); - * // add a widget at position (10, 20) - * panel.add(button, 10, 20); - * app.add(panel); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * var button = app.createButton("a button"); + * var panel = app.createAbsolutePanel(); + * // add a widget at position (10, 20) + * panel.add(button, 10, 20); + * app.add(panel); + * return app; + * } * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the AbsolutePanel documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the AbsolutePanel documentation here. */ export interface AbsolutePanel { add(widget: Widget): AbsolutePanel; @@ -61,27 +58,24 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A widget that represents a simple element. That is, a hyperlink to a different page. * - * By design, these hyperlinks always open in a new page. Links that reload the current page are - * not allowed. + * By design, these hyperlinks always open in a new page. Links that reload the current page are + * not allowed. * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * // Creates a link to your favorite search engine. - * var anchor = app.createAnchor("a link", "http://www.google.com"); - * app.add(anchor); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * // Creates a link to your favorite search engine. + * var anchor = app.createAnchor("a link", "http://www.google.com"); + * app.add(anchor); + * return app; + * } * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the Anchor documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the Anchor documentation here. */ export interface Anchor { addBlurHandler(handler: Handler): Anchor; @@ -131,31 +125,28 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A standard push-button widget. * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * // create a button and give it a click handler - * var button = app.createButton("click me!").setId("button"); - * button.addClickHandler(app.createServerHandler("handlerFunction")); - * app.add(button); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * // create a button and give it a click handler + * var button = app.createButton("click me!").setId("button"); + * button.addClickHandler(app.createServerHandler("handlerFunction")); + * app.add(button); + * return app; + * } * - * function handlerFunction(eventInfo) { - * var app = UiApp.getActiveApplication(); - * app.getElementById("button").setText("I was clicked!"); - * return app; - * } + * function handlerFunction(eventInfo) { + * var app = UiApp.getActiveApplication(); + * app.getElementById("button").setText("I was clicked!"); + * return app; + * } * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the Button documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the Button documentation here. */ export interface Button { addBlurHandler(handler: Handler): Button; @@ -199,31 +190,28 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. + * A panel that wraps its contents in a border with a caption that appears in the upper left corner + * of the border. This is an implementation of the fieldset HTML element. * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. - * A panel that wraps its contents in a border with a caption that appears in the upper left - * corner of the border. This is an implementation of the fieldset HTML element. + * Note that this panel can contain at most one direct child widget. To add more children, make + * the child of this panel a different panel that can contain more than one child. * - * Note that this panel can contain at most one direct child widget. To add more children, make the - * child of this panel a different panel that can contain more than one child. + * Note also that the placement of the caption in a caption panel will vary slightly from browser + * to browser, so this widget is not a good choice when precise cross-browser layout is needed. * - * Note also that the placement of the caption in a caption panel will vary slightly from browser to - * browser, so this widget is not a good choice when precise cross-browser layout is needed. + * Here is an example of how to use this widget: * - * Here is an example of how to use this widget: + * function doGet() { + * var app = UiApp.createApplication(); + * var panel = app.createCaptionPanel("my caption!"); + * panel.add(app.createButton("a button inside...")); + * app.add(panel); + * return app; + * } * - * function doGet() { - * var app = UiApp.createApplication(); - * var panel = app.createCaptionPanel("my caption!"); - * panel.add(app.createButton("a button inside...")); - * app.add(panel); - * return app; - * } - * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the CaptionPanel documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the CaptionPanel documentation here. */ export interface CaptionPanel { add(widget: Widget): CaptionPanel; @@ -255,30 +243,27 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A standard check box widget. * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * var handler = app.createServerHandler("change"); - * var check = app.createCheckBox("click me").addValueChangeHandler(handler); - * app.add(check); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * var handler = app.createServerHandler("change"); + * var check = app.createCheckBox("click me").addValueChangeHandler(handler); + * app.add(check); + * return app; + * } * - * function change() { - * var app = UiApp.getActiveApplication(); - * app.add(app.createLabel("The value changed!")); - * return app; - * } + * function change() { + * var app = UiApp.getActiveApplication(); + * app.add(app.createLabel("The value changed!")); + * return app; + * } * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the CheckBox documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the CheckBox documentation here. */ export interface CheckBox { addBlurHandler(handler: Handler): CheckBox; @@ -327,45 +312,43 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. + * An event handler that runs in the user's browser without needing a call back to the server. These + * will, in general, run much faster than ServerHandlers but they are also more limited in + * what they can do. * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. - * An event handler that runs in the user's browser without needing a call back to the server. - * These will, in general, run much faster than ServerHandlers but they are also more - * limited in what they can do. + * Any method that accepts a "Handler" parameter can accept a ClientHandler. * - * Any method that accepts a "Handler" parameter can accept a ClientHandler. + * If you set validators on a ClientHandler, they will be checked before the handler performs its + * actions. The actions will only be performed if the validators succeed. * - * If you set validators on a ClientHandler, they will be checked before the handler performs its - * actions. The actions will only be performed if the validators succeed. + * If you have multiple ClientHandlers for the same event on the same widget, they will perform + * their actions in the order that they were added. * - * If you have multiple ClientHandlers for the same event on the same widget, they will perform - * their actions in the order that they were added. + * An example of using client handlers: * - * An example of using client handlers: + * function doGet() { + * var app = UiApp.createApplication(); + * var button = app.createButton("Say Hello"); * - * function doGet() { - * var app = UiApp.createApplication(); - * var button = app.createButton("Say Hello"); + * // Create a label with the "Hello World!" text and hide it for now + * var label = app.createLabel("Hello World!").setVisible(false); * - * // Create a label with the "Hello World!" text and hide it for now - * var label = app.createLabel("Hello World!").setVisible(false); + * // Create a new handler that does not require the server. + * // We give the handler two actions to perform on different targets. + * // The first action disables the widget that invokes the handler + * // and the second displays the label. + * var handler = app.createClientHandler() + * .forEventSource().setEnabled(false) + * .forTargets(label).setVisible(true); * - * // Create a new handler that does not require the server. - * // We give the handler two actions to perform on different targets. - * // The first action disables the widget that invokes the handler - * // and the second displays the label. - * var handler = app.createClientHandler() - * .forEventSource().setEnabled(false) - * .forTargets(label).setVisible(true); + * // Add our new handler to be invoked when the button is clicked + * button.addClickHandler(handler); * - * // Add our new handler to be invoked when the button is clicked - * button.addClickHandler(handler); - * - * app.add(button); - * app.add(label); - * return app; - * } + * app.add(button); + * app.add(label); + * return app; + * } */ export interface ClientHandler { forEventSource(): ClientHandler; @@ -407,9 +390,7 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A generic component object. * Implementing classes * @@ -421,8 +402,8 @@ declare namespace GoogleAppsScript { * * ButtonA standard push-button widget. * - * CaptionPanelA panel that wraps its contents in a border with a caption that appears in the upper left - * corner of the border. + * CaptionPanelA panel that wraps its contents in a border with a caption that appears in the upper left corner + * of the border. * * ChartA Chart object, which can be embedded into documents, UI elements, or used as a static image. * @@ -432,29 +413,28 @@ declare namespace GoogleAppsScript { * * ControlA user interface control object, that drives the data displayed by a DashboardPanel. * - * DashboardPanelA dashboard is a visual structure that enables the organization and management - * of multiple charts that share the same underlying data. + * DashboardPanelA dashboard is a visual structure that enables the organization and management of multiple charts + * that share the same underlying data. * * DateBoxA text box that shows a DatePicker when the user focuses on it. * * DatePickerA date picker widget. * * DecoratedStackPanelA StackPanel that wraps each item in a 2x3 grid (six box), which allows users to add - * rounded corners. + * rounded corners. * * DecoratedTabBarA TabBar that wraps each tab in a 2x3 grid (six box), which allows users to add rounded corners. * * DecoratedTabPanelA TabPanel that uses a DecoratedTabBar with rounded corners. * * DecoratorPanelA SimplePanel that wraps its contents in stylized boxes, which can be used to add rounded - * corners to a Widget. + * corners to a Widget. * - * DialogBoxA form of popup that has a caption area at the top and can be dragged by the - * user. + * DialogBoxA form of popup that has a caption area at the top and can be dragged by the user. * * DocsListDialogA "file-open" dialog for Google Drive. * - * EmbeddedChartRepresents a chart that has been embedded into a Spreadsheet. + * EmbeddedChartRepresents a chart that has been embedded into a spreadsheet. * * FileUploadA widget that wraps the HTML element. * @@ -463,7 +443,7 @@ declare namespace GoogleAppsScript { * FlowPanelA panel that formats its child widgets using the default HTML layout behavior. * * FocusPanelA simple panel that makes its contents focusable, and adds the ability to catch mouse and - * keyboard events. + * keyboard events. * * FormPanelA panel that wraps its contents in an HTML
element. * @@ -474,7 +454,7 @@ declare namespace GoogleAppsScript { * HandlerBase interface for client and server handlers. * * HiddenRepresents a hidden field for storing data in the user's browser that can be passed back to a - * handler as a "callback element". + * handler as a "callback element". * * HorizontalPanelA panel that lays all of its widgets out in a single horizontal column. * @@ -484,8 +464,8 @@ declare namespace GoogleAppsScript { * * LabelA widget that contains arbitrary text, not interpreted as HTML. * - * ListBoxA widget that presents a list of choices to the user, either as a list box or - * as a drop-down list. + * ListBoxA widget that presents a list of choices to the user, either as a list box or as a drop-down + * list. * * MenuBarA standard menu bar widget. * @@ -502,7 +482,7 @@ declare namespace GoogleAppsScript { * RadioButtonA mutually-exclusive selection radio button widget. * * ResetButtonA standard push-button widget which will automatically reset its enclosing FormPanel if - * any. + * any. * * ScrollPanelA panel that wraps its contents in a scrollable element. * @@ -516,26 +496,25 @@ declare namespace GoogleAppsScript { * * SplitLayoutPanelA panel that adds user-positioned splitters between each of its child widgets. * - * StackPanelA panel that stacks its children vertically, displaying only one at a time, - * with a header for each child which the user can click to display. + * StackPanelA panel that stacks its children vertically, displaying only one at a time, with a header for + * each child which the user can click to display. * * SubmitButtonA standard push-button widget which will automatically submit its enclosing FormPanel if - * any. + * any. * - * SuggestBoxA SuggestBox is a text box or text area which displays a - * pre-configured set of selections that match the user's input. + * SuggestBoxA SuggestBox is a text box or text area which displays a pre-configured set of selections + * that match the user's input. * * TabBarA horizontal bar of folder-style tabs, most commonly used as part of a TabPanel. * - * TabPanelA panel that represents a tabbed set of pages, each of which contains another - * widget. + * TabPanelA panel that represents a tabbed set of pages, each of which contains another widget. * * TextAreaA text box that allows multiple lines of text to be entered. * * TextBoxA standard single-line text box. * - * ToggleButtonA ToggleButton is a stylish stateful button which allows the - * user to toggle between up and down states. + * ToggleButtonA ToggleButton is a stylish stateful button which allows the user to toggle between + * up and down states. * * TreeA standard hierarchical tree widget. * @@ -553,31 +532,28 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A text box that shows a DatePicker when the user focuses on it. * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * var handler = app.createServerHandler("change"); - * var dateBox = app.createDateBox().addValueChangeHandler(handler).setId("datebox"); - * app.add(dateBox); + * function doGet() { + * var app = UiApp.createApplication(); + * var handler = app.createServerHandler("change"); + * var dateBox = app.createDateBox().addValueChangeHandler(handler).setId("datebox"); + * app.add(dateBox); + * return app; + * } + * + * function change(eventInfo) { + * var app = UiApp.getActiveApplication(); + * app.add(app.createLabel("The value of the date box changed to " + + * eventInfo.parameter.datebox)); * return app; * } * - * function change(eventInfo) { - * var app = UiApp.getActiveApplication(); - * app.add(app.createLabel("The value of the date box changed to " + - * eventInfo.parameter.datebox)); - * return app; - * } - * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the DateBox documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the DateBox documentation here. */ export interface DateBox { addStyleDependentName(styleName: string): DateBox; @@ -614,31 +590,28 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A date picker widget. * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * var handler = app.createServerHandler("change"); - * var picker = app.createDatePicker().addValueChangeHandler(handler).setId("picker"); - * app.add(picker); + * function doGet() { + * var app = UiApp.createApplication(); + * var handler = app.createServerHandler("change"); + * var picker = app.createDatePicker().addValueChangeHandler(handler).setId("picker"); + * app.add(picker); + * return app; + * } + * + * function change(eventInfo) { + * var app = UiApp.getActiveApplication(); + * app.add(app.createLabel("The value of the date picker changed to " + + * eventInfo.parameter.picker)); * return app; * } * - * function change(eventInfo) { - * var app = UiApp.getActiveApplication(); - * app.add(app.createLabel("The value of the date picker changed to " + - * eventInfo.parameter.picker)); - * return app; - * } - * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the DatePicker documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the DatePicker documentation here. */ export interface DatePicker { addStyleDependentName(styleName: string): DatePicker; @@ -668,30 +641,24 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. + * Date and time format constants for widgets such as DateBox. * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. - * Date and time format constants for widgets such as - * DateBox. - * - * These correspond to the predefined constants from the Google Web Toolkit. You can read - * more about these constants - * here. + * These correspond to the predefined constants from the Google Web Toolkit. You can read more + * about these constants + * here. */ export enum DateTimeFormat { ISO_8601, RFC_2822, DATE_FULL, DATE_LONG, DATE_MEDIUM, DATE_SHORT, TIME_FULL, TIME_LONG, TIME_MEDIUM, TIME_SHORT, DATE_TIME_FULL, DATE_TIME_LONG, DATE_TIME_MEDIUM, DATE_TIME_SHORT, DAY, HOUR_MINUTE, HOUR_MINUTE_SECOND, HOUR24_MINUTE, HOUR24_MINUTE_SECOND, MINUTE_SECOND, MONTH, MONTH_ABBR, MONTH_ABBR_DAY, MONTH_DAY, MONTH_NUM_DAY, MONTH_WEEKDAY_DAY, YEAR, YEAR_MONTH, YEAR_MONTH_ABBR, YEAR_MONTH_ABBR_DAY, YEAR_MONTH_DAY, YEAR_MONTH_NUM, YEAR_MONTH_NUM_DAY, YEAR_MONTH_WEEKDAY_DAY, YEAR_QUARTER, YEAR_QUARTER_ABBR } /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A StackPanel that wraps each item in a 2x3 grid (six box), which allows users to add - * rounded corners. + * rounded corners. * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the DecoratedStackPanel documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the DecoratedStackPanel documentation here. */ export interface DecoratedStackPanel { add(widget: Widget): DecoratedStackPanel; @@ -725,14 +692,11 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A TabBar that wraps each tab in a 2x3 grid (six box), which allows users to add rounded corners. * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the DecoratedTabBar documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the DecoratedTabBar documentation here. */ export interface DecoratedTabBar { addBeforeSelectionHandler(handler: Handler): DecoratedTabBar; @@ -766,14 +730,11 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A TabPanel that uses a DecoratedTabBar with rounded corners. * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the DecoratedTabPanel documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the DecoratedTabPanel documentation here. */ export interface DecoratedTabPanel { add(widget: Widget): DecoratedTabPanel; @@ -807,18 +768,15 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A SimplePanel that wraps its contents in stylized boxes, which can be used to add rounded - * corners to a Widget. + * corners to a Widget. * - * Note that this panel can contain at most one direct child widget. To add more children, make the - * child of this panel a different panel that can contain more than one child. + * Note that this panel can contain at most one direct child widget. To add more children, make + * the child of this panel a different panel that can contain more than one child. * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the DecoratorPanel documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the DecoratorPanel documentation here. */ export interface DecoratorPanel { add(widget: Widget): DecoratorPanel; @@ -847,35 +805,31 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. + * A form of popup that has a caption area at the top and can be dragged by the user. Unlike a + * PopupPanel, calls to setWidth(width) and setHeight(height) will set + * the width and height of the dialog box itself, even if a widget has not been added as yet. * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. - * A form of popup that has a caption area at the top and can be dragged by the - * user. Unlike a PopupPanel, calls to setWidth(width) and - * setHeight(height) will set the width and height of the dialog box - * itself, even if a widget has not been added as yet. + * In general it's not recommended to add this panel as a child of another widget or of the app + * as that will make it behave like any other inline panel and not act as a popup. Instead, create + * the popup and then use its show() and hide() methods to show and hide it. See + * the example below. * - * In general it's not recommended to add this panel as a child of another widget or of the app - * as that will make it behave like any other inline panel and not act as a popup. Instead, create - * the popup and then use its show() and hide() methods to show and hide it. See - * the example below. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the DialogBox documentation here. * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the DialogBox documentation here. + * Here is an example showing how to use the dialog box widget: * - * Here is an example showing how to use the dialog box widget: - * - * function doGet() { - * var app = UiApp.createApplication(); - * // Create a dialog box. - * var dialog = app.createDialogBox(); - * // Set the position and dimensions. - * dialog.setPopupPosition(100, 100).setSize(500, 500); - * // Show the dialog. Note that it does not have to be "added" to the UiInstance. - * dialog.show(); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * // Create a dialog box. + * var dialog = app.createDialogBox(); + * // Set the position and dimensions. + * dialog.setPopupPosition(100, 100).setSize(500, 500); + * // Show the dialog. Note that it does not have to be "added" to the UiInstance. + * dialog.show(); + * return app; + * } */ export interface DialogBox { add(widget: Widget): DialogBox; @@ -918,64 +872,61 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A "file-open" dialog for Google Drive. Unlike most UiApp objects, DocsListDialog - * should not be added to the UiInstance. The - * example below shows how to display a DocsListDialog in the - * new version of Google Sheets. + * should not be added to the UiInstance. The + * example below shows how to display a DocsListDialog in the new version of Google Sheets. * * Note that HTML service offers a similar but superior - * feature, Google Picker. In almost all - * cases, using Google Picker is preferable. + * feature, Google Picker. In almost all + * cases, using Google Picker is preferable. * - * function onOpen() { - * SpreadsheetApp.getUi() // Or DocumentApp or FormApp. - * .createMenu('Custom Menu') - * .addItem('Select file', 'showDialog') - * .addToUi(); - * } + * function onOpen() { + * SpreadsheetApp.getUi() // Or DocumentApp or FormApp. + * .createMenu('Custom Menu') + * .addItem('Select file', 'showDialog') + * .addToUi(); + * } * - * function showDialog() { - * // Dummy call to DriveApp to ensure the OAuth dialog requests Google Drive scope, so that the - * // getOAuthToken() call below returns a token with the necessary permissions. - * DriveApp.getRootFolder(); + * function showDialog() { + * // Dummy call to DriveApp to ensure the OAuth dialog requests Google Drive scope, so that the + * // getOAuthToken() call below returns a token with the necessary permissions. + * DriveApp.getRootFolder(); * - * var app = UiApp.createApplication() - * .setWidth(570) - * .setHeight(352); + * var app = UiApp.createApplication() + * .setWidth(570) + * .setHeight(352); * - * var serverHandler = app.createServerHandler('pickerHandler'); + * var serverHandler = app.createServerHandler('pickerHandler'); * - * app.createDocsListDialog() - * .addCloseHandler(serverHandler) - * .addSelectionHandler(serverHandler) - * .setOAuthToken(ScriptApp.getOAuthToken()) - * .showDocsPicker(); + * app.createDocsListDialog() + * .addCloseHandler(serverHandler) + * .addSelectionHandler(serverHandler) + * .setOAuthToken(ScriptApp.getOAuthToken()) + * .showDocsPicker(); * - * SpreadsheetApp.getUi() // Or DocumentApp or FormApp. - * .showModalDialog(app,' '); - * } + * SpreadsheetApp.getUi() // Or DocumentApp or FormApp. + * .showModalDialog(app,' '); + * } * - * function pickerHandler(e) { - * var action = e.parameter.eventType; - * var app = UiApp.getActiveApplication(); + * function pickerHandler(e) { + * var action = e.parameter.eventType; + * var app = UiApp.getActiveApplication(); * - * if (action == 'selection') { - * var doc = e.parameter.items[0]; - * var id = doc.id; - * var name = doc.name; - * var url = doc.url; - * app.add(app.createLabel('You picked ')); - * app.add(app.createAnchor(name, url)); - * app.add(app.createLabel('(ID: ' + id + ').')); - * } else if (action == 'close') { - * app.add(app.createLabel('You clicked "Cancel".')); - * } + * if (action == 'selection') { + * var doc = e.parameter.items[0]; + * var id = doc.id; + * var name = doc.name; + * var url = doc.url; + * app.add(app.createLabel('You picked ')); + * app.add(app.createAnchor(name, url)); + * app.add(app.createLabel('(ID: ' + id + ').')); + * } else if (action == 'close') { + * app.add(app.createLabel('You clicked "Cancel".')); + * } * - * return app; - * } + * return app; + * } */ export interface DocsListDialog { addCloseHandler(handler: Handler): DocsListDialog; @@ -995,47 +946,41 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. - * File type constants for the - * DocsListDialog. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. + * File type constants for the DocsListDialog. */ export enum FileType { ALL, ALL_DOCS, DRAWINGS, DOCUMENTS, SPREADSHEETS, FOLDERS, RECENTLY_PICKED, PRESENTATIONS, FORMS, PHOTOS, PHOTO_ALBUMS, PDFS } /** * * Deprecated. The UI service was + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. + * A widget that wraps the HTML element. This widget must be used within a + * FormPanel. * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. - * A widget that wraps the HTML element. This widget - * must be used within a FormPanel. + * The result of a FileUpload is a "Blob" which can we used in various other functions. Below is + * an example of how to use FileUpload. * - * The result of a FileUpload is a "Blob" which can we used in various other functions. Below is an - * example of how to use FileUpload. + * function doGet(e) { * - * function doGet(e) { + * var app = UiApp.createApplication().setTitle("Upload CSV to Sheet"); + * var formContent = app.createVerticalPanel(); + * formContent.add(app.createFileUpload().setName('thefile')); + * formContent.add(app.createSubmitButton()); + * var form = app.createFormPanel(); + * form.add(formContent); + * app.add(form); + * return app; + * } * - * var app = UiApp.createApplication().setTitle("Upload CSV to Sheet"); - * var formContent = app.createVerticalPanel(); - * formContent.add(app.createFileUpload().setName('thefile')); - * formContent.add(app.createSubmitButton()); - * var form = app.createFormPanel(); - * form.add(formContent); - * app.add(form); - * return app; - * } + * function doPost(e) { + * // data returned is a blob for FileUpload widget + * var fileBlob = e.parameter.thefile; + * var doc = DocsList.createFile(fileBlob); + * } * - * function doPost(e) { - * // data returned is a blob for FileUpload widget - * var fileBlob = e.parameter.thefile; - * var doc = DocsList.createFile(fileBlob); - * } - * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the FileUpload documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the FileUpload documentation here. */ export interface FileUpload { addChangeHandler(handler: Handler): FileUpload; @@ -1064,32 +1009,28 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. + * A flexible table that creates cells on demand. It can be jagged (that is, each row can contain a + * different number of cells) and individual cells can be set to span multiple rows or columns. * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. - * A flexible table that creates cells on demand. It can be jagged (that is, - * each row can contain a different number of cells) and individual cells can be - * set to span multiple rows or columns. + * Here is an example of how to use this widget: * - * Here is an example of how to use this widget: + * function doGet() { + * var app = UiApp.createApplication(); + * app.add(app.createFlexTable() + * .insertRow(0).insertRow(0).insertRow(0) + * .insertCell(0, 0) + * .insertCell(0, 1) + * .insertCell(0, 2) + * .insertCell(1, 0) + * .insertCell(1, 1) + * .insertCell(2, 0) + * .setBorderWidth(5).setCellPadding(10).setCellSpacing(10)); + * return app; + * } * - * function doGet() { - * var app = UiApp.createApplication(); - * app.add(app.createFlexTable() - * .insertRow(0).insertRow(0).insertRow(0) - * .insertCell(0, 0) - * .insertCell(0, 1) - * .insertCell(0, 2) - * .insertCell(1, 0) - * .insertCell(1, 1) - * .insertCell(2, 0) - * .setBorderWidth(5).setCellPadding(10).setCellSpacing(10)); - * return app; - * } - * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the FlexTable documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the FlexTable documentation here. */ export interface FlexTable { addCell(row: Integer): FlexTable; @@ -1134,25 +1075,22 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A panel that formats its child widgets using the default HTML layout behavior. * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * var panel = app.createFlowPanel(); - * panel.add(app.createButton("button 1")); - * panel.add(app.createButton("button 2")); - * app.add(panel); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * var panel = app.createFlowPanel(); + * panel.add(app.createButton("button 1")); + * panel.add(app.createButton("button 2")); + * app.add(panel); + * return app; + * } * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the FlowPanel documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the FlowPanel documentation here. */ export interface FlowPanel { add(widget: Widget): FlowPanel; @@ -1183,31 +1121,28 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A simple panel that makes its contents focusable, and adds the ability to catch mouse and - * keyboard events. + * keyboard events. * - * Note that this panel can contain at most one direct child widget. To add more children, make the - * child of this panel a different panel that can contain more than one child. + * Note that this panel can contain at most one direct child widget. To add more children, make + * the child of this panel a different panel that can contain more than one child. * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * var focus = app.createFocusPanel(); - * var flow = app.createFlowPanel(); - * flow.add(app.createButton("button 1")); - * flow.add(app.createButton("button 2")); - * focus.add(flow); - * app.add(focus); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * var focus = app.createFocusPanel(); + * var flow = app.createFlowPanel(); + * flow.add(app.createButton("button 1")); + * flow.add(app.createButton("button 2")); + * focus.add(flow); + * app.add(focus); + * return app; + * } * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the FocusPanel documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the FocusPanel documentation here. */ export interface FocusPanel { add(widget: Widget): FocusPanel; @@ -1251,45 +1186,42 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A panel that wraps its contents in an HTML element. * - * This panel can be used with a SubmitButton to post form values to the server. All - * children of this panel (direct, or even children of sub-panels) that have a setName function - * and have been given a name will have their values sent to the server when the form is submitted. - * The submit can be handled in the special "doPost" function, as shown in the example. + * This panel can be used with a SubmitButton to post form values to the server. All + * children of this panel (direct, or even children of sub-panels) that have a setName function and + * have been given a name will have their values sent to the server when the form is submitted. The + * submit can be handled in the special "doPost" function, as shown in the example. * - * Note that this panel can contain at most one direct child widget. To add more children, make the - * child of this panel a different panel that can contain more than one child. + * Note that this panel can contain at most one direct child widget. To add more children, make + * the child of this panel a different panel that can contain more than one child. * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * var form = app.createFormPanel(); - * var flow = app.createFlowPanel(); - * flow.add(app.createTextBox().setName("textBox")); - * flow.add(app.createListBox().setName("listBox").addItem("option 1").addItem("option 2")); - * flow.add(app.createSubmitButton("Submit")); - * form.add(flow); - * app.add(form); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * var form = app.createFormPanel(); + * var flow = app.createFlowPanel(); + * flow.add(app.createTextBox().setName("textBox")); + * flow.add(app.createListBox().setName("listBox").addItem("option 1").addItem("option 2")); + * flow.add(app.createSubmitButton("Submit")); + * form.add(flow); + * app.add(form); + * return app; + * } * - * function doPost(eventInfo) { - * var app = UiApp.getActiveApplication(); - * app.add(app.createLabel("Form submitted. The text box's value was '" + - * eventInfo.parameter.textBox + - * "' and the list box's value was '" + - * eventInfo.parameter.listBox + "'")); - * return app; - * } + * function doPost(eventInfo) { + * var app = UiApp.getActiveApplication(); + * app.add(app.createLabel("Form submitted. The text box's value was '" + + * eventInfo.parameter.textBox + + * "' and the list box's value was '" + + * eventInfo.parameter.listBox + "'")); + * return app; + * } * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the FormPanel documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the FormPanel documentation here. */ export interface FormPanel { add(widget: Widget): FormPanel; @@ -1323,36 +1255,33 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A rectangular grid that can contain text, html, or a child widget within its cells. It must be - * resized explicitly to the desired number of rows and columns. + * resized explicitly to the desired number of rows and columns. * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * app.add(app.createGrid(3, 3) - * .setBorderWidth(1) - * .setCellSpacing(10) - * .setCellPadding(10) - * .setText(0, 0, "X") - * .setText(1, 1, "X") - * .setText(2, 2, "X") - * .setText(0, 1, "O") - * .setText(0, 2, "O") - * .setStyleAttribute(0, 0, "color", "red") - * .setStyleAttribute(1, 1, "color", "red") - * .setStyleAttribute(2, 2, "color", "red") - * .setStyleAttribute(0, 1, "color", "blue") - * .setStyleAttribute(0, 2, "color", "blue")); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * app.add(app.createGrid(3, 3) + * .setBorderWidth(1) + * .setCellSpacing(10) + * .setCellPadding(10) + * .setText(0, 0, "X") + * .setText(1, 1, "X") + * .setText(2, 2, "X") + * .setText(0, 1, "O") + * .setText(0, 2, "O") + * .setStyleAttribute(0, 0, "color", "red") + * .setStyleAttribute(1, 1, "color", "red") + * .setStyleAttribute(2, 2, "color", "red") + * .setStyleAttribute(0, 1, "color", "blue") + * .setStyleAttribute(0, 2, "color", "blue")); + * return app; + * } * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the Grid documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the Grid documentation here. */ export interface Grid { addClickHandler(handler: Handler): Grid; @@ -1392,25 +1321,22 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A widget that contains arbitrary text, which is interpreted as HTML. * - * Only basic HTML markup such as bold, italic, etc. are allowed; in particular, scripts will be - * stripped out completely. + * Only basic HTML markup such as bold, italic, etc. are allowed; in particular, scripts will be + * stripped out completely. * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * app.add(app.createHTML("Hello World!")); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * app.add(app.createHTML("Hello World!")); + * return app; + * } * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the HTML documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the HTML documentation here. */ export interface HTML { addClickHandler(handler: Handler): HTML; @@ -1448,9 +1374,7 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * Base interface for client and server handlers. * Implementing classes * @@ -1489,42 +1413,39 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * Represents a hidden field for storing data in the user's browser that can be passed back to a - * handler as a "callback element". + * handler as a "callback element". * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * // Note that the name "appState" for callbacks, and the id "hidden" for - * // getting a reference to the widget, are not required to be the same. - * var hidden = app.createHidden("appState", "0").setId("hidden"); - * app.add(hidden); - * var handler = app.createServerHandler("click").addCallbackElement(hidden); - * app.add(app.createButton("click me!", handler)); - * app.add(app.createLabel("clicked 0 times").setId("label")); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * // Note that the name "appState" for callbacks, and the id "hidden" for + * // getting a reference to the widget, are not required to be the same. + * var hidden = app.createHidden("appState", "0").setId("hidden"); + * app.add(hidden); + * var handler = app.createServerHandler("click").addCallbackElement(hidden); + * app.add(app.createButton("click me!", handler)); + * app.add(app.createLabel("clicked 0 times").setId("label")); + * return app; + * } * - * function click(eventInfo) { - * var app = UiApp.createApplication(); - * // We have the value of the hidden field because it was a callback element. - * var numClicks = Number(eventInfo.parameter.appState); - * numClicks++; - * // Just store the number as a string. We could actually store arbitrarily complex data - * // here using JSON.stringify() to turn a JavaScript object into a string to store, and - * // JSON.parse() to turn the string back into an object. - * app.getElementById("hidden").setValue(String(numClicks)); - * app.getElementById("label").setText("clicked " + numClicks + " times"); - * return app; - * } + * function click(eventInfo) { + * var app = UiApp.createApplication(); + * // We have the value of the hidden field because it was a callback element. + * var numClicks = Number(eventInfo.parameter.appState); + * numClicks++; + * // Just store the number as a string. We could actually store arbitrarily complex data + * // here using JSON.stringify() to turn a JavaScript object into a string to store, and + * // JSON.parse() to turn the string back into an object. + * app.getElementById("hidden").setValue(String(numClicks)); + * app.getElementById("label").setText("clicked " + numClicks + " times"); + * return app; + * } * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the Hidden documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the Hidden documentation here. */ export interface Hidden { addStyleDependentName(styleName: string): Hidden; @@ -1554,9 +1475,7 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * Horizontal alignment constants to use with setHorizontalAlignment methods in UiApp. */ export enum HorizontalAlignment { LEFT, RIGHT, CENTER, DEFAULT, JUSTIFY, LOCALE_START, LOCALE_END } @@ -1564,25 +1483,22 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A panel that lays all of its widgets out in a single horizontal column. * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * var panel = app.createHorizontalPanel(); - * panel.add(app.createButton("button 1")); - * panel.add(app.createButton("button 2")); - * app.add(panel); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * var panel = app.createHorizontalPanel(); + * panel.add(app.createButton("button 1")); + * panel.add(app.createButton("button 2")); + * app.add(panel); + * return app; + * } * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the HorizontalPanel documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the HorizontalPanel documentation here. */ export interface HorizontalPanel { add(widget: Widget): HorizontalPanel; @@ -1620,38 +1536,34 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A widget that displays the image at a given URL. * - * The image can be in 'unclipped' mode (the default) or 'clipped' mode. - * In clipped mode, a viewport is overlaid on top of the image so that a subset of the image will be - * displayed. In unclipped mode, there is no viewport - the entire image will be - * visible. Whether an image is in clipped or unclipped mode depends on how the - * image is constructed, and how it is transformed after construction. Methods - * will operate differently depending on the mode that the image is in. These - * differences are detailed in the documentation for each method. + * The image can be in 'unclipped' mode (the default) or 'clipped' mode. In clipped mode, a + * viewport is overlaid on top of the image so that a subset of the image will be displayed. In + * unclipped mode, there is no viewport - the entire image will be visible. Whether an image is in + * clipped or unclipped mode depends on how the image is constructed, and how it is transformed + * after construction. Methods will operate differently depending on the mode that the image is in. + * These differences are detailed in the documentation for each method. * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * // The very first Google Doodle! - * app.add(app.createImage("http://www.google.com/logos/googleburn.jpg")); - * // Just the man in the middle - * app.add(app.createImage("http://www.google.com/logos/googleburn.jpg", 118, 0, 50, 106)); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * // The very first Google Doodle! + * app.add(app.createImage("http://www.google.com/logos/googleburn.jpg")); + * // Just the man in the middle + * app.add(app.createImage("http://www.google.com/logos/googleburn.jpg", 118, 0, 50, 106)); + * return app; + * } * - * Due to browser-specific HTML constructions needed to achieve the clipping effect, certain CSS - * attributes, such as padding and background, may not work as expected when an image is in clipped - * mode. These limitations can usually be easily worked around by encapsulating the image in a - * container widget that can itself be styled. + * Due to browser-specific HTML constructions needed to achieve the clipping effect, certain CSS + * attributes, such as padding and background, may not work as expected when an image is in clipped + * mode. These limitations can usually be easily worked around by encapsulating the image in a + * container widget that can itself be styled. * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the Image documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the Image documentation here. */ export interface Image { addClickHandler(handler: Handler): Image; @@ -1690,16 +1602,13 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A widget that contains arbitrary text, not interpreted as HTML. * - * This widget uses a element, causing it to be displayed with inline layout. + * This widget uses a element, causing it to be displayed with inline layout. * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the InlineLabel documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the InlineLabel documentation here. */ export interface InlineLabel { addClickHandler(handler: Handler): InlineLabel; @@ -1736,22 +1645,19 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A widget that contains arbitrary text, not interpreted as HTML. * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * app.add(app.createLabel("Hello World!")); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * app.add(app.createLabel("Hello World!")); + * return app; + * } * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the Label documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the Label documentation here. */ export interface Label { addClickHandler(handler: Handler): Label; @@ -1788,55 +1694,52 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. + * A widget that presents a list of choices to the user, either as a list box or as a drop-down + * list. * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. - * A widget that presents a list of choices to the user, either as a list box or - * as a drop-down list. + * Here is an example usage, which should be executed from within a spreadsheet bound script. * - * Here is an example usage, which should be executed from within a spreadsheet bound script. + * // execute this in a spreadsheet + * function show() { + * var doc = SpreadsheetApp.getActiveSpreadsheet(); + * var app = UiApp.createApplication().setTitle('My Application'); + * var panel = app.createVerticalPanel(); + * var lb = app.createListBox(true).setId('myId').setName('myLbName'); * - * // execute this in a spreadsheet - * function show() { - * var doc = SpreadsheetApp.getActiveSpreadsheet(); - * var app = UiApp.createApplication().setTitle('My Application'); - * var panel = app.createVerticalPanel(); - * var lb = app.createListBox(true).setId('myId').setName('myLbName'); + * // add items to ListBox + * lb.setVisibleItemCount(3); + * lb.addItem('first'); + * lb.addItem('second'); + * lb.addItem('third'); + * lb.addItem('fourth'); + * lb.addItem('fifth'); + * lb.addItem('sixth'); * - * // add items to ListBox - * lb.setVisibleItemCount(3); - * lb.addItem('first'); - * lb.addItem('second'); - * lb.addItem('third'); - * lb.addItem('fourth'); - * lb.addItem('fifth'); - * lb.addItem('sixth'); + * panel.add(lb); + * var button = app.createButton('press me'); + * var handler = app.createServerClickHandler('click').addCallbackElement(panel); + * button.addClickHandler(handler); + * panel.add(button); + * app.add(panel); + * doc.show(app); + * } * - * panel.add(lb); - * var button = app.createButton('press me'); - * var handler = app.createServerClickHandler('click').addCallbackElement(panel); - * button.addClickHandler(handler); - * panel.add(button); - * app.add(panel); - * doc.show(app); - * } + * function click(eventInfo) { + * var app = UiApp.getActiveApplication(); + * // get values of ListBox + * var value = eventInfo.parameter.myLbName; + * // multi select box returns a comma separated string + * var n = value.split(','); * - * function click(eventInfo) { - * var app = UiApp.getActiveApplication(); - * // get values of ListBox - * var value = eventInfo.parameter.myLbName; - * // multi select box returns a comma separated string - * var n = value.split(','); + * var doc = SpreadsheetApp.getActiveSpreadsheet(); + * doc.getRange('a1').setValue(value); + * doc.getRange('b1').setValue('there are ' + n.length + ' items selected'); + * return app; + * } * - * var doc = SpreadsheetApp.getActiveSpreadsheet(); - * doc.getRange('a1').setValue(value); - * doc.getRange('b1').setValue('there are ' + n.length + ' items selected'); - * return app; - * } - * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the ListBox documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the ListBox documentation here. */ export interface ListBox { addBlurHandler(handler: Handler): ListBox; @@ -1889,17 +1792,14 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A standard menu bar widget. * - * A menu bar can contain any number of menu items, - * each of which can either fire an event handler or open a cascaded menu bar. + * A menu bar can contain any number of menu items, each of which can either fire an event + * handler or open a cascaded menu bar. * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the MenuBar documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the MenuBar documentation here. */ export interface MenuBar { addCloseHandler(handler: Handler): MenuBar; @@ -1935,16 +1835,14 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * An entry in a MenuBar. * - * Menu items can either fire an event handler when they are clicked, or open a cascading sub-menu. + * Menu items can either fire an event handler when they are clicked, or open a cascading + * sub-menu. * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the MenuItem documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the MenuItem documentation here. */ export interface MenuItem { addStyleDependentName(styleName: string): MenuItem; @@ -1973,14 +1871,11 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A separator that can be placed in a MenuBar. * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the MenuItemSeparator documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the MenuItemSeparator documentation here. */ export interface MenuItemSeparator { addStyleDependentName(styleName: string): MenuItemSeparator; @@ -2005,44 +1900,41 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A text box that visually masks its input to prevent eavesdropping. * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * var text = app.createPasswordTextBox().setName("text"); - * var handler = app.createServerHandler("test").addCallbackElement(text); - * app.add(text); - * app.add(app.createButton("Test", handler)); - * app.add(app.createLabel("0 characters").setId("label")); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * var text = app.createPasswordTextBox().setName("text"); + * var handler = app.createServerHandler("test").addCallbackElement(text); + * app.add(text); + * app.add(app.createButton("Test", handler)); + * app.add(app.createLabel("0 characters").setId("label")); + * return app; + * } * - * function test(eventInfo) { - * var app = UiApp.createApplication(); - * // Because the text box was named "text" and added as a callback element to the - * // button's click event, we have its value available in eventInfo.parameter.text. - * var pass = eventInfo.parameter.text; - * var isStrong = - * pass.length >= 10 && /[A-Z]/.test(pass) && /[a-z]/.test(pass) && /[0-9]/.test(pass); - * var label = app.getElementById("label"); - * if (isStrong) { - * label.setText("Strong! Well, not really, but this is just an example.") - * .setStyleAttribute("color", "green"); - * } else { - * label.setText("Weak! Use at least 10 characters, with uppercase, lowercase, and digits") - * .setStyleAttribute("color", "red"); - * } - * return app; - * } + * function test(eventInfo) { + * var app = UiApp.createApplication(); + * // Because the text box was named "text" and added as a callback element to the + * // button's click event, we have its value available in eventInfo.parameter.text. + * var pass = eventInfo.parameter.text; + * var isStrong = + * pass.length >= 10 && /[A-Z]/.test(pass) && /[a-z]/.test(pass) && /[0-9]/.test(pass); + * var label = app.getElementById("label"); + * if (isStrong) { + * label.setText("Strong! Well, not really, but this is just an example.") + * .setStyleAttribute("color", "green"); + * } else { + * label.setText("Weak! Use at least 10 characters, with uppercase, lowercase, and digits") + * .setStyleAttribute("color", "red"); + * } + * return app; + * } * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the PasswordTextBox documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the PasswordTextBox documentation here. */ export interface PasswordTextBox { addBlurHandler(handler: Handler): PasswordTextBox; @@ -2097,40 +1989,37 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. + * A panel that can "pop up" over other widgets. It overlays the browser's client area (and any + * previously-created popups). * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. - * A panel that can "pop up" over other widgets. It overlays the browser's - * client area (and any previously-created popups). + * In general it's not recommended to add this panel as a child of another widget or of the app + * as that will make it behave like any other inline panel and not act as a popup. Instead, create + * the popup and then use its show() and hide() methods to show and hide it. See + * the example below. * - * In general it's not recommended to add this panel as a child of another widget or of the app - * as that will make it behave like any other inline panel and not act as a popup. Instead, create - * the popup and then use its show() and hide() methods to show and hide it. See - * the example below. + * To make the popup stay at a fixed location rather than scrolling with the page, try setting + * the 'position', 'fixed' style on it with setStyleAttribute(attribute, value). * - * To make the popup stay at a fixed location rather than scrolling with the page, try setting the - * 'position', 'fixed' style on it with setStyleAttribute(attribute, value). + * Note that this panel can contain at most one direct child widget. To add more children, make + * the child of this panel a different panel that can contain more than one child. * - * Note that this panel can contain at most one direct child widget. To add more children, make the - * child of this panel a different panel that can contain more than one child. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the PopupPanel documentation here. * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the PopupPanel documentation here. + * Here is an example showing how to use the popup panel widget: * - * Here is an example showing how to use the popup panel widget: - * - * function doGet() { - * var app = UiApp.createApplication(); - * // Create a popup panel and set it to be modal. - * var popupPanel = app.createPopupPanel(false, true); - * // Add a button to the panel and set the dimensions and position. - * popupPanel.add(app.createButton()).setWidth("100px").setHeight("100px") - * .setPopupPosition(100, 100); - * // Show the panel. Note that it does not have to be "added" to the UiInstance. - * popupPanel.show(); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * // Create a popup panel and set it to be modal. + * var popupPanel = app.createPopupPanel(false, true); + * // Add a button to the panel and set the dimensions and position. + * popupPanel.add(app.createButton()).setWidth("100px").setHeight("100px") + * .setPopupPosition(100, 100); + * // Show the panel. Note that it does not have to be "added" to the UiInstance. + * popupPanel.show(); + * return app; + * } */ export interface PopupPanel { add(widget: Widget): PopupPanel; @@ -2171,31 +2060,28 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A normal push button with custom styling. * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * // create a button and give it a click handler - * var button = app.createPushButton().setText("click me!").setId("button"); - * button.addClickHandler(app.createServerHandler("handlerFunction")); - * app.add(button); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * // create a button and give it a click handler + * var button = app.createPushButton().setText("click me!").setId("button"); + * button.addClickHandler(app.createServerHandler("handlerFunction")); + * app.add(button); + * return app; + * } * - * function handlerFunction(eventInfo) { - * var app = UiApp.getActiveApplication(); - * app.add(app.createLabel("The button was clicked!")); - * return app; - * } + * function handlerFunction(eventInfo) { + * var app = UiApp.getActiveApplication(); + * app.add(app.createLabel("The button was clicked!")); + * return app; + * } * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the PushButton documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the PushButton documentation here. */ export interface PushButton { addBlurHandler(handler: Handler): PushButton; @@ -2239,35 +2125,31 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A mutually-exclusive selection radio button widget. * - * This widget fires - * click events when the radio button is clicked, and value change events when the - * button becomes checked. Note, however, that browser limitations prevent - * value change events from being sent when the radio button is cleared as a side - * effect of another in the group being clicked. + * This widget fires click events when the radio button is clicked, and value change events when + * the button becomes checked. Note, however, that browser limitations prevent value change events + * from being sent when the radio button is cleared as a side effect of another in the group being + * clicked. * - * RadioButtons are grouped according to the following rules: + * RadioButtons are grouped according to the following rules: * * In the absence of a FormPanel, RadioButtons with the same name are part of the same - * group. + * group. * * Within a FormPanel, all unnamed RadioButtons are part of the same group. * * Within a FormPanel, all RadioButtons with the same name are part of the same group - but - * not part of the same group as RadioButtons with the same name outside of the - * FormPanel. + * not part of the same group as RadioButtons with the same name outside of the + * FormPanel. * - * Note that radio button selections within a group do not propagate to server handlers created with - * UiInstance#createServerHandler(). Instead, to capture values on the server, use - * doPost() or separate handlers for each RadioButton. + * Note that radio button selections within a group do not propagate to server handlers created + * with UiInstance#createServerHandler(). Instead, to capture values on the server, use + * doPost() or separate handlers for each RadioButton. * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the RadioButton documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the RadioButton documentation here. */ export interface RadioButton { addBlurHandler(handler: Handler): RadioButton; @@ -2316,28 +2198,25 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A standard push-button widget which will automatically reset its enclosing FormPanel if - * any. + * any. * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * var panel = app.createFlowPanel(); - * panel.add(app.createTextBox().setText("some text")); - * panel.add(app.createResetButton("reset the textbox")); - * var form = app.createFormPanel(); - * form.add(panel); - * app.add(form); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * var panel = app.createFlowPanel(); + * panel.add(app.createTextBox().setText("some text")); + * panel.add(app.createResetButton("reset the textbox")); + * var form = app.createFormPanel(); + * form.add(panel); + * app.add(form); + * return app; + * } * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the ResetButton documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the ResetButton documentation here. */ export interface ResetButton { addBlurHandler(handler: Handler): ResetButton; @@ -2381,32 +2260,29 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A panel that wraps its contents in a scrollable element. * - * Note that this panel can contain at most one direct child widget. To add more children, make the - * child of this panel a different panel that can contain more than one child. + * Note that this panel can contain at most one direct child widget. To add more children, make + * the child of this panel a different panel that can contain more than one child. * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * // Create some long content. - * var vertical = app.createVerticalPanel(); - * for (var i = 0; i < 100; ++i) { - * vertical.add(app.createButton("button " + i)); - * } - * var scroll = app.createScrollPanel().setPixelSize(100, 100); - * scroll.add(vertical); - * app.add(scroll); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * // Create some long content. + * var vertical = app.createVerticalPanel(); + * for (var i = 0; i < 100; ++i) { + * vertical.add(app.createButton("button " + i)); + * } + * var scroll = app.createScrollPanel().setPixelSize(100, 100); + * scroll.add(vertical); + * app.add(scroll); + * return app; + * } * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the ScrollPanel documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the ScrollPanel documentation here. */ export interface ScrollPanel { add(widget: Widget): ScrollPanel; @@ -2439,29 +2315,26 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. + * An event handler that runs on the server. These will, in general, run much slower than ClientHandlers but they are not limited in what they can do. * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. - * An event handler that runs on the server. These will, in general, run much slower than - * ClientHandlers but they are not limited in what they can do. + * Any method that accepts a "Handler" parameter can accept a ServerHandler. * - * Any method that accepts a "Handler" parameter can accept a ServerHandler. + * When a ServerHandler is invoked, the function it refers to is called on the Apps Script server + * in a "fresh" script. This means that no variable values will have survived from previous handlers + * or from the initial script that loaded the app. Global variables in the script will be + * re-evaluated, which means that it's a bad idea to do anything slow (like opening a Spreadsheet or + * fetching a Calendar) in a global variable. * - * When a ServerHandler is invoked, the function it refers to is called on the Apps Script server in - * a "fresh" script. This means that no variable values will have survived from previous handlers or - * from the initial script that loaded the app. Global variables in the script will be re-evaluated, - * which means that it's a bad idea to do anything slow (like opening a Spreadsheet or fetching a - * Calendar) in a global variable. + * If you need to save state on the server, you can try using ScriptProperties or UserProperties. + * You can also add a Hidden field to your app storing the information you want to save and + * pass it back explicitly to handlers as a "callback element." * - * If you need to save state on the server, you can try using ScriptProperties or UserProperties. - * You can also add a Hidden field to your app storing the information you want to save - * and pass it back explicitly to handlers as a "callback element." + * If you set validators on a ServerHandler, they will be checked before the handler calls the + * server. The server will only be called if the validators succeed. * - * If you set validators on a ServerHandler, they will be checked before the handler calls the - * server. The server will only be called if the validators succeed. - * - * If you have multiple ServerHandlers for the same event on the same widget, they will be called - * simultaneously. + * If you have multiple ServerHandlers for the same event on the same widget, they will be called + * simultaneously. */ export interface ServerHandler { addCallbackElement(widget: Widget): ServerHandler; @@ -2494,14 +2367,11 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A simple checkbox widget, with no label. * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the SimpleCheckBox documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the SimpleCheckBox documentation here. */ export interface SimpleCheckBox { addBlurHandler(handler: Handler): SimpleCheckBox; @@ -2545,30 +2415,27 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A panel that can contain only one widget. * - * This panel is useful for adding styling effects to the child widget. To add more children, make - * the child of this panel a different panel that can contain more than one child. + * This panel is useful for adding styling effects to the child widget. To add more children, + * make the child of this panel a different panel that can contain more than one child. * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * var simple = app.createSimplePanel(); - * var flow = app.createFlowPanel(); - * flow.add(app.createButton("button 1")); - * flow.add(app.createButton("button 2")); - * simple.add(flow); - * app.add(simple); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * var simple = app.createSimplePanel(); + * var flow = app.createFlowPanel(); + * flow.add(app.createButton("button 1")); + * flow.add(app.createButton("button 2")); + * simple.add(flow); + * app.add(simple); + * return app; + * } * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the SimplePanel documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the SimplePanel documentation here. */ export interface SimplePanel { add(widget: Widget): SimplePanel; @@ -2597,16 +2464,13 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A simple radio button widget, with no label. * - * SimpleRadioButtons are grouped according to the same rules as RadioButtons. + * SimpleRadioButtons are grouped according to the same rules as RadioButtons. * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the SimpleRadioButton documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the SimpleRadioButton documentation here. */ export interface SimpleRadioButton { addBlurHandler(handler: Handler): SimpleRadioButton; @@ -2650,17 +2514,14 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A panel that adds user-positioned splitters between each of its child widgets. * - * This panel is similar to a DockLayoutPanel, but each pair of child widgets has a splitter - * between them that the user can drag. + * This panel is similar to a DockLayoutPanel, but each pair of child widgets has a + * splitter between them that the user can drag. * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the SplitLayoutPanel documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the SplitLayoutPanel documentation here. */ export interface SplitLayoutPanel { add(widget: Widget): SplitLayoutPanel; @@ -2695,15 +2556,12 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. + * A panel that stacks its children vertically, displaying only one at a time, with a header for + * each child which the user can click to display. * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. - * A panel that stacks its children vertically, displaying only one at a time, - * with a header for each child which the user can click to display. - * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the StackPanel documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the StackPanel documentation here. */ export interface StackPanel { add(widget: Widget): StackPanel; @@ -2737,35 +2595,32 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A standard push-button widget which will automatically submit its enclosing FormPanel if - * any. + * any. * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * var form = app.createFormPanel(); - * var flow = app.createFlowPanel(); - * flow.add(app.createTextBox().setName("textBox")); - * flow.add(app.createSubmitButton("Submit")); - * form.add(flow); - * app.add(form); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * var form = app.createFormPanel(); + * var flow = app.createFlowPanel(); + * flow.add(app.createTextBox().setName("textBox")); + * flow.add(app.createSubmitButton("Submit")); + * form.add(flow); + * app.add(form); + * return app; + * } * - * function doPost(eventInfo) { - * var app = UiApp.getActiveApplication(); - * app.add(app.createLabel("Form submitted. The text box's value was '" + - * eventInfo.parameter.textBox + "'")); - * return app; - * } + * function doPost(eventInfo) { + * var app = UiApp.getActiveApplication(); + * app.add(app.createLabel("Form submitted. The text box's value was '" + + * eventInfo.parameter.textBox + "'")); + * return app; + * } * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the SubmitButton documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the SubmitButton documentation here. */ export interface SubmitButton { addBlurHandler(handler: Handler): SubmitButton; @@ -2809,14 +2664,13 @@ declare namespace GoogleAppsScript { /** * * Deprecated. This class is deprecated and should not be used in new scripts. - * A SuggestBox is a text box or text area which displays a - * pre-configured set of selections that match the user's input. + * A SuggestBox is a text box or text area which displays a pre-configured set of selections + * that match the user's input. * - * This widget is not currently functional. + * This widget is not currently functional. * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the SuggestBox documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the SuggestBox documentation here. */ export interface SuggestBox { addKeyDownHandler(handler: Handler): SuggestBox; @@ -2857,14 +2711,11 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A horizontal bar of folder-style tabs, most commonly used as part of a TabPanel. * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the TabBar documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the TabBar documentation here. */ export interface TabBar { addBeforeSelectionHandler(handler: Handler): TabBar; @@ -2898,16 +2749,12 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. + * A panel that represents a tabbed set of pages, each of which contains another widget. Its child + * widgets are shown as the user selects the various tabs associated with them. * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. - * A panel that represents a tabbed set of pages, each of which contains another - * widget. Its child widgets are shown as the user selects the various tabs - * associated with them. - * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the TabPanel documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the TabPanel documentation here. */ export interface TabPanel { add(widget: Widget): TabPanel; @@ -2941,34 +2788,31 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A text box that allows multiple lines of text to be entered. * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * var text = app.createTextArea().setName("text"); - * var handler = app.createServerHandler("count").addCallbackElement(text); - * app.add(text); - * app.add(app.createButton("Count", handler)); - * app.add(app.createLabel("0 characters").setId("label")); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * var text = app.createTextArea().setName("text"); + * var handler = app.createServerHandler("count").addCallbackElement(text); + * app.add(text); + * app.add(app.createButton("Count", handler)); + * app.add(app.createLabel("0 characters").setId("label")); + * return app; + * } * - * function count(eventInfo) { - * var app = UiApp.createApplication(); - * // Because the text area was named "text" and added as a callback element to the - * // button's click event, we have its value available in eventInfo.parameter.text. - * app.getElementById("label").setText(eventInfo.parameter.text.length + " characters"); - * return app; - * } + * function count(eventInfo) { + * var app = UiApp.createApplication(); + * // Because the text area was named "text" and added as a callback element to the + * // button's click event, we have its value available in eventInfo.parameter.text. + * app.getElementById("label").setText(eventInfo.parameter.text.length + " characters"); + * return app; + * } * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the TextArea documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the TextArea documentation here. */ export interface TextArea { addBlurHandler(handler: Handler): TextArea; @@ -3023,34 +2867,31 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A standard single-line text box. * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * var text = app.createTextBox().setName("text"); - * var handler = app.createServerHandler("count").addCallbackElement(text); - * app.add(text); - * app.add(app.createButton("Count", handler)); - * app.add(app.createLabel("0 characters").setId("label")); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * var text = app.createTextBox().setName("text"); + * var handler = app.createServerHandler("count").addCallbackElement(text); + * app.add(text); + * app.add(app.createButton("Count", handler)); + * app.add(app.createLabel("0 characters").setId("label")); + * return app; + * } * - * function count(eventInfo) { - * var app = UiApp.createApplication(); - * // Because the text box was named "text" and added as a callback element to the - * // button's click event, we have its value available in eventInfo.parameter.text. - * app.getElementById("label").setText(eventInfo.parameter.text.length + " characters"); - * return app; - * } + * function count(eventInfo) { + * var app = UiApp.createApplication(); + * // Because the text box was named "text" and added as a callback element to the + * // button's click event, we have its value available in eventInfo.parameter.text. + * app.getElementById("label").setText(eventInfo.parameter.text.length + " characters"); + * return app; + * } * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the TextBox documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the TextBox documentation here. */ export interface TextBox { addBlurHandler(handler: Handler): TextBox; @@ -3105,15 +2946,12 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. + * A ToggleButton is a stylish stateful button which allows the user to toggle between + * up and down states. * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. - * A ToggleButton is a stylish stateful button which allows the - * user to toggle between up and down states. - * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the ToggleButton documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the ToggleButton documentation here. */ export interface ToggleButton { addBlurHandler(handler: Handler): ToggleButton; @@ -3158,15 +2996,12 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. + * A standard hierarchical tree widget. The tree contains a hierarchy of TreeItems that the + * user can open, close, and select. * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. - * A standard hierarchical tree widget. The tree contains a hierarchy of - * TreeItems that the user can open, close, and select. - * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the Tree documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the Tree documentation here. */ export interface Tree { add(widget: Widget): Tree; @@ -3217,14 +3052,11 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * An item that can be contained within a Tree. * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the TreeItem documentation here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the TreeItem documentation here. */ export interface TreeItem { addItem(text: string): TreeItem; @@ -3260,9 +3092,7 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * Create user interfaces for use inside G Suite or as standalone services. */ export interface UiApp { @@ -3278,12 +3108,10 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A representation of a user interface. * - * You can use this to create a new user interface or manipulate an existing one. + * You can use this to create a new user interface or manipulate an existing one. */ export interface UiInstance { add(child: Widget): UiInstance; @@ -3428,9 +3256,7 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * Vertical alignment constants to use with setVerticalAlignment methods in UiApp. */ export enum VerticalAlignment { TOP, MIDDLE, BOTTOM } @@ -3438,26 +3264,22 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * A panel that lays all of its widgets out in a single vertical column. * - * Here is an example of how to use this widget: + * Here is an example of how to use this widget: * - * function doGet() { - * var app = UiApp.createApplication(); - * var panel = app.createVerticalPanel(); - * panel.add(app.createButton("button 1")); - * panel.add(app.createButton("button 2")); - * app.add(panel); - * return app; - * } + * function doGet() { + * var app = UiApp.createApplication(); + * var panel = app.createVerticalPanel(); + * panel.add(app.createButton("button 1")); + * panel.add(app.createButton("button 2")); + * app.add(panel); + * return app; + * } * - * Internally, UiApp widgets are built on top of the - * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation - * directly. You can find the VerticalPanel documentation - * here. + * Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful + * to look at the GWT documentation directly. You can find the VerticalPanel documentation here. */ export interface VerticalPanel { add(widget: Widget): VerticalPanel; @@ -3495,9 +3317,7 @@ declare namespace GoogleAppsScript { /** * * Deprecated. The UI service was - * - * deprecated on December 11, 2014. To create user interfaces, use the - * HTML service instead. + * deprecated on December 11, 2014. To create user interfaces, use the HTML service instead. * Base interface for UiApp widgets. * Implementing classes * @@ -3509,8 +3329,8 @@ declare namespace GoogleAppsScript { * * ButtonA standard push-button widget. * - * CaptionPanelA panel that wraps its contents in a border with a caption that appears in the upper left - * corner of the border. + * CaptionPanelA panel that wraps its contents in a border with a caption that appears in the upper left corner + * of the border. * * ChartA Chart object, which can be embedded into documents, UI elements, or used as a static image. * @@ -3518,27 +3338,26 @@ declare namespace GoogleAppsScript { * * ControlA user interface control object, that drives the data displayed by a DashboardPanel. * - * DashboardPanelA dashboard is a visual structure that enables the organization and management - * of multiple charts that share the same underlying data. + * DashboardPanelA dashboard is a visual structure that enables the organization and management of multiple charts + * that share the same underlying data. * * DateBoxA text box that shows a DatePicker when the user focuses on it. * * DatePickerA date picker widget. * * DecoratedStackPanelA StackPanel that wraps each item in a 2x3 grid (six box), which allows users to add - * rounded corners. + * rounded corners. * * DecoratedTabBarA TabBar that wraps each tab in a 2x3 grid (six box), which allows users to add rounded corners. * * DecoratedTabPanelA TabPanel that uses a DecoratedTabBar with rounded corners. * * DecoratorPanelA SimplePanel that wraps its contents in stylized boxes, which can be used to add rounded - * corners to a Widget. + * corners to a Widget. * - * DialogBoxA form of popup that has a caption area at the top and can be dragged by the - * user. + * DialogBoxA form of popup that has a caption area at the top and can be dragged by the user. * - * EmbeddedChartRepresents a chart that has been embedded into a Spreadsheet. + * EmbeddedChartRepresents a chart that has been embedded into a spreadsheet. * * FileUploadA widget that wraps the HTML element. * @@ -3547,7 +3366,7 @@ declare namespace GoogleAppsScript { * FlowPanelA panel that formats its child widgets using the default HTML layout behavior. * * FocusPanelA simple panel that makes its contents focusable, and adds the ability to catch mouse and - * keyboard events. + * keyboard events. * * FormPanelA panel that wraps its contents in an HTML element. * @@ -3556,7 +3375,7 @@ declare namespace GoogleAppsScript { * HTMLA widget that contains arbitrary text, which is interpreted as HTML. * * HiddenRepresents a hidden field for storing data in the user's browser that can be passed back to a - * handler as a "callback element". + * handler as a "callback element". * * HorizontalPanelA panel that lays all of its widgets out in a single horizontal column. * @@ -3566,8 +3385,8 @@ declare namespace GoogleAppsScript { * * LabelA widget that contains arbitrary text, not interpreted as HTML. * - * ListBoxA widget that presents a list of choices to the user, either as a list box or - * as a drop-down list. + * ListBoxA widget that presents a list of choices to the user, either as a list box or as a drop-down + * list. * * MenuBarA standard menu bar widget. * @@ -3580,7 +3399,7 @@ declare namespace GoogleAppsScript { * RadioButtonA mutually-exclusive selection radio button widget. * * ResetButtonA standard push-button widget which will automatically reset its enclosing FormPanel if - * any. + * any. * * ScrollPanelA panel that wraps its contents in a scrollable element. * @@ -3592,26 +3411,25 @@ declare namespace GoogleAppsScript { * * SplitLayoutPanelA panel that adds user-positioned splitters between each of its child widgets. * - * StackPanelA panel that stacks its children vertically, displaying only one at a time, - * with a header for each child which the user can click to display. + * StackPanelA panel that stacks its children vertically, displaying only one at a time, with a header for + * each child which the user can click to display. * * SubmitButtonA standard push-button widget which will automatically submit its enclosing FormPanel if - * any. + * any. * - * SuggestBoxA SuggestBox is a text box or text area which displays a - * pre-configured set of selections that match the user's input. + * SuggestBoxA SuggestBox is a text box or text area which displays a pre-configured set of selections + * that match the user's input. * * TabBarA horizontal bar of folder-style tabs, most commonly used as part of a TabPanel. * - * TabPanelA panel that represents a tabbed set of pages, each of which contains another - * widget. + * TabPanelA panel that represents a tabbed set of pages, each of which contains another widget. * * TextAreaA text box that allows multiple lines of text to be entered. * * TextBoxA standard single-line text box. * - * ToggleButtonA ToggleButton is a stylish stateful button which allows the - * user to toggle between up and down states. + * ToggleButtonA ToggleButton is a stylish stateful button which allows the user to toggle between + * up and down states. * * TreeA standard hierarchical tree widget. * diff --git a/types/google-apps-script/google-apps-script.url-fetch.d.ts b/types/google-apps-script/google-apps-script.url-fetch.d.ts index 4e8d45ec16..43d6825b72 100644 --- a/types/google-apps-script/google-apps-script.url-fetch.d.ts +++ b/types/google-apps-script/google-apps-script.url-fetch.d.ts @@ -1,7 +1,6 @@ -// Type definitions for Google Apps Script 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen -// ramzallan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -26,75 +25,33 @@ declare namespace GoogleAppsScript { getResponseCode(): Integer; } - export interface URLFetchRequestOptions { - /** - * the content type (defaults to 'application/x-www-form-urlencoded'). Another example of content - * type is 'application/xml; charset=utf-8'. - */ - contentType?: string; - - /** - * a JavaScript key/value map of HTTP headers for the request - */ - headers?: Object; - - /** - * the HTTP method for the request: get, delete, patch, post, or put. The default is get. - */ - method?: 'get' | 'delete' | 'patch' | 'post' | 'put'; - - /** - * the payload (e.g. POST body) for the request. Certain HTTP methods (e.g. GET) do not accept a - * payload. It can be a string, a byte array, or a JavaScript object. A JavaScript object will be - * interpretted as a map of form field names to values, where the values can be either strings or blobs. - */ - payload?: string; - - /** - * Deprecated. This instructs fetch to resolve the specified URL within the intranet linked to your - * domain through (deprecated) SDC - */ - useIntranet?: boolean; - - /** - * if this is set to false, the fetch will ignore any invalid certificates for HTTPS requests. - * The default is true. - */ - validateHttpsCertificates?: boolean; - - /** - * if this is set to false, the fetch not automatically follow HTTP redirects; it will return - * the original HTTP response. The default is true. - */ - followRedirects?: boolean; - - /** - * if this is set to true, the fetch will not throw an exception if the response code indicates - * failure, and will instead return the HTTPResponse (default: false) - */ - muteHttpExceptions?: boolean; - - /** - * if this is set to false, reserved characters in the URL will not be escaped (default: true) - */ - escaping?: boolean; - } - /** * Fetch resources and communicate with other hosts over the Internet. * - * This service allows scripts to communicate with other applications or access other resources on - * the web by fetching URLs. A script can use the URL Fetch service to issue HTTP and HTTPS requests - * and receive responses. The URL Fetch service uses Google's network infrastructure for efficiency - * and scaling purposes. + * This service allows scripts to communicate with other applications or access other resources + * on the web by fetching URLs. A script can use the URL Fetch service to issue HTTP and HTTPS + * requests and receive responses. The URL Fetch service uses Google's network infrastructure for + * efficiency and scaling purposes. + * + * Requests made using this service originate from a set pool of IP ranges. You can look up the full list of IP addresses + * if you need to whitelist or approve these requests. + * + * This service requires the https://www.googleapis.com/auth/script.external_request + * scope. In most cases Apps Script automatically detects and includes the scopes a script needs, + * but if you are setting your scopes + * explicitly you must manually add this scope to use UrlFetchApp. * See also * * HTTPResponse + * + * Setting explicit scopes */ export interface UrlFetchApp { - fetch(url: string, params?: URLFetchRequestOptions): HTTPResponse; + fetch(url: string): HTTPResponse; + fetch(url: string, params: Object): HTTPResponse; fetchAll(requests: Object[]): HTTPResponse[]; - getRequest(url: string, params?: URLFetchRequestOptions): Object; + getRequest(url: string): Object; + getRequest(url: string, params: Object): Object; } } 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 c8fde9349c..272c341b6c 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 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -25,7 +25,7 @@ declare namespace GoogleAppsScript { /** * This service provides utilities for string encoding/decoding, date formatting, JSON manipulation, - * and other miscellaneous tasks. + * and other miscellaneous tasks. */ export interface Utilities { Charset: typeof Charset; @@ -41,10 +41,13 @@ declare namespace GoogleAppsScript { base64EncodeWebSafe(data: Byte[]): string; base64EncodeWebSafe(data: string): string; base64EncodeWebSafe(data: string, charset: Charset): string; + computeDigest(algorithm: DigestAlgorithm, value: Byte[]): Byte[]; computeDigest(algorithm: DigestAlgorithm, value: string): Byte[]; computeDigest(algorithm: DigestAlgorithm, value: string, charset: Charset): Byte[]; + computeHmacSha256Signature(value: Byte[], key: Byte[]): Byte[]; computeHmacSha256Signature(value: string, key: string): Byte[]; computeHmacSha256Signature(value: string, key: string, charset: Charset): Byte[]; + 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[]; computeRsaSha256Signature(value: string, key: string): Byte[]; @@ -52,6 +55,8 @@ declare namespace GoogleAppsScript { formatDate(date: Date, timeZone: string, format: string): string; formatString(template: string, ...args: Object[]): string; getUuid(): string; + gzip(blob: Base.BlobSource): Base.Blob; + gzip(blob: Base.BlobSource, name: string): Base.Blob; newBlob(data: Byte[]): Base.Blob; newBlob(data: Byte[], contentType: string): Base.Blob; newBlob(data: Byte[], contentType: string, name: string): Base.Blob; @@ -61,6 +66,7 @@ declare namespace GoogleAppsScript { parseCsv(csv: string): string[][]; parseCsv(csv: string, delimiter: Char): string[][]; sleep(milliseconds: Integer): void; + ungzip(blob: Base.BlobSource): Base.Blob; unzip(blob: Base.BlobSource): Base.Blob[]; zip(blobs: Base.BlobSource[]): Base.Blob; zip(blobs: Base.BlobSource[], name: string): Base.Blob; diff --git a/types/google-apps-script/google-apps-script.xml-service.d.ts b/types/google-apps-script/google-apps-script.xml-service.d.ts index 664fbfc2b9..ff63f961b8 100644 --- a/types/google-apps-script/google-apps-script.xml-service.d.ts +++ b/types/google-apps-script/google-apps-script.xml-service.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2017-05-12 +// Type definitions for Google Apps Script 2018-07-11 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,21 +10,21 @@ declare namespace GoogleAppsScript { /** * A representation of an XML attribute. * - * // Reads the first and last name of each person and adds a new attribute with the full name. - * var xml = '' - * + '' - * + '' - * + ''; - * var document = XmlService.parse(xml); - * var people = document.getRootElement().getChildren('person'); - * for (var i = 0; i < people.length; i++) { - * var person = people[i]; - * var firstName = person.getAttribute('first').getValue(); - * var lastName = person.getAttribute('last').getValue(); - * person.setAttribute('full', firstName + ' ' + lastName); - * } - * xml = XmlService.getPrettyFormat().format(document); - * Logger.log(xml); + * // Reads the first and last name of each person and adds a new attribute with the full name. + * var xml = '' + * + '' + * + '' + * + ''; + * var document = XmlService.parse(xml); + * var people = document.getRootElement().getChildren('person'); + * for (var i = 0; i < people.length; i++) { + * var person = people[i]; + * var firstName = person.getAttribute('first').getValue(); + * var lastName = person.getAttribute('last').getValue(); + * person.setAttribute('full', firstName + ' ' + lastName); + * } + * xml = XmlService.getPrettyFormat().format(document); + * Logger.log(xml); */ export interface Attribute { getName(): string; @@ -38,15 +38,15 @@ declare namespace GoogleAppsScript { /** * A representation of an XML CDATASection node. * - * // Create and log an XML document that shows how special characters like '<', '>', and '&' are - * // stored in a CDATASection node as compared to in a Text node. - * var illegalCharacters = 'The Amazing Adventures of Kavalier & Clay'; - * var cdata = XmlService.createCdata(illegalCharacters); - * var text = XmlService.createText(illegalCharacters); - * var root = XmlService.createElement('root').addContent(cdata).addContent(text); - * var document = XmlService.createDocument(root); - * var xml = XmlService.getPrettyFormat().format(document); - * Logger.log(xml); + * // Create and log an XML document that shows how special characters like '<', '>', and '&' are + * // stored in a CDATASection node as compared to in a Text node. + * var illegalCharacters = 'The Amazing Adventures of Kavalier & Clay'; + * var cdata = XmlService.createCdata(illegalCharacters); + * var text = XmlService.createText(illegalCharacters); + * var root = XmlService.createElement('root').addContent(cdata).addContent(text); + * var document = XmlService.createDocument(root); + * var xml = XmlService.getPrettyFormat().format(document); + * Logger.log(xml); */ export interface Cdata { append(text: string): Text; @@ -149,23 +149,23 @@ declare namespace GoogleAppsScript { /** * A representation of an XML Element node. * - * // Adds up the values listed in a sample XML document and adds a new element with the total. - * var xml = '' - * + '12' - * + '18' - * + '25' - * + ''; - * var document = XmlService.parse(xml); - * var root = document.getRootElement(); - * var items = root.getChildren(); - * var total = 0; - * for (var i = 0; i < items.length; i++) { - * total += Number(items[i].getText()); - * } - * var totalElement = XmlService.createElement('total').setText(total); - * root.addContent(totalElement); - * xml = XmlService.getPrettyFormat().format(document); - * Logger.log(xml); + * // Adds up the values listed in a sample XML document and adds a new element with the total. + * var xml = '' + * + '12' + * + '18' + * + '25' + * + ''; + * var document = XmlService.parse(xml); + * var root = document.getRootElement(); + * var items = root.getChildren(); + * var total = 0; + * for (var i = 0; i < items.length; i++) { + * total += Number(items[i].getText()); + * } + * var totalElement = XmlService.createElement('total').setText(total); + * root.addContent(totalElement); + * xml = XmlService.getPrettyFormat().format(document); + * Logger.log(xml); */ export interface Element { addContent(content: Content): Element; @@ -227,17 +227,17 @@ declare namespace GoogleAppsScript { /** * A formatter for outputting an XML document, with three pre-defined formats that can be further - * customized. + * customized. * - * // Log an XML document with specified formatting options. - * var xml = 'Text!More text!'; - * var document = XmlService.parse(xml); - * var output = XmlService.getCompactFormat() - * .setLineSeparator('\n') - * .setEncoding('UTF-8') - * .setIndent(' ') - * .format(document); - * Logger.log(output); + * // Log an XML document with specified formatting options. + * var xml = 'Text!More text!'; + * var document = XmlService.parse(xml); + * var output = XmlService.getCompactFormat() + * .setLineSeparator('\n') + * .setEncoding('UTF-8') + * .setIndent(' ') + * .format(document); + * Logger.log(output); */ export interface Format { format(document: Document): string; @@ -283,41 +283,41 @@ declare namespace GoogleAppsScript { /** * This service allows scripts to parse, navigate, and programmatically create XML documents. * - * // Log the title and labels for the first page of blog posts on the G Suite Developer blog. - * function parseXml() { - * var url = 'https://gsuite-developers.googleblog.com/atom.xml'; - * var xml = UrlFetchApp.fetch(url).getContentText(); - * var document = XmlService.parse(xml); - * var root = document.getRootElement(); - * var atom = XmlService.getNamespace('http://www.w3.org/2005/Atom'); + * // Log the title and labels for the first page of blog posts on the G Suite Developer blog. + * function parseXml() { + * var url = 'https://gsuite-developers.googleblog.com/atom.xml'; + * var xml = UrlFetchApp.fetch(url).getContentText(); + * var document = XmlService.parse(xml); + * var root = document.getRootElement(); + * var atom = XmlService.getNamespace('http://www.w3.org/2005/Atom'); * - * var entries = document.getRootElement().getChildren('entry', atom); - * for (var i = 0; i < entries.length; i++) { - * var title = entries[i].getChild('title', atom).getText(); - * var categoryElements = entries[i].getChildren('category', atom); - * var labels = []; - * for (var j = 0; j < categoryElements.length; j++) { - * labels.push(categoryElements[j].getAttribute('term').getValue()); - * } - * Logger.log('%s (%s)', title, labels.join(', ')); - * } - * } + * var entries = document.getRootElement().getChildren('entry', atom); + * for (var i = 0; i < entries.length; i++) { + * var title = entries[i].getChild('title', atom).getText(); + * var categoryElements = entries[i].getChildren('category', atom); + * var labels = []; + * for (var j = 0; j < categoryElements.length; j++) { + * labels.push(categoryElements[j].getAttribute('term').getValue()); + * } + * Logger.log('%s (%s)', title, labels.join(', ')); + * } + * } * - * // Create and log an XML representation of the threads in your Gmail inbox. - * function createXml() { - * var root = XmlService.createElement('threads'); - * var threads = GmailApp.getInboxThreads(); - * for (var i = 0; i < threads.length; i++) { - * var child = XmlService.createElement('thread') - * .setAttribute('messageCount', threads[i].getMessageCount()) - * .setAttribute('isUnread', threads[i].isUnread()) - * .setText(threads[i].getFirstMessageSubject()); - * root.addContent(child); - * } - * var document = XmlService.createDocument(root); - * var xml = XmlService.getPrettyFormat().format(document); - * Logger.log(xml); - * } + * // Create and log an XML representation of the threads in your Gmail inbox. + * function createXml() { + * var root = XmlService.createElement('threads'); + * var threads = GmailApp.getInboxThreads(); + * for (var i = 0; i < threads.length; i++) { + * var child = XmlService.createElement('thread') + * .setAttribute('messageCount', threads[i].getMessageCount()) + * .setAttribute('isUnread', threads[i].isUnread()) + * .setText(threads[i].getFirstMessageSubject()); + * root.addContent(child); + * } + * var document = XmlService.createDocument(root); + * var xml = XmlService.getPrettyFormat().format(document); + * Logger.log(xml); + * } */ export interface XmlService { ContentTypes: typeof ContentType; diff --git a/types/google-apps-script/index.d.ts b/types/google-apps-script/index.d.ts index 129e11d70f..0a965efe99 100644 --- a/types/google-apps-script/index.d.ts +++ b/types/google-apps-script/index.d.ts @@ -7,7 +7,7 @@ /// /// /// -/// +/// /// /// /// diff --git a/types/google-cloud__storage/index.d.ts b/types/google-cloud__storage/index.d.ts index a614ea4982..9eb90db25a 100644 --- a/types/google-cloud__storage/index.d.ts +++ b/types/google-cloud__storage/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/GoogleCloudPlatform/google-cloud-node/tree/master/packages/storage // Definitions by: Brian Love // Nathan Brooker Perry +// Matt Welke // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -17,7 +18,7 @@ declare namespace Storage { class Bucket { constructor(storage: Storage, name: string); acl: Acl; - combine(sources: string[] | File[], destination: string[] | File[]): Promise<[File, ApiResponse]>; + combine(sources: string[] | File[], destination: string | File): Promise<[File, ApiResponse]>; create(config?: BucketConfig): Promise<[Bucket, ApiResponse]>; createChannel(id: string, config: ChannelConfig): Promise<[Channel, ApiResponse]>; delete(): Promise<[ApiResponse]>; diff --git a/types/google.visualization/index.d.ts b/types/google.visualization/index.d.ts index a94ca8dc90..5a4e8f0b32 100644 --- a/types/google.visualization/index.d.ts +++ b/types/google.visualization/index.d.ts @@ -20,6 +20,7 @@ declare namespace google { export interface ChartSpecs { chartType: string; + container?: HTMLElement; containerId?: string; options?: Object; dataTable?: Object; diff --git a/types/googlemaps/googlemaps-tests.ts b/types/googlemaps/googlemaps-tests.ts index 99d5902a88..77a2900b7b 100644 --- a/types/googlemaps/googlemaps-tests.ts +++ b/types/googlemaps/googlemaps-tests.ts @@ -412,3 +412,28 @@ heatmap.setData([ { weight: 1, location: new google.maps.LatLng(37.782551, -122.445368) }, { weight: 2, location: new google.maps.LatLng(37.782745, -122.444586) } ]); + +/***** google.maps.places.PlacesService *****/ +let service = new google.maps.places.PlacesService(new HTMLDivElement()); + +service.getDetails({ + placeId: '-a1', + fields: ['name'] +}, (result, status) => { + if (status === google.maps.places.PlacesServiceStatus.NOT_FOUND) { + return; + } + + result.name; // $ExpectType string +}) + +service.findPlaceFromQuery({ + query: 'Big Ben London', + fields: ['name'] +}, (results, status) => { + if (status === google.maps.places.PlacesServiceStatus.ERROR) { + return; + } + + results[0].name; // $ExpectType string +}); diff --git a/types/googlemaps/index.d.ts b/types/googlemaps/index.d.ts index a8de5810ec..501dd4c1f8 100644 --- a/types/googlemaps/index.d.ts +++ b/types/googlemaps/index.d.ts @@ -1106,6 +1106,13 @@ declare namespace google.maps { zIndex?: number; } + export interface CircleLiteral extends CircleOptions { + /** The center of the Circle. */ + center?: LatLng|LatLngLiteral; + /** The radius in meters on the Earth's surface. */ + radius?: number; + } + /** * The possible positions of the stroke on a polygon. */ @@ -2549,6 +2556,8 @@ declare namespace google.maps { country: string|string[]; } + export type LocationBias = LatLng|LatLngLiteral|LatLngBounds|LatLngBoundsLiteral|Circle|CircleLiteral|string; + export interface PlaceAspectRating { rating: number; type: string; @@ -2556,6 +2565,7 @@ declare namespace google.maps { export interface PlaceDetailsRequest { placeId: string; + fields?: string[]; } export interface PlaceGeometry { @@ -2629,16 +2639,21 @@ declare namespace google.maps { export class PlacesService { constructor(attrContainer: HTMLDivElement|Map); + findPlaceFromPhoneNumber(request: FindPlaceFromPhoneNumberRequest, callback: (results: PlaceResult[], status: PlacesServiceStatus) => void): void; + findPlaceFromQuery(request: FindPlaceFromQueryRequest, callback: (results: PlaceResult[], status: PlacesServiceStatus) => void): void; getDetails(request: PlaceDetailsRequest, callback: (result: PlaceResult, status: PlacesServiceStatus) => void): void; nearbySearch(request: PlaceSearchRequest, callback: (results: PlaceResult[], status: PlacesServiceStatus, pagination: PlaceSearchPagination) => void): void; + /** @deprecated Radar search is deprecated as of June 30, 2018. After that time, this feature will no longer be available. */ radarSearch(request: RadarSearchRequest, callback: (results: PlaceResult[], status: PlacesServiceStatus) => void): void; textSearch(request: TextSearchRequest, callback: (results: PlaceResult[], status: PlacesServiceStatus, pagination: PlaceSearchPagination) => void): void; } export enum PlacesServiceStatus { + ERROR, INVALID_REQUEST, OK, OVER_QUERY_LIMIT, + NOT_FOUND, REQUEST_DENIED, UNKNOWN_ERROR, ZERO_RESULTS @@ -2693,6 +2708,18 @@ declare namespace google.maps { types?: string[]; /* Deprecated. Will be removed February 16, 2017 */ type?: string; } + + export interface FindPlaceFromQueryRequest { + fields: string[]; + locationBias?: LocationBias; + query: string; + } + + export interface FindPlaceFromPhoneNumberRequest { + fields: string[]; + locationBias?: LocationBias; + query: string; + } } /***** Drawing Library *****/ diff --git a/types/got/index.d.ts b/types/got/index.d.ts index f786af118e..86a3d42131 100644 --- a/types/got/index.d.ts +++ b/types/got/index.d.ts @@ -100,6 +100,7 @@ declare namespace got { } interface GotJSONOptions extends GotOptions { + // Body must be an object or array. See https://github.com/sindresorhus/got/issues/511 body?: object; form?: boolean; json: true; diff --git a/types/graphql/execution/execute.d.ts b/types/graphql/execution/execute.d.ts index 7ef4d5ce63..60294abbc7 100644 --- a/types/graphql/execution/execute.d.ts +++ b/types/graphql/execution/execute.d.ts @@ -36,15 +36,19 @@ export interface ExecutionContext { errors: GraphQLError[]; } +export interface ExecutionResultDataDefault { + [key: string]: any +} + /** * The result of GraphQL execution. * * - `errors` is included when any errors occurred as a non-empty array. * - `data` is the result of a successful execution of the query. */ -export interface ExecutionResult { +export interface ExecutionResult { errors?: ReadonlyArray; - data?: { [key: string]: any }; + data?: TData; } export type ExecutionArgs = { @@ -69,8 +73,8 @@ export type ExecutionArgs = { * * Accepts either an object with named arguments, or individual arguments. */ -export function execute(args: ExecutionArgs): MaybePromise; -export function execute( +export function execute(args: ExecutionArgs): MaybePromise>; +export function execute( schema: GraphQLSchema, document: DocumentNode, rootValue?: any, @@ -78,7 +82,7 @@ export function execute( variableValues?: Maybe<{ [key: string]: any }>, operationName?: Maybe, fieldResolver?: Maybe> -): MaybePromise; +): MaybePromise>; /** * Given a ResponsePath (found in the `path` entry in the information provided @@ -89,6 +93,7 @@ export function responsePathAsArray(path: ResponsePath): ReadonlyArray>; } -export function graphql(args: GraphQLArgs): Promise; -export function graphql( +export function graphql(args: GraphQLArgs): Promise>; +export function graphql( schema: GraphQLSchema, source: Source | string, rootValue?: any, @@ -53,7 +53,7 @@ export function graphql( variableValues?: Maybe<{ [key: string]: any }>, operationName?: Maybe, fieldResolver?: Maybe> -): Promise; +): Promise>; /** * The graphqlSync function also fulfills GraphQL operations by parsing, @@ -61,8 +61,8 @@ export function graphql( * However, it guarantees to complete synchronously (or throw an error) assuming * that all field resolvers are also synchronous. */ -export function graphqlSync(args: GraphQLArgs): ExecutionResult; -export function graphqlSync( +export function graphqlSync(args: GraphQLArgs): ExecutionResult; +export function graphqlSync( schema: GraphQLSchema, source: Source | string, rootValue?: any, @@ -70,4 +70,4 @@ export function graphqlSync( variableValues?: Maybe<{ [key: string]: any }>, operationName?: Maybe, fieldResolver?: Maybe> -): ExecutionResult; +): ExecutionResult; diff --git a/types/graphql/index.d.ts b/types/graphql/index.d.ts index ba9213b7c4..2e9b01d700 100644 --- a/types/graphql/index.d.ts +++ b/types/graphql/index.d.ts @@ -14,6 +14,7 @@ // Alessio Dionisi // Divyendu Singh // Brad Zacher +// Curtis Layne // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 diff --git a/types/graphql/subscription/subscribe.d.ts b/types/graphql/subscription/subscribe.d.ts index f5b29ebbb8..b58c36bd8a 100644 --- a/types/graphql/subscription/subscribe.d.ts +++ b/types/graphql/subscription/subscribe.d.ts @@ -2,7 +2,7 @@ import Maybe from "../tsutils/Maybe"; import { GraphQLSchema } from "../type/schema"; import { DocumentNode } from "../language/ast"; import { GraphQLFieldResolver } from "../type/definition"; -import { ExecutionResult } from "../execution/execute"; +import { ExecutionResult, ExecutionResultDataDefault } from "../execution/execute"; /** * Implements the "Subscribe" algorithm described in the GraphQL specification. @@ -24,7 +24,7 @@ import { ExecutionResult } from "../execution/execute"; * * Accepts either an object with named arguments, or individual arguments. */ -export function subscribe(args: { +export function subscribe(args: { schema: GraphQLSchema; document: DocumentNode; rootValue?: any; @@ -33,9 +33,9 @@ export function subscribe(args: { operationName?: Maybe; fieldResolver?: Maybe>; subscribeFieldResolver?: Maybe>; -}): Promise | ExecutionResult>; +}): Promise> | ExecutionResult>; -export function subscribe( +export function subscribe( schema: GraphQLSchema, document: DocumentNode, rootValue?: any, @@ -44,7 +44,7 @@ export function subscribe( operationName?: Maybe, fieldResolver?: Maybe>, subscribeFieldResolver?: Maybe> -): Promise | ExecutionResult>; +): Promise> | ExecutionResult>; /** * Implements the "CreateSourceEventStream" algorithm described in the @@ -64,7 +64,7 @@ export function subscribe( * or otherwise separating these two steps. For more on this, see the * "Supporting Subscriptions at Scale" information in the GraphQL specification. */ -export function createSourceEventStream( +export function createSourceEventStream( schema: GraphQLSchema, document: DocumentNode, rootValue?: any, @@ -72,4 +72,4 @@ export function createSourceEventStream( variableValues?: { [key: string]: any }, operationName?: Maybe, fieldResolver?: Maybe> -): Promise | ExecutionResult>; +): Promise | ExecutionResult>; diff --git a/types/grid-styled/index.d.ts b/types/grid-styled/index.d.ts index af969b0cec..81c11df405 100644 --- a/types/grid-styled/index.d.ts +++ b/types/grid-styled/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for grid-styled 4.1 +// Type definitions for grid-styled 4.2 // Project: https://github.com/jxnblk/grid-styled // Definitions by: Anton Vasin // Victor Orlov @@ -8,7 +8,7 @@ export type Omit = Pick; -import { ComponentClass } from "react"; +import { ComponentType } from "react"; import { StyledComponentClass } from "styled-components"; export type ResponsiveProp = number | string | Array; @@ -39,7 +39,7 @@ export interface BoxProps extends Omit, "width" | "wrap" | "is"> { flex?: ResponsiveProp; order?: ResponsiveProp; - is?: string | ComponentClass; + is?: string | ComponentType; alignSelf?: ResponsiveProp; } @@ -77,4 +77,4 @@ export const theme: Theme; export type DivProps = Omit, "ref"> & { innerRef?: (el: HTMLDivElement) => any; }; -export const div: ComponentClass; +export const div: ComponentType; diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index d8edc40685..f5001a8324 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -3200,7 +3200,7 @@ export interface ServerState { * 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[]): string; + format(cookies: ServerStateFormat | ServerStateFormat[]): Promise; /** * Parses an HTTP 'Cookies' header based on the server.options.state where: @@ -3209,7 +3209,7 @@ export interface ServerState { * 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): Util.Dictionary; + parse(header: string): Promise>; } /** diff --git a/types/hard-source-webpack-plugin/hard-source-webpack-plugin-tests.ts b/types/hard-source-webpack-plugin/hard-source-webpack-plugin-tests.ts new file mode 100644 index 0000000000..a2cc9a486a --- /dev/null +++ b/types/hard-source-webpack-plugin/hard-source-webpack-plugin-tests.ts @@ -0,0 +1,8 @@ +import * as HardSourceWebpackPlugin from 'hard-source-webpack-plugin'; + +new HardSourceWebpackPlugin({ + info: { + level: 'debug', + mode: 'test', + } +}); diff --git a/types/hard-source-webpack-plugin/index.d.ts b/types/hard-source-webpack-plugin/index.d.ts new file mode 100644 index 0000000000..3e02ee1d8a --- /dev/null +++ b/types/hard-source-webpack-plugin/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for hard-source-webpack-plugin 0.9 +// Project: https://github.com/mzgoddard/hard-source-webpack-plugin#readme +// Definitions by: woitechen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as webpack from 'webpack'; + +declare class hard_source_webpack_plugin { + constructor(options?: Options); + apply(...args: any[]): void; +} + +declare namespace hard_source_webpack_plugin { } + +interface Options { + cacheDirectory?: string; + configHash?: (webpackConfig?: webpack.Configuration) => string; + environmentHash?: { + root: string; + directories: string[]; + files: string[]; + }; + info?: { + mode: 'none' | 'test'; + level: 'debug' | 'log' | 'info' | 'warn' | 'error'; + }; + cachePrune?: { + maxAge: number; + sizeThreshold: number; + }; +} + +export = hard_source_webpack_plugin; diff --git a/types/hard-source-webpack-plugin/tsconfig.json b/types/hard-source-webpack-plugin/tsconfig.json new file mode 100644 index 0000000000..94b7ae1705 --- /dev/null +++ b/types/hard-source-webpack-plugin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "hard-source-webpack-plugin-tests.ts" + ] +} diff --git a/types/hard-source-webpack-plugin/tslint.json b/types/hard-source-webpack-plugin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/hard-source-webpack-plugin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/hexo-fs/hexo-fs-tests.ts b/types/hexo-fs/hexo-fs-tests.ts index 7bd5dc13b8..d678e91f34 100644 --- a/types/hexo-fs/hexo-fs-tests.ts +++ b/types/hexo-fs/hexo-fs-tests.ts @@ -1,995 +1,144 @@ +import 'mocha'; import fs = require('hexo-fs'); -import { join, dirname } from 'path'; import chai = require('chai'); import Promise = require('bluebird'); - -// Stub mocha functions -const {describe, it, before, after, beforeEach, afterEach} = null as any as { - [s: string]: ((s: string, cb: (done: any) => void) => void) & ((cb: (done: any) => void) => void) & {only: any, skip: any}; -}; +import { FSWatcher } from 'chokidar'; const should = chai.should(); -function createDummyFolder(path: string) { - return Promise.all([ - // Normal files in a hidden folder - fs.writeFile(join(path, '.hidden', 'a.txt'), 'a'), - fs.writeFile(join(path, '.hidden', 'b.js'), 'b'), - // Normal folder in a hidden folder - fs.writeFile(join(path, '.hidden', 'c', 'd'), 'd'), - // Top-class files - fs.writeFile(join(path, 'e.txt'), 'e'), - fs.writeFile(join(path, 'f.js'), 'f'), - // A hidden file - fs.writeFile(join(path, '.g'), 'g'), - // Files in a normal folder - fs.writeFile(join(path, 'folder', 'h.txt'), 'h'), - fs.writeFile(join(path, 'folder', 'i.js'), 'i'), - // A hidden files in a normal folder - fs.writeFile(join(path, 'folder', '.j'), 'j') - ]); -} +let string = ''; +let strings = [string]; +let bool = false; +let boolPromise: Promise; +let stringPromise: Promise; +let stringsPromise: Promise; +let stringOrStrings: string|string[]; +let stringOrStringsPromise: Promise; +let watcherPromise: Promise; +let writeStream: fs.WriteStream; +let writeStreamPromise: Promise; -const tmpDir = join(__dirname, 'fs_tmp'); +boolPromise = fs.exists(string); -before(() => fs.mkdirs(tmpDir)); - -after(done => { - fs.rmdir(tmpDir); - done(); +fs.exists(string, exist => { + bool = exist; }); -it('exists()', () => { - return fs.exists(tmpDir).then(exist => { - exist.should.be.true; - }); +// $ExpectType Bluebird +fs.mkdirs(string); + +fs.mkdirs(string, err => { + should.not.exist(err); }); -it('exists() - callback', callback => { - fs.exists(tmpDir, (exist) => { - exist.should.be.true; - callback(); - }); +// $ExpectType void +fs.mkdirsSync(string); + +// $ExpectType Bluebird +fs.writeFile(string, 'foo'); + +fs.writeFile(string, 'foo', err => { + should.not.exist(err); }); -it('mkdirs()', () => { - const target = join(tmpDir, 'a', 'b', 'c'); +// $ExpectType void +fs.writeFileSync(string, 'foo'); - return fs.mkdirs(target).then(() => { - return fs.exists(target); - }).then(exist => { - exist.should.be.true; - return fs.rmdir(join(tmpDir, 'a')); - }); +// $ExpectType Bluebird +fs.appendFile(string, 'foo'); + +fs.appendFile(string, 'bar', err => { + should.not.exist(err); }); -it('mkdirs() - callback', callback => { - const target = join(tmpDir, 'a', 'b', 'c'); +// $ExpectType void +fs.appendFileSync(string, 'bar'); - fs.mkdirs(target, err => { - should.not.exist(err); +// $ExpectType Bluebird +fs.copyFile(string, string); - fs.exists(target, exist => { - exist.should.be.true; - fs.rmdir(join(tmpDir, 'a'), callback); - }); - }); +fs.copyFile(string, string, err => { + should.not.exist(err); }); -it('mkdirsSync()', () => { - const target = join(tmpDir, 'a', 'b', 'c'); +stringsPromise = fs.copyDir(string, string); - fs.mkdirsSync(target); - - return fs.exists(target).then(exist => { - exist.should.be.true; - return fs.rmdir(join(tmpDir, 'a')); - }); +fs.copyDir(string, string, (err, files) => { + should.not.exist(err); + strings = files!; }); -it('writeFile()', () => { - const target = join(tmpDir, 'a', 'b', 'test.txt'); - const body = 'foo'; +stringsPromise = fs.copyDir(string, string, { ignoreHidden: false }); +stringsPromise = fs.copyDir(string, string, { ignorePattern: /\.js/ }); - return fs.writeFile(target, body).then(() => { - return fs.readFile(target); - }).then(content => { - content.should.eql(body); - return fs.rmdir(join(tmpDir, 'a')); - }); +stringsPromise = fs.listDir(string); + +fs.listDir(string, (err, files) => { + should.not.exist(err); + strings = files!; }); -it('writeFile() - callback', callback => { - const target = join(tmpDir, 'a', 'b', 'test.txt'); - const body = 'foo'; +stringsPromise = fs.listDir(string, { ignoreHidden: false }); +stringsPromise = fs.listDir(string, { ignorePattern: /\.js/ }); - fs.writeFile(target, body, err => { - should.not.exist(err); +stringOrStrings = fs.listDirSync(string); +stringOrStrings = fs.listDirSync(string, { ignoreHidden: false }); +stringOrStrings = fs.listDirSync(string, { ignorePattern: /\.js/ }); - fs.readFile(target, (_, content) => { - content!.should.eql(body); - fs.rmdir(join(tmpDir, 'a'), callback); - }); - }); +stringPromise = fs.readFile(string); + +fs.readFile(string, (err, content) => { + should.not.exist(err); + string = content!; }); -it('writeFileSync()', () => { - const target = join(tmpDir, 'a', 'b', 'test.txt'); - const body = 'foo'; +string = fs.readFileSync(string); - fs.writeFileSync(target, body); +// $ExpectType Bluebird +fs.unlink(string); - return fs.readFile(target).then(content => { - content.should.eql(body); - return fs.rmdir(join(tmpDir, 'a')); - }); +stringOrStringsPromise = fs.emptyDir(string); + +fs.emptyDir(string, (err, files) => { + should.not.exist(err); + stringOrStrings = files!; }); -it('appendFile()', () => { - const target = join(tmpDir, 'a', 'b', 'test.txt'); - const body = 'foo'; - const body2 = 'bar'; +stringOrStringsPromise = fs.emptyDir(string, { ignoreHidden: false }); +stringOrStringsPromise = fs.emptyDir(string, { ignorePattern: /\.js/ }); +stringOrStringsPromise = fs.emptyDir(string, { exclude: strings }); - return fs.writeFile(target, body).then(() => { - return fs.appendFile(target, body2); - }).then(() => { - return fs.readFile(target); - }).then(content => { - content.should.eql(body + body2); - return fs.rmdir(join(tmpDir, 'a')); - }); +stringOrStrings = fs.emptyDirSync(string); +stringOrStrings = fs.emptyDirSync(string, { ignoreHidden: false }); +stringOrStrings = fs.emptyDirSync(string, { ignorePattern: /\.js/ }); +stringOrStrings = fs.emptyDirSync(string, { exclude: strings }); + +// $ExpectType Bluebird +fs.rmdir(string); + +fs.rmdir(string, err => { + should.not.exist(err); }); -it('appendFile() - callback', callback => { - const target = join(tmpDir, 'a', 'b', 'test.txt'); - const body = 'foo'; - const body2 = 'bar'; +// $ExpectType void +fs.rmdirSync(string); - fs.writeFile(target, body, () => { - fs.appendFile(target, body2, err => { - should.not.exist(err); +watcherPromise = fs.watch(string); - fs.readFile(target, (_, content) => { - content!.should.eql(body + body2); - fs.rmdir(join(tmpDir, 'a'), callback); - }); - }); - }); +stringPromise = fs.ensurePath(string); + +fs.ensurePath(string, (err, path) => { + should.not.exist(err); + string = path!; }); -it('appendFileSync()', () => { - const target = join(tmpDir, 'a', 'b', 'test.txt'); - const body = 'foo'; - const body2 = 'bar'; +string = fs.ensurePathSync(string); - return fs.writeFile(target, body).then(() => { - fs.appendFileSync(target, body2); - return fs.readFile(target); - }).then(content => { - content.should.eql(body + body2); - return fs.rmdir(join(tmpDir, 'a')); - }); +writeStreamPromise = fs.ensureWriteStream(string); + +fs.ensureWriteStream(string, (err, stream) => { + should.not.exist(err); + writeStream = stream!; }); -it('copyFile()', () => { - const src = join(tmpDir, 'test.txt'); - const dest = join(tmpDir, 'a', 'b', 'test.txt'); - const body = 'foo'; - - return fs.writeFile(src, body).then(() => { - return fs.copyFile(src, dest); - }).then(() => { - return fs.readFile(dest); - }).then(content => { - content.should.eql(body); - - return Promise.all([ - fs.unlink(src), - fs.rmdir(join(tmpDir, 'a')) - ]); - }); -}); - -it('copyFile() - callback', callback => { - const src = join(tmpDir, 'test.txt'); - const dest = join(tmpDir, 'a', 'b', 'test.txt'); - const body = 'foo'; - - fs.writeFile(src, body, err => { - if (err) return callback(err); - - fs.copyFile(src, dest, err => { - if (err) return callback(err); - - fs.readFile(dest, (err, content) => { - if (err) - return callback(err); - content!.should.eql(body); - - Promise.all([ - fs.unlink(src), - fs.rmdir(join(tmpDir, 'a')) - ]).asCallback(callback); - }); - }); - }); -}); - -it('copyDir()', () => { - const src = join(tmpDir, 'a'); - const dest = join(tmpDir, 'b'); - - return createDummyFolder(src).then(() => { - return fs.copyDir(src, dest); - }).then(files => { - files.should.have.members([ - 'e.txt', - 'f.js', - join('folder', 'h.txt'), - join('folder', 'i.js') - ]); - - return Promise.all([ - fs.readFile(join(dest, 'e.txt')), - fs.readFile(join(dest, 'f.js')), - fs.readFile(join(dest, 'folder', 'h.txt')), - fs.readFile(join(dest, 'folder', 'i.js')) - ]); - }).then(result => { - result.should.eql(['e', 'f', 'h', 'i']); - }).then(() => { - return Promise.all([ - fs.rmdir(src), - fs.rmdir(dest) - ]); - }); -}); - -it('copyDir() - callback', callback => { - const src = join(tmpDir, 'a'); - const dest = join(tmpDir, 'b'); - - createDummyFolder(src).then(() => { - fs.copyDir(src, dest, (err, files) => { - should.not.exist(err); - files!.should.have.members([ - 'e.txt', - 'f.js', - join('folder', 'h.txt'), - join('folder', 'i.js') - ]); - - Promise.all([ - fs.readFile(join(dest, 'e.txt')), - fs.readFile(join(dest, 'f.js')), - fs.readFile(join(dest, 'folder', 'h.txt')), - fs.readFile(join(dest, 'folder', 'i.js')) - ]).then(result => { - result.should.eql(['e', 'f', 'h', 'i']); - }).then(() => { - return Promise.all([ - fs.rmdir(src), - fs.rmdir(dest) - ]); - }).asCallback(callback); - }); - }); -}); - -it('copyDir() - ignoreHidden off', () => { - const src = join(tmpDir, 'a'); - const dest = join(tmpDir, 'b'); - - return createDummyFolder(src).then(() => { - return fs.copyDir(src, dest, { ignoreHidden: false }); - }).then(files => { - files.should.have.members([ - join('.hidden', 'a.txt'), - join('.hidden', 'b.js'), - join('.hidden', 'c', 'd'), - 'e.txt', - 'f.js', - '.g', - join('folder', 'h.txt'), - join('folder', 'i.js'), - join('folder', '.j') - ]); - - return Promise.all([ - fs.readFile(join(dest, '.hidden', 'a.txt')), - fs.readFile(join(dest, '.hidden', 'b.js')), - fs.readFile(join(dest, '.hidden', 'c', 'd')), - fs.readFile(join(dest, 'e.txt')), - fs.readFile(join(dest, 'f.js')), - fs.readFile(join(dest, '.g')), - fs.readFile(join(dest, 'folder', 'h.txt')), - fs.readFile(join(dest, 'folder', 'i.js')), - fs.readFile(join(dest, 'folder', '.j')) - ]); - }).then(result => { - result.should.eql(['a', 'b', 'd', 'e', 'f', 'g', 'h', 'i', 'j']); - }).then(() => { - return Promise.all([ - fs.rmdir(src), - fs.rmdir(dest) - ]); - }); -}); - -it('copyDir() - ignorePattern', () => { - const src = join(tmpDir, 'a'); - const dest = join(tmpDir, 'b'); - - return createDummyFolder(src).then(() => { - return fs.copyDir(src, dest, { ignorePattern: /\.js/ }); - }).then(files => { - files.should.have.members(['e.txt', join('folder', 'h.txt')]); - - return Promise.all([ - fs.readFile(join(dest, 'e.txt')), - fs.readFile(join(dest, 'folder', 'h.txt')) - ]); - }).then(result => { - result.should.eql(['e', 'h']); - }).then(() => { - return Promise.all([ - fs.rmdir(src), - fs.rmdir(dest) - ]); - }); -}); - -it('listDir()', () => { - const target = join(tmpDir, 'test'); - - return createDummyFolder(target).then(() => { - return fs.listDir(target); - }).then(files => { - files.should.have.members([ - 'e.txt', - 'f.js', - join('folder', 'h.txt'), - join('folder', 'i.js') - ]); - - return fs.rmdir(target); - }); -}); - -it('listDir() - callback', callback => { - const target = join(tmpDir, 'test'); - - createDummyFolder(target).then(() => { - fs.listDir(target, (err, files) => { - if (err) return callback(err); - - files!.should.have.members([ - 'e.txt', - 'f.js', - join('folder', 'h.txt'), - join('folder', 'i.js') - ]); - - fs.rmdir(target, callback); - }); - }); -}); - -it('listDir() - ignoreHidden off', () => { - const target = join(tmpDir, 'test'); - - return createDummyFolder(target).then(() => { - return fs.listDir(target, { ignoreHidden: false }); - }).then(files => { - files.should.have.members([ - join('.hidden', 'a.txt'), - join('.hidden', 'b.js'), - join('.hidden', 'c', 'd'), - 'e.txt', - 'f.js', - '.g', - join('folder', 'h.txt'), - join('folder', 'i.js'), - join('folder', '.j') - ]); - - return fs.rmdir(target); - }); -}); - -it('listDir() - ignorePattern', () => { - const target = join(tmpDir, 'test'); - - return createDummyFolder(target).then(() => { - return fs.listDir(target, { ignorePattern: /\.js/ }); - }).then(files => { - files.should.have.members(['e.txt', join('folder', 'h.txt')]); - return fs.rmdir(target); - }); -}); - -it('listDirSync()', () => { - const target = join(tmpDir, 'test'); - - return createDummyFolder(target).then(() => { - const files = fs.listDirSync(target); - files.should.have.members([ - 'e.txt', - 'f.js', - join('folder', 'h.txt'), - join('folder', 'i.js') - ]); - - return fs.rmdir(target); - }); -}); - -it('listDirSync() - ignoreHidden off', () => { - const target = join(tmpDir, 'test'); - - return createDummyFolder(target).then(() => { - const files = fs.listDirSync(target, { ignoreHidden: false }); - files.should.have.members([ - join('.hidden', 'a.txt'), - join('.hidden', 'b.js'), - join('.hidden', 'c', 'd'), - 'e.txt', - 'f.js', - '.g', - join('folder', 'h.txt'), - join('folder', 'i.js'), - join('folder', '.j') - ]); - - return fs.rmdir(target); - }); -}); - -it('listDirSync() - ignorePattern', () => { - const target = join(tmpDir, 'test'); - - return createDummyFolder(target).then(() => { - const files = fs.listDirSync(target, { ignorePattern: /\.js/ }); - files.should.have.members(['e.txt', join('folder', 'h.txt')]); - return fs.rmdir(target); - }); -}); - -it('readFile()', () => { - const target = join(tmpDir, 'test.txt'); - const body = 'test'; - - return fs.writeFile(target, body).then(() => { - return fs.readFile(target); - }).then(content => { - content.should.eql(body); - return fs.unlink(target); - }); -}); - -it('readFile() - callback', callback => { - const target = join(tmpDir, 'test.txt'); - const body = 'test'; - - fs.writeFile(target, body, err => { - if (err) return callback(err); - - fs.readFile(target, (err, content) => { - if (err) return callback(err); - - content!.should.eql(body); - - fs.unlink(target).asCallback(callback); - }); - }); -}); - -it('readFile() - escape BOM', () => { - const target = join(tmpDir, 'test.txt'); - const body = '\ufefffoo'; - - return fs.writeFile(target, body).then(() => { - return fs.readFile(target); - }).then(content => { - content.should.eql('foo'); - return fs.unlink(target); - }); -}); - -it('readFile() - escape Windows line ending', () => { - const target = join(tmpDir, 'test.txt'); - const body = 'foo\r\nbar'; - - return fs.writeFile(target, body).then(() => { - return fs.readFile(target); - }).then(content => { - content.should.eql('foo\nbar'); - return fs.unlink(target); - }); -}); - -it('readFileSync()', () => { - const target = join(tmpDir, 'test.txt'); - const body = 'test'; - - return fs.writeFile(target, body).then(() => { - fs.readFileSync(target).should.eql(body); - return fs.unlink(target); - }); -}); - -it('readFileSync() - escape BOM', () => { - const target = join(tmpDir, 'test.txt'); - const body = '\ufefffoo'; - - return fs.writeFile(target, body).then(() => { - fs.readFileSync(target).should.eql('foo'); - return fs.unlink(target); - }); -}); - -it('readFileSync() - escape Windows line ending', () => { - const target = join(tmpDir, 'test.txt'); - const body = 'foo\r\nbar'; - - return fs.writeFile(target, body).then(() => { - fs.readFileSync(target).should.eql('foo\nbar'); - return fs.unlink(target); - }); -}); - -it('unlink()', () => { - const target = join(tmpDir, 'test-unlink'); - - return fs.writeFile(target, '').then(() => { - return fs.exists(target); - }).then(exist => { - exist.should.eql(true); - return fs.unlink(target); - }).then(() => { - return fs.exists(target); - }).then(exist => { - exist.should.eql(false); - }); -}); - -it('emptyDir()', () => { - const target = join(tmpDir, 'test'); - - return createDummyFolder(target).then(() => { - return fs.emptyDir(target); - }).then(files => { - files.should.have.members([ - 'e.txt', - 'f.js', - join('folder', 'h.txt'), - join('folder', 'i.js') - ]); - - return [ - [join(target, '.hidden', 'a.txt'), true], - [join(target, '.hidden', 'b.js'), true], - [join(target, '.hidden', 'c', 'd'), true], - [join(target, 'e.txt'), false], - [join(target, 'f.js'), false], - [join(target, '.g'), true], - [join(target, 'folder', 'h.txt'), false], - [join(target, 'folder', 'i.js'), false], - [join(target, 'folder', '.j'), true] - ]; - }).map((data: [string, boolean]) => { - return fs.exists(data[0]).then(exist => { - exist.should.eql(data[1]); - }); - }).then(() => { - return fs.rmdir(target); - }); -}); - -it('emptyDir() - callback', callback => { - const target = join(tmpDir, 'test'); - - createDummyFolder(target).then(() => { - fs.emptyDir(target, (err, files) => { - if (err) return callback(err); - - files!.should.have.members([ - 'e.txt', - 'f.js', - join('folder', 'h.txt'), - join('folder', 'i.js') - ]); - - Promise.map([ - [join(target, '.hidden', 'a.txt'), true], - [join(target, '.hidden', 'b.js'), true], - [join(target, '.hidden', 'c', 'd'), true], - [join(target, 'e.txt'), false], - [join(target, 'f.js'), false], - [join(target, '.g'), true], - [join(target, 'folder', 'h.txt'), false], - [join(target, 'folder', 'i.js'), false], - [join(target, 'folder', '.j'), true] - ], (data: any) => { - return fs.exists(data[0]).then(exist => { - exist.should.eql(data[1]); - }); - }).then(() => { - return fs.rmdir(target); - }).asCallback(callback); - }); - }); -}); - -it('emptyDir() - ignoreHidden off', () => { - const target = join(tmpDir, 'test'); - - return createDummyFolder(target).then(() => { - return fs.emptyDir(target, { ignoreHidden: false }); - }).then(files => { - files.should.have.members([ - join('.hidden', 'a.txt'), - join('.hidden', 'b.js'), - join('.hidden', 'c', 'd'), - 'e.txt', - 'f.js', - '.g', - join('folder', 'h.txt'), - join('folder', 'i.js'), - join('folder', '.j') - ]); - - return [ - [join(target, '.hidden', 'a.txt'), false], - [join(target, '.hidden', 'b.js'), false], - [join(target, '.hidden', 'c', 'd'), false], - [join(target, 'e.txt'), false], - [join(target, 'f.js'), false], - [join(target, '.g'), false], - [join(target, 'folder', 'h.txt'), false], - [join(target, 'folder', 'i.js'), false], - [join(target, 'folder', '.j'), false] - ]; - }).map((data: [string, boolean]) => { - return fs.exists(data[0]).then(exist => { - exist.should.eql(data[1]); - }); - }).then(() => { - return fs.rmdir(target); - }); -}); - -it('emptyDir() - ignorePattern', () => { - const target = join(tmpDir, 'test'); - - return createDummyFolder(target).then(() => { - return fs.emptyDir(target, { ignorePattern: /\.js/ }); - }).then(files => { - files.should.have.members(['e.txt', join('folder', 'h.txt')]); - - return [ - [join(target, '.hidden', 'a.txt'), true], - [join(target, '.hidden', 'b.js'), true], - [join(target, '.hidden', 'c', 'd'), true], - [join(target, 'e.txt'), false], - [join(target, 'f.js'), true], - [join(target, '.g'), true], - [join(target, 'folder', 'h.txt'), false], - [join(target, 'folder', 'i.js'), true], - [join(target, 'folder', '.j'), true] - ]; - }).map((data: [string, boolean]) => { - return fs.exists(data[0]).then(exist => { - exist.should.eql(data[1]); - }); - }).then(() => { - return fs.rmdir(target); - }); -}); - -it('emptyDir() - exclude', () => { - const target = join(tmpDir, 'test'); - - return createDummyFolder(target).then(() => { - return fs.emptyDir(target, { exclude: ['e.txt', join('folder', 'i.js')] }); - }).then(files => { - files.should.have.members(['f.js', join('folder', 'h.txt')]); - - return [ - [join(target, '.hidden', 'a.txt'), true], - [join(target, '.hidden', 'b.js'), true], - [join(target, '.hidden', 'c', 'd'), true], - [join(target, 'e.txt'), true], - [join(target, 'f.js'), false], - [join(target, '.g'), true], - [join(target, 'folder', 'h.txt'), false], - [join(target, 'folder', 'i.js'), true], - [join(target, 'folder', '.j'), true] - ]; - }).map((data: [string, boolean]) => { - return fs.exists(data[0]).then(exist => { - exist.should.eql(data[1]); - }); - }).then(() => { - return fs.rmdir(target); - }); -}); - -it('emptyDirSync()', () => { - const target = join(tmpDir, 'test'); - - return createDummyFolder(target).then(() => { - const files = fs.emptyDirSync(target); - files.should.have.members([ - 'e.txt', - 'f.js', - join('folder', 'h.txt'), - join('folder', 'i.js') - ]); - - return [ - [join(target, '.hidden', 'a.txt'), true], - [join(target, '.hidden', 'b.js'), true], - [join(target, '.hidden', 'c', 'd'), true], - [join(target, 'e.txt'), false], - [join(target, 'f.js'), false], - [join(target, '.g'), true], - [join(target, 'folder', 'h.txt'), false], - [join(target, 'folder', 'i.js'), false], - [join(target, 'folder', '.j'), true] - ]; - }).map((data: [string, boolean]) => { - return fs.exists(data[0]).then(exist => { - exist.should.eql(data[1]); - }); - }).then(() => { - return fs.rmdir(target); - }); -}); - -it('emptyDirSync() - ignoreHidden off', () => { - const target = join(tmpDir, 'test'); - - return createDummyFolder(target).then(() => { - const files = fs.emptyDirSync(target, { ignoreHidden: false }); - files.should.have.members([ - join('.hidden', 'a.txt'), - join('.hidden', 'b.js'), - join('.hidden', 'c', 'd'), - 'e.txt', - 'f.js', - '.g', - join('folder', 'h.txt'), - join('folder', 'i.js'), - join('folder', '.j') - ]); - - return [ - [join(target, '.hidden', 'a.txt'), false], - [join(target, '.hidden', 'b.js'), false], - [join(target, '.hidden', 'c', 'd'), false], - [join(target, 'e.txt'), false], - [join(target, 'f.js'), false], - [join(target, '.g'), false], - [join(target, 'folder', 'h.txt'), false], - [join(target, 'folder', 'i.js'), false], - [join(target, 'folder', '.j'), false] - ]; - }).map((data: [string, boolean]) => { - return fs.exists(data[0]).then(exist => { - exist.should.eql(data[1]); - }); - }).then(() => { - return fs.rmdir(target); - }); -}); - -it('emptyDirSync() - ignorePattern', () => { - const target = join(tmpDir, 'test'); - - return createDummyFolder(target).then(() => { - const files = fs.emptyDirSync(target, { ignorePattern: /\.js/ }); - files.should.have.members(['e.txt', join('folder', 'h.txt')]); - - return [ - [join(target, '.hidden', 'a.txt'), true], - [join(target, '.hidden', 'b.js'), true], - [join(target, '.hidden', 'c', 'd'), true], - [join(target, 'e.txt'), false], - [join(target, 'f.js'), true], - [join(target, '.g'), true], - [join(target, 'folder', 'h.txt'), false], - [join(target, 'folder', 'i.js'), true], - [join(target, 'folder', '.j'), true] - ]; - }).map((data: [string, boolean]) => { - return fs.exists(data[0]).then(exist => { - exist.should.eql(data[1]); - }); - }).then(() => { - return fs.rmdir(target); - }); -}); - -it('emptyDirSync() - exclude', () => { - const target = join(tmpDir, 'test'); - - return createDummyFolder(target).then(() => { - const files = fs.emptyDirSync(target, { exclude: ['e.txt', join('folder', 'i.js')] }); - files.should.have.members(['f.js', join('folder', 'h.txt')]); - - return [ - [join(target, '.hidden', 'a.txt'), true], - [join(target, '.hidden', 'b.js'), true], - [join(target, '.hidden', 'c', 'd'), true], - [join(target, 'e.txt'), true], - [join(target, 'f.js'), false], - [join(target, '.g'), true], - [join(target, 'folder', 'h.txt'), false], - [join(target, 'folder', 'i.js'), true], - [join(target, 'folder', '.j'), true] - ]; - }).map((data: [string, boolean]) => { - return fs.exists(data[0]).then(exist => { - exist.should.eql(data[1]); - }); - }).then(() => { - return fs.rmdir(target); - }); -}); - -it('rmdir()', () => { - const target = join(tmpDir, 'test'); - - return createDummyFolder(target).then(() => { - return fs.rmdir(target); - }).then(() => { - return fs.exists(target); - }).then(exist => { - exist.should.be.false; - }); -}); - -it('rmdir() - callback', callback => { - const target = join(tmpDir, 'test'); - - createDummyFolder(target).then(() => { - fs.rmdir(target, err => { - should.not.exist(err); - - fs.exists(target, exist => { - exist.should.be.false; - callback(); - }); - }); - }); -}); - -it('rmdirSync()', () => { - const target = join(tmpDir, 'test'); - - return createDummyFolder(target).then(() => { - fs.rmdirSync(target); - return fs.exists(target); - }).then(exist => { - exist.should.be.false; - }); -}); - -import { FSWatcher } from 'chokidar'; - -it('watch()', () => { - let watcher: FSWatcher; - - return fs.watch(tmpDir).then(watcher_ => { - watcher = watcher_; - - return new Promise((resolve, reject) => { - const path = join(tmpDir, 'test.txt'); - - watcher.on('add', (path_) => { - path_.should.eql(path); - resolve(); - }); - - fs.writeFile(path, 'test').catch(reject); - }); - }).finally(() => { - if (watcher) watcher.close(); - }); -}); - -it('ensurePath() - file exists', () => { - const target = join(tmpDir, 'test'); - - return Promise.all([ - fs.writeFile(join(target, 'foo.txt'), ''), - fs.writeFile(join(target, 'foo-1.txt'), ''), - fs.writeFile(join(target, 'foo-2.md'), ''), - fs.writeFile(join(target, 'bar.txt'), '') - ]).then(() => { - return fs.ensurePath(join(target, 'foo.txt')); - }).then(path => { - path.should.eql(join(target, 'foo-2.txt')); - return fs.rmdir(target); - }); -}); - -it('ensurePath() - file not exist', () => { - const target = join(tmpDir, 'foo.txt'); - - return fs.ensurePath(target).then(path => { - path.should.eql(target); - }); -}); - -it('ensurePath() - callback', callback => { - const target = join(tmpDir, 'test'); - - Promise.all([ - fs.writeFile(join(target, 'foo.txt'), ''), - fs.writeFile(join(target, 'foo-1.txt'), ''), - fs.writeFile(join(target, 'foo-2.md'), ''), - fs.writeFile(join(target, 'bar.txt'), '') - ]).then(() => { - fs.ensurePath(join(target, 'foo.txt'), (err, path) => { - should.not.exist(err); - path!.should.eql(join(target, 'foo-2.txt')); - fs.rmdir(target, callback); - }); - }); -}); - -it('ensurePathSync() - file exists', () => { - const target = join(tmpDir, 'test'); - - return Promise.all([ - fs.writeFile(join(target, 'foo.txt'), ''), - fs.writeFile(join(target, 'foo-1.txt'), ''), - fs.writeFile(join(target, 'foo-2.md'), ''), - fs.writeFile(join(target, 'bar.txt'), '') - ]).then(() => { - const path = fs.ensurePathSync(join(target, 'foo.txt')); - path.should.eql(join(target, 'foo-2.txt')); - - return fs.rmdir(target); - }); -}); - -it('ensurePathSync() - file not exist', () => { - const target = join(tmpDir, 'foo.txt'); - const path = fs.ensurePathSync(target); - - path.should.eql(target); -}); - -it('ensureWriteStream()', () => { - const target = join(tmpDir, 'foo', 'bar.txt'); - - return fs.ensureWriteStream(target).then(stream => { - stream.path.should.eql(target); - stream.on('finish', () => { - return fs.unlink(target); - }); - }); -}); - -it('ensureWriteStream() - callback', callback => { - const target = join(tmpDir, 'foo', 'bar.txt'); - - fs.ensureWriteStream(target, (err, stream) => { - should.not.exist(err); - stream!.path.should.eql(target); - callback(); - }); -}); - -it('ensureWriteStreamSync()', () => { - const target = join(tmpDir, 'foo', 'bar.txt'); - const stream = fs.ensureWriteStreamSync(target); - - stream.path.should.eql(target); - stream.on('finish', () => { - return fs.rmdir(dirname(target)); - }); -}); +writeStream = fs.ensureWriteStreamSync(string); diff --git a/types/hexo-fs/index.d.ts b/types/hexo-fs/index.d.ts index 46c7b99d64..89166b230c 100644 --- a/types/hexo-fs/index.d.ts +++ b/types/hexo-fs/index.d.ts @@ -2,7 +2,7 @@ // Project: http://hexo.io/ // Definitions by: segayuu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import Promise = require('bluebird'); import { diff --git a/types/hexo-util/hexo-util-tests.ts b/types/hexo-util/hexo-util-tests.ts new file mode 100644 index 0000000000..8d46185ccc --- /dev/null +++ b/types/hexo-util/hexo-util-tests.ts @@ -0,0 +1,278 @@ +import { + CacheStream, + camelCaseKeys, + escapeDiacritic, + escapeHTML, + escapeRegExp, + hash, + HashStream, + highlight, + htmlTag, + Pattern, + Permalink, + slugize, + spawn, + truncate, + wordWrap +} from 'hexo-util'; + +import { expect } from 'chai'; + +import { Readable } from 'stream'; +import { createHash } from 'crypto'; +import { join } from 'path'; + +let buffer = Buffer.alloc(0); +let directory: { [x: string]: any; } = {}; +let string = ''; + +const cacheStream = new CacheStream(); +const hashStream = new HashStream(); +const readable = new Readable(); + +readable.pipe(cacheStream); + +buffer = cacheStream.getCache(); +cacheStream.destroy(); + +directory = camelCaseKeys({ foo_bar: 'test' }); +directory = camelCaseKeys({ foo_bar: 'test' }); +directory = camelCaseKeys({ _foo_bar: 'test', __bar_baz: 'foo' }); +directory = camelCaseKeys({ fooBar: 'test' }); + +escapeDiacritic('Hell\u00F2 w\u00F2rld') === 'Hello world'; +escapeHTML('

Hello "world".

') === '<p>Hello "world".</p>'; +escapeRegExp('hello*world') === 'hello\\*world'; + +const sha1 = (content: string) => { + const hash = createHash('sha1'); + hash.update(content); + + return hash.digest(); +}; + +string = '123456'; +hash(string).equals(sha1(string)); + +sha1(string).equals(hashStream.read()); + +const testString = JSON.stringify({ + foo: 1, + bar: 2 +}, null, ' '); + +string = highlight(testString); +string = highlight(testString, { gutter: false }); +string = highlight(testString, { wrap: false }); +string = highlight(testString, { firstLine: 3 }); +string = highlight(testString, { lang: 'json' }); +string = highlight(testString, { autoDetect: true }); +string = highlight('test', { lang: 'jrowiejrowi' }); +string = highlight(testString, { caption: 'hello world' }); + +string = highlight([ + 'function fib(i){', + '\tif (i <= 1) return i;', + '\treturn fib(i - 1) + fib(i - 2);', + '}' +].join('\n'), { tab: ' ', lang: 'js' }); + +string = highlight([ + 'const string = `', + ' Multi', + ' line', + ' string', + '`' +].join('\n'), { lang: 'js' }); + +string = highlight([ + 'const string = `', + ' Multi', + '', + ' string', + '`' +].join('\n'), { lang: 'js' }); + +string = highlight([ + '"use strict";', + 'const string = `', + ' Multi', + '', + ' string', + '`' +].join('\n'), { autoDetect: true }); + +string = highlight([ + 'roses are red', + 'violets are blue', + 'sugar is sweet', + 'and so are you' +].join('\n'), { mark: [1, 3, 5] }); + +string.includes('class="line marked">roses'); +string.includes('class="line">violets'); +string.includes('class="line marked">sugar'); +string.includes('class="line">and'); + +const gutterStart = '
';
+const codeStart = '
';
+
+string = highlight([
+    'a => {',
+    '    if (a > 3)',
+    '        return true;',
+    '    return false;',
+    '}'
+].join('\n'), { hljs: true, lang: 'javascript' });
+
+string.includes(gutterStart);
+string.includes(codeStart);
+string.includes('code class="hljs javascript"');
+string.includes('class="hljs-function"');
+
+string = highlight([
+    'a => {',
+    '    if (a > 3)',
+    '        return true;',
+    '    return false;',
+    '}'
+].join('\n'), { hljs: true, gutter: false, lang: 'javascript' });
+
+!string.includes(gutterStart);
+!string.includes(codeStart);
+string.includes('code class="hljs javascript"');
+string.includes('class="hljs-function"');
+
+string = htmlTag('hr');
+string = htmlTag('img', { src: 'http://placekitten.com/200/300' });
+string = htmlTag('img', {
+    src: 'http://placekitten.com/200/300',
+    width: 200,
+    height: 300
+});
+string = htmlTag('a', { href: 'http://zespia.tw' }, 'My blog');
+
+{
+    const pattern = new Pattern('posts/:id');
+    const result = pattern.match('/posts/89');
+
+    result![0] === 'posts/89';
+    result![1] === '89';
+    result!.id === '89';
+}
+
+{
+    const pattern = new Pattern('posts/*path');
+    const result = pattern.match('posts/2013/hello-world');
+
+    result![0] === 'posts/2013/hello-world';
+    result![1] === '2013/hello-world';
+    result!.path === '2013/hello-world';
+}
+
+{
+    const pattern = new Pattern('posts/:id?');
+    const result = pattern.match('posts/');
+
+    result![0] === 'posts/';
+    result![1] === undefined;
+    result!.id === undefined;
+}
+
+{
+    const pattern = new Pattern('posts/:id?');
+    const result = pattern.match('posts/89');
+
+    result![0] === 'posts/89';
+    result![1] === '89';
+    result!.id === '89';
+}
+
+{
+    const pattern = new Pattern(/ab?cd/);
+
+    pattern.match('abcd')!.length !== 0;
+    pattern.match('acd')!.length !== 0;
+}
+
+{
+    const pattern = new Pattern(str => {
+        str === 'foo';
+        return {};
+    });
+
+    pattern.match('foo').should.eql({});
+}
+
+let permalink = new Permalink(':year/:month/:day/:title');
+
+permalink.rule === ':year/:month/:day/:title';
+permalink.regex === /^(.+?)\/(.+?)\/(.+?)\/(.+?)$/;
+permalink.params.should.eql(['year', 'month', 'day', 'title']);
+
+permalink = new Permalink(':year/:month/:day/:title', {
+    segments: {
+        year: /(\d{4})/,
+        month: /(\d{2})/,
+        day: /(\d{2})/
+    }
+});
+
+permalink.rule === ':year/:month/:day/:title';
+permalink.regex === /^(\d{4})\/(\d{2})\/(\d{2})\/(.+?)$/;
+permalink.params.should.eql(['year', 'month', 'day', 'title']);
+permalink.test('2014/01/31/test');
+!permalink.test('foweirojwoier');
+
+expect(permalink.parse('2014/01/31/test')).eql({
+    year: '2014',
+    month: '01',
+    day: '31',
+    title: 'test'
+});
+
+permalink.stringify({
+    year: '2014',
+    month: '01',
+    day: '31',
+    title: 'test'
+}) === '2014/01/31/test';
+
+slugize('Hello World') === 'Hello-World';
+slugize('Hell\u00F2 w\u00F2rld') === 'Hello-world';
+slugize('Hello  World') === 'Hello-World';
+slugize('~Hello World~') === 'Hello-World';
+slugize('Hello ~`!@#$%^&*()-_+=[]{}|\\;:"\'<>,.?/World') === 'Hello-World';
+slugize('Hello World', { separator: '_' }) === 'Hello_World';
+slugize('Hello World', { transform: 1 }) === 'hello-world';
+slugize('Hello World', { transform: 2 }) === 'HELLO-WORLD';
+slugize('遊戲') === '遊戲';
+
+async () => {
+    const fixturePath = join(__dirname, 'spawn_test.txt');
+
+    string = await spawn('cat', [fixturePath]);
+
+    try {
+        await spawn('cat', ['nothing']);
+    } catch (err) {
+        err.message.trim() === 'cat: nothing: No such file or directory';
+        err.code === 1;
+    }
+
+    string = await spawn('cat', [fixturePath], { encoding: 'hex' });
+    buffer = await spawn('cat', [fixturePath], { encoding: null });
+
+    await spawn('echo', ['something'], { stdio: 'inherit' });
+};
+
+string = truncate('Once upon a time in a world far far away');
+string = truncate('Once upon');
+string = truncate('Once upon a time in a world far far away', { length: 17 });
+string = truncate('Once upon a time in a world far far away', { length: 17, separator: ' ' });
+string = truncate('And they found that many people were sleeping better.', { length: 25, omission: '... (continued)' });
+
+string = wordWrap('Once upon a time');
+string = wordWrap('Once upon a time, in a kingdom called Far Far Away, a king fell ill, and finding a successor to the throne turned out to be more trouble than anyone could have imagined...');
+string = wordWrap('Once upon a time', { width: 8 });
+string = wordWrap('Once upon a time', { width: 1 });
diff --git a/types/hexo-util/index.d.ts b/types/hexo-util/index.d.ts
new file mode 100644
index 0000000000..aed429f0ce
--- /dev/null
+++ b/types/hexo-util/index.d.ts
@@ -0,0 +1,109 @@
+// Type definitions for hexo-util 0.6
+// Project: https://hexo.io/
+// Definitions by: sega yuu 
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.2
+
+/// 
+
+import { Transform } from "stream";
+import { SpawnOptions } from 'child_process';
+
+export class CacheStream extends Transform {
+    destroy(): void;
+    getCache(): Buffer;
+}
+
+export function camelCaseKeys(obj: { [x: string]: any; }): { [x: string]: any; };
+
+export function escapeRegExp(str: string): string;
+
+export function escapeDiacritic(str: string): string;
+
+export function escapeHTML(str: string): string;
+
+export function hash(str: string | ArrayBufferView): Buffer;
+
+export class HashStream extends Transform {}
+
+export function highlight(str: string, options?: {
+    hljs?: boolean;
+    gutter?: boolean;
+    wrap?: boolean;
+    firstLine?: number;
+    caption?: string;
+    mark?: number[];
+    tab?: string;
+    lang?: string;
+    autoDetect?: boolean;
+}): string;
+
+export function htmlTag(tag: string, attrs?: string[] | ArrayLike | { [x: string]: any }, text?: string | null): string;
+
+export interface Pattern {
+    test(str: string): boolean;
+    match(str: string): T;
+}
+
+export const Pattern: {
+    new(rule: Pattern | ((str: string) => T)): Pattern;
+    new(rule: RegExp): Pattern;
+    new(rule: string): Pattern<{ 0: string; [index: number]: any; } & { [name: string]: any; } | undefined>;
+};
+
+export class Permalink {
+    constructor(rule: string, options?: {
+        segments?: { [name: string]: string | RegExp; };
+    });
+    rule: string;
+    regex: RegExp;
+    params: string[];
+    test(str: string): boolean;
+    parse(str: string): { [param: string]: any; } | undefined;
+    stringify(data: { [name: string]: string; }): string;
+}
+
+export function slugize(str: string, options?: {
+    separator?: string;
+    transform?: 1 | 2;
+}): string;
+
+export interface hexoSpawnOptions extends SpawnOptions {
+    verbose?: boolean;
+    encoding?: BufferEncoding;
+}
+
+export interface hexoSpawnDisableEncodingOptions extends SpawnOptions {
+    verbose?: boolean;
+    encoding: '' | false | null;
+}
+
+export interface hexoSpawnOverrideStdioOptions extends hexoSpawnOptions {
+    stdio: any[] | string;
+}
+
+export interface hexoSpawnDisableEncodingAndOverrideStdioOptions extends hexoSpawnDisableEncodingOptions {
+    stdio: any[] | string;
+}
+
+export function spawn(command: string, args: string[], options: hexoSpawnDisableEncodingAndOverrideStdioOptions): Promise;
+export function spawn(command: string, args: string[], options: hexoSpawnOverrideStdioOptions): Promise;
+export function spawn(command: string, args: string[], options: hexoSpawnDisableEncodingOptions): Promise;
+export function spawn(command: string, args: string[], options?: hexoSpawnOptions): Promise;
+
+export function spawn(command: string, options: hexoSpawnDisableEncodingAndOverrideStdioOptions): Promise;
+export function spawn(command: string, options: hexoSpawnOverrideStdioOptions): Promise;
+export function spawn(command: string, options: hexoSpawnDisableEncodingOptions): Promise;
+export function spawn(command: string, options?: hexoSpawnOptions): Promise;
+
+export function stripHTML(str: string): string;
+
+export function wordWrap(str: string, options?: {
+    width?: number;
+}): string;
+
+export function truncate(str: string, options?: {
+    length?: number;
+    omission?: string;
+    separator?: string;
+}): string;
diff --git a/types/hexo-util/tsconfig.json b/types/hexo-util/tsconfig.json
new file mode 100644
index 0000000000..f93eb62342
--- /dev/null
+++ b/types/hexo-util/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",
+        "hexo-util-tests.ts"
+    ]
+}
diff --git a/types/hexo-util/tslint.json b/types/hexo-util/tslint.json
new file mode 100644
index 0000000000..3db14f85ea
--- /dev/null
+++ b/types/hexo-util/tslint.json
@@ -0,0 +1 @@
+{ "extends": "dtslint/dt.json" }
diff --git a/types/highcharts/index.d.ts b/types/highcharts/index.d.ts
index 6ef4ef4e2a..07a06256e5 100644
--- a/types/highcharts/index.d.ts
+++ b/types/highcharts/index.d.ts
@@ -1995,7 +1995,7 @@ declare namespace Highcharts {
         fontWeight?: string;
         left?: string;
         opacity?: number;
-		overflow?: string;
+        overflow?: string;
         padding?: string | number;
         position?: string;
         top?: string;
@@ -6807,6 +6807,16 @@ declare namespace Highcharts {
 
         map(array: any[], fn: Function): any[];
 
+        /**
+         * Wrap an existing behavior of a part of the chart to extend or replace it.
+         * @since 2.3.0
+         *
+         * @see {@link https://www.highcharts.com/docs/extending-highcharts/extending-highcharts}
+         *
+         * @param prototype The prototype for the part of the chart to extend.
+         * @param type The type of behavior you are extending.
+         * @param cb The function that executes when the behavior occurs.
+         */
         wrap(prototype: any, type: string, cb: (proceed: Function, ...args: any[]) => void): void;
 
         /**
@@ -6838,6 +6848,15 @@ declare namespace Highcharts {
                   type: string,
                   eventArguments?: any,
                   defaultFunction?: () => void): void;
+
+        distribute(array: any[], value: number): void;
+
+        /**
+         * Prototype used to extend tooltip behavior in a chart.
+         *
+         * @see {@link https://www.highcharts.com/docs/extending-highcharts/extending-highcharts}
+         */
+        Tooltip: TooltipPrototype;
     }
 
     /**
@@ -7079,6 +7098,19 @@ declare namespace Highcharts {
          */
         update(options: LegendOptions, redraw?: boolean): void;
     }
+
+    /**
+     * The Tooltip prototype is used to to wrap and extend tooltip behaviors.
+     *
+     * @see {@link https://www.highcharts.com/docs/extending-highcharts/extending-highcharts}
+     */
+    interface TooltipPrototype {
+        /**
+         * The behavior prototypes for the tooltips in a chart.
+         * @since 2.3.0
+         */
+        prototype: any;
+    }
 }
 
 declare global {
diff --git a/types/highcharts/test/index.ts b/types/highcharts/test/index.ts
index 310886b585..d6eeaf8c52 100644
--- a/types/highcharts/test/index.ts
+++ b/types/highcharts/test/index.ts
@@ -2816,3 +2816,11 @@ function test_WordCloud() {
         }
     };
 }
+
+// Test wrapping the tooltip refresh behavior.
+function test_WrapTooltipBehavior() {
+    Highcharts.wrap(Highcharts.Tooltip.prototype, 'refresh', (proceed, points) => {
+        // When refresh is called, code inside this wrap is executed.
+        // Many prototype functions use this so arrow functions should only be used to replace behaviors.
+    });
+}
diff --git a/types/highland/highland-tests.ts b/types/highland/highland-tests.ts
index a1c48c944b..fc63a23925 100644
--- a/types/highland/highland-tests.ts
+++ b/types/highland/highland-tests.ts
@@ -333,6 +333,12 @@ fooStream.toArray((arr: Foo[]) => {});
 fooStream.toCallback((err: Error, x: Foo) => {});
 fooStream.toCallback((err: Error) => {});
 
+fooStream.toNodeStream();
+fooStream.toNodeStream({objectMode: false});
+fooStream.toNodeStream({objectMode: true});
+
+fooStream.toPromise(Promise);
+
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // UTILS
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/types/highland/index.d.ts b/types/highland/index.d.ts
index 473e93880a..7203e959ab 100644
--- a/types/highland/index.d.ts
+++ b/types/highland/index.d.ts
@@ -1,9 +1,10 @@
-// Type definitions for Highland 2.10.5
+// Type definitions for Highland 2.12.0
 // Project: http://highlandjs.org/
 // Definitions by: Bart van der Schoor 
 //                 Hugo Wood 
 //                 William Yu 
 //                 Alvis HT Tang 
+//                 Jack Wearden 
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
 // TypeScript Version: 2.3
 
@@ -1319,6 +1320,25 @@ declare namespace Highland {
 		 */
 		toCallback(cb: (err?: Error, x?: R) => void): void;
 
+		/**
+		 * Converts the stream to a node Readable Stream for use in methods
+		 * or pipes that depend on the native stream type.
+		 *
+		 * The options parameter can be an object passed into the [`Readable`
+		 * constructor](http://nodejs.org/api/stream.html#stream_class_stream_readable).
+		 *
+		 * @id toNodeStream
+		 * @section Consumption
+		 * @name Stream.toNodeStream(options)
+		 * @param {Object} options - (optional) [`Readable` constructor](http://nodejs.org/api/stream.html#stream_class_stream_readable) options
+		 * @api public
+		 *
+		 * _(fs.createReadStream('./abc')).toNodeStream()
+		 * _(fs.createReadStream('./abc')).toNodeStream({objectMode: false})
+		 * _([{a: 1}]).toNodeStream({objectMode: true})
+		 */
+		toNodeStream(options?: object): NodeJS.ReadableStream;
+
     /**
      * Converts the result of a stream to Promise.
      *
diff --git a/types/html-webpack-plugin/html-webpack-plugin-tests.ts b/types/html-webpack-plugin/html-webpack-plugin-tests.ts
index b80ea9e6b0..60f1faf023 100644
--- a/types/html-webpack-plugin/html-webpack-plugin-tests.ts
+++ b/types/html-webpack-plugin/html-webpack-plugin-tests.ts
@@ -1,4 +1,5 @@
 import HtmlWebpackPlugin = require('html-webpack-plugin');
+import { Compiler, compilation } from 'webpack';
 
 new HtmlWebpackPlugin();
 
@@ -25,3 +26,16 @@ const optionsArray: HtmlWebpackPlugin.Options[] = [
 ];
 
 const plugins: HtmlWebpackPlugin[] = optionsArray.map(options => new HtmlWebpackPlugin(options));
+
+// Webpack plugin `apply` function
+function apply(compiler: Compiler) {
+	compiler.hooks.compilation.tap('SomeWebpackPlugin', (compilation: compilation.Compilation) => {
+		( compilation.hooks).htmlWebpackPluginAfterHtmlProcessing.tap(
+			'MyPlugin',
+			(data) => {
+				data.html += 'The Magic Footer';
+				return data;
+			}
+		);
+	});
+}
diff --git a/types/html-webpack-plugin/index.d.ts b/types/html-webpack-plugin/index.d.ts
index c3db12f4e7..74c7d31073 100644
--- a/types/html-webpack-plugin/index.d.ts
+++ b/types/html-webpack-plugin/index.d.ts
@@ -6,7 +6,8 @@
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
 // TypeScript Version: 2.3
 
-import { Plugin } from 'webpack';
+import { Plugin, compilation } from 'webpack';
+import { AsyncSeriesWaterfallHook } from 'tapable';
 import { Options as HtmlMinifierOptions } from 'html-minifier';
 
 export = HtmlWebpackPlugin;
@@ -84,8 +85,81 @@ declare namespace HtmlWebpackPlugin {
 		[option: string]: any;
 	}
 
+	interface Hooks extends compilation.CompilationHooks {
+		htmlWebpackPluginBeforeHtmlGeneration: AsyncSeriesWaterfallHook<{
+			assets: {
+				publicPath: string;
+				js: EntryObject[];
+				css: EntryObject[];
+			};
+			outputName: string;
+			plugin: HtmlWebpackPlugin;
+		}>;
+		htmlWebpackPluginBeforeHtmlProcessing: AsyncSeriesWaterfallHook<{
+			html: string;
+			assets: {
+				publicPath: string;
+				js: EntryObject[];
+				css: EntryObject[];
+			};
+			outputName: string;
+			plugin: HtmlWebpackPlugin;
+		}>;
+		htmlWebpackPluginAfterHtmlProcessing: AsyncSeriesWaterfallHook<{
+			html: string;
+			assets: {
+				publicPath: string;
+				js: EntryObject[];
+				css: EntryObject[];
+			};
+			outputName: string;
+			plugin: HtmlWebpackPlugin;
+		}>;
+		htmlWebpackPluginAlterAssetTags: AsyncSeriesWaterfallHook<{
+			head: HtmlTagObject[];
+			body: HtmlTagObject[];
+			outputName: string;
+			plugin: HtmlWebpackPlugin;
+		}>;
+		htmlWebpackPluginAfterEmit: AsyncSeriesWaterfallHook<{
+			html: string;
+			outputName: string;
+			plugin: HtmlWebpackPlugin;
+		}>;
+	}
+
 	/** @deprecated use MinifyOptions */
 	type MinifyConfig = MinifyOptions;
 	/** @deprecated use Options */
 	type Config = Options;
 }
+
+interface EntryObject {
+	/** Webpack entry or chunk name */
+	entryName: string;
+	/** Entry or chunk path */
+	path: string;
+}
+
+interface HtmlTagObject {
+	/**
+	 * Attributes of the html tag
+	 * E.g. `{'disabled': true, 'value': 'demo'}`
+	 */
+	attributes: {
+		[attributeName: string]: string | boolean;
+	};
+	/**
+	 * Wether this html must not contain innerHTML
+	 * @see https://www.w3.org/TR/html5/syntax.html#void-elements
+	 */
+	voidTag: boolean;
+	/**
+	 * The tag name e.g. `'div'`
+	 */
+	tagName: string;
+	/**
+	 * Inner HTML The
+	 */
+	innerHTML?: string;
+}
diff --git a/types/http-graceful-shutdown/http-graceful-shutdown-tests.ts b/types/http-graceful-shutdown/http-graceful-shutdown-tests.ts
index 17bc81ce1d..2445635c67 100644
--- a/types/http-graceful-shutdown/http-graceful-shutdown-tests.ts
+++ b/types/http-graceful-shutdown/http-graceful-shutdown-tests.ts
@@ -1,5 +1,6 @@
 import GracefulShutdown = require('http-graceful-shutdown');
 import * as http from "http";
+import * as https from "https";
 
 const opts: GracefulShutdown.Options = {
     signals: "SIGINT SIGTERM",
@@ -14,8 +15,16 @@ const opts: GracefulShutdown.Options = {
     }
 };
 
-const server = http.createServer((req, res) => {
+const httpServer = http.createServer((req, res) => {
     res.end();
 });
 
-GracefulShutdown(server, opts);
+const httpsServer = https.createServer({
+    key: new Buffer('foo'),
+    cert: new Buffer('bar')
+}, (req, res) => {
+    res.end();
+});
+
+GracefulShutdown(httpServer, opts);
+GracefulShutdown(httpsServer, opts);
diff --git a/types/http-graceful-shutdown/index.d.ts b/types/http-graceful-shutdown/index.d.ts
index f8269adea7..ba34246290 100644
--- a/types/http-graceful-shutdown/index.d.ts
+++ b/types/http-graceful-shutdown/index.d.ts
@@ -5,9 +5,10 @@
 
 /// 
 
-import { Server } from "http";
+import { Server as HttpServer } from "http";
+import { Server as HttpsServer } from "https";
 
-declare function GracefulShutdown(server: Server, options?: GracefulShutdown.Options): void;
+declare function GracefulShutdown(server: HttpServer | HttpsServer, options?: GracefulShutdown.Options): void;
 
 declare namespace GracefulShutdown {
     interface Options {
diff --git a/types/http-proxy-middleware/http-proxy-middleware-tests.ts b/types/http-proxy-middleware/http-proxy-middleware-tests.ts
index 3e932bb838..9f60f3704d 100644
--- a/types/http-proxy-middleware/http-proxy-middleware-tests.ts
+++ b/types/http-proxy-middleware/http-proxy-middleware-tests.ts
@@ -64,7 +64,7 @@ proxy({
 });
 proxy({
   logProvider(provider) {
-    const logger = new (Winston.Logger)();
+    const logger = Winston.createLogger();
 
     return {
       log: logger.log,
diff --git a/types/http-proxy-middleware/package.json b/types/http-proxy-middleware/package.json
new file mode 100644
index 0000000000..0aa4cf368f
--- /dev/null
+++ b/types/http-proxy-middleware/package.json
@@ -0,0 +1,6 @@
+{
+    "private": true,
+    "dependencies": {
+        "winston": "^3.0.0"
+    }
+}
diff --git a/types/i18next/index.d.ts b/types/i18next/index.d.ts
index 61b59b32e1..7674762de6 100644
--- a/types/i18next/index.d.ts
+++ b/types/i18next/index.d.ts
@@ -493,7 +493,7 @@ declare namespace i18next {
         /**
          * Returns rtl or ltr depending on languages read direction.
          */
-        dir(lng?: string): void;
+        dir(lng?: string): "ltr" | "rtl";
 
         /**
          * Exposes interpolation.format function added on init.
diff --git a/types/i18next/v2/index.d.ts b/types/i18next/v2/index.d.ts
index f9bd900e77..b67a5f9423 100644
--- a/types/i18next/v2/index.d.ts
+++ b/types/i18next/v2/index.d.ts
@@ -128,7 +128,7 @@ declare namespace i18n {
 
         loadLanguages(lngs: string[], callback?: () => void): void;
 
-        dir(lng?: string): string;
+        dir(lng?: string): "ltr" | "rtl";
 
         createInstance(options?: Options, callback?: (err: any, t: TranslationFunction) => void): I18n;
 
diff --git a/types/icepick/index.d.ts b/types/icepick/index.d.ts
index bffe424d1b..fe7a3d0b36 100644
--- a/types/icepick/index.d.ts
+++ b/types/icepick/index.d.ts
@@ -8,13 +8,15 @@ export declare function freeze(collection: T): T;
 export declare function thaw(collection: T): T;
 export declare function assoc(collection: T, key: number | string, value: V): T;
 export declare function dissoc(collection: T, key: number | string): T;
+export declare function dissocIn(collection: T, path: Array): T;
 export declare function assocIn(collection: T, path: Array, value: V): T;
 export declare function getIn(collection: T, path: Array): any;
 export declare function updateIn(collection: T, path: Array, callback: (value: V) => V): T;
 
 export {assoc as set};
-export {dissoc as unset};
 export {assocIn as setIn};
+export {dissoc as unset};
+export {dissocIn as unsetIn};
 
 export declare function assign(target: T): T;
 export declare function assign(target: T, source1: S1): (T & S1);
@@ -52,6 +54,9 @@ interface IcepickWrapper {
 
     assocIn(path: Array, value: V): IcepickWrapper;
     setIn(path: Array, value: V): IcepickWrapper;
+    
+    dissocIn(path: Array): IcepickWrapper;
+    unsetIn(path: Array): IcepickWrapper;
 
     getIn(path: Array): IcepickWrapper;
     updateIn(path: Array, callback: (value: V) => V): IcepickWrapper;
diff --git a/types/inboxsdk/inboxsdk-tests.ts b/types/inboxsdk/inboxsdk-tests.ts
index a763674c73..4f51bae92c 100644
--- a/types/inboxsdk/inboxsdk-tests.ts
+++ b/types/inboxsdk/inboxsdk-tests.ts
@@ -358,7 +358,7 @@ InboxSDK.load(1, '1234').then((sdk: InboxSDK.InboxSDKInstance) => {
 
     const contacts: InboxSDK.Common.Contact[] = threadRowView.getContacts();
 
-    threadRowView.on('destroyed', () => console.log());
+    threadRowView.on('destroy', () => console.log());
 
     const destroyed: boolean = threadRowView.destroyed;
   });
@@ -704,7 +704,7 @@ InboxSDK.load(1, '1234').then((sdk: InboxSDK.InboxSDKInstance) => {
   });
 
   modalView.close();
-  modalView.on('destroyed', () => {
+  modalView.on('destroy', () => {
   });
   const destroyed: boolean = modalView.destroyed;
 
@@ -728,7 +728,7 @@ InboxSDK.load(1, '1234').then((sdk: InboxSDK.InboxSDKInstance) => {
   const minimized: boolean = moleView.getMinimized();
   moleView.setMinimized(true);
   moleView.setTitle('title');
-  moleView.on('destroyed', () => {
+  moleView.on('destroy', () => {
   });
   moleView.on('minimize', () => {
   });
@@ -745,7 +745,7 @@ InboxSDK.load(1, '1234').then((sdk: InboxSDK.InboxSDKInstance) => {
   drawerView.close();
   drawerView.disassociateComposeView();
   const destroyed1: boolean = drawerView.destroyed;
-  drawerView.on('destroyed', () => {
+  drawerView.on('destroy', () => {
   });
   drawerView.on('slideAnimationDone', () => {
   });
diff --git a/types/inboxsdk/index.d.ts b/types/inboxsdk/index.d.ts
index 66b696e05a..4ced3ce6bd 100644
--- a/types/inboxsdk/index.d.ts
+++ b/types/inboxsdk/index.d.ts
@@ -306,7 +306,7 @@ declare namespace InboxSDK {
 
       getContacts(): Common.Contact[];
 
-      on(name: 'destroyed', cb: () => void): void;
+      on(name: 'destroy', cb: () => void): void;
 
       destroyed: boolean;
     }
@@ -909,7 +909,7 @@ declare namespace InboxSDK {
     interface ModalView {
       close(): void;
 
-      on(name: 'destroyed', cb: () => void): void;
+      on(name: 'destroy', cb: () => void): void;
 
       destroyed: boolean;
     }
@@ -923,7 +923,7 @@ declare namespace InboxSDK {
 
       getMinimized(): boolean;
 
-      on(name: 'destroyed' | 'minimize' | 'restore', cb: () => void): void;
+      on(name: 'destroy' | 'minimize' | 'restore', cb: () => void): void;
 
       destroyed: boolean;
     }
@@ -935,7 +935,7 @@ declare namespace InboxSDK {
 
       disassociateComposeView(): void;
 
-      on(name: 'destroyed' | 'slideAnimationDone' | 'closing', cb: () => void): void;
+      on(name: 'destroy' | 'slideAnimationDone' | 'closing', cb: () => void): void;
 
       destroyed: boolean;
     }
diff --git a/types/inline-css/index.d.ts b/types/inline-css/index.d.ts
index 6d43b7975d..2567e01e85 100644
--- a/types/inline-css/index.d.ts
+++ b/types/inline-css/index.d.ts
@@ -2,10 +2,7 @@
 // Project: https://github.com/jonkemp/inline-css
 // Definitions by: Philip Spain 
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-// TypeScript Version: 2.3
-
-/// 
-
+// TypeScript Version: 2.8
 
 import Promise = require('bluebird');
 
diff --git a/types/intercom-client/Company.d.ts b/types/intercom-client/Company.d.ts
index ee20d80863..e0b218fb8c 100644
--- a/types/intercom-client/Company.d.ts
+++ b/types/intercom-client/Company.d.ts
@@ -1,7 +1,5 @@
 
-export interface CompanyIdentifier {
-    company_id: string
-}
+export type CompanyIdentifier = { id: string } | { company_id: string }
 
 export interface Company {
     readonly "type": "company",
diff --git a/types/intercom-client/Event.d.ts b/types/intercom-client/Event.d.ts
new file mode 100644
index 0000000000..d4e5832373
--- /dev/null
+++ b/types/intercom-client/Event.d.ts
@@ -0,0 +1,24 @@
+interface IntercomUserIdId { intercom_user_id: string }
+interface UserIdId { user_id: string }
+interface EmailIdId { email: string }
+
+export type EventIdentifier = IntercomUserIdId | UserIdId | EmailIdId;
+
+export interface Event extends Partial, Partial, Partial {
+  readonly id: string,
+  created_at: number,
+  event_name: string,
+  metadata?: any;
+}
+
+export type ListParam = EventIdentifier & {
+  type: 'user',
+  per_page?: number, // max 100
+}
+
+export interface List {
+  "type": "event.list",
+  "total_count": number,
+  "events": (Event)[],
+  "pages": { "next"?: string, "page": number, "per_page": number, "total_pages": number }
+}
diff --git a/types/intercom-client/Tag.d.ts b/types/intercom-client/Tag.d.ts
new file mode 100644
index 0000000000..0faebb074b
--- /dev/null
+++ b/types/intercom-client/Tag.d.ts
@@ -0,0 +1,30 @@
+import { UserIdentifier } from "./User";
+
+export interface TagIdentifier {
+  id: string
+}
+
+export interface Tag extends Partial {
+  readonly type: "tag",
+  readonly id: string,
+  name: string,
+}
+
+export interface List {
+  "type": "tag.list",
+  "total_count": number,
+  "tags": (Tag)[],
+  "pages": { "next"?: string, "page": number, "per_page": number, "total_pages": number }
+}
+
+interface TagUsers {
+  name: string,
+  users: UserIdentifier[]
+}
+
+interface TagCompanies {
+  name: string,
+  users: { id: string }[]
+}
+
+type TagOper = TagCompanies | TagUsers;
diff --git a/types/intercom-client/index.d.ts b/types/intercom-client/index.d.ts
index c9c9fc3364..25b166e10d 100644
--- a/types/intercom-client/index.d.ts
+++ b/types/intercom-client/index.d.ts
@@ -7,6 +7,8 @@
 
 import { List as UserList, User, UserIdentifier } from './User';
 import { CompanyIdentifier, List as CompanyList, Company } from './Company';
+import { TagIdentifier, List as TagList, Tag, TagOper } from './Tag';
+import { List as EventList, Event, ListParam as EventListParam } from './Event';
 import { Scroll } from './Scroll';
 import { IntercomError } from './IntercomError';
 
@@ -29,6 +31,8 @@ export class Client {
 
     users: Users;
     companies: Companies;
+    tags: Tags;
+    events: Events;
 }
 
 export class ApiResponse extends IncomingMessage {
@@ -80,3 +84,28 @@ export class Companies {
 
     archive(): Promise;
 }
+
+export class Tags {
+  create(tag: Partial): Promise>;
+  create(tag: Partial, cb: callback>): void;
+
+  tag(tagOper: TagOper): Promise>;
+  tag(tagOper: TagOper, cb: callback>): void;
+
+  untag(tagOper: TagOper): Promise>;
+  untag(tagOper: TagOper, cb: callback>): void;
+
+  delete(tag: TagIdentifier): Promise;
+  delete(tag: TagIdentifier, cb: callback): void;
+
+  list(): Promise>;
+  list(cb: callback>): void;
+}
+
+export class Events {
+    create(event: Partial): Promise;
+    create(event: Partial, cb: callback): void;
+
+    listBy(params: EventListParam): Promise>;
+    listBy(params: EventListParam, cb: callback>): void;
+}
diff --git a/types/ioredis/index.d.ts b/types/ioredis/index.d.ts
index 41df1f9ee7..45b334a205 100644
--- a/types/ioredis/index.d.ts
+++ b/types/ioredis/index.d.ts
@@ -5,8 +5,9 @@
 //                 Yoga Aliarham 
 //                 Ebrahim 
 //                 Shahar Mor 
+//                 Whemoon Jang 
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-// TypeScript Version: 2.3
+// TypeScript Version: 2.8
 
 /* =================== USAGE ===================
     import * as Redis from "ioredis";
@@ -436,6 +437,8 @@ declare namespace IORedis {
 
         scan(cursor: number, ...args: any[]): any;
 
+        sscan(key: string, cursor: number, ...args: any[]): any;
+
         hscan(key: string, cursor: number, ...args: any[]): any;
 
         zscan(key: string, cursor: number, ...args: any[]): any;
@@ -449,11 +452,19 @@ declare namespace IORedis {
         pipeline(commands?: string[][]): Pipeline;
 
         scanStream(options?: ScanStreamOption): NodeJS.EventEmitter;
+        sscanStream(key: string, options?: ScanStreamOption): NodeJS.EventEmitter;
         hscanStream(key: string, options?: ScanStreamOption): NodeJS.EventEmitter;
         zscanStream(key: string, options?: ScanStreamOption): NodeJS.EventEmitter;
     }
 
     interface Pipeline {
+        redis: Redis;
+        isCluster: boolean;
+        options: RedisOptions;
+        _queue: Command[];
+        _result: any[];
+        _transactions: number;
+        _shaToScript: {};
         bitcount(key: string, callback?: (err: Error, res: number) => void): Pipeline;
         bitcount(key: string, start: number, end: number, callback?: (err: Error, res: number) => void): Pipeline;
 
@@ -737,6 +748,8 @@ declare namespace IORedis {
 
         scan(cursor: number, ...args: any[]): Pipeline;
 
+        sscan(key: string, cursor: number, ...args: any[]): Pipeline;
+
         hscan(key: string, cursor: number, ...args: any[]): Pipeline;
 
         zscan(key: string, cursor: number, ...args: any[]): Pipeline;
diff --git a/types/jackrabbit/index.d.ts b/types/jackrabbit/index.d.ts
index ec0ff27fa9..7be4ee23ed 100644
--- a/types/jackrabbit/index.d.ts
+++ b/types/jackrabbit/index.d.ts
@@ -2,7 +2,7 @@
 // Project: https://github.com/hunterloftis/jackrabbit
 // Definitions by: Elvis Adomnica 
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-// TypeScript Version: 2.4
+// TypeScript Version: 2.8
 
 import { Connection, Options, Message } from 'amqplib';
 
diff --git a/types/java/java-tests.ts b/types/java/java-tests.ts
index 4c79640733..42ca007155 100644
--- a/types/java/java-tests.ts
+++ b/types/java/java-tests.ts
@@ -1,11 +1,11 @@
 import java = require('java');
-import BluePromise = require('bluebird');
+import pify = require('pify');
 
 java.asyncOptions = {
   syncSuffix: 'Sync',
   asyncSuffix: '',
   promiseSuffix: 'P',
-  promisify: BluePromise.promisify
+  promisify: pify
 };
 // todo: figure out why promise doesn't work here
 /* java.registerClientP((): Promise => {
diff --git a/types/jest-each/index.d.ts b/types/jest-each/index.d.ts
index c457054065..e49f703a91 100644
--- a/types/jest-each/index.d.ts
+++ b/types/jest-each/index.d.ts
@@ -4,7 +4,7 @@
 // Definitions: 
 // TypeScript Version: 2.1
 
-export = JestEach;
+export default JestEach;
 
 declare function JestEach(parameters: any[][]): JestEach.ReturnType;
 
diff --git a/types/jest-each/jest-each-tests.ts b/types/jest-each/jest-each-tests.ts
index bbfbcabe05..c95a69d8c5 100644
--- a/types/jest-each/jest-each-tests.ts
+++ b/types/jest-each/jest-each-tests.ts
@@ -1,4 +1,4 @@
-import * as each from 'jest-each';
+import each from "jest-each";
 
 const params = [[1, 0, 1], [1, 1, 0], ['1', 'two', 'three']];
 
diff --git a/types/jest/index.d.ts b/types/jest/index.d.ts
index 5abfa4eea5..fa1cb4074a 100644
--- a/types/jest/index.d.ts
+++ b/types/jest/index.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for Jest 23.1
+// Type definitions for Jest 23.3
 // Project: http://facebook.github.io/jest/
 // Definitions by: Asana 
 //                 Ivo Stratev 
@@ -15,6 +15,7 @@
 //                 Jeff Lau 
 //                 Andrew Makarov 
 //                 Martin Hochel 
+//                 Sebastian Sebald 
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
 // TypeScript Version: 2.3
 
@@ -109,6 +110,9 @@ declare namespace jest {
      * Creates a mock function. Optionally takes a mock implementation.
      */
     function fn(implementation: (...args: any[]) => T): Mock;
+    /**
+     * Creates a mock function. Optionally takes a mock implementation.
+     */
     function fn(implementation?: (...args: any[]) => any): Mock;
     /**
      * Use the automatic mocking system to generate a mocked version of the given module.
@@ -173,7 +177,25 @@ declare namespace jest {
      */
     function setTimeout(timeout: number): typeof jest;
     /**
-     * Creates a mock function similar to jest.fn but also tracks calls to object[methodName]
+     * Creates a mock function similar to jest.fn but also tracks calls to `object[methodName]`
+     *
+     * Note: By default, jest.spyOn also calls the spied method. This is different behavior from most
+     * other test libraries.
+     *
+     * @example
+     *
+     * const video = require('./video');
+     *
+     * test('plays video', () => {
+     *   const spy = jest.spyOn(video, 'play');
+     *   const isPlaying = video.play();
+     *
+     *   expect(spy).toHaveBeenCalled();
+     *   expect(isPlaying).toBe(true);
+     *
+     *   spy.mockReset();
+     *   spy.mockRestore();
+     * });
      */
     function spyOn(object: T, method: M, accessType?: 'get' | 'set'): SpyInstance;
     /**
@@ -233,15 +255,63 @@ declare namespace jest {
          * Only runs this test in the current file.
          */
         only: It;
+        /**
+         * Skips running this test in the current file.
+         */
         skip: It;
+        /**
+         * Experimental and should be avoided.
+         */
         concurrent: It;
+        /**
+         * Use if you keep duplicating the same test with different data. `.each` allows you to write the
+         * test once and pass data in.
+         *
+         * `.each` is available with two APIs:
+         *
+         * #### 1  `test.each(table)(name, fn)`
+         *
+         * - `table`: Array of Arrays with the arguments that are passed into the test fn for each row.
+         * - `name`: String the title of the test block.
+         * - `fn`: Function the test to be ran, this is the function that will receive the parameters in each row as function arguments.
+         *
+         *
+         * #### 2  `test.each table(name, fn)`
+         *
+         * - `table`: Tagged Template Literal
+         * - `name`: String the title of the test, use `$variable` to inject test data into the test title from the tagged template expressions.
+         * - `fn`: Function the test to be ran, this is the function that will receive the test data object..
+         *
+         * @example
+         *
+         * // API 1
+         * test.each([[1, 1, 2], [1, 2, 3], [2, 1, 3]])(
+         *   '.add(%i, %i)',
+         *   (a, b, expected) => {
+         *     expect(a + b).toBe(expected);
+         *   },
+         * );
+         *
+         * // API 2
+         * test.each`
+         * a    | b    | expected
+         * ${1} | ${1} | ${2}
+         * ${1} | ${2} | ${3}
+         * ${2} | ${1} | ${3}
+         * `('returns $expected when $a is added $b', ({a, b, expected}) => {
+         *    expect(a + b).toBe(expected);
+         * });
+         *
+         */
         each: Each;
     }
 
     interface Describe {
         // tslint:disable-next-line ban-types
         (name: number | string | Function | FunctionLike, fn: EmptyFunction): void;
+        /** Only runs the tests inside this `describe` for the current file */
         only: Describe;
+        /** Skips running the tests inside this `describe` for the current file */
         skip: Describe;
         each: Each;
     }
@@ -273,7 +343,7 @@ declare namespace jest {
     }
 
     interface ExpectExtendMap {
-        [key: string]: (this: MatcherUtils, received: any, ...actual: any[]) => { message(): string, pass: boolean } | Promise<{ message(): string, pass: boolean }>;
+        [key: string]: (this: MatcherUtils, received: any, ...actual: any[]) => { message(): string | (() => string), pass: boolean } | Promise<{ message(): string, pass: boolean }>;
     }
 
     interface SnapshotSerializerOptions {
@@ -325,11 +395,37 @@ declare namespace jest {
          *
          * @param actual The value to apply matchers against.
          */
-        (actual: any): Matchers;
+        (actual: T): Matchers;
+        /**
+         * Matches anything but null or undefined. You can use it inside `toEqual` or `toBeCalledWith` instead
+         * of a literal value. For example, if you want to check that a mock function is called with a
+         * non-null argument:
+         *
+         * @example
+         *
+         * test('map calls its argument with a non-null argument', () => {
+         *   const mock = jest.fn();
+         *   [1].map(x => mock(x));
+         *   expect(mock).toBeCalledWith(expect.anything());
+         * });
+         *
+         */
         anything(): any;
         /**
          * Matches anything that was created with the given constructor.
          * You can use it inside `toEqual` or `toBeCalledWith` instead of a literal value.
+         *
+         * @example
+         *
+         * function randocall(fn) {
+         *   return fn(Math.floor(Math.random() * 6 + 1));
+         * }
+         *
+         * test('randocall calls its callback with a number', () => {
+         *   const mock = jest.fn();
+         *   randocall(mock);
+         *   expect(mock).toBeCalledWith(expect.any(Number));
+         * });
          */
         any(classType: any): any;
         /**
@@ -521,6 +617,19 @@ declare namespace jest {
          * no matter what value you provided as the expected return value.
          */
         toHaveNthReturnedWith(nthCall: number, expected: any): R;
+        /**
+         * Use to check if property at provided reference keyPath exists for an object.
+         * For checking deeply nested properties in an object you may use dot notation or an array containing
+         * the keyPath for deep references.
+         *
+         * Optionally, you can provide a value to check if it's equal to the value present at keyPath
+         * on the target object. This matcher uses 'deep equality' (like `toEqual()`) and recursively checks
+         * the equality of all fields.
+         *
+         * @example
+         *
+         * expect(houseForSale).toHaveProperty('kitchen.area', 20);
+         */
         toHaveProperty(propertyPath: string | any[], value?: any): R;
         /**
          * Use to test that the mock function successfully returned (i.e., did not throw an error) at least one time
@@ -543,11 +652,28 @@ declare namespace jest {
          * Used to check that a JavaScript object matches a subset of the properties of an object
          */
         toMatchObject(expected: {} | any[]): R;
+        /**
+         * This ensures that a value matches the most recent snapshot with property matchers.
+         * Check out [the Snapshot Testing guide](http://facebook.github.io/jest/docs/snapshot-testing.html) for more information.
+         */
+        toMatchSnapshot(propertyMatchers: Partial, snapshotName?: string): R;
         /**
          * This ensures that a value matches the most recent snapshot.
          * Check out [the Snapshot Testing guide](http://facebook.github.io/jest/docs/snapshot-testing.html) for more information.
          */
         toMatchSnapshot(snapshotName?: string): R;
+        /**
+         * This ensures that a value matches the most recent snapshot with property matchers.
+         * Instead of writing the snapshot value to a .snap file, it will be written into the source code automatically.
+         * Check out [the Snapshot Testing guide](http://facebook.github.io/jest/docs/snapshot-testing.html) for more information.
+         */
+        toMatchInlineSnapshot(propertyMatchers: Partial, snapshot?: string): R;
+        /**
+         * This ensures that a value matches the most recent snapshot with property matchers.
+         * Instead of writing the snapshot value to a .snap file, it will be written into the source code automatically.
+         * Check out [the Snapshot Testing guide](http://facebook.github.io/jest/docs/snapshot-testing.html) for more information.
+         */
+        toMatchInlineSnapshot(snapshot?: string): R;
         /**
          * Ensure that a mock function has returned (as opposed to thrown) at least once.
          */
@@ -576,6 +702,11 @@ declare namespace jest {
          * Used to test that a function throws a error matching the most recent snapshot when it is called.
          */
         toThrowErrorMatchingSnapshot(): R;
+        /**
+         * Used to test that a function throws a error matching the most recent snapshot when it is called.
+         * Instead of writing the snapshot value to a .snap file, it will be written into the source code automatically.
+         */
+        toThrowErrorMatchingInlineSnapshot(snapshot?: string): R;
     }
 
     interface Constructable {
@@ -588,6 +719,12 @@ declare namespace jest {
     }
 
     interface SpyInstance extends MockInstance {
+        /**
+         * Removes the mock and restores the initial implementation.
+         *
+         * This is useful when you want to mock functions in certain test cases and restore the
+         * original implementation in others.
+         */
         mockRestore(): void;
     }
 
@@ -595,6 +732,7 @@ declare namespace jest {
      * Wrap module with mock definitions
      *
      * @example
+     *
      *  jest.mock("../api");
      *  import { Api } from "../api";
      *
@@ -606,19 +744,148 @@ declare namespace jest {
     } & T;
 
     interface MockInstance {
+        /** Returns the mock name string set by calling `mockFn.mockName(value)`. */
         getMockName(): string;
+        /** Provides access to the mock's metadata */
         mock: MockContext;
+        /**
+         * Resets all information stored in the mockFn.mock.calls and mockFn.mock.instances arrays.
+         *
+         * Often this is useful when you want to clean up a mock's usage data between two assertions.
+         *
+         * Beware that `mockClear` will replace `mockFn.mock`, not just `mockFn.mock.calls` and `mockFn.mock.instances`.
+         * You should therefore avoid assigning mockFn.mock to other variables, temporary or not, to make sure you
+         * don't access stale data.
+         */
         mockClear(): void;
+        /**
+         * Resets all information stored in the mock, including any initial implementation and mock name given.
+         *
+         * This is useful when you want to completely restore a mock back to its initial state.
+         *
+         * Beware that `mockReset` will replace `mockFn.mock`, not just `mockFn.mock.calls` and `mockFn.mock.instances`.
+         * You should therefore avoid assigning mockFn.mock to other variables, temporary or not, to make sure you
+         * don't access stale data.
+         */
         mockReset(): void;
+        /**
+         * Accepts a function that should be used as the implementation of the mock. The mock itself will still record
+         * all calls that go into and instances that come from itself – the only difference is that the implementation
+         * will also be executed when the mock is called.
+         *
+         * Note: `jest.fn(implementation)` is a shorthand for `jest.fn().mockImplementation(implementation)`.
+         */
         mockImplementation(fn: (...args: any[]) => any): Mock;
+        /**
+         * Accepts a function that will be used as an implementation of the mock for one call to the mocked function.
+         * Can be chained so that multiple function calls produce different results.
+         *
+         * @example
+         *
+         * const myMockFn = jest
+         *   .fn()
+         *    .mockImplementationOnce(cb => cb(null, true))
+         *    .mockImplementationOnce(cb => cb(null, false));
+         *
+         * myMockFn((err, val) => console.log(val)); // true
+         *
+         * myMockFn((err, val) => console.log(val)); // false
+         */
         mockImplementationOnce(fn: (...args: any[]) => any): Mock;
+        /** Sets the name of the mock`. */
         mockName(name: string): Mock;
+        /**
+         * Just a simple sugar function for:
+         *
+         * @example
+         *
+         *   jest.fn(function() {
+         *     return this;
+         *   });
+         */
         mockReturnThis(): Mock;
+        /**
+         * Accepts a value that will be returned whenever the mock function is called.
+         *
+         * @example
+         *
+         * const mock = jest.fn();
+         * mock.mockReturnValue(42);
+         * mock(); // 42
+         * mock.mockReturnValue(43);
+         * mock(); // 43
+         */
         mockReturnValue(value: any): Mock;
+        /**
+         * Accepts a value that will be returned for one call to the mock function. Can be chained so that
+         * successive calls to the mock function return different values. When there are no more
+         * `mockReturnValueOnce` values to use, calls will return a value specified by `mockReturnValue`.
+         *
+         * @example
+         *
+         * const myMockFn = jest.fn()
+         *   .mockReturnValue('default')
+         *   .mockReturnValueOnce('first call')
+         *   .mockReturnValueOnce('second call');
+         *
+         * // 'first call', 'second call', 'default', 'default'
+         * console.log(myMockFn(), myMockFn(), myMockFn(), myMockFn());
+         *
+         */
         mockReturnValueOnce(value: any): Mock;
+        /**
+         * Simple sugar function for: `jest.fn().mockImplementation(() => Promise.resolve(value));`
+         */
         mockResolvedValue(value: any): Mock;
+        /**
+         * Simple sugar function for: `jest.fn().mockImplementationOnce(() => Promise.resolve(value));`
+         *
+         * @example
+         *
+         * test('async test', async () => {
+         *  const asyncMock = jest
+         *    .fn()
+         *    .mockResolvedValue('default')
+         *    .mockResolvedValueOnce('first call')
+         *    .mockResolvedValueOnce('second call');
+         *
+         *  await asyncMock(); // first call
+         *  await asyncMock(); // second call
+         *  await asyncMock(); // default
+         *  await asyncMock(); // default
+         * });
+         *
+         */
         mockResolvedValueOnce(value: any): Mock;
+        /**
+         * Simple sugar function for: `jest.fn().mockImplementation(() => Promise.reject(value));`
+         *
+         * @example
+         *
+         * test('async test', async () => {
+         *   const asyncMock = jest.fn().mockRejectedValue(new Error('Async error'));
+         *
+         *   await asyncMock(); // throws "Async error"
+         * });
+         */
         mockRejectedValue(value: any): Mock;
+
+        /**
+         * Simple sugar function for: `jest.fn().mockImplementationOnce(() => Promise.reject(value));`
+         *
+         * @example
+         *
+         * test('async test', async () => {
+         *  const asyncMock = jest
+         *    .fn()
+         *    .mockResolvedValueOnce('first call')
+         *    .mockRejectedValueOnce(new Error('Async error'));
+         *
+         *  await asyncMock(); // first call
+         *  await asyncMock(); // throws "Async error"
+         * });
+         *
+         */
         mockRejectedValueOnce(value: any): Mock;
     }
 
diff --git a/types/jest/jest-tests.ts b/types/jest/jest-tests.ts
index 84b2007854..9eb14a5751 100644
--- a/types/jest/jest-tests.ts
+++ b/types/jest/jest-tests.ts
@@ -289,7 +289,6 @@ const spiedTarget = {
 const spy1 = jest.spyOn(spiedTarget, "returnsVoid");
 const spy2 = jest.spyOn(spiedTarget, "returnsVoid", "get");
 const spy3 = jest.spyOn(spiedTarget, "returnsString", "set");
-
 const spy1Name: string = spy1.getMockName();
 
 const spy2Calls: any[][] = spy2.mock.calls;
@@ -301,6 +300,7 @@ const spy3Mock: jest.Mock<() => string> = spy3
     .mockImplementation(() => "")
     .mockImplementation((arg: {}) => arg)
     .mockImplementation((...args: string[]) => args.join(""))
+    .mockImplementationOnce(() => "")
     .mockName("name")
     .mockReturnThis()
     .mockReturnValue("value")
@@ -425,6 +425,72 @@ expect.extend({
         };
     }
 });
+expect.extend({
+    async foo(this: jest.MatcherUtils, received: {}, ...actual: Array<{}>) {
+        return {
+            message: () => JSON.stringify(received),
+            pass: false,
+        };
+    }
+});
+expect.extend({
+    foo(this: jest.MatcherUtils) {
+        const isNot: boolean = this.isNot;
+
+        const expectedColor = this.utils.EXPECTED_COLOR("blue");
+        const receivedColor = this.utils.EXPECTED_COLOR("red");
+
+        this.utils.ensureActualIsNumber({});
+        this.utils.ensureActualIsNumber({}, "matcher");
+
+        this.utils.ensureExpectedIsNumber({});
+        this.utils.ensureExpectedIsNumber({}, "matcher");
+
+        this.utils.ensureNoExpected({});
+        this.utils.ensureNoExpected({}, "matcher");
+
+        this.utils.ensureNumbers({}, {});
+        this.utils.ensureNumbers({}, {}, "matcher");
+
+        const valueType: string = this.utils.getType({});
+
+        this.utils.matcherHint("matcher");
+        this.utils.matcherHint("matcher", "received");
+        this.utils.matcherHint("matcher", "received", "expected");
+        this.utils.matcherHint("matcher", "received", "expected", {});
+        this.utils.matcherHint("matcher", "received", "expected", {
+            isDirectExpectCall: true,
+        });
+        this.utils.matcherHint("matcher", "received", "expected", {
+            secondArgument: "",
+        });
+        this.utils.matcherHint("matcher", "received", "expected", {
+            isDirectExpectCall: true,
+            secondArgument: "",
+        });
+
+        const plural: string = this.utils.pluralize("word", 3);
+
+        const expectedPrinted: string = this.utils.printExpected({});
+
+        const receivedPrinted: string = this.utils.printReceived({});
+
+        const printedWithType: string = this.utils.printWithType(
+            "name",
+            {},
+            (value: {}) => "");
+
+        const stringified: string = this.utils.stringify({});
+        const stringifiedWithMaxDepth: string = this.utils.stringify({}, 3);
+
+        const equals: boolean = this.equals({}, {});
+
+        return {
+            message: () => "",
+            pass: false,
+        };
+    }
+});
 
 /* Basic matchers */
 
@@ -544,6 +610,21 @@ describe("", () => {
 
         expect({}).toMatchSnapshot();
         expect({}).toMatchSnapshot("snapshotName");
+        expect({ abc: "def" }).toMatchSnapshot({ abc: expect.any(String) }, "snapshotName");
+        expect({
+            one: 1,
+            two: "2",
+            date: new Date(),
+        }).toMatchSnapshot({ one: expect.any(Number), date: expect.any(Date) });
+
+        expect({}).toMatchInlineSnapshot();
+        expect({}).toMatchInlineSnapshot("snapshot");
+        expect({ abc: "def" }).toMatchInlineSnapshot({ abc: expect.any(String) }, "snapshot");
+        expect({
+            one: 1,
+            two: "2",
+            date: new Date(),
+        }).toMatchInlineSnapshot({ one: expect.any(Number), date: expect.any(Date) });
 
         expect(jest.fn()).toReturn();
 
@@ -569,6 +650,15 @@ describe("", () => {
         expect(jest.fn()).toThrowErrorMatchingSnapshot();
         expect(jest.fn(willThrow)).toThrowErrorMatchingSnapshot();
 
+        expect(() => {}).toThrowErrorMatchingInlineSnapshot();
+        expect(() => {}).toThrowErrorMatchingInlineSnapshot('Error Message');
+        expect(willThrow).toThrowErrorMatchingInlineSnapshot();
+        expect(willThrow).toThrowErrorMatchingInlineSnapshot('Error Message');
+        expect(jest.fn()).toThrowErrorMatchingInlineSnapshot();
+        expect(jest.fn()).toThrowErrorMatchingInlineSnapshot('Error Message');
+        expect(jest.fn(willThrow)).toThrowErrorMatchingInlineSnapshot();
+        expect(jest.fn(willThrow)).toThrowErrorMatchingInlineSnapshot('Error Message');
+
         /* not */
 
         expect({}).not.toEqual({});
@@ -1059,3 +1149,5 @@ test.only.each`
 `("returns $expected when $a is added $b", ({ a, b, expected }: Case) => {
     expect(a + b).toBe(expected);
 });
+
+expect("").toHaveProperty("path.to.thing");
diff --git a/types/jexl/index.d.ts b/types/jexl/index.d.ts
new file mode 100644
index 0000000000..953702346c
--- /dev/null
+++ b/types/jexl/index.d.ts
@@ -0,0 +1,113 @@
+// Type definitions for jexl 1.1
+// Project: https://github.com/TechnologyAdvice/jexl
+// Definitions by: Marcin Tomczyk 
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.2
+
+// Currently maintained by https://github.com/TomFrost/Jexl
+
+type TransformFunction = (value: any, args?: object) => any;
+
+type BinaryOpFunction = (left: any, right: any) => any;
+
+type UnaryOpFunction = (right: any) => any;
+
+type EvalCallbackFunction = (err: Error | null, result: any) => void;
+
+/**
+ * Jexl is the Javascript Expression Language, capable of parsing and
+ * evaluating basic to complex expression strings, combined with advanced
+ * xpath-like drilldown into native Javascript objects.
+ */
+declare class Jexl {
+    /**
+     * Adds a binary operator to Jexl at the specified precedence. The higher the
+     * precedence, the earlier the operator is applied in the order of operations.
+     * For example, * has a higher precedence than +, because multiplication comes
+     * before division.
+     *
+     * Please see grammar.js for a listing of all default operators and their
+     * precedence values in order to choose the appropriate precedence for the
+     * new operator.
+     * @param operator The operator string to be added
+     * @param precedence The operator's precedence
+     * @param fn A function to run to calculate the result. The function
+     *      will be called with two arguments: left and right, denoting the values
+     *      on either side of the operator. It should return either the resulting
+     *      value, or a Promise that resolves with the resulting value.
+     */
+    addBinaryOp(operator: string, precedence: number, fn: BinaryOpFunction): void;
+
+    /**
+     * Adds a unary operator to Jexl. Unary operators are currently only supported
+     * on the left side of the value on which it will operate.
+     * @param operator The operator string to be added
+     * @param fn A function to run to calculate the result. The function
+     *      will be called with one argument: the literal value to the right of the
+     *      operator. It should return either the resulting value, or a Promise
+     *      that resolves with the resulting value.
+     */
+    addUnaryOp(operator: string, fn: UnaryOpFunction): void;
+
+    /**
+     * Adds or replaces a transform function in this Jexl instance.
+     * @param name The name of the transform function, as it will be used
+     *      within Jexl expressions
+     * @param fn The function to be executed when this transform is
+     *      invoked.  It will be provided with two arguments:
+     *          - {*} value: The value to be transformed
+     *          - {{}} args: The arguments for this transform
+     *          - {function} cb: A callback function to be called with an error
+     *            if the transform fails, or a null first argument and the
+     *            transformed value as the second argument on success.
+     */
+    addTransform(name: string, fn: TransformFunction): void;
+
+    /**
+     * Syntactic sugar for calling {@link #Jexl:addTransform} repeatedly.  This function
+     * accepts a map of one or more transform names to their transform function.
+     * @param map A map of transform names to transform functions
+     */
+    addTransforms(map: { [key: string]: TransformFunction }): void;
+
+    /**
+     * Retrieves a previously set transform function.
+     * @param name The name of the transform function
+     * @returns The transform function
+     */
+    getTransform(name: string): TransformFunction;
+
+    /**
+     * Evaluates a Jexl string within an optional context.
+     * @param expression The Jexl expression to be evaluated
+     * @param context A mapping of variables to values, which will be
+     *      made accessible to the Jexl expression when evaluating it
+     * @param cb An optional callback function to be executed when
+     *      evaluation is complete.  It will be supplied with two arguments:
+     *          - err: Present if an error occurred
+     *          - result: The result of the evaluation
+     * @returns resolves with the result of the evaluation.  Note that
+     *      if a callback is supplied, the returned promise will already have
+     *      a '.catch' attached to it in order to pass the error to the callback.
+     */
+    eval(expression: string, context?: object, cb?: EvalCallbackFunction): Promise;
+
+    /**
+     * Removes a binary or unary operator from the Jexl grammar.
+     * @param operator The operator string to be removed
+     */
+    removeOp(operator: string): void;
+}
+
+/**
+ * Jexl is the Javascript Expression Language, capable of parsing and
+ * evaluating basic to complex expression strings, combined with advanced
+ * xpath-like drilldown into native Javascript objects.
+ */
+declare class BuildableJexl extends Jexl {
+    Jexl: { new(): Jexl };
+}
+
+declare const exportJexl: BuildableJexl;
+
+export = exportJexl;
diff --git a/types/jexl/jexl-tests.ts b/types/jexl/jexl-tests.ts
new file mode 100644
index 0000000000..df55bba69e
--- /dev/null
+++ b/types/jexl/jexl-tests.ts
@@ -0,0 +1,77 @@
+import * as jexl from "jexl";
+
+const context = {
+    name: {first: 'Sterling', last: 'Archer'},
+    assoc: [
+        {first: 'Lana', last: 'Kane'},
+        {first: 'Cyril', last: 'Figgis'},
+        {first: 'Pam', last: 'Poovey'}
+    ],
+    age: 36
+};
+
+// Filter an array
+// Output: Kane
+// $ExpectType Promise
+jexl.eval('assoc[.first == "Lana"].last', context);
+
+// Do math
+// Output: 72
+// $ExpectType Promise
+jexl.eval('age * (3 - 1)', context, (err, res) => {
+});
+
+// Concatenate
+// Output: Sterling Archer
+// $ExpectType Promise
+jexl.eval('name.first + " " + name["la" + "st"]', context);
+
+// Compound
+// Output: true
+// $ExpectType Promise
+jexl.eval('assoc[.last == "Figgis"].first == "Cyril" && assoc[.last == "Poovey"].first == "Pam"', context);
+
+// Use array indexes
+// Output: Cyril Figgis
+// $ExpectType Promise
+jexl.eval('assoc[1]', context, (err, res) => {
+});
+
+// Use conditional logic
+// Output: working
+// $ExpectType Promise
+jexl.eval('age > 62 ? "retired" : "working"', context);
+
+// Transform
+// $ExpectType void
+jexl.addTransform('upper', (val) => {
+    return val.toUpperCase();
+});
+// Output: DUCHESS ARCHER
+// $ExpectType Promise
+jexl.eval('"duchess"|upper + " " + name.last|upper', context);
+
+// Transform asynchronously, with arguments
+// $ExpectType void
+jexl.addTransform('getStat', (val, stat) => {
+    return Promise.resolve('Test'); // Returns a promise
+});
+// Output: 184
+// $ExpectType Promise
+jexl.eval('name.last|getStat("weight")', context, (err, res) => {
+});
+
+// Add your own (a)synchronous operators
+// Here's a case-insensitive string equality
+// $ExpectType void
+jexl.addBinaryOp('_=', 20, (left, right) => {
+    return left.toLowerCase() === right.toLowerCase();
+});
+// Output: true
+// $ExpectType Promise
+jexl.eval('"Guest" _= "gUeSt"');
+
+const newJexlInstance = new jexl.Jexl();
+
+// $ExpectType Promise
+newJexlInstance.eval("true == true");
diff --git a/types/winston/tsconfig.json b/types/jexl/tsconfig.json
similarity index 87%
rename from types/winston/tsconfig.json
rename to types/jexl/tsconfig.json
index 390e22a274..8db678a16d 100644
--- a/types/winston/tsconfig.json
+++ b/types/jexl/tsconfig.json
@@ -6,8 +6,8 @@
         ],
         "noImplicitAny": true,
         "noImplicitThis": true,
-        "strictNullChecks": false,
         "strictFunctionTypes": true,
+        "strictNullChecks": true,
         "baseUrl": "../",
         "typeRoots": [
             "../"
@@ -18,6 +18,6 @@
     },
     "files": [
         "index.d.ts",
-        "winston-tests.ts"
+        "jexl-tests.ts"
     ]
-}
\ No newline at end of file
+}
diff --git a/types/jexl/tslint.json b/types/jexl/tslint.json
new file mode 100644
index 0000000000..3db14f85ea
--- /dev/null
+++ b/types/jexl/tslint.json
@@ -0,0 +1 @@
+{ "extends": "dtslint/dt.json" }
diff --git a/types/joi/index.d.ts b/types/joi/index.d.ts
index dbf60400b9..12aa17b643 100644
--- a/types/joi/index.d.ts
+++ b/types/joi/index.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for joi v13.3.0
+// Type definitions for joi v13.4.0
 // Project: https://github.com/hapijs/joi
 // Definitions by: Bart van der Schoor 
 //                 Laurence Dougal Myers 
@@ -753,8 +753,11 @@ export interface ObjectSchema extends AnySchema {
 
     /**
      * Specify validation rules for unknown keys matching a pattern.
+	 *
+	 * @param pattern - a pattern that can be either a regular expression or a joi schema that will be tested against the unknown key names
+	 * @param schema - the schema object matching keys must validate against
      */
-    pattern(regex: RegExp, schema: SchemaLike): this;
+    pattern(pattern: RegExp | SchemaLike, schema: SchemaLike): this;
 
     /**
      * Defines an all-or-nothing relationship between keys where if one of the peers is present, all of them are required as well.
diff --git a/types/jquery-gray/index.d.ts b/types/jquery-gray/index.d.ts
new file mode 100644
index 0000000000..2d48831bc2
--- /dev/null
+++ b/types/jquery-gray/index.d.ts
@@ -0,0 +1,23 @@
+// Type definitions for JQuery Gray 1.6
+// Project: https://github.com/karlhorky/gray
+// Definitions by: Anderson Friaça 
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.3
+
+/// 
+
+export type Classes = Partial<{
+    fade: string;
+}>;
+
+export type Options = Partial<{
+    fade: boolean;
+    classes: Classes;
+}>;
+
+declare global {
+    interface JQuery {
+        gray(options?: Options): JQuery;
+        toggleClass(className: 'grayscale-off'): JQuery;
+    }
+}
diff --git a/types/jquery-gray/jquery-gray-tests.ts b/types/jquery-gray/jquery-gray-tests.ts
new file mode 100644
index 0000000000..2e2027354f
--- /dev/null
+++ b/types/jquery-gray/jquery-gray-tests.ts
@@ -0,0 +1,16 @@
+import { Options } from "jquery-gray";
+
+// basic usage
+$('.images').gray();
+
+$('.images').toggleClass('grayscale-off');
+
+// with options
+const options: Options = {
+    fade: true,
+    classes: {
+        fade: 'grayscale-fade'
+    }
+};
+
+$('.images').gray(options);
diff --git a/types/jquery-gray/tsconfig.json b/types/jquery-gray/tsconfig.json
new file mode 100644
index 0000000000..81d0dced36
--- /dev/null
+++ b/types/jquery-gray/tsconfig.json
@@ -0,0 +1,25 @@
+{
+    "compilerOptions": {
+        "module": "commonjs",
+        "lib": [
+            "es6",
+            "dom"
+        ],
+        "noImplicitAny": true,
+        "noImplicitThis": true,
+        "strictNullChecks": true,
+        "strictFunctionTypes": true,
+        "baseUrl": "../",
+        "typeRoots": [
+            "../"
+        ],
+        "types": [],
+        "noEmit": true,
+        "forceConsistentCasingInFileNames": true,
+        "esModuleInterop": true
+    },
+    "files": [
+        "index.d.ts",
+        "jquery-gray-tests.ts"
+    ]
+}
\ No newline at end of file
diff --git a/types/jquery-gray/tslint.json b/types/jquery-gray/tslint.json
new file mode 100644
index 0000000000..d04fe2e1fa
--- /dev/null
+++ b/types/jquery-gray/tslint.json
@@ -0,0 +1 @@
+{"extends": "dtslint/dt.json"}
\ No newline at end of file
diff --git a/types/jquery/tsconfig.json b/types/jquery/tsconfig.json
index 40a0bc76d4..86c99c452f 100644
--- a/types/jquery/tsconfig.json
+++ b/types/jquery/tsconfig.json
@@ -21,7 +21,6 @@
     "files": [
         "index.d.ts",
         "jquery-tests.ts",
-        "test/bluebird-global-tests.ts",
         "test/example-tests.ts",
         "test/longdesc-tests.ts",
         "test/learn-tests.ts",
diff --git a/types/js-yaml/index.d.ts b/types/js-yaml/index.d.ts
index da2d2a36c8..1dfa56c5a5 100644
--- a/types/js-yaml/index.d.ts
+++ b/types/js-yaml/index.d.ts
@@ -6,10 +6,8 @@
 
 export as namespace jsyaml;
 
-export type DocumentLoadResult = object | undefined;
-
-export function safeLoad(str: string, opts?: LoadOptions): DocumentLoadResult;
-export function load(str: string, opts?: LoadOptions): DocumentLoadResult;
+export function safeLoad(str: string, opts?: LoadOptions): any;
+export function load(str: string, opts?: LoadOptions): any;
 
 export class Type {
 	constructor(tag: string, opts?: TypeConstructorOptions);
@@ -30,10 +28,10 @@ export class Schema implements SchemaDefinition {
 	static create(schemas: Schema[] | Schema, types: Type[] | Type): Schema;
 }
 
-export function safeLoadAll(str: string, iterator?: undefined, opts?: LoadOptions): DocumentLoadResult[];
+export function safeLoadAll(str: string, iterator?: undefined, opts?: LoadOptions): any[];
 export function safeLoadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): undefined;
 
-export function loadAll(str: string, iterator?: undefined, opts?: LoadOptions): DocumentLoadResult[];
+export function loadAll(str: string, iterator?: undefined, opts?: LoadOptions): any[];
 
 export function loadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): undefined;
 
diff --git a/types/js-yaml/js-yaml-tests.ts b/types/js-yaml/js-yaml-tests.ts
index 9a61da204f..2d67b99192 100644
--- a/types/js-yaml/js-yaml-tests.ts
+++ b/types/js-yaml/js-yaml-tests.ts
@@ -109,19 +109,19 @@ type.styleAliases;
 
 // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 
-// $ExpectType DocumentLoadResult
+// $ExpectType any
 yaml.safeLoad(str);
-// $ExpectType DocumentLoadResult
+// $ExpectType any
 yaml.safeLoad(str, loadOpts);
 
-// $ExpectType DocumentLoadResult
+// $ExpectType any
 yaml.load(str);
-// $ExpectType DocumentLoadResult
+// $ExpectType any
 yaml.load(str, loadOpts);
 
 // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 
-// $ExpectType DocumentLoadResult[]
+// $ExpectType any[]
 yaml.safeLoadAll(str);
 
 // $ExpectType undefined
@@ -132,10 +132,10 @@ yaml.safeLoadAll(str, (doc) => {
 yaml.safeLoadAll(str, (doc) => {
 	value = doc;
 }, loadOpts);
-// $ExpectType DocumentLoadResult[]
+// $ExpectType any[]
 value = yaml.safeLoadAll(str, undefined, loadOpts);
 
-// $ExpectType DocumentLoadResult[]
+// $ExpectType any[]
 value = yaml.loadAll(str);
 
 // $ExpectType undefined
@@ -146,7 +146,7 @@ yaml.loadAll(str, (doc) => {
 yaml.loadAll(str, (doc) => {
 	value = doc;
 }, loadOpts);
-// $ExpectType DocumentLoadResult[]
+// $ExpectType any[]
 value = yaml.loadAll(str, undefined, loadOpts);
 
 // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
diff --git a/types/json-editor/index.d.ts b/types/json-editor/index.d.ts
index 280c17e70f..947dfad4bb 100644
--- a/types/json-editor/index.d.ts
+++ b/types/json-editor/index.d.ts
@@ -1,6 +1,7 @@
 // Type definitions for json-editor
 // Project: https://github.com/jdorn/json-editor
 // Definitions by: York Yao 
+//                 Felipe Provenzano 
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
 
 type JSONEditorOptions = {
@@ -75,7 +76,7 @@ type JSONEditorOptions = {
     /**
      * The CSS theme to use.
      */
-    theme?: "barebones" | "html" | "bootstrap2" | "bootstrap3" | "foundation3" | "foundation4" | "foundation5" | "foundation6" | "jqueryui";
+    theme?: "barebones" | "html" | "bootstrap2" | "bootstrap3" | "bootstrap4" | "foundation3" | "foundation4" | "foundation5" | "foundation6" | "jqueryui";
     /**
      * If true, only required properties will be included by default.
      */
diff --git a/types/jsonwebtoken/index.d.ts b/types/jsonwebtoken/index.d.ts
index 23d58789e1..f54d3862c9 100644
--- a/types/jsonwebtoken/index.d.ts
+++ b/types/jsonwebtoken/index.d.ts
@@ -77,10 +77,10 @@ export interface DecodeOptions {
     complete?: boolean;
     json?: boolean;
 }
-
+export type VerifyErrors=JsonWebTokenError | NotBeforeError | TokenExpiredError;
 export interface VerifyCallback {
     (
-        err: JsonWebTokenError | NotBeforeError | TokenExpiredError,
+        err: VerifyErrors,
         decoded: object | string,
     ): void;
 }
diff --git a/types/karma-coverage/index.d.ts b/types/karma-coverage/index.d.ts
index 03ca857449..50be80d5cf 100644
--- a/types/karma-coverage/index.d.ts
+++ b/types/karma-coverage/index.d.ts
@@ -2,7 +2,7 @@
 // Project: https://github.com/karma-runner/karma-coverage
 // Definitions by: Tanguy Krotoff 
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-// TypeScript Version: 2.3
+// TypeScript Version: 2.8
 
 import * as karma from 'karma';
 import * as istanbul from 'istanbul';
diff --git a/types/karma-webpack/index.d.ts b/types/karma-webpack/index.d.ts
index 73e65a39f5..f7278b64a5 100644
--- a/types/karma-webpack/index.d.ts
+++ b/types/karma-webpack/index.d.ts
@@ -2,7 +2,7 @@
 // Project: http://github.com/webpack/karma-webpack
 // Definitions by: Matt Traynham 
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-// TypeScript Version: 2.3
+// TypeScript Version: 2.8
 
 import 'karma';
 import * as Webpack from 'webpack';
diff --git a/types/karma/index.d.ts b/types/karma/index.d.ts
index e2cce2c340..cc4525566b 100644
--- a/types/karma/index.d.ts
+++ b/types/karma/index.d.ts
@@ -3,7 +3,7 @@
 // Definitions by: Tanguy Krotoff 
 //                 James Garbutt 
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-// TypeScript Version: 2.3
+// TypeScript Version: 2.8
 
 /// 
 
@@ -294,6 +294,18 @@ declare namespace karma {
          * @description A list of log appenders to be used. See the documentation for [log4js] for more information.
          */
         loggers?: Log4jsAppenderConfigBase[];
+        /**
+         * @default []
+         * @description List of names of additional middleware you want the
+         * Karma server to use. Middleware will be used in the order listed.
+         * You must have installed the middleware via a plugin/framework
+         * (either inline or via NPM). Additional information can be found in
+         * [plugins](http://karma-runner.github.io/2.0/config/plugins.html).
+         * The plugin must provide an express/connect middleware function
+         * (details about this can be found in the
+         * [Express](http://expressjs.com/guide/using-middleware.html) docs).
+         */
+        middleware?: string[];
         /**
          * @default {}
          * @description Redefine default mapping from file extensions to MIME-type.
diff --git a/types/karma/karma-tests.ts b/types/karma/karma-tests.ts
index b21fa88e50..6d9b8abd9f 100644
--- a/types/karma/karma-tests.ts
+++ b/types/karma/karma-tests.ts
@@ -88,6 +88,8 @@ module.exports = function(config: karma.Config) {
       'coverage'
     ],
 
+    middleware: ['foo', 'bar'],
+
     mime: {
       'text/x-typescript': ['ts', 'tsx']
     },
diff --git a/types/keen-tracking/index.d.ts b/types/keen-tracking/index.d.ts
new file mode 100644
index 0000000000..69f513312c
--- /dev/null
+++ b/types/keen-tracking/index.d.ts
@@ -0,0 +1,20 @@
+// Type definitions for keen-tracking 2.0
+// Project: https://github.com/keen/keen-tracking.js#readme
+// Definitions by: Rui Ferreira 
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.2
+
+export default class KeenTracking {
+    constructor(options: { projectId: string; writeKey: string; requestType?: string });
+
+    recordEvent(
+        collectionName: string,
+        event: object
+    ): Promise<{ created: boolean }>;
+
+    recordEvents(events: {
+        [collectionName: string]: object[];
+    }): Promise<{
+        [collectionName: string]: boolean[];
+    }>;
+}
diff --git a/types/keen-tracking/keen-tracking-tests.ts b/types/keen-tracking/keen-tracking-tests.ts
new file mode 100644
index 0000000000..ce89d00bcb
--- /dev/null
+++ b/types/keen-tracking/keen-tracking-tests.ts
@@ -0,0 +1,29 @@
+import KeenTracking from "keen-tracking";
+
+// $ExpectType KeenTracking
+let tc = new KeenTracking({
+  projectId: "xpto",
+  writeKey: "XPTOQWEKASDKASD"
+});
+
+// $ExpectType KeenTracking
+tc = new KeenTracking({
+  projectId: "xpto",
+  writeKey: "XPTOQWEKASDKASD",
+  requestType: "beacon"
+});
+
+// $ExpectType Promise<{ created: boolean; }>
+tc.recordEvent("my_collection", {a: "xxx", b: 123});
+
+// $ExpectType Promise<{ [collectionName: string]: boolean[]; }>
+tc.recordEvents({
+  my_collection_1: [
+    {a: "aaa", b: 111},
+    {a: "bbb", b: 222}
+  ],
+  my_collection_2: [
+    {x: 1.0, y: {z: "ok"}},
+    {x: 2.0, y: {z: "ko"}}
+  ]
+});
diff --git a/types/keen-tracking/tsconfig.json b/types/keen-tracking/tsconfig.json
new file mode 100644
index 0000000000..c5476575c9
--- /dev/null
+++ b/types/keen-tracking/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",
+        "keen-tracking-tests.ts"
+    ]
+}
diff --git a/types/keen-tracking/tslint.json b/types/keen-tracking/tslint.json
new file mode 100644
index 0000000000..3db14f85ea
--- /dev/null
+++ b/types/keen-tracking/tslint.json
@@ -0,0 +1 @@
+{ "extends": "dtslint/dt.json" }
diff --git a/types/knex-postgis/index.d.ts b/types/knex-postgis/index.d.ts
index b63c1f11dd..193c0aa4a5 100644
--- a/types/knex-postgis/index.d.ts
+++ b/types/knex-postgis/index.d.ts
@@ -2,7 +2,7 @@
 // Project: https://github.com/jfgodoy/knex-postgis
 // Definitions by: Vesa Poikajärvi 
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-// TypeScript Version: 2.3
+// TypeScript Version: 2.8
 
 import * as GeoJSON from 'geojson';
 import * as Knex from 'knex';
diff --git a/types/knex/index.d.ts b/types/knex/index.d.ts
index 624fde2d01..c80238f259 100644
--- a/types/knex/index.d.ts
+++ b/types/knex/index.d.ts
@@ -7,7 +7,7 @@
 //                 Satana Charuwichitratana 
 //                 Shrey Jain 
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-// TypeScript Version: 2.3
+// TypeScript Version: 2.8
 
 /// 
 
@@ -155,7 +155,7 @@ declare namespace Knex {
         pluck(column: string): QueryBuilder;
 
         insert(data: any, returning?: string | string[]): QueryBuilder;
-        modify(callback: QueryCallback, ...args: any[]): QueryBuilder;
+        modify(callback: QueryCallbackWithArgs, ...args: any[]): QueryBuilder;
         update(data: any, returning?: string | string[]): QueryBuilder;
         update(columnName: string, value: Value, returning?: string | string[]): QueryBuilder;
         returning(column: string | string[]): QueryBuilder;
@@ -360,6 +360,8 @@ declare namespace Knex {
     //
 
     type QueryCallback = (this: QueryBuilder, builder: QueryBuilder) => void;
+    type QueryCallbackWithArgs = (this: QueryBuilder, builder: QueryBuilder, ...args: any[]) => void;
+
     interface QueryBuilder extends QueryInterface, ChainableInterface {
         or: QueryBuilder;
         and: QueryBuilder;
diff --git a/types/knex/knex-tests.ts b/types/knex/knex-tests.ts
index 9167ad3f77..ebd392aea3 100644
--- a/types/knex/knex-tests.ts
+++ b/types/knex/knex-tests.ts
@@ -1045,10 +1045,10 @@ knex('users')
   }).unionAll(function(builder) {
     let self: Knex.QueryBuilder = this;
     self = builder;
-  }).modify(function(builder) {
+  }).modify(function(builder, aBool) {
     let self: Knex.QueryBuilder = this;
     self = builder;
-  });
+  }, true);
 
 //
 // Migrations
diff --git a/types/knockout/index.d.ts b/types/knockout/index.d.ts
index fd30672d93..215d38e7f1 100644
--- a/types/knockout/index.d.ts
+++ b/types/knockout/index.d.ts
@@ -106,9 +106,9 @@ interface KnockoutObservableArray extends KnockoutObservable, KnockoutOb
 interface KnockoutObservableStatic {
     fn: KnockoutObservableFunctions;
 
-    (): KnockoutObservable
-    (value: null): KnockoutObservable
     (value: T): KnockoutObservable;
+    (value: null): KnockoutObservable
+    (): KnockoutObservable
 }
 
 interface KnockoutObservable extends KnockoutSubscribable, KnockoutObservableFunctions {
diff --git a/types/knockout/test/index.ts b/types/knockout/test/index.ts
index 130527818e..094cab2aa1 100644
--- a/types/knockout/test/index.ts
+++ b/types/knockout/test/index.ts
@@ -757,3 +757,7 @@ interface MyObservableArray extends KnockoutObservableArray {
 interface MyComputed extends KnockoutComputed {
     isBeautiful?: boolean;
 }
+
+function observableAny() {
+    ko.observable(5 as any); // $ExpectType KnockoutObservable
+}
diff --git a/types/koa-bodyparser/index.d.ts b/types/koa-bodyparser/index.d.ts
index 1664e86cac..deb1eb04e9 100644
--- a/types/koa-bodyparser/index.d.ts
+++ b/types/koa-bodyparser/index.d.ts
@@ -23,51 +23,54 @@ declare module "koa" {
     }
 }
 
-declare function bodyParser(opts?: {
-    /**
-     *  parser will only parse when request type hits enableTypes, default is ['json', 'form'].
-     */
-    enableTypes?: string[];
-    /**
-     * requested encoding. Default is utf-8 by co-body
-     */
-    encode?: string;
+declare function bodyParser(opts?: bodyParser.Options): Koa.Middleware;
 
-    /**
-     * limit of the urlencoded body. If the body ends up being larger than this limit
-     * a 413 error code is returned. Default is 56kb
-     */
-    formLimit?: string;
+declare namespace bodyParser {
+    interface Options {
+        /**
+         *  parser will only parse when request type hits enableTypes, default is ['json', 'form'].
+         */
+        enableTypes?: string[];
+        /**
+         * requested encoding. Default is utf-8 by co-body
+         */
+        encode?: string;
 
-    /**
-     * limit of the json body. Default is 1mb
-     */
-    jsonLimit?: string;
+        /**
+         * limit of the urlencoded body. If the body ends up being larger than this limit
+         * a 413 error code is returned. Default is 56kb
+         */
+        formLimit?: string;
 
-    /**
-     * when set to true, JSON parser will only accept arrays and objects. Default is true
-     */
-    strict?: boolean;
+        /**
+         * limit of the json body. Default is 1mb
+         */
+        jsonLimit?: string;
 
-    /**
-     * custom json request detect function. Default is null
-     */
-    detectJSON?: (ctx: Koa.Context) => boolean;
+        /**
+         * when set to true, JSON parser will only accept arrays and objects. Default is true
+         */
+        strict?: boolean;
 
-    /**
-     * support extend types
-     */
-    extendTypes?: {
-        json?: string[];
-        form?: string[];
-        text?: string[];
+        /**
+         * custom json request detect function. Default is null
+         */
+        detectJSON?: (ctx: Koa.Context) => boolean;
+
+        /**
+         * support extend types
+         */
+        extendTypes?: {
+            json?: string[];
+            form?: string[];
+            text?: string[];
+        };
+
+        /**
+         * support custom error handle
+         */
+        onerror?: (err: Error, ctx: Koa.Context) => void;
     }
+}
 
-    /**
-     * support custom error handle
-     */
-    onerror?: (err: Error, ctx: Koa.Context) => void;
-}): Koa.Middleware;
-
-declare namespace bodyParser { }
 export = bodyParser;
diff --git a/types/koa-csrf/index.d.ts b/types/koa-csrf/index.d.ts
index 268e261134..f8bfccd030 100644
--- a/types/koa-csrf/index.d.ts
+++ b/types/koa-csrf/index.d.ts
@@ -24,7 +24,7 @@ export = koaCsrf;
 import { Middleware } from 'koa';
 
 declare module "koa" {
-    interface Request {
+    interface Context {
         csrf: string;
     }
 }
diff --git a/types/koa-logger-winston/index.d.ts b/types/koa-logger-winston/index.d.ts
index ccb63ccd68..f6196b167b 100644
--- a/types/koa-logger-winston/index.d.ts
+++ b/types/koa-logger-winston/index.d.ts
@@ -7,11 +7,11 @@
 /// 
 
 import { Middleware } from 'koa';
-import { LoggerInstance } from 'winston';
+import { Logger } from 'winston';
 
 export = logger;
 
-declare function logger(logger: LoggerInstance): Middleware;
+declare function logger(logger: Logger): Middleware;
 
 declare namespace logger {
 }
diff --git a/types/koa-logger-winston/koa-logger-winston-tests.ts b/types/koa-logger-winston/koa-logger-winston-tests.ts
index 7bec5877f4..f2af3c650a 100644
--- a/types/koa-logger-winston/koa-logger-winston-tests.ts
+++ b/types/koa-logger-winston/koa-logger-winston-tests.ts
@@ -1,6 +1,6 @@
 import koa = require('koa');
 import logger = require('koa-logger-winston');
-import * as winston from 'winston';
+import { createLogger } from 'winston';
 
 const app = new koa();
-app.use(logger(new winston.Logger()));
+app.use(logger(createLogger()));
diff --git a/types/koa-logger-winston/package.json b/types/koa-logger-winston/package.json
new file mode 100644
index 0000000000..0aa4cf368f
--- /dev/null
+++ b/types/koa-logger-winston/package.json
@@ -0,0 +1,6 @@
+{
+    "private": true,
+    "dependencies": {
+        "winston": "^3.0.0"
+    }
+}
diff --git a/types/koa-websocket/index.d.ts b/types/koa-websocket/index.d.ts
index ebbfeee8f2..38fb0c0994 100644
--- a/types/koa-websocket/index.d.ts
+++ b/types/koa-websocket/index.d.ts
@@ -1,6 +1,7 @@
 // Type definitions for koa-websocket 5.0
 // Project: https://github.com/kudos/koa-websocket
 // Definitions by: Maël Lavault 
+//                 Jaco Greeff 
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
 // TypeScript Version: 2.3
 
@@ -9,26 +10,32 @@ import * as ws from 'ws';
 import * as http from 'http';
 import * as https from 'https';
 
-type KoaWebsocketConnectionHandler = (socket: ws) => void;
-type KoaWebsocketMiddleware = (this: KoaWebsocketMiddlewareContext, context: Koa.Context, next: () => Promise) => any;
-interface KoaWebsocketMiddlewareContext extends Koa.Context {
-    websocket: ws;
-    path: string;
+declare namespace KoaWebsocket {
+    type ConnectionHandler = (socket: ws) => void;
+
+    type Middleware = (this: MiddlewareContext, context: Koa.Context, next: () => Promise) => any;
+
+    interface MiddlewareContext extends Koa.Context {
+        websocket: ws;
+        path: string;
+    }
+
+    class Server {
+        app: Koa;
+        middleware: Koa.Middleware[];
+
+        constructor(app: Koa);
+
+        listen(options: ws.ServerOptions): ws.Server;
+        onConnection(handler: ConnectionHandler): void;
+        use(middleware: Middleware): this;
+    }
+
+    interface App extends Koa {
+        ws: Server;
+    }
 }
 
-declare class KoaWebsocketServer {
-    app: Koa;
-    middleware: Koa.Middleware[];
+declare function websockets(app: Koa): KoaWebsocket.App;
 
-    constructor(app: Koa);
-    listen(options: ws.ServerOptions): ws.Server;
-    onConnection(handler: KoaWebsocketConnectionHandler): void;
-    use(middleware: KoaWebsocketMiddleware): this;
-}
-
-interface KoaWebsocketApp extends Koa {
-    ws: KoaWebsocketServer;
-}
-
-declare function websockets(app: Koa): KoaWebsocketApp;
 export = websockets;
diff --git a/types/leaflet/index.d.ts b/types/leaflet/index.d.ts
index 89f9625114..47b2ebc515 100644
--- a/types/leaflet/index.d.ts
+++ b/types/leaflet/index.d.ts
@@ -390,6 +390,7 @@ export interface LayerOptions {
 
 export interface InteractiveLayerOptions extends LayerOptions {
     interactive?: boolean;
+    bubblingMouseEvents?: boolean;
 }
 
 export class Layer extends Evented {
@@ -542,12 +543,13 @@ export namespace tileLayer {
     function wms(baseUrl: string, options?: WMSOptions): TileLayer.WMS;
 }
 
-export interface ImageOverlayOptions extends LayerOptions {
+export interface ImageOverlayOptions extends InteractiveLayerOptions {
     opacity?: number;
     alt?: string;
     interactive?: boolean;
     attribution?: string;
     crossOrigin?: boolean;
+    className?: string;
 }
 
 export class ImageOverlay extends Layer {
diff --git a/types/leaflet/leaflet-tests.ts b/types/leaflet/leaflet-tests.ts
index a22ab91248..1f6671cc8c 100644
--- a/types/leaflet/leaflet-tests.ts
+++ b/types/leaflet/leaflet-tests.ts
@@ -251,6 +251,29 @@ tileLayer = new L.TileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png');
 tileLayer = new L.TileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', tileLayerOptions);
 tileLayer = new L.TileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png?{foo}&{bar}&{abc}', {foo: 'bar', bar: (data: any) => 'foo', abc: () => ''});
 
+// imageOverlay
+let imageOverlayOptions: L.ImageOverlayOptions;
+imageOverlayOptions = {
+    opacity: 100,
+    alt: 'alt',
+    interactive: true,
+    attribution: 'attribution',
+    crossOrigin: true,
+    className: 'className',
+    bubblingMouseEvents: false,
+    pane: 'pane'
+};
+
+const imageOverlayBounds = latLngBounds;
+let imageOverlay: L.ImageOverlay;
+imageOverlay = L.imageOverlay('https://www.google.ru/images/branding/googlelogo/2x/googlelogo_color_120x44dp.png', imageOverlayBounds);
+imageOverlay = L.imageOverlay('https://www.google.ru/images/branding/googlelogo/2x/googlelogo_color_120x44dp.png', imageOverlayBounds, imageOverlayOptions);
+imageOverlay = L.imageOverlay('https://www.google.ru/images/branding/googlelogo/2x/googlelogo_color_120x44dp.png', imageOverlayBounds, {
+    opacity: 100,
+    alt: 'alt',
+    className: 'className',
+});
+
 const eventHandler = () => {};
 const domEvent: Event = {} as Event;
 L.DomEvent
diff --git a/types/lodash/common/function.d.ts b/types/lodash/common/function.d.ts
index 71ec3bb884..66dc75a296 100644
--- a/types/lodash/common/function.d.ts
+++ b/types/lodash/common/function.d.ts
@@ -840,14 +840,30 @@ declare module "../index" {
          * @param predicate The predicate to negate.
          * @return Returns the new function.
          */
-        negate any>(predicate: T): T;
+        negate(predicate: () => boolean): () => boolean;
+        negate(predicate: (a1: A1) => boolean): (a1: A1) => boolean;
+        negate(predicate: (a1: A1, a2: A2) => boolean): (a1: A1, a2: A2) => boolean;
+        negate(predicate: (...args: any[]) => any): (...args: any[]) => boolean;
     }
 
-    interface LoDashWrapper {
+    interface LoDashImplicitWrapper {
         /**
          * @see _.negate
          */
-        negate(): this;
+        negate(this: LoDashImplicitWrapper<() => boolean>): LoDashImplicitWrapper<() => boolean>;
+        negate(this: LoDashImplicitWrapper<(a1: A1) => boolean>): LoDashImplicitWrapper<(a1: A1) => boolean>;
+        negate(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => boolean>): LoDashImplicitWrapper<(a1: A1, a2: A2) => boolean>;
+        negate(this: LoDashImplicitWrapper<(...args: any[]) => any>): LoDashImplicitWrapper<(...args: any[]) => boolean>;
+    }
+
+    interface LoDashExplicitWrapper {
+        /**
+         * @see _.negate
+         */
+        negate(this: LoDashExplicitWrapper<() => boolean>): LoDashExplicitWrapper<() => boolean>;
+        negate(this: LoDashExplicitWrapper<(a1: A1) => boolean>): LoDashExplicitWrapper<(a1: A1) => boolean>;
+        negate(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => boolean>): LoDashExplicitWrapper<(a1: A1, a2: A2) => boolean>;
+        negate(this: LoDashExplicitWrapper<(...args: any[]) => any>): LoDashExplicitWrapper<(...args: any[]) => boolean>;
     }
 
     // once
diff --git a/types/lodash/common/object.d.ts b/types/lodash/common/object.d.ts
index 5e2d539c23..edb9e1736c 100644
--- a/types/lodash/common/object.d.ts
+++ b/types/lodash/common/object.d.ts
@@ -2951,6 +2951,22 @@ declare module "../index" {
          * _.omitBy(object, _.isNumber);
          * // => { 'b': '2' }
          */
+        omitBy(
+            object: Dictionary | null | undefined,
+            predicate?: ValueKeyIteratee
+        ): Dictionary;
+
+        /**
+         * @see _.omitBy
+         */
+        omitBy(
+            object: NumericDictionary | null | undefined,
+            predicate?: ValueKeyIteratee
+        ): NumericDictionary;
+
+        /**
+         * @see _.omitBy
+         */
         omitBy(
             object: T | null | undefined,
             predicate: ValueKeyIteratee
@@ -2958,6 +2974,22 @@ declare module "../index" {
     }
 
     interface LoDashImplicitWrapper {
+        /**
+         * @see _.omitBy
+         */
+        omitBy(
+            this: LoDashImplicitWrapper | null | undefined>,
+            predicate?: ValueKeyIteratee
+        ): LoDashImplicitWrapper>;
+
+        /**
+         * @see _.omitBy
+         */
+        omitBy(
+            this: LoDashImplicitWrapper | null | undefined>,
+            predicate?: ValueKeyIteratee
+        ): LoDashImplicitWrapper>;
+
         /**
          * @see _.omitBy
          */
@@ -2968,6 +3000,22 @@ declare module "../index" {
     }
 
     interface LoDashExplicitWrapper {
+        /**
+         * @see _.omitBy
+         */
+        omitBy(
+            this: LoDashExplicitWrapper | null | undefined>,
+            predicate?: ValueKeyIteratee
+        ): LoDashExplicitWrapper>;
+
+        /**
+         * @see _.omitBy
+         */
+        omitBy(
+            this: LoDashExplicitWrapper | null | undefined>,
+            predicate?: ValueKeyIteratee
+        ): LoDashExplicitWrapper>;
+
         /**
          * @see _.omitBy
          */
@@ -3063,6 +3111,30 @@ declare module "../index" {
          * _.pickBy(object, _.isNumber);
          * // => { 'a': 1, 'c': 3 }
          */
+        pickBy(
+            object: T | null | undefined,
+            predicate: ObjectIteratorTypeGuard
+        ): Dictionary;
+
+        /**
+         * @see _.pickBy
+         */
+        pickBy(
+            object: Dictionary | null | undefined,
+            predicate?: ValueKeyIteratee
+        ): Dictionary;
+
+        /**
+         * @see _.pickBy
+         */
+        pickBy(
+            object: NumericDictionary | null | undefined,
+            predicate?: ValueKeyIteratee
+        ): NumericDictionary;
+
+        /**
+         * @see _.pickBy
+         */
         pickBy(
             object: T | null | undefined,
             predicate?: ValueKeyIteratee
@@ -3070,6 +3142,30 @@ declare module "../index" {
     }
 
     interface LoDashImplicitWrapper {
+        /**
+         * @see _.pickBy
+         */
+        pickBy(
+            this: LoDashImplicitWrapper,
+            predicate: ObjectIteratorTypeGuard
+        ): LoDashImplicitWrapper>;
+
+        /**
+         * @see _.pickBy
+         */
+        pickBy(
+            this: LoDashImplicitWrapper | null | undefined>,
+            predicate?: ValueKeyIteratee
+        ): LoDashImplicitWrapper>;
+
+        /**
+         * @see _.pickBy
+         */
+        pickBy(
+            this: LoDashImplicitWrapper | null | undefined>,
+            predicate?: ValueKeyIteratee
+        ): LoDashImplicitWrapper>;
+
         /**
          * @see _.pickBy
          */
@@ -3080,6 +3176,30 @@ declare module "../index" {
     }
 
     interface LoDashExplicitWrapper {
+        /**
+         * @see _.pickBy
+         */
+        pickBy(
+            this: LoDashExplicitWrapper,
+            predicate: ObjectIteratorTypeGuard
+        ): LoDashExplicitWrapper>;
+
+        /**
+         * @see _.pickBy
+         */
+        pickBy(
+            this: LoDashExplicitWrapper | null | undefined>,
+            predicate?: ValueKeyIteratee
+        ): LoDashExplicitWrapper>;
+
+        /**
+         * @see _.pickBy
+         */
+        pickBy(
+            this: LoDashExplicitWrapper | null | undefined>,
+            predicate?: ValueKeyIteratee
+        ): LoDashExplicitWrapper>;
+
         /**
          * @see _.pickBy
          */
diff --git a/types/lodash/fp.d.ts b/types/lodash/fp.d.ts
index c799bd734b..f373d81a27 100644
--- a/types/lodash/fp.d.ts
+++ b/types/lodash/fp.d.ts
@@ -300,7 +300,12 @@ declare namespace _ {
     }
     type LodashCloneWith2x1 = (value: T) => TResult | T;
     type LodashCompact = (array: lodash.List | null | undefined) => T[];
-    type LodashNegate =  any>(predicate: T) => T;
+    interface LodashNegate {
+        (predicate: () => boolean): () => boolean;
+        (predicate: (a1: A1) => boolean): (a1: A1) => boolean;
+        (predicate: (a1: A1, a2: A2) => boolean): (a1: A1, a2: A2) => boolean;
+        (predicate: (...args: any[]) => any): (...args: any[]) => boolean;
+    }
     interface LodashFlowRight {
         (f2: (a: R1) => R2, f1: () => R1): () => R2;
         (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R3;
@@ -2289,11 +2294,21 @@ declare namespace _ {
     }
     interface LodashOmitBy {
         (predicate: lodash.ValueKeyIteratee): LodashOmitBy1x1;
-        (predicate: lodash.__, object: T | null | undefined): LodashOmitBy1x2;
+        (predicate: lodash.__, object: lodash.Dictionary | null | undefined): LodashOmitBy1x2;
+        (predicate: lodash.ValueKeyIteratee, object: lodash.Dictionary | null | undefined): lodash.Dictionary;
+        (predicate: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashOmitBy2x2;
+        (predicate: lodash.ValueKeyIteratee, object: lodash.NumericDictionary | null | undefined): lodash.NumericDictionary;
+        (predicate: lodash.__, object: T | null | undefined): LodashOmitBy3x2;
         (predicate: lodash.ValueKeyIteratee, object: T | null | undefined): lodash.PartialObject;
     }
-    type LodashOmitBy1x1 = (object: T1 | null | undefined) => lodash.PartialObject;
-    type LodashOmitBy1x2 = (predicate: lodash.ValueKeyIteratee) => lodash.PartialObject;
+    interface LodashOmitBy1x1 {
+        (object: lodash.Dictionary | null | undefined): lodash.Dictionary;
+        (object: lodash.NumericDictionary | null | undefined): lodash.NumericDictionary;
+        (object: T1 | null | undefined): lodash.PartialObject;
+    }
+    type LodashOmitBy1x2 = (predicate: lodash.ValueKeyIteratee) => lodash.Dictionary;
+    type LodashOmitBy2x2 = (predicate: lodash.ValueKeyIteratee) => lodash.NumericDictionary;
+    type LodashOmitBy3x2 = (predicate: lodash.ValueKeyIteratee) => lodash.PartialObject;
     type LodashOnce =  any>(func: T) => T;
     interface LodashOrderBy {
         (iteratees: lodash.Many<(value: T) => lodash.NotVoid>): LodashOrderBy1x1;
@@ -2872,12 +2887,28 @@ declare namespace _ {
     type LodashPick2x1 = (object: T | null | undefined) => lodash.PartialDeep;
     type LodashPick2x2 = (props: lodash.PropertyPath) => lodash.PartialDeep;
     interface LodashPickBy {
-        (predicate: lodash.ValueKeyIteratee): LodashPickBy1x1;
+        (predicate: lodash.ValueIteratorTypeGuard): LodashPickBy1x1;
         (predicate: lodash.__, object: T | null | undefined): LodashPickBy1x2;
+        (predicate: lodash.ValueIteratorTypeGuard, object: T | null | undefined): lodash.Dictionary;
+        (predicate: lodash.ValueKeyIteratee): LodashPickBy2x1;
+        (predicate: lodash.__, object: lodash.Dictionary | null | undefined): LodashPickBy2x2;
+        (predicate: lodash.ValueKeyIteratee, object: lodash.Dictionary | null | undefined): lodash.Dictionary;
+        (predicate: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPickBy3x2;
+        (predicate: lodash.ValueKeyIteratee, object: lodash.NumericDictionary | null | undefined): lodash.NumericDictionary;
         (predicate: lodash.ValueKeyIteratee, object: T | null | undefined): lodash.PartialObject;
     }
-    type LodashPickBy1x1 = (object: T1 | null | undefined) => lodash.PartialObject;
-    type LodashPickBy1x2 = (predicate: lodash.ValueKeyIteratee) => lodash.PartialObject;
+    type LodashPickBy1x1 = (object: T | null | undefined) => lodash.Dictionary;
+    interface LodashPickBy1x2 {
+        (predicate: lodash.ValueIteratorTypeGuard): lodash.Dictionary;
+        (predicate: lodash.ValueKeyIteratee): lodash.PartialObject;
+    }
+    interface LodashPickBy2x1 {
+        (object: lodash.Dictionary | null | undefined): lodash.Dictionary;
+        (object: lodash.NumericDictionary | null | undefined): lodash.NumericDictionary;
+        (object: T1 | null | undefined): lodash.PartialObject;
+    }
+    type LodashPickBy2x2 = (predicate: lodash.ValueKeyIteratee) => lodash.Dictionary;
+    type LodashPickBy3x2 = (predicate: lodash.ValueKeyIteratee) => lodash.NumericDictionary;
     interface LodashProp {
         (path: TKey | [TKey]): LodashProp1x1;
         (path: lodash.__, object: TObject): LodashProp1x2;
diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts
index 88a5a88bfc..d158765b33 100644
--- a/types/lodash/lodash-tests.ts
+++ b/types/lodash/lodash-tests.ts
@@ -3516,6 +3516,18 @@ fp.now(); // $ExpectType number
     _((a1: number, a2: number): boolean => true).negate(); // $ExpectType LoDashImplicitWrapper<(a1: number, a2: number) => boolean>
     _.chain((a1: number, a2: number): boolean => true).negate(); // $ExpectType LoDashExplicitWrapper<(a1: number, a2: number) => boolean>
     fp.negate((a1: number, a2: number): boolean => true); // $ExpectType (a1: number, a2: number) => boolean
+
+    const userDefinedTypeGuard = (item: any): item is number => typeof item === "number";
+
+    _.negate(userDefinedTypeGuard); // $ExpectType (a1: any) => boolean
+    _(userDefinedTypeGuard).negate(); // $ExpectType LoDashImplicitWrapper<(a1: any) => boolean>
+    _.chain(userDefinedTypeGuard).negate(); // $ExpectType LoDashExplicitWrapper<(a1: any) => boolean>
+    fp.negate(userDefinedTypeGuard); // $ExpectType (a1: any) => boolean
+
+    _.negate((a1: number, a2: number, a3: number): boolean => true); // $ExpectType (...args: any[]) => boolean
+    _((a1: number, a2: number, a3: number): boolean => true).negate(); // $ExpectType LoDashImplicitWrapper<(...args: any[]) => boolean>
+    _.chain((a1: number, a2: number, a3: number): boolean => true).negate(); // $ExpectType LoDashExplicitWrapper<(...args: any[]) => boolean>
+    fp.negate((a1: number, a2: number, a3: number): boolean => true); // $ExpectType (...args: any[]) => boolean
 }
 
 // _.once
@@ -5561,13 +5573,23 @@ fp.now(); // $ExpectType number
 // _.omitBy
 {
     const obj: AbcObject | null | undefined = anything;
+    const dictionary: _.Dictionary | null | undefined = anything;
+    const numericDictionary: _.NumericDictionary | null | undefined = anything;
     const predicate = (element: string | number | boolean, key: string) => true;
+    const predicate2 = (element: boolean, key: string) => true;
 
     _.omitBy(obj, predicate); // $ExpectType Partial
+    _.omitBy(dictionary, predicate2); // $ExpectType Dictionary
+    _.omitBy(numericDictionary, predicate2); // $ExpectType NumericDictionary
     _(obj).omitBy(predicate); // $ExpectType LoDashImplicitWrapper>
+    _(dictionary).omitBy(predicate2); // $ExpectType LoDashImplicitWrapper>
+    _(numericDictionary).omitBy(predicate2); // $ExpectType LoDashImplicitWrapper>
     _.chain(obj).omitBy(predicate); // $ExpectType LoDashExplicitWrapper>
+    _.chain(dictionary).omitBy(predicate2); // $ExpectType LoDashExplicitWrapper>
+    _.chain(numericDictionary).omitBy(predicate2); // $ExpectType LoDashExplicitWrapper>
     fp.omitBy(predicate, obj); // $ExpectType Partial
-    fp.omitBy(predicate)(obj); // $ExpectType Partial
+    fp.omitBy(predicate2)(dictionary); // $ExpectType Dictionary
+    fp.omitBy(predicate2)(numericDictionary); // $ExpectType NumericDictionary
 }
 
 // _.pick
@@ -5584,8 +5606,10 @@ fp.now(); // $ExpectType number
     _.pick(obj1, readonlyArray); // $ExpectType PartialDeep
     // Broken in TS 2.4
     // _.pick(obj2, "a", "b"); // Pick
-    _.pick(obj2, literalsArray); // $ExpectType Pick
-    _.pick(obj2, roLiteralsArray); // $ExpectType Pick
+    // We can't use ExpectType here because typescript keeps changing what order the types appear.
+    let result1: Pick;
+    result1 = _.pick(obj2, literalsArray);
+    result1 = _.pick(obj2, roLiteralsArray);
 
     _(obj1).pick("a"); // $ExpectType LoDashImplicitWrapper>
     _(obj1).pick(0, "a"); // $ExpectType LoDashImplicitWrapper>
@@ -5593,8 +5617,9 @@ fp.now(); // $ExpectType number
     _(obj1).pick(readonlyArray); // $ExpectType LoDashImplicitWrapper>
     // Broken in TS 2.4
     // _(obj2).pick("a", "b"); // LoDashImplicitWrapper>
-    _(obj2).pick(literalsArray); // $ExpectType LoDashImplicitWrapper>
-    _(obj2).pick(roLiteralsArray); // $ExpectType LoDashImplicitWrapper>
+    let result2: _.LoDashImplicitWrapper>;
+    result2 = _(obj2).pick(literalsArray);
+    result2 = _(obj2).pick(roLiteralsArray);
 
     _.chain(obj1).pick("a"); // $ExpectType LoDashExplicitWrapper>
     _.chain(obj1).pick(0, "a"); // $ExpectType LoDashExplicitWrapper>
@@ -5602,24 +5627,41 @@ fp.now(); // $ExpectType number
     _.chain(obj1).pick(readonlyArray); // $ExpectType LoDashExplicitWrapper>
     // Broken in TS 2.4
     // _.chain(obj2).pick("a", "b"); // LoDashExplicitWrapper>
-    _.chain(obj2).pick(literalsArray); // $ExpectType LoDashExplicitWrapper>
-    _.chain(obj2).pick(roLiteralsArray); // $ExpectType LoDashExplicitWrapper>
+    let result3: _.LoDashExplicitWrapper>;
+    result3 = _.chain(obj2).pick(literalsArray);
+    result3 = _.chain(obj2).pick(roLiteralsArray);
 
     fp.pick("a", obj2); // $ExpectType Pick
     fp.pick("a")(obj2); // $ExpectType Pick
-    fp.pick(literalsArray)(obj2); // $ExpectType Pick
+    result1 = fp.pick(literalsArray)(obj2);
 }
 
 // _.pickBy
 {
     const obj: AbcObject | null | undefined = anything;
+    const dictionary: _.Dictionary | null | undefined = anything;
+    const numericDictionary: _.NumericDictionary | null | undefined = anything;
     const predicate = (element: string | number | boolean, key: string) => true;
+    const predicate2 = (element: boolean, key: string) => true;
 
     _.pickBy(obj, predicate); // $ExpectType Partial
+    _.pickBy(dictionary, predicate2); // $ExpectType Dictionary
+    _.pickBy(numericDictionary, predicate2); // $ExpectType NumericDictionary
     _(obj).pickBy(predicate); // $ExpectType LoDashImplicitWrapper>
+    _(dictionary).pickBy(predicate2); // $ExpectType LoDashImplicitWrapper>
+    _(numericDictionary).pickBy(predicate2); // $ExpectType LoDashImplicitWrapper>
     _.chain(obj).pickBy(predicate); // $ExpectType LoDashExplicitWrapper>
+    _.chain(dictionary).pickBy(predicate2); // $ExpectType LoDashExplicitWrapper>
+    _.chain(numericDictionary).pickBy(predicate2); // $ExpectType LoDashExplicitWrapper>
     fp.pickBy(predicate, obj); // $ExpectType Partial
-    fp.pickBy(predicate)(obj); // $ExpectType Partial
+    fp.pickBy(predicate2)(dictionary); // $ExpectType Dictionary
+    fp.pickBy(predicate2)(numericDictionary); // $ExpectType NumericDictionary
+
+    const mixedDictionary: _.Dictionary | null | undefined = anything;
+
+    _.pickBy(mixedDictionary, (item: string | number): item is number => typeof item === "number"); // $ExpectType Dictionary
+    _(mixedDictionary).pickBy((item: string | number): item is number => typeof item === "number"); // $ExpectType LoDashImplicitWrapper>
+    _.chain(mixedDictionary).pickBy((item: string | number): item is number => typeof item === "number"); // $ExpectType LoDashExplicitWrapper>
 }
 
 // _.result
diff --git a/types/lolex/index.d.ts b/types/lolex/index.d.ts
index fc6dcc3b4b..1727c97ad3 100644
--- a/types/lolex/index.d.ts
+++ b/types/lolex/index.d.ts
@@ -184,7 +184,7 @@ export interface LolexInstallOpts {
     /**
      * Installs lolex with the specified unix epoch (default: 0)
      */
-    now?: number;
+    now?: number | Date;
 
     /**
      * An array with explicit function names to hijack. When not set, lolex will automatically fake all methods except nextTick
diff --git a/types/lolex/lolex-tests.ts b/types/lolex/lolex-tests.ts
index 4de6ecc7a6..f698eac3cc 100644
--- a/types/lolex/lolex-tests.ts
+++ b/types/lolex/lolex-tests.ts
@@ -25,6 +25,15 @@ lolex.install({
 	toFake: ["setTimeout", "nextTick", "hrtime"]
 });
 
+lolex.install({
+	advanceTimeDelta: 20,
+	loopLimit: 10,
+	now: new Date(0),
+	shouldAdvanceTime: true,
+	target: {},
+	toFake: ["setTimeout", "nextTick", "hrtime"]
+});
+
 const browserNow: number = browserClock.now;
 const browserDate: Date = new browserClock.Date();
 
diff --git a/types/lowdb/_lodash.d.ts b/types/lowdb/_lodash.d.ts
index a7d2c424f0..dc34d17db0 100644
--- a/types/lowdb/_lodash.d.ts
+++ b/types/lowdb/_lodash.d.ts
@@ -805,6 +805,10 @@ declare module "./index" {
             ...args: any[]
         ): LoDashExplicitSyncWrapper;
         memoize(resolver?: (...args: any[]) => any): LoDashExplicitSyncWrapper;
+        negate(this: LoDashExplicitSyncWrapper<() => boolean>): LoDashExplicitSyncWrapper<() => boolean>;
+        negate(this: LoDashExplicitSyncWrapper<(a1: A1) => boolean>): LoDashExplicitSyncWrapper<(a1: A1) => boolean>;
+        negate(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => boolean>): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => boolean>;
+        negate(this: LoDashExplicitSyncWrapper<(...args: any[]) => any>): LoDashExplicitSyncWrapper<(...args: any[]) => boolean>;
         overArgs(...transforms: Array<_.Many<(...args: any[]) => any>>): LoDashExplicitSyncWrapper<(...args: any[]) => any>;
         partial: _.ExplicitPartial;
         partialRight: _.ExplicitPartialRight;
@@ -1273,6 +1277,14 @@ declare module "./index" {
             this: LoDashExplicitSyncWrapper,
             ...paths: Array<_.Many<_.PropertyName>>
         ): LoDashExplicitSyncWrapper<_.PartialObject>;
+        omitBy(
+            this: LoDashExplicitSyncWrapper<_.Dictionary | null | undefined>,
+            predicate?: _.ValueKeyIteratee
+        ): LoDashExplicitSyncWrapper<_.Dictionary>;
+        omitBy(
+            this: LoDashExplicitSyncWrapper<_.NumericDictionary | null | undefined>,
+            predicate?: _.ValueKeyIteratee
+        ): LoDashExplicitSyncWrapper<_.NumericDictionary>;
         omitBy(
             this: LoDashExplicitSyncWrapper,
             predicate: _.ValueKeyIteratee
@@ -1285,6 +1297,18 @@ declare module "./index" {
             this: LoDashExplicitSyncWrapper,
             ...props: _.PropertyPath[]
         ): LoDashExplicitSyncWrapper<_.PartialObject>;
+        pickBy(
+            this: LoDashExplicitSyncWrapper,
+            predicate: _.ObjectIteratorTypeGuard
+        ): LoDashExplicitSyncWrapper<_.Dictionary>;
+        pickBy(
+            this: LoDashExplicitSyncWrapper<_.Dictionary | null | undefined>,
+            predicate?: _.ValueKeyIteratee
+        ): LoDashExplicitSyncWrapper<_.Dictionary>;
+        pickBy(
+            this: LoDashExplicitSyncWrapper<_.NumericDictionary | null | undefined>,
+            predicate?: _.ValueKeyIteratee
+        ): LoDashExplicitSyncWrapper<_.NumericDictionary>;
         pickBy(
             this: LoDashExplicitSyncWrapper,
             predicate?: _.ValueKeyIteratee
@@ -2373,6 +2397,10 @@ declare module "./index" {
             ...args: any[]
         ): LoDashExplicitAsyncWrapper;
         memoize(resolver?: (...args: any[]) => any): LoDashExplicitAsyncWrapper;
+        negate(this: LoDashExplicitAsyncWrapper<() => boolean>): LoDashExplicitAsyncWrapper<() => boolean>;
+        negate(this: LoDashExplicitAsyncWrapper<(a1: A1) => boolean>): LoDashExplicitAsyncWrapper<(a1: A1) => boolean>;
+        negate(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => boolean>): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => boolean>;
+        negate(this: LoDashExplicitAsyncWrapper<(...args: any[]) => any>): LoDashExplicitAsyncWrapper<(...args: any[]) => boolean>;
         overArgs(...transforms: Array<_.Many<(...args: any[]) => any>>): LoDashExplicitAsyncWrapper<(...args: any[]) => any>;
         partial: _.ExplicitPartial;
         partialRight: _.ExplicitPartialRight;
@@ -2841,6 +2869,14 @@ declare module "./index" {
             this: LoDashExplicitAsyncWrapper,
             ...paths: Array<_.Many<_.PropertyName>>
         ): LoDashExplicitAsyncWrapper<_.PartialObject>;
+        omitBy(
+            this: LoDashExplicitAsyncWrapper<_.Dictionary | null | undefined>,
+            predicate?: _.ValueKeyIteratee
+        ): LoDashExplicitAsyncWrapper<_.Dictionary>;
+        omitBy(
+            this: LoDashExplicitAsyncWrapper<_.NumericDictionary | null | undefined>,
+            predicate?: _.ValueKeyIteratee
+        ): LoDashExplicitAsyncWrapper<_.NumericDictionary>;
         omitBy(
             this: LoDashExplicitAsyncWrapper,
             predicate: _.ValueKeyIteratee
@@ -2853,6 +2889,18 @@ declare module "./index" {
             this: LoDashExplicitAsyncWrapper,
             ...props: _.PropertyPath[]
         ): LoDashExplicitAsyncWrapper<_.PartialObject>;
+        pickBy(
+            this: LoDashExplicitAsyncWrapper,
+            predicate: _.ObjectIteratorTypeGuard
+        ): LoDashExplicitAsyncWrapper<_.Dictionary>;
+        pickBy(
+            this: LoDashExplicitAsyncWrapper<_.Dictionary | null | undefined>,
+            predicate?: _.ValueKeyIteratee
+        ): LoDashExplicitAsyncWrapper<_.Dictionary>;
+        pickBy(
+            this: LoDashExplicitAsyncWrapper<_.NumericDictionary | null | undefined>,
+            predicate?: _.ValueKeyIteratee
+        ): LoDashExplicitAsyncWrapper<_.NumericDictionary>;
         pickBy(
             this: LoDashExplicitAsyncWrapper,
             predicate?: _.ValueKeyIteratee
diff --git a/types/luxon/index.d.ts b/types/luxon/index.d.ts
index 75491e24f6..17706a9002 100644
--- a/types/luxon/index.d.ts
+++ b/types/luxon/index.d.ts
@@ -209,8 +209,8 @@ declare module 'luxon' {
             toLocaleParts(options?: DateTimeFormatOptions): any[];
             toLocaleString(options?: DateTimeFormatOptions): string;
             toMillis(): number;
-            toObject(options?: { includeConfig?: boolean }): DateObject;
             toMillis(): number;
+            toObject(options?: { includeConfig?: boolean }): DateObject;
             toRFC2822(): string;
             toSQL(options?: Object): string;
             toSQLDate(): string;
@@ -402,6 +402,10 @@ declare module 'luxon' {
             equals(other: Zone): boolean;
             offset(ts: number): number;
         }
+
+        class IANAZone extends Zone {
+            constructor(ianaString: string);
+        }
     }
 
     export = luxon;
diff --git a/types/luxon/luxon-tests.ts b/types/luxon/luxon-tests.ts
index 4396e8d7a2..de0aca9bfd 100644
--- a/types/luxon/luxon-tests.ts
+++ b/types/luxon/luxon-tests.ts
@@ -1,4 +1,4 @@
-import { DateTime, Duration, Interval, Info, Settings } from 'luxon';
+import { DateTime, Duration, Interval, Info, Settings, IANAZone } from 'luxon';
 
 /* DateTime */
 const dt = DateTime.local(2017, 5, 15, 8, 30);
@@ -13,6 +13,11 @@ const fromObject = DateTime.fromObject({
     numberingSystem: 'beng'
 });
 
+const ianaZone = new IANAZone('America/Los_Angeles');
+const ianaZoneTest = DateTime.fromObject({
+    zone: ianaZone
+});
+
 const fromIso = DateTime.fromISO('2017-05-15'); // => May 15, 2017 at midnight
 const fromIso2 = DateTime.fromISO('2017-05-15T08:30:00'); // => May 15, 2017 at midnight
 
diff --git a/types/mapbox-gl/index.d.ts b/types/mapbox-gl/index.d.ts
index 4cfdf986bf..5f64b7470b 100644
--- a/types/mapbox-gl/index.d.ts
+++ b/types/mapbox-gl/index.d.ts
@@ -464,6 +464,8 @@ declare namespace mapboxgl {
         anchor?: Anchor;
 
         offset?: number | PointLike | { [key: string]: PointLike; };
+
+        className?: string;
     }
 
     export interface Style {
diff --git a/types/mapbox-gl/mapbox-gl-tests.ts b/types/mapbox-gl/mapbox-gl-tests.ts
index fa62007088..87297effda 100644
--- a/types/mapbox-gl/mapbox-gl-tests.ts
+++ b/types/mapbox-gl/mapbox-gl-tests.ts
@@ -225,7 +225,7 @@ map.addLayer({
 /**
  * Popup
  */
-var popup = new mapboxgl.Popup({closeOnClick: false, closeButton: true, anchor: 'top-right', offset: {'top': [0,0], 'bottom': [25,-50]} })
+var popup = new mapboxgl.Popup({closeOnClick: false, closeButton: true, anchor: 'top-right', offset: {'top': [0,0], 'bottom': [25,-50]}, className: 'custom-class' })
 	.setLngLat([-50, 50])
 	.setHTML('

Hello World!

') .addTo(map); diff --git a/types/match-sorter/index.d.ts b/types/match-sorter/index.d.ts new file mode 100644 index 0000000000..e1a7e8efe4 --- /dev/null +++ b/types/match-sorter/index.d.ts @@ -0,0 +1,52 @@ +// Type definitions for match-sorter 2.2 +// Project: https://github.com/kentcdodds/match-sorter#readme +// Definitions by: Claas Ahlrichs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace matchSorter { + namespace rankings { + const CASE_SENSITIVE_EQUAL: 9; + const EQUAL: 8; + const STARTS_WITH: 7; + const WORD_STARTS_WITH: 6; + const STRING_CASE: 5; + const STRING_CASE_ACRONYM: 4; + const CONTAINS: 3; + const ACRONYM: 2; + const MATCHES: 1; + const NO_MATCH: 0; + } +} + +interface MinRanking { + minRanking: number; + key: string; +} + +interface MaxRanking { + maxRanking: number; + key: string; +} + +interface MinMaxRanking { + minRanking: number; + maxRanking: number; + key: string; +} + +interface Options { + keys?: Array<(string | ((item: T) => string) | MinRanking | MaxRanking | MinMaxRanking)>; + threshold?: number; + keepDiacritics?: boolean; +} + +/** + * Takes an array of items and a value and returns a new array with the items that match the given value + * @param items - the items to sort + * @param value - the value to use for ranking + * @param options - Some options to configure the sorter + * @return the new sorted array + */ +declare function matchSorter(items: T[], value: string, options?: Options): T[]; + +export = matchSorter; diff --git a/types/match-sorter/match-sorter-tests.ts b/types/match-sorter/match-sorter-tests.ts new file mode 100644 index 0000000000..e1496cba9f --- /dev/null +++ b/types/match-sorter/match-sorter-tests.ts @@ -0,0 +1,130 @@ +import matchSorter = require('match-sorter'); + +// # Basic Sample +{ + const list = ['hi', 'hey', 'hello', 'sup', 'yo']; + matchSorter(list, 'h'); // ['hi', 'hey', 'hello'] + matchSorter(list, 'y'); // ['yo', 'hey'] + matchSorter(list, 'z'); // [] +} + +// # Advanced options + +// ## keys: [string] +{ + const objList = [ + {name: 'Janice', color: 'Green'}, + {name: 'Fred', color: 'Orange'}, + {name: 'George', color: 'Blue'}, + {name: 'Jen', color: 'Red'}, + ]; + matchSorter(objList, 'g', {keys: ['name', 'color']}); + // [{name: 'George', color: 'Blue'}, {name: 'Janice', color: 'Green'}, {name: 'Fred', color: 'Orange'}] + + matchSorter(objList, 're', {keys: ['color', 'name']}); + // [{name: 'Jen', color: 'Red'}, {name: 'Janice', color: 'Green'}, {name: 'Fred', color: 'Orange'}, {name: 'George', color: 'Blue'}] +} + +// ### Array of values +{ + const iceCreamYum = [ + {favoriteIceCream: ['mint', 'chocolate']}, + {favoriteIceCream: ['candy cane', 'brownie']}, + {favoriteIceCream: ['birthday cake', 'rocky road', 'strawberry']}, + ]; + matchSorter(iceCreamYum, 'cc', {keys: ['favoriteIceCream']}); + // [{favoriteIceCream: ['candy cane', 'brownie']}, {favoriteIceCream: ['mint', 'chocolate']}] +} + +// ### Nested Keys +{ + const nestedObjList = [ + {name: {first: 'Janice'}}, + {name: {first: 'Fred'}}, + {name: {first: 'George'}}, + {name: {first: 'Jen'}}, + ]; + matchSorter(nestedObjList, 'j', {keys: ['name.first']}); + // [{name: {first: 'Janice'}}, {name: {first: 'Jen'}}] +} +{ + const nestedObjList = [ + {name: [{first: 'Janice'}]}, + {name: [{first: 'Fred'}]}, + {name: [{first: 'George'}]}, + {name: [{first: 'Jen'}]}, + ]; + matchSorter(nestedObjList, 'j', {keys: ['name.0.first']}); + // [{name: {first: 'Janice'}}, {name: {first: 'Jen'}}] + // matchSorter(nestedObjList, 'j', {keys: ['name[0].first']}) does not work +} + +// ### Property Callbacks +{ + const list = [{name: 'Janice'}, {name: 'Fred'}, {name: 'George'}, {name: 'Jen'}]; + matchSorter(list, 'j', {keys: [item => item.name]}); + // [{name: 'Janice'}, {name: 'Jen'}] +} + +// ### Min and Max Ranking +{ + const tea = [ + {tea: 'Earl Grey', alias: 'A'}, + {tea: 'Assam', alias: 'B'}, + {tea: 'Black', alias: 'C'}, + ]; + matchSorter(tea, 'A', { + keys: ['tea', {maxRanking: matchSorter.rankings.STARTS_WITH, key: 'alias'}], + }); + // without maxRanking, Earl Grey would come first because the alias "A" would be CASE_SENSITIVE_EQUAL + // `tea` key comes before `alias` key, so Assam comes first even though both match as STARTS_WITH + // [{tea: 'Assam', alias: 'B'}, {tea: 'Earl Grey', alias: 'A'},{tea: 'Black', alias: 'C'}] +} +{ + const tea = [ + {tea: 'Milk', alias: 'moo'}, + {tea: 'Oolong', alias: 'B'}, + {tea: 'Green', alias: 'C'}, + ]; + matchSorter(tea, 'oo', { + keys: ['tea', {minRanking: matchSorter.rankings.EQUAL, key: 'alias'}], + }); + // minRanking bumps Milk up to EQUAL from CONTAINS (alias) + // Oolong matches as STARTS_WITH + // Green is missing due to no match + // [{tea: 'Milk', alias: 'moo'}, {tea: 'Oolong', alias: 'B'}] +} + +// ## threshold: number +{ + const fruit = ['orange', 'apple', 'grape', 'banana']; + matchSorter(fruit, 'ap', {threshold: matchSorter.rankings.NO_MATCH}); + // ['apple', 'grape', 'orange', 'banana'] (returns all items, just sorted by best match) + + const things = ['google', 'airbnb', 'apple', 'apply', 'app']; + matchSorter(things, 'app', {threshold: matchSorter.rankings.EQUAL}); + // ['app'] (only items that are equal) + + const otherThings = ['fiji apple', 'google', 'app', 'crabapple', 'apple', 'apply']; + matchSorter(otherThings, 'app', {threshold: matchSorter.rankings.WORD_STARTS_WITH}); + // ['app', 'apple', 'apply', 'fiji apple'] (everything that matches with "word starts with" or better) +} + +// ## keepDiacritics: boolean +{ + const thingsWithDiacritics = [ + 'jalapeño', + 'à la carte', + 'café', + 'papier-mâché', + 'à la mode', + ]; + matchSorter(thingsWithDiacritics, 'aa'); + // ['jalapeño', 'à la carte', 'à la mode', 'papier-mâché'] + + matchSorter(thingsWithDiacritics, 'aa', {keepDiacritics: true}); + // ['jalapeño', 'à la carte'] + + matchSorter(thingsWithDiacritics, 'à', {keepDiacritics: true}); + // ['à la carte', 'à la mode'] +} diff --git a/types/match-sorter/tsconfig.json b/types/match-sorter/tsconfig.json new file mode 100644 index 0000000000..7bdcd8a2d6 --- /dev/null +++ b/types/match-sorter/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "esModuleInterop": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "match-sorter-tests.ts" + ] +} diff --git a/types/match-sorter/tslint.json b/types/match-sorter/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/match-sorter/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material-ui/index.d.ts b/types/material-ui/index.d.ts index 21ee89c329..649a058156 100644 --- a/types/material-ui/index.d.ts +++ b/types/material-ui/index.d.ts @@ -1908,6 +1908,8 @@ declare namespace __MaterialUI { minlength?: string; step?: number; autoComplete?: string; + placeholder?: string; + title?: string; } export class TextField extends React.Component { blur(): void; diff --git a/types/materialize-css/common.d.ts b/types/materialize-css/common.d.ts index 605e9389be..a37afbbb34 100644 --- a/types/materialize-css/common.d.ts +++ b/types/materialize-css/common.d.ts @@ -43,7 +43,7 @@ declare namespace M { previousMonth: string; nextMonth: string; months: string[]; - monthsShort: string; + monthsShort: string[]; weekdays: string[]; weekdaysShort: string[]; weekdaysAbbrev: string[]; diff --git a/types/merge-stream/index.d.ts b/types/merge-stream/index.d.ts index 6c6426b902..9f085fc61c 100644 --- a/types/merge-stream/index.d.ts +++ b/types/merge-stream/index.d.ts @@ -1,16 +1,17 @@ -// Type definitions for merge-stream v1.1.0 +// Type definitions for merge-stream 1.1 // Project: https://github.com/grncdr/merge-stream -// Definitions by: Keita Kagurazaka , Tom X. Tobin , Daniel Zazula +// Definitions by: Keita Kagurazaka +// Tom X. Tobin +// Daniel Zazula +// Daniel Cassidy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// - -interface IMergedStream extends NodeJS.ReadWriteStream { - add(source: NodeJS.ReadableStream): IMergedStream; - add(source: NodeJS.ReadableStream[]): IMergedStream; +interface MergedStream extends NodeJS.ReadWriteStream { + add(source: NodeJS.ReadableStream | ReadonlyArray): MergedStream; isEmpty(): boolean; } -declare function merge(...streams: (T | T[])[]): IMergedStream; +declare function merge(...streams: Array>): MergedStream; export = merge; diff --git a/types/merge-stream/merge-stream-tests.ts b/types/merge-stream/merge-stream-tests.ts index a12e7f9c65..495ab31409 100644 --- a/types/merge-stream/merge-stream-tests.ts +++ b/types/merge-stream/merge-stream-tests.ts @@ -1,23 +1,22 @@ - import stream = require("stream"); import Stream = stream.Readable; import merge = require("merge-stream"); -var stream1 = new Stream(); -var stream2 = new Stream(); +const stream1 = new Stream(); +const stream2 = new Stream(); -var merged = merge(stream1, stream2); +const merged = merge(stream1, stream2); -var stream3 = new Stream(); +const stream3 = new Stream(); merged.add(stream3); -var stream4 = new Stream(); -var stream5 = new Stream(); +const stream4 = new Stream(); +const stream5 = new Stream(); merged.add([stream4, stream5]); merged.isEmpty(); -var stream6 = new Stream(); -var stream7 = new Stream(); -var streamArray = [stream6, stream7]; -var merged2 = merge(streamArray); +const stream6 = new Stream(); +const stream7 = new Stream(); +const streamArray = [stream6, stream7]; +const merged2 = merge(streamArray); diff --git a/types/merge-stream/tsconfig.json b/types/merge-stream/tsconfig.json index d68bbea99f..92082068cf 100644 --- a/types/merge-stream/tsconfig.json +++ b/types/merge-stream/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", "merge-stream-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/merge-stream/tslint.json b/types/merge-stream/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/merge-stream/tslint.json +++ b/types/merge-stream/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/micro-cors/index.d.ts b/types/micro-cors/index.d.ts new file mode 100644 index 0000000000..eb91dde7f2 --- /dev/null +++ b/types/micro-cors/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for micro-cors 0.1 +// Project: https://github.com/possibilities/micro-cors#readme +// Definitions by: Callum Denby +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import { RequestHandler } from "micro"; + +interface Options { + maxAge?: string; + origin?: string; + allowHeaders?: string[]; + allowMethods?: string[]; + exposeHeaders?: string[]; +} + +declare function micro_cors(options?: Options): (handler: RequestHandler) => RequestHandler; + +export = micro_cors; diff --git a/types/micro-cors/micro-cors-tests.ts b/types/micro-cors/micro-cors-tests.ts new file mode 100644 index 0000000000..b69b157c03 --- /dev/null +++ b/types/micro-cors/micro-cors-tests.ts @@ -0,0 +1,18 @@ +import cors = require('micro-cors'); +import micro from 'micro'; + +const handler = cors(); + +cors({ allowMethods: ['PUT', 'POST'] }); + +cors({ + maxAge: '1000', + origin: '*', + allowHeaders: [], + allowMethods: [], + exposeHeaders: [] +}); + +handler(async (req, res) => {}); +handler((req, res) => {}); +micro(handler((req, res) => {})); diff --git a/types/micro-cors/tsconfig.json b/types/micro-cors/tsconfig.json new file mode 100644 index 0000000000..e44b2c9151 --- /dev/null +++ b/types/micro-cors/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", + "micro-cors-tests.ts" + ] +} diff --git a/types/micro-cors/tslint.json b/types/micro-cors/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/micro-cors/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/millisecond/index.d.ts b/types/millisecond/index.d.ts new file mode 100644 index 0000000000..94da379679 --- /dev/null +++ b/types/millisecond/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for millisecond 0.1 +// Project: https://github.com/unshiftio/millisecond +// Definitions by: Aayush Kapoor +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function millisecond(ms: string | number): number; + +declare namespace millisecond { } + +export = millisecond; diff --git a/types/millisecond/millisecond-tests.ts b/types/millisecond/millisecond-tests.ts new file mode 100644 index 0000000000..fea9bc47e8 --- /dev/null +++ b/types/millisecond/millisecond-tests.ts @@ -0,0 +1,4 @@ +import * as millisecond from "millisecond"; + +millisecond(100); +millisecond("1 years"); diff --git a/types/millisecond/tsconfig.json b/types/millisecond/tsconfig.json new file mode 100644 index 0000000000..8d84f8f844 --- /dev/null +++ b/types/millisecond/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es2015" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "millisecond-tests.ts" + ] +} diff --git a/types/millisecond/tslint.json b/types/millisecond/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/millisecond/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/minio/index.d.ts b/types/minio/index.d.ts index c93d041fbf..53ca4fa6cd 100644 --- a/types/minio/index.d.ts +++ b/types/minio/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for minio 5.1 +// Type definitions for minio 6.0 // Project: https://github.com/minio/minio-js#readme // Definitions by: Barin Britva // Lubomir Kaplan @@ -23,6 +23,8 @@ export interface ClientOptions { secure?: boolean; port?: number; region?: Region; + transport?: any; + sessionToken?: string; } export interface BucketItemFromList { @@ -45,9 +47,9 @@ export interface BucketItem { export interface BucketItemStat { size: number; - contentType: string; etag: string; lastModified: Date; + metaData: ItemBucketMetadata; } export interface IncompleteUploadedBucketItem { @@ -67,6 +69,10 @@ export interface PostPolicyResult { }; } +export interface ItemBucketMetadata { + [key: string]: any; +} + // No need to export this. But without it - linter error. export class TargetConfig { setId(id: any): void; @@ -111,11 +117,11 @@ export class Client { putObject(bucketName: string, objectName: string, stream: Stream|Buffer|string, callback: ResultCallback): void; putObject(bucketName: string, objectName: string, stream: Stream|Buffer|string, size: number, callback: ResultCallback): void; - putObject(bucketName: string, objectName: string, stream: Stream|Buffer|string, size: number, cotentType: string, callback: ResultCallback): void; - putObject(bucketName: string, objectName: string, stream: Stream|Buffer|string, size?: number, cotentType?: string): Promise; + putObject(bucketName: string, objectName: string, stream: Stream|Buffer|string, size: number, metaData: ItemBucketMetadata, callback: ResultCallback): void; + putObject(bucketName: string, objectName: string, stream: Stream|Buffer|string, size?: number, metaData?: ItemBucketMetadata): Promise; - fPutObject(bucketName: string, objectName: string, filePath: string, contentType: string, callback: ResultCallback): void; - fPutObject(bucketName: string, objectName: string, filePath: string, contentType: string): Promise; + fPutObject(bucketName: string, objectName: string, filePath: string, metaData: ItemBucketMetadata, callback: ResultCallback): void; + fPutObject(bucketName: string, objectName: string, filePath: string, metaData: ItemBucketMetadata): Promise; copyObject(bucketName: string, objectName: string, sourceObject: string, conditions: CopyConditions, callback: ResultCallback): void; copyObject(bucketName: string, objectName: string, sourceObject: string, conditions: CopyConditions): Promise; @@ -127,6 +133,7 @@ export class Client { removeObject(bucketName: string, objectName: string): Promise; removeObjects(bucketName: string, objectsList: string[], callback: NoResultCallback): void; + removeObjects(bucketName: string, objectsList: string[]): Promise; removeIncompleteUpload(bucketName: string, objectName: string, callback: NoResultCallback): void; removeIncompleteUpload(bucketName: string, objectName: string): Promise; diff --git a/types/minio/minio-tests.ts b/types/minio/minio-tests.ts index ac666724c0..46d83201f7 100644 --- a/types/minio/minio-tests.ts +++ b/types/minio/minio-tests.ts @@ -44,15 +44,21 @@ minio.getPartialObject('testBucket', 'hello.jpg', 10, 20); minio.fGetObject('testBucket', 'hello.jpg', 'file/path', (error: Error|null) => { console.log(error); }); minio.fGetObject('testBucket', 'hello.jpg', 'file/path'); +const metaData = { + 'Content-Type': 'text/html', + 'Content-Language': 123, + 'X-Amz-Meta-Testing': 1234, + example: 5678 +}; minio.putObject('testBucket', 'hello.jpg', new Stream(), (error: Error|null, etag: string) => { console.log(error, etag); }); minio.putObject('testBucket', 'hello.jpg', new Buffer('string'), 100, (error: Error|null, etag: string) => { console.log(error, etag); }); -minio.putObject('testBucket', 'hello.txt', 'hello.txt content', 100, 'text/plain', (error: Error|null, etag: string) => { console.log(error, etag); }); +minio.putObject('testBucket', 'hello.txt', 'hello.txt content', 100, metaData, (error: Error|null, etag: string) => { console.log(error, etag); }); minio.putObject('testBucket', 'hello.jpg', new Stream()); minio.putObject('testBucket', 'hello.jpg', new Buffer('string'), 100); -minio.putObject('testBucket', 'hello.txt', 'hello.txt content', 100, 'text/plain'); +minio.putObject('testBucket', 'hello.txt', 'hello.txt content', 100, metaData); -minio.fPutObject('testBucket', 'hello.jpg', 'file/path', 'image/jpg', (error: Error|null, etag: string) => { console.log(error, etag); }); -minio.fPutObject('testBucket', 'hello.jpg', 'file/path', 'image/jpg'); +minio.fPutObject('testBucket', 'hello.jpg', 'file/path', metaData, (error: Error|null, etag: string) => { console.log(error, etag); }); +minio.fPutObject('testBucket', 'hello.jpg', 'file/path', metaData); const conditions = new Minio.CopyConditions(); conditions.setMatchETag('bd891862ea3e22c93ed53a098218791d'); @@ -66,6 +72,7 @@ minio.removeObject('testBucket', 'hello.jpg', (error: Error|null) => { console.l minio.removeObject('testBucket', 'hello.jpg'); minio.removeObjects('testBucket', ['hello.jpg', 'hello.txt'], (error: Error|null) => { console.log(error); }); +minio.removeObjects('testBucket', ['hello.jpg', 'hello.txt']); minio.removeIncompleteUpload('testBucket', 'hello.jpg', (error: Error|null) => { console.log(error); }); minio.removeIncompleteUpload('testBucket', 'hello.jpg'); diff --git a/types/mocha/index.d.ts b/types/mocha/index.d.ts index 5f0aa3baf6..868a6c332d 100644 --- a/types/mocha/index.d.ts +++ b/types/mocha/index.d.ts @@ -9,9 +9,6 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 -export = Mocha; -export as namespace Mocha; - /** * Mocha API * @@ -426,7 +423,9 @@ declare namespace Mocha { * @returns [bdd] `Suite` * @returns [tdd] `void` */ - type PendingSuiteFunction = (title: string, fn: (this: Suite) => void) => Suite | void; + interface PendingSuiteFunction { + (title: string, fn: (this: Suite) => void): Suite | void; + } interface TestFunction { /** @@ -2623,234 +2622,365 @@ declare namespace Mocha { // #endregion } -declare global { - // #region Test interface augmentations +// #region Test interface augmentations - /** - * Triggers root suite execution. - * - * - _Only available if flag --delay is passed into Mocha._ - * - _Only available when invoked via the mocha CLI._ - * - * @see https://mochajs.org/api/global.html#runWithSuite - */ - function run(): void; +/** + * Triggers root suite execution. + * + * - _Only available if flag --delay is passed into Mocha._ + * - _Only available when invoked via the mocha CLI._ + * + * @see https://mochajs.org/api/global.html#runWithSuite + */ +declare function run(): void; - /** - * Execute before running tests. - * - * - _Only available when invoked via the mocha CLI._ - * - * @see https://mochajs.org/api/global.html#before - */ - var before: Mocha.HookFunction; +/** + * Execute before running tests. + * + * - _Only available when invoked via the mocha CLI._ + * + * @see https://mochajs.org/api/global.html#before + */ +declare var before: Mocha.HookFunction; - /** - * Execute before running tests. - * - * - _Only available when invoked via the mocha CLI._ - * - * @see https://mochajs.org/api/global.html#before - */ - var suiteSetup: Mocha.HookFunction; +/** + * Execute before running tests. + * + * - _Only available when invoked via the mocha CLI._ + * + * @see https://mochajs.org/api/global.html#before + */ +declare var suiteSetup: Mocha.HookFunction; - /** - * Execute after running tests. - * - * - _Only available when invoked via the mocha CLI._ - * - * @see https://mochajs.org/api/global.html#after - */ - var after: Mocha.HookFunction; +/** + * Execute after running tests. + * + * - _Only available when invoked via the mocha CLI._ + * + * @see https://mochajs.org/api/global.html#after + */ +declare var after: Mocha.HookFunction; - /** - * Execute after running tests. - * - * - _Only available when invoked via the mocha CLI._ - * - * @see https://mochajs.org/api/global.html#after - */ - var suiteTeardown: Mocha.HookFunction; +/** + * Execute after running tests. + * + * - _Only available when invoked via the mocha CLI._ + * + * @see https://mochajs.org/api/global.html#after + */ +declare var suiteTeardown: Mocha.HookFunction; - /** - * Execute before each test case. - * - * - _Only available when invoked via the mocha CLI._ - * - * @see https://mochajs.org/api/global.html#beforeEach - */ - var beforeEach: Mocha.HookFunction; +/** + * Execute before each test case. + * + * - _Only available when invoked via the mocha CLI._ + * + * @see https://mochajs.org/api/global.html#beforeEach + */ +declare var beforeEach: Mocha.HookFunction; - /** - * Execute before each test case. - * - * - _Only available when invoked via the mocha CLI._ - * - * @see https://mochajs.org/api/global.html#beforeEach - */ - var setup: Mocha.HookFunction; +/** + * Execute before each test case. + * + * - _Only available when invoked via the mocha CLI._ + * + * @see https://mochajs.org/api/global.html#beforeEach + */ +declare var setup: Mocha.HookFunction; - /** - * Execute after each test case. - * - * - _Only available when invoked via the mocha CLI._ - * - * @see https://mochajs.org/api/global.html#afterEach - */ - var afterEach: Mocha.HookFunction; +/** + * Execute after each test case. + * + * - _Only available when invoked via the mocha CLI._ + * + * @see https://mochajs.org/api/global.html#afterEach + */ +declare var afterEach: Mocha.HookFunction; - /** - * Execute after each test case. - * - * - _Only available when invoked via the mocha CLI._ - * - * @see https://mochajs.org/api/global.html#afterEach - */ - var teardown: Mocha.HookFunction; +/** + * Execute after each test case. + * + * - _Only available when invoked via the mocha CLI._ + * + * @see https://mochajs.org/api/global.html#afterEach + */ +declare var teardown: Mocha.HookFunction; - /** - * Describe a "suite" containing nested suites and tests. - * - * - _Only available when invoked via the mocha CLI._ - */ - var describe: Mocha.SuiteFunction; +/** + * Describe a "suite" containing nested suites and tests. + * + * - _Only available when invoked via the mocha CLI._ + */ +declare var describe: Mocha.SuiteFunction; - /** - * Describe a "suite" containing nested suites and tests. - * - * - _Only available when invoked via the mocha CLI._ - */ - var context: Mocha.SuiteFunction; +/** + * Describe a "suite" containing nested suites and tests. + * + * - _Only available when invoked via the mocha CLI._ + */ +declare var context: Mocha.SuiteFunction; - /** - * Describe a "suite" containing nested suites and tests. - * - * - _Only available when invoked via the mocha CLI._ - */ - var suite: Mocha.SuiteFunction; +/** + * Describe a "suite" containing nested suites and tests. + * + * - _Only available when invoked via the mocha CLI._ + */ +declare var suite: Mocha.SuiteFunction; - /** - * Pending suite. - * - * - _Only available when invoked via the mocha CLI._ - */ - var xdescribe: Mocha.PendingSuiteFunction; +/** + * Pending suite. + * + * - _Only available when invoked via the mocha CLI._ + */ +declare var xdescribe: Mocha.PendingSuiteFunction; - /** - * Pending suite. - * - * - _Only available when invoked via the mocha CLI._ - */ - var xcontext: Mocha.PendingSuiteFunction; +/** + * Pending suite. + * + * - _Only available when invoked via the mocha CLI._ + */ +declare var xcontext: Mocha.PendingSuiteFunction; - /** - * Describes a test case. - * - * - _Only available when invoked via the mocha CLI._ - */ - var it: Mocha.TestFunction; +/** + * Describes a test case. + * + * - _Only available when invoked via the mocha CLI._ + */ +declare var it: Mocha.TestFunction; - /** - * Describes a test case. - * - * - _Only available when invoked via the mocha CLI._ - */ - var specify: Mocha.TestFunction; +/** + * Describes a test case. + * + * - _Only available when invoked via the mocha CLI._ + */ +declare var specify: Mocha.TestFunction; - /** - * Describes a test case. - * - * - _Only available when invoked via the mocha CLI._ - */ - var test: Mocha.TestFunction; +/** + * Describes a test case. + * + * - _Only available when invoked via the mocha CLI._ + */ +declare var test: Mocha.TestFunction; - /** - * Describes a pending test case. - * - * - _Only available when invoked via the mocha CLI._ - */ - var xit: Mocha.PendingTestFunction; +/** + * Describes a pending test case. + * + * - _Only available when invoked via the mocha CLI._ + */ +declare var xit: Mocha.PendingTestFunction; - /** - * Describes a pending test case. - * - * - _Only available when invoked via the mocha CLI._ - */ - var xspecify: Mocha.PendingTestFunction; +/** + * Describes a pending test case. + * + * - _Only available when invoked via the mocha CLI._ + */ +declare var xspecify: Mocha.PendingTestFunction; - // #endregion Test interface augmentations +// #endregion Test interface augmentations - // #region Reporter augmentations +// #region Reporter augmentations - // Forward declaration for `HTMLLIElement` from lib.dom.d.ts. - // Required by Mocha.reporters.HTML. - // NOTE: Mocha *must not* have a direct dependency on DOM types. +// Forward declaration for `HTMLLIElement` from lib.dom.d.ts. +// Required by Mocha.reporters.HTML. +// NOTE: Mocha *must not* have a direct dependency on DOM types. +// tslint:disable-next-line no-empty-interface +interface HTMLLIElement { } + +// Augments the DOM `Window` object when lib.dom.d.ts is loaded. +// tslint:disable-next-line no-empty-interface +interface Window extends Mocha.MochaGlobals { } + +declare namespace NodeJS { + // Forward declaration for `NodeJS.EventEmitter` from node.d.ts. + // Required by Mocha.Runnable, Mocha.Runner, and Mocha.Suite. + // NOTE: Mocha *must not* have a direct dependency on @types/node. // tslint:disable-next-line no-empty-interface - interface HTMLLIElement { } + interface EventEmitter { } - // Augments the DOM `Window` object when lib.dom.d.ts is loaded. + // Augments NodeJS's `global` object when node.d.ts is loaded // tslint:disable-next-line no-empty-interface - interface Window extends Mocha.MochaGlobals { } + interface Global extends Mocha.MochaGlobals { } +} - namespace NodeJS { - // Forward declaration for `NodeJS.EventEmitter` from node.d.ts. - // Required by Mocha.Runnable, Mocha.Runner, and Mocha.Suite. - // NOTE: Mocha *must not* have a direct dependency on @types/node. - // tslint:disable-next-line no-empty-interface - interface EventEmitter { } +// #endregion Reporter augmentations - // Augments NodeJS's `global` object when node.d.ts is loaded - // tslint:disable-next-line no-empty-interface - interface Global extends Mocha.MochaGlobals { } - } +// #region Browser augmentations - // #endregion Reporter augmentations - - // #region Browser augmentations +/** + * Mocha global. + * + * - _Only supported in the browser._ + */ +declare const mocha: BrowserMocha; +interface BrowserMocha extends Mocha { /** - * Mocha global. + * Function to allow assertion libraries to throw errors directly into mocha. + * This is useful when running tests in a browser because window.onerror will + * only receive the 'message' attribute of the Error. * * - _Only supported in the browser._ */ - const mocha: BrowserMocha; - - interface BrowserMocha extends Mocha { - /** - * Function to allow assertion libraries to throw errors directly into mocha. - * This is useful when running tests in a browser because window.onerror will - * only receive the 'message' attribute of the Error. - * - * - _Only supported in the browser._ - */ - throwError(err: any): never; - - /** - * Setup mocha with the given settings options. - * - * - _Only supported in the browser._ - */ - setup(opts?: Mocha.Interface | MochaSetupOptions): this; - } + throwError(err: any): never; /** - * Options to pass to `mocha.setup` in the browser. + * Setup mocha with the given settings options. + * + * - _Only supported in the browser._ */ - interface MochaSetupOptions extends Mocha.MochaOptions { - // TODO: This does not seem to be supported according to the source. Should it be removed? - require?: string[]; - fullTrace?: boolean; - } + setup(opts?: Mocha.Interface | MochaSetupOptions): this; +} + +/** + * Options to pass to `mocha.setup` in the browser. + */ +interface MochaSetupOptions extends Mocha.MochaOptions { + /** @deprecated This is not used by Mocha. Use `files` instead. */ + require?: string[]; + fullTrace?: boolean; +} + +// #endregion Browser augmentations + +// #region Deprecations + +/** @deprecated use `Mocha.Done` instead. */ +type MochaDone = Mocha.Done; + +/** @deprecated use `Mocha.ReporterConstructor` instead. */ +type ReporterConstructor = Mocha.ReporterConstructor; + +// #endregion Deprecations + +declare module "mocha" { + export = Mocha; +} + +declare module "mocha/lib/ms" { + export = milliseconds; + /** + * Parse the given `str` and return milliseconds. + * + * @see {@link https://mochajs.org/api/module-milliseconds.html} + * @see {@link https://mochajs.org/api/module-milliseconds.html#~parse} + */ + function milliseconds(val: string): number; + + /** + * Format for `ms`. + * + * @see {@link https://mochajs.org/api/module-milliseconds.html} + * @see {@link https://mochajs.org/api/module-milliseconds.html#~format} + */ + function milliseconds(val: number): string; +} + +declare module "mocha/lib/interfaces/common" { + export = common; + + function common(suites: Mocha.Suite[], context: Mocha.MochaGlobals, mocha: Mocha): common.CommonFunctions; + + namespace common { + interface CommonFunctions { + /** + * This is only present if flag --delay is passed into Mocha. It triggers + * root suite execution. + */ + runWithSuite(suite: Mocha.Suite): () => void; + + /** + * Execute before running tests. + */ + before(fn?: Mocha.Func | Mocha.AsyncFunc): void; + + /** + * Execute before running tests. + */ + before(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void; + + /** + * Execute after running tests. + */ + after(fn?: Mocha.Func | Mocha.AsyncFunc): void; + + /** + * Execute after running tests. + */ + after(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void; + + /** + * Execute before each test case. + */ + beforeEach(fn?: Mocha.Func | Mocha.AsyncFunc): void; + + /** + * Execute before each test case. + */ + beforeEach(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void; + + /** + * Execute after each test case. + */ + afterEach(fn?: Mocha.Func | Mocha.AsyncFunc): void; + + /** + * Execute after each test case. + */ + afterEach(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void; + + suite: SuiteFunctions; + test: TestFunctions; + } + + interface CreateOptions { + /** Title of suite */ + title: string; + + /** Suite function */ + fn?: (this: Mocha.Suite) => void; + + /** Is suite pending? */ + pending?: boolean; + + /** Filepath where this Suite resides */ + file?: string; + + /** Is suite exclusive? */ + isOnly?: boolean; + } + + interface SuiteFunctions { + /** + * Create an exclusive Suite; convenience function + */ + only(opts: CreateOptions): Mocha.Suite; - // #endregion Browser augmentations + /** + * Create a Suite, but skip it; convenience function + */ + skip(opts: CreateOptions): Mocha.Suite; - // #region Deprecations + /** + * Creates a suite. + */ + create(opts: CreateOptions): Mocha.Suite; + } - /** @deprecated use `Mocha.Done` instead. */ - type MochaDone = Mocha.Done; + interface TestFunctions { + /** + * Exclusive test-case. + */ + only(mocha: Mocha, test: Mocha.Test): Mocha.Test; - /** @deprecated use `Mocha.ReporterConstructor` instead. */ - type ReporterConstructor = Mocha.ReporterConstructor; + /** + * Pending test case. + */ + skip(title: string): void; - // #endregion Deprecations + /** + * Number of retry attempts + */ + retries(n: number): void; + } + } } diff --git a/types/mocha/lib/interfaces/common.d.ts b/types/mocha/lib/interfaces/common.d.ts deleted file mode 100644 index 9756482354..0000000000 --- a/types/mocha/lib/interfaces/common.d.ts +++ /dev/null @@ -1,109 +0,0 @@ -import Mocha = require("../../"); - -export = common; - -declare function common(suites: Mocha.Suite[], context: Mocha.MochaGlobals, mocha: Mocha): common.CommonFunctions; - -declare namespace common { - interface CommonFunctions { - /** - * This is only present if flag --delay is passed into Mocha. It triggers - * root suite execution. - */ - runWithSuite(suite: Mocha.Suite): () => void; - - /** - * Execute before running tests. - */ - before(fn?: Mocha.Func | Mocha.AsyncFunc): void; - - /** - * Execute before running tests. - */ - before(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void; - - /** - * Execute after running tests. - */ - after(fn?: Mocha.Func | Mocha.AsyncFunc): void; - - /** - * Execute after running tests. - */ - after(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void; - - /** - * Execute before each test case. - */ - beforeEach(fn?: Mocha.Func | Mocha.AsyncFunc): void; - - /** - * Execute before each test case. - */ - beforeEach(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void; - - /** - * Execute after each test case. - */ - afterEach(fn?: Mocha.Func | Mocha.AsyncFunc): void; - - /** - * Execute after each test case. - */ - afterEach(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void; - - suite: SuiteFunctions; - test: TestFunctions; - } - - interface CreateOptions { - /** Title of suite */ - title: string; - - /** Suite function */ - fn?: (this: Mocha.Suite) => void; - - /** Is suite pending? */ - pending?: boolean; - - /** Filepath where this Suite resides */ - file?: string; - - /** Is suite exclusive? */ - isOnly?: boolean; - } - - interface SuiteFunctions { - /** - * Create an exclusive Suite; convenience function - */ - only(opts: CreateOptions): Mocha.Suite; - - /** - * Create a Suite, but skip it; convenience function - */ - skip(opts: CreateOptions): Mocha.Suite; - - /** - * Creates a suite. - */ - create(opts: CreateOptions): Mocha.Suite; - } - - interface TestFunctions { - /** - * Exclusive test-case. - */ - only(mocha: Mocha, test: Mocha.Test): Mocha.Test; - - /** - * Pending test case. - */ - skip(title: string): void; - - /** - * Number of retry attempts - */ - retries(n: number): void; - } -} diff --git a/types/mocha/lib/ms.d.ts b/types/mocha/lib/ms.d.ts deleted file mode 100644 index 3b89a55fc5..0000000000 --- a/types/mocha/lib/ms.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export = milliseconds; - -/** - * Parse the given `str` and return milliseconds. - * - * @see {@link https://mochajs.org/api/module-milliseconds.html} - * @see {@link https://mochajs.org/api/module-milliseconds.html#~parse} - */ -declare function milliseconds(val: string): number; - -/** - * Format for `ms`. - * - * @see {@link https://mochajs.org/api/module-milliseconds.html} - * @see {@link https://mochajs.org/api/module-milliseconds.html#~format} - */ -declare function milliseconds(val: number): string; diff --git a/types/mocha/mocha-tests.ts b/types/mocha/mocha-tests.ts index b80d7b415d..e175c1cc53 100644 --- a/types/mocha/mocha-tests.ts +++ b/types/mocha/mocha-tests.ts @@ -1261,3 +1261,42 @@ function test_interfaces_common(suites: Mocha.Suite[], context: Mocha.MochaGloba funcs.test.skip(string); funcs.test.retries(number); } + +// mocha-typescript (https://www.npmjs.com/package/mocha-typescript/) augments +// the mocha functions and enables them to work as test class decorators. +declare module "mocha" { + interface SuiteFunction { + (target: TFunction): TFunction | void; + } + interface PendingSuiteFunction { + (target: TFunction): TFunction | void; + } + interface ExclusiveSuiteFunction { + (target: TFunction): TFunction | void; + } + interface TestFunction { + (target: Object, propertyKey: string | symbol): void; + } + interface PendingTestFunction { + (target: Object, propertyKey: string | symbol): void; + } + interface ExclusiveTestFunction { + (target: Object, propertyKey: string | symbol): void; + } +} + +@suite +class TestClass1 { + @test method1() {} + @test.only method2() {} + @test.skip method3() {} +} + +@suite.skip +class TestClass2 { +} + +@suite.only +class TestClass3 { +} +// end of augmentations used by mocha-typescript diff --git a/types/mocha/tsconfig.json b/types/mocha/tsconfig.json index f26091927f..73966aa544 100644 --- a/types/mocha/tsconfig.json +++ b/types/mocha/tsconfig.json @@ -15,12 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "experimentalDecorators": true }, "files": [ "index.d.ts", - "lib/ms.d.ts", - "lib/interfaces/common.d.ts", "mocha-tests.ts" ] } \ No newline at end of file diff --git a/types/mocha/tslint.json b/types/mocha/tslint.json index 1e7d1ca65a..fce65c808b 100644 --- a/types/mocha/tslint.json +++ b/types/mocha/tslint.json @@ -5,6 +5,7 @@ "interface-name": false, "ban-types": false, "no-single-declare-module": false, - "no-declare-current-package": false + "no-declare-current-package": false, + "callable-types": false } } diff --git a/types/mock-knex/index.d.ts b/types/mock-knex/index.d.ts index bad0aadb01..8c3f022bc7 100644 --- a/types/mock-knex/index.d.ts +++ b/types/mock-knex/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/colonyamerican/mock-knex // Definitions by: Jesse Zhang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/mockjs/index.d.ts b/types/mockjs/index.d.ts index a0ca673b0a..9be645b791 100644 --- a/types/mockjs/index.d.ts +++ b/types/mockjs/index.d.ts @@ -58,7 +58,7 @@ declare namespace mockjs { character(pool?: S): S; // Random.string - string(pool: S | N, min?: N, max?: N): S; + string(pool?: S | N, min?: N, max?: N): S; // Random.range range(start?: N, stop?: N, step?: N): N; diff --git a/types/mongodb-memory-server/index.d.ts b/types/mongodb-memory-server/index.d.ts new file mode 100644 index 0000000000..bfb14ed97d --- /dev/null +++ b/types/mongodb-memory-server/index.d.ts @@ -0,0 +1,153 @@ +// Type definitions for mongodb-memory-server 1.8 +// Project: https://github.com/nodkz/mongodb-memory-server +// Definitions by: Dmitry Rogozhny +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +import { ChildProcess } from "child_process"; + +import MongoMemoryServer = _MongoMemoryServer.MongoMemoryServer; +import MongoInstance = _MongoInstance.MongodbInstance; +import MongoBinary = _MongoBinary.MongoBinary; + +export default MongoMemoryServer; +export { MongoMemoryServer, MongoInstance, MongoBinary }; + +// exports from the ./util/MongoBinary.js.flow file +declare namespace _MongoBinary { + interface MongoBinaryCache { + [version: string]: string; + } + + interface MongoBinaryOpts { + version?: string; + downloadDir?: string; + platform?: string; + arch?: string; + debug?: boolean | ((...args: any[]) => any); + } + + // disable error for a class with all static functions, + // so the TypeScript declaration would map the implementation with flow types for easier support. + // tslint:disable-next-line:no-unnecessary-class + class MongoBinary { + static cache: MongoBinaryCache; + + static getPath(opts?: MongoBinaryOpts): Promise; + static hasValidBinPath(files: string[]): boolean; + } +} + +// exports from the ./util/MongoInstance.js.flow file +declare namespace _MongoInstance { + interface MongodOps { + // instance options + instance: { + port: number, + storageEngine?: string, + dbPath: string, + debug?: boolean | ((...args: any[]) => any), + }; + + // mongo binary options + binary?: _MongoBinary.MongoBinaryOpts; + + // child process spawn options + spawn?: { + cwd?: string, + env?: object, + argv0?: string, + stdio?: string | any[], + detached?: boolean, + uid?: number, + gid?: number, + shell?: boolean | string, + }; + + debug?: boolean | ((...args: any[]) => any); + } + + class MongodbInstance { + static childProcessList: ChildProcess[]; + + opts: MongodOps; + debug: ((...args: any[]) => any); + childProcess: ChildProcess; + killerProcess: ChildProcess; + instanceReady: ((...args: any[]) => any); + instanceFailed: ((...args: any[]) => any); + + static run(opts: MongodOps): Promise; + + constructor(opts: MongodOps); + + prepareCommandArgs(): string[]; + run(): Promise; + kill(): Promise; + getPid(): number | undefined; + _launchMongod(mongoBin: string): ChildProcess; + _launchKiller(parentPid: number, childPid: number): ChildProcess; + errorHandler(err: string): void; + closeHandler(code: number): void; + stderrHandler(message: string | Buffer): void; + stdoutHandler(message: string | Buffer): void; + } +} + +// exports from the MongoMemoryServer.js.flow file +declare namespace _MongoMemoryServer { + interface MongoMemoryServerOptsT { + instance: { + port?: number, + dbPath?: string, + dbName?: string, + storageEngine?: string, + debug?: boolean | ((...args: any[]) => any), + }; + binary: { + version?: string, + downloadDir?: string, + platform?: string, + arch?: string, + debug?: boolean | ((...args: any[]) => any), + }; + debug?: boolean; + spawn: any; + autoStart?: boolean; + } + + interface MongoInstanceDataT { + port: number; + dbPath: string; + dbName: string; + uri: string; + storageEngine: string; + instance: _MongoInstance.MongodbInstance; + childProcess: ChildProcess; + tmpDir?: { + name: string, + removeCallback: ((...args: any[]) => any), + }; + } + + class MongoMemoryServer { + isRunning: boolean; + runningInstance: Promise | undefined; + opts: MongoMemoryServerOptsT; + debug: ((...args: any[]) => any); + + constructor(opts?: Partial); + + start(): Promise; + _startUpInstance(): Promise; + stop(): Promise; + getInstanceData(): Promise; + getUri(otherDbName?: string | boolean): Promise; + getConnectionString(otherDbName?: string | boolean): Promise; + getPort(): Promise; + getDbPath(): Promise; + getDbName(): Promise; + } +} diff --git a/types/mongodb-memory-server/mongodb-memory-server-tests.ts b/types/mongodb-memory-server/mongodb-memory-server-tests.ts new file mode 100644 index 0000000000..62abb2651b --- /dev/null +++ b/types/mongodb-memory-server/mongodb-memory-server-tests.ts @@ -0,0 +1,15 @@ +import MongodbMemoryServer from 'mongodb-memory-server'; + +// Simple server start example from https://www.npmjs.com/package/mongodb-memory-server +async function simpleServerStart() { + const mongod = new MongodbMemoryServer(); + + const uri = await mongod.getConnectionString(); + const port = await mongod.getPort(); + const dbPath = await mongod.getDbPath(); + const dbName = await mongod.getDbName(); + + // you may stop mongod manually + mongod.stop(); + // or it will be stopped automatically when you exit from script +} diff --git a/types/mongodb-memory-server/tsconfig.json b/types/mongodb-memory-server/tsconfig.json new file mode 100644 index 0000000000..29046ccb01 --- /dev/null +++ b/types/mongodb-memory-server/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", + "mongodb-memory-server-tests.ts" + ] +} diff --git a/types/mongodb-memory-server/tslint.json b/types/mongodb-memory-server/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/mongodb-memory-server/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/mongodb-uri/index.d.ts b/types/mongodb-uri/index.d.ts new file mode 100644 index 0000000000..6d6d9c1839 --- /dev/null +++ b/types/mongodb-uri/index.d.ts @@ -0,0 +1,101 @@ +// Type definitions for mongodb-uri 0.9 +// Project: https://github.com/mongolab/mongodb-uri-node +// Definitions by: mernxl +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface Host { + host: string; + port?: number; +} + +export interface parserOptions { + scheme: string; +} + +export interface UriObject { + scheme: string; + hosts: Host[]; + + username?: string; + password?: string; + database?: string; + options?: any; +} + +export class MongodbUriParser { + constructor(options?: parserOptions); + + /** + * Takes a URI of the form: + * + * mongodb://[username[:password]@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database]][?options] + * + * scheme and hosts will always be present. Other fields will only be present in the result if they were + * present in the input. + */ + parse(uri: string): UriObject; + + /** + * Takes a URI object and returns a URI string of the form: + * + * mongodb://[username[:password]@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database]][?options] + * + */ + format(uriObject?: UriObject): string; + + /** + * Takes either a URI object or string and returns a Mongoose connection string. Specifically, instead of listing all + * hosts and ports in a single URI, a Mongoose connection string contains a list of URIs each with a single host and + * port pair. + * + * Useful in environments where a MongoDB URI environment variable is provided, but needs to be programmatically + * transformed into a string digestible by mongoose.connect()--for example, when deploying to a PaaS like Heroku + * using a MongoDB add-on like MongoLab. + * + */ + formatMongoose(uri: UriObject | string): string; +} + +/** + * Takes a URI of the form: + * + * mongodb://[username[:password]@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database]][?options] + * + * and returns an object of the form: + * + * { + * scheme: !String, + * username: String=, + * password: String=, + * hosts: [ { host: !String, port: Number= }, ... ], + * database: String=, + * options: Object= + * } + * + * scheme and hosts will always be present. Other fields will only be present in the result if they were + * present in the input. + * + */ +export function parse(uri: string): UriObject; + +/** + * Takes a URI object and returns a URI string of the form: + * + * mongodb://[username[:password]@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database]][?options] + * + * @param uriObject + */ +export function format(uriObject?: UriObject): string; + +/** + * Takes either a URI object or string and returns a Mongoose connection string. Specifically, instead of listing all + * hosts and ports in a single URI, a Mongoose connection string contains a list of URIs each with a single host and + * port pair. + * + * Useful in environments where a MongoDB URI environment variable is provided, but needs to be programmatically + * transformed into a string digestible by mongoose.connect()--for example, when deploying to a PaaS like Heroku + * using a MongoDB add-on like MongoLab. + * + * @param uri + */ +export function formatMongoose(uri: UriObject | string): string; diff --git a/types/mongodb-uri/mongodb-uri-tests.ts b/types/mongodb-uri/mongodb-uri-tests.ts new file mode 100644 index 0000000000..2befe964ed --- /dev/null +++ b/types/mongodb-uri/mongodb-uri-tests.ts @@ -0,0 +1,12 @@ +import { format, formatMongoose, MongodbUriParser, parse } from 'mongodb-uri'; + +const urlString = 'mongodb://localhost'; +const parser = new MongodbUriParser(); + +const parsed1 = parser.parse(urlString); +const urlString1 = parser.format(parsed1); +const formatMongoose1 = parser.formatMongoose(parsed1); + +const parsed2 = parse(urlString); +const urlString2 = format(parsed2); +const formatMongoose2 = formatMongoose(parsed2); diff --git a/types/mongodb-uri/tsconfig.json b/types/mongodb-uri/tsconfig.json new file mode 100644 index 0000000000..68ca627c9a --- /dev/null +++ b/types/mongodb-uri/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", + "mongodb-uri-tests.ts" + ] +} diff --git a/types/mongodb-uri/tslint.json b/types/mongodb-uri/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/mongodb-uri/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index 12927d1f34..2849770ece 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -1,8 +1,7 @@ -// Type definitions for MongoDB v3.0 +// Type definitions for MongoDB v3.1 // Project: https://github.com/mongodb/node-mongodb-native/tree/3.0.0 // Definitions by: Federico Caselli // Alan Marcell -// Gady Piazza // Jason Dreyzehner // Gaurav Lahoti // Mariano Cortesi @@ -11,10 +10,12 @@ // Julien Chaumond // Dan Aprahamian // Denys Bushulyak +// Bastien Arata +// Wan Bachtiar // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -// Documentation : http://mongodb.github.io/node-mongodb-native/3.0/api/ +// Documentation : http://mongodb.github.io/node-mongodb-native/3.1/api/ /// /// @@ -27,34 +28,34 @@ export function connect(uri: string, options?: MongoClientOptions): Promise; export function connect(uri: string, callback: MongoCallback): void; export function connect(uri: string, options: MongoClientOptions, callback: MongoCallback): void; -export { Binary, Double, Long, Decimal128, MaxKey, MinKey, ObjectID, ObjectId, Timestamp, DBRef } from 'bson'; +export { Binary, DBRef, Decimal128, Double, Long, MaxKey, MinKey, ObjectID, ObjectId, Timestamp } from 'bson'; -// Class documentation : http://mongodb.github.io/node-mongodb-native/3.0/api/MongoClient.html +// Class documentation : http://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html export class MongoClient extends EventEmitter { constructor(uri: string, options?: MongoClientOptions); - /** http://mongodb.github.io/node-mongodb-native/3.0/api/MongoClient.html#.connect */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html#.connect */ static connect(uri: string, callback: MongoCallback): void; static connect(uri: string, options?: MongoClientOptions): Promise; static connect(uri: string, options: MongoClientOptions, callback: MongoCallback): void; /** * @deprecated - * http://mongodb.github.io/node-mongodb-native/3.0/api/MongoClient.html#connect + * http://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html#connect */ connect(): Promise; connect(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/MongoClient.html#close */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html#close */ close(callback: MongoCallback): void; close(force?: boolean): Promise; close(force: boolean, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/MongoClient.html#db */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html#db */ db(dbName?: string, options?: MongoClientCommonOption): Db - /** http://mongodb.github.io/node-mongodb-native/3.0/api/MongoClient.html#isConnected */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html#isConnected */ isConnected(options?: MongoClientCommonOption): boolean; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/MongoClient.html#logout */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html#logout */ logout(callback: MongoCallback): void; logout(options?: { dbName?: string }): Promise; logout(options: { dbName?: string }, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/MongoClient.html#startSession */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html#startSession */ startSession(options?: any): ClientSession; } @@ -75,14 +76,14 @@ export interface MongoCallback { (error: MongoError, result: T): void; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/MongoError.html */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/MongoError.html */ export class MongoError extends Error { constructor(message: string); static create(options: Object): MongoError; code?: number; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/MongoClient.html#.connect */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html#.connect */ export interface MongoClientOptions extends DbCreateOptions, ServerOptions, @@ -102,7 +103,9 @@ export interface MongoClientOptions extends auth?: { user: string; password: string; - } + }, + // Determines whether or not to use the new url parser + useNewUrlParser?: boolean } export interface SSLOptions { @@ -143,7 +146,7 @@ export interface HighAvailabilityOptions { domainsEnabled?: boolean; } -// See http://mongodb.github.io/node-mongodb-native/3.0/api/ReadPreference.html +// See http://mongodb.github.io/node-mongodb-native/3.1/api/ReadPreference.html export class ReadPreference { constructor(mode: string, tags: Object); mode: string; @@ -158,7 +161,7 @@ export class ReadPreference { static isValid(mode: string): boolean; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html */ export interface DbCreateOptions extends CommonOptions { // If the database authentication is dependent on another databaseName. authSource?: string; @@ -191,7 +194,7 @@ export interface DbCreateOptions extends CommonOptions { bufferMaxEntries?: number; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Server.html */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Server.html */ export interface SocketOptions { // Reconnect on error. default:false autoReconnect?: boolean; @@ -205,7 +208,7 @@ export interface SocketOptions { socketTimeoutMS?: number; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Server.html */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Server.html */ export interface ServerOptions extends SSLOptions { // Default: 30; reconnectTries?: number; @@ -220,14 +223,14 @@ export interface ServerOptions extends SSLOptions { domainsEnabled?: boolean; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Mongos.html */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Mongos.html */ export interface MongosOptions extends SSLOptions, HighAvailabilityOptions { // Default: 15; Cutoff latency point in MS for MongoS proxy selection acceptableLatencyMS?: number; socketOptions?: SocketOptions; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/ReplSet.html */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/ReplSet.html */ export interface ReplSetOptions extends SSLOptions, HighAvailabilityOptions { // The max staleness to secondary reads (values under 10 seconds cannot be guaranteed); maxStalenessSeconds?: number; @@ -241,7 +244,7 @@ export interface ReplSetOptions extends SSLOptions, HighAvailabilityOptions { export type ProfilingLevel = 'off' | 'slow_only' | 'all'; -// Class documentation : http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html +// Class documentation : http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html export class Db extends EventEmitter { constructor(databaseName: string, serverConfig: Server | ReplSet | Mongos, options?: DbCreateOptions); @@ -253,69 +256,69 @@ export class Db extends EventEmitter { slaveOk: boolean; writeConcern: any; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#addUser */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#addUser */ addUser(username: string, password: string, callback: MongoCallback): void; addUser(username: string, password: string, options?: DbAddUserOptions): Promise; addUser(username: string, password: string, options: DbAddUserOptions, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#admin */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#admin */ admin(): Admin; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#collection */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#collection */ collection(name: string): Collection; collection(name: string, callback: MongoCallback>): Collection; collection(name: string, options: DbCollectionOptions, callback: MongoCallback>): Collection; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#collections */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#collections */ collections(): Promise[]>; collections(callback: MongoCallback[]>): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#command */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#command */ command(command: Object, callback: MongoCallback): void; command(command: Object, options?: { readPreference: ReadPreference | string }): Promise; command(command: Object, options: { readPreference: ReadPreference | string }, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#createCollection */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#createCollection */ createCollection(name: string, callback: MongoCallback>): void; createCollection(name: string, options?: CollectionCreateOptions): Promise>; createCollection(name: string, options: CollectionCreateOptions, callback: MongoCallback>): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#createIndex */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#createIndex */ createIndex(name: string, fieldOrSpec: string | Object, callback: MongoCallback): void; createIndex(name: string, fieldOrSpec: string | Object, options?: IndexOptions): Promise; createIndex(name: string, fieldOrSpec: string | Object, options: IndexOptions, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#dropCollection */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#dropCollection */ dropCollection(name: string): Promise; dropCollection(name: string, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#dropDatabase */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#dropDatabase */ dropDatabase(): Promise; dropDatabase(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#executeDbAdminCommand */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#executeDbAdminCommand */ executeDbAdminCommand(command: Object, callback: MongoCallback): void; executeDbAdminCommand(command: Object, options?: { readPreference?: ReadPreference | string, maxTimeMS?: number }): Promise; executeDbAdminCommand(command: Object, options: { readPreference?: ReadPreference | string, maxTimeMS?: number }, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#indexInformation */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#indexInformation */ indexInformation(name: string, callback: MongoCallback): void; indexInformation(name: string, options?: { full?: boolean, readPreference?: ReadPreference | string }): Promise; indexInformation(name: string, options: { full?: boolean, readPreference?: ReadPreference | string }, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#listCollections */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#listCollections */ listCollections(filter?: Object, options?: { batchSize?: number, readPreference?: ReadPreference | string }): CommandCursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#profilingInfo */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#profilingInfo */ /** @deprecated Query the system.profile collection directly. */ profilingInfo(callback: MongoCallback): void; profilingInfo(options?: { session?: ClientSession }): Promise; profilingInfo(options: { session?: ClientSession }, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#profilingLevel */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#profilingLevel */ profilingLevel(callback: MongoCallback): void; profilingLevel(options?: { session?: ClientSession }): Promise; profilingLevel(options: { session?: ClientSession }, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#removeUser */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#removeUser */ removeUser(username: string, callback: MongoCallback): void; removeUser(username: string, options?: CommonOptions): Promise; removeUser(username: string, options: CommonOptions, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#renameCollection */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#renameCollection */ renameCollection(fromCollection: string, toCollection: string, callback: MongoCallback>): void; renameCollection(fromCollection: string, toCollection: string, options?: { dropTarget?: boolean }): Promise>; renameCollection(fromCollection: string, toCollection: string, options: { dropTarget?: boolean }, callback: MongoCallback>): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#setProfilingLevel */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#setProfilingLevel */ setProfilingLevel(level: ProfilingLevel, callback: MongoCallback): void; setProfilingLevel(level: ProfilingLevel, options?: { session?: ClientSession }): Promise; setProfilingLevel(level: ProfilingLevel, options: { session?: ClientSession }, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#stats */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#stats */ stats(callback: MongoCallback): void; stats(options?: { scale?: number }): Promise; stats(options: { scale?: number }, callback: MongoCallback): void; @@ -332,34 +335,34 @@ export interface CommonOptions { session?: ClientSession; } -// Deprecated http://mongodb.github.io/node-mongodb-native/3.0/api/Server.html +// Deprecated http://mongodb.github.io/node-mongodb-native/3.1/api/Server.html export class Server extends EventEmitter { constructor(host: string, port: number, options?: ServerOptions); connections(): Array; } -// Deprecated http://mongodb.github.io/node-mongodb-native/3.0/api/ReplSet.html +// Deprecated http://mongodb.github.io/node-mongodb-native/3.1/api/ReplSet.html export class ReplSet extends EventEmitter { constructor(servers: Array, options?: ReplSetOptions); connections(): Array; } -// Deprecated http://mongodb.github.io/node-mongodb-native/3.0/api/ReplSet.html +// Deprecated http://mongodb.github.io/node-mongodb-native/3.1/api/ReplSet.html export class Mongos extends EventEmitter { constructor(servers: Array, options?: MongosOptions); connections(): Array; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#addUser */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#addUser */ export interface DbAddUserOptions extends CommonOptions { customData?: Object; roles?: Object[]; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#createCollection */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#createCollection */ export interface CollectionCreateOptions extends CommonOptions { raw?: boolean; pkFactory?: Object; @@ -381,7 +384,7 @@ export interface CollectionCreateOptions extends CommonOptions { collation?: object; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#collection */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#collection */ export interface DbCollectionOptions extends CommonOptions { raw?: boolean; pkFactory?: Object; @@ -391,7 +394,7 @@ export interface DbCollectionOptions extends CommonOptions { readConcern?: { level: Object }; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#createIndex */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#createIndex */ export interface IndexOptions extends CommonOptions { // Creates an unique index. unique?: boolean; @@ -419,57 +422,57 @@ export interface IndexOptions extends CommonOptions { default_language?: string } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Admin.html */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html */ export interface Admin { - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Admin.html#addUser */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#addUser */ addUser(username: string, password: string, callback: MongoCallback): void; addUser(username: string, password: string, options?: AddUserOptions): Promise; addUser(username: string, password: string, options: AddUserOptions, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Admin.html#buildInfo */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#buildInfo */ buildInfo(): Promise; buildInfo(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Admin.html#command */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#command */ command(command: Object, callback: MongoCallback): void; command(command: Object, options?: { readPreference?: ReadPreference | string, maxTimeMS?: number }): Promise; command(command: Object, options: { readPreference?: ReadPreference | string, maxTimeMS?: number }, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Admin.html#listDatabases */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#listDatabases */ listDatabases(): Promise; listDatabases(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Admin.html#ping */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#ping */ ping(): Promise; ping(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Admin.html#removeUser */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#removeUser */ removeUser(username: string, callback: MongoCallback): void; removeUser(username: string, options?: FSyncOptions): Promise; removeUser(username: string, options: FSyncOptions, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Admin.html#replSetGetStatus */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#replSetGetStatus */ replSetGetStatus(): Promise; replSetGetStatus(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Admin.html#serverInfo */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#serverInfo */ serverInfo(): Promise; serverInfo(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Admin.html#serverStatus */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#serverStatus */ serverStatus(): Promise; serverStatus(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Admin.html#validateCollection */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#validateCollection */ validateCollection(collectionNme: string, callback: MongoCallback): void; validateCollection(collectionNme: string, options?: Object): Promise; validateCollection(collectionNme: string, options: Object, callback: MongoCallback): void; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Admin.html#addUser */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#addUser */ export interface AddUserOptions extends CommonOptions { fsync: boolean; customData?: Object; roles?: Object[] } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Admin.html#removeUser */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#removeUser */ export interface FSyncOptions extends CommonOptions { fsync?: boolean } -// Documentation : http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html +// Documentation : http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html export interface Collection { // Get the collection name. collectionName: string; @@ -482,176 +485,190 @@ export interface Collection { // Get current index hint for collection. hint: any; /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#aggregate */ + aggregate(callback: MongoCallback>): AggregationCursor; aggregate(pipeline: Object[], callback: MongoCallback>): AggregationCursor; - aggregate(pipeline: Object[], options?: CollectionAggregationOptions, callback?: MongoCallback>): AggregationCursor; + aggregate(pipeline?: Object[], options?: CollectionAggregationOptions, callback?: MongoCallback>): AggregationCursor; /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#bulkWrite */ bulkWrite(operations: Object[], callback: MongoCallback): void; - bulkWrite(operations: Object[], options?: CollectionBluckWriteOptions): Promise; - bulkWrite(operations: Object[], options: CollectionBluckWriteOptions, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#count */ + bulkWrite(operations: Object[], options?: CollectionBulkWriteOptions): Promise; + bulkWrite(operations: Object[], options: CollectionBulkWriteOptions, callback: MongoCallback): void; + /** + * http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#count + * @deprecated Use countDocuments or estimatedDocumentCount + */ count(callback: MongoCallback): void; count(query: Object, callback: MongoCallback): void; count(query?: Object, options?: MongoCountPreferences): Promise; count(query: Object, options: MongoCountPreferences, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#createIndex */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#countDocuments */ + countDocuments(callback: MongoCallback): void; + countDocuments(query: Object, callback: MongoCallback): void; + countDocuments(query?: Object, options?: MongoCountPreferences): Promise; + countDocuments(query: Object, options: MongoCountPreferences, callback: MongoCallback): void; + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#createIndex */ createIndex(fieldOrSpec: string | any, callback: MongoCallback): void; createIndex(fieldOrSpec: string | any, options?: IndexOptions): Promise; createIndex(fieldOrSpec: string | any, options: IndexOptions, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#createIndexes and http://docs.mongodb.org/manual/reference/command/createIndexes/ */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#createIndexes and http://docs.mongodb.org/manual/reference/command/createIndexes/ */ createIndexes(indexSpecs: Object[], callback: MongoCallback): void; createIndexes(indexSpecs: Object[], options?: {session?: ClientSession}): Promise; createIndexes(indexSpecs: Object[], options: {session?: ClientSession}, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#deleteMany */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#deleteMany */ deleteMany(filter: FilterQuery, callback: MongoCallback): void; deleteMany(filter: FilterQuery, options?: CommonOptions): Promise; deleteMany(filter: FilterQuery, options: CommonOptions, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#deleteOne */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#deleteOne */ deleteOne(filter: FilterQuery, callback: MongoCallback): void; deleteOne(filter: FilterQuery, options?: CommonOptions & { bypassDocumentValidation?: boolean }): Promise; deleteOne(filter: FilterQuery, options: CommonOptions & { bypassDocumentValidation?: boolean }, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#distinct */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#distinct */ distinct(key: string, query: Object, callback: MongoCallback): void; distinct(key: string, query: Object, options?: { readPreference?: ReadPreference | string, maxTimeMS?: number, session?: ClientSession }): Promise; distinct(key: string, query: Object, options: { readPreference?: ReadPreference | string, maxTimeMS?: number, session?: ClientSession }, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#drop */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#drop */ drop(options?: {session: ClientSession}): Promise; drop(callback: MongoCallback): void; drop(options: {session: ClientSession}, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#dropIndex */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#dropIndex */ dropIndex(indexName: string, callback: MongoCallback): void; dropIndex(indexName: string, options?: CommonOptions & { maxTimeMS?: number }): Promise; dropIndex(indexName: string, options: CommonOptions & { maxTimeMS?: number }, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#dropIndexes */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#dropIndexes */ dropIndexes(options?: {session?: ClientSession, maxTimeMS?: number}): Promise; dropIndexes(callback?: MongoCallback): void; dropIndexes(options: {session?: ClientSession, maxTimeMS?: number}, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#find */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#estimatedDocumentCount */ + estimatedDocumentCount(callback: MongoCallback): void; + estimatedDocumentCount(query: Object, callback: MongoCallback): void; + estimatedDocumentCount(query?: Object, options?: MongoCountPreferences): Promise; + estimatedDocumentCount(query: Object, options: MongoCountPreferences, callback: MongoCallback): void; + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#find */ find(query?: FilterQuery): Cursor; /** @deprecated */ find(query: FilterQuery, options?: FindOneOptions): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#findOne */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#findOne */ findOne(filter: FilterQuery, callback: MongoCallback): void; findOne(filter: FilterQuery, options?: FindOneOptions): Promise; findOne(filter: FilterQuery, options: FindOneOptions, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#findOneAndDelete */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#findOneAndDelete */ findOneAndDelete(filter: FilterQuery, callback: MongoCallback>): void; findOneAndDelete(filter: FilterQuery, options?: { projection?: Object, sort?: Object, maxTimeMS?: number, session?: ClientSession }): Promise>; findOneAndDelete(filter: FilterQuery, options: { projection?: Object, sort?: Object, maxTimeMS?: number, session?: ClientSession }, callback: MongoCallback>): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#findOneAndReplace */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#findOneAndReplace */ findOneAndReplace(filter: FilterQuery, replacement: Object, callback: MongoCallback>): void; findOneAndReplace(filter: FilterQuery, replacement: Object, options?: FindOneAndReplaceOption): Promise>; findOneAndReplace(filter: FilterQuery, replacement: Object, options: FindOneAndReplaceOption, callback: MongoCallback>): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#findOneAndUpdate */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#findOneAndUpdate */ findOneAndUpdate(filter: FilterQuery, update: Object, callback: MongoCallback>): void; findOneAndUpdate(filter: FilterQuery, update: Object, options?: FindOneAndReplaceOption): Promise>; findOneAndUpdate(filter: FilterQuery, update: Object, options: FindOneAndReplaceOption, callback: MongoCallback>): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#geoHaystackSearch */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#geoHaystackSearch */ geoHaystackSearch(x: number, y: number, callback: MongoCallback): void; geoHaystackSearch(x: number, y: number, options?: GeoHaystackSearchOptions): Promise; geoHaystackSearch(x: number, y: number, options: GeoHaystackSearchOptions, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#geoNear */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#geoNear */ geoNear(x: number, y: number, callback: MongoCallback): void; geoNear(x: number, y: number, options?: GeoNearOptions): Promise; geoNear(x: number, y: number, options: GeoNearOptions, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#group */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#group */ group(keys: Object | Array | Function | Code, condition: Object, initial: Object, reduce: Function | Code, finalize: Function | Code, command: boolean, callback: MongoCallback): void; group(keys: Object | Array | Function | Code, condition: Object, initial: Object, reduce: Function | Code, finalize: Function | Code, command: boolean, options?: { readPreference?: ReadPreference | string }): Promise; group(keys: Object | Array | Function | Code, condition: Object, initial: Object, reduce: Function | Code, finalize: Function | Code, command: boolean, options: { readPreference?: ReadPreference | string }, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#indexes */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#indexes */ indexes(options?: {session: ClientSession}): Promise; indexes(callback: MongoCallback): void; indexes(options: {session?: ClientSession}, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#indexExists */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#indexExists */ indexExists(indexes: string | string[], callback: MongoCallback): void; indexExists(indexes: string | string[], options?: {session: ClientSession}): Promise; indexExists(indexes: string | string[], options: {session: ClientSession}, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#indexInformation */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#indexInformation */ indexInformation(callback: MongoCallback): void; indexInformation(options?: { full: boolean, session: ClientSession }): Promise; indexInformation(options: { full: boolean, session: ClientSession }, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#initializeOrderedBulkOp */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#initializeOrderedBulkOp */ initializeOrderedBulkOp(options?: CommonOptions): OrderedBulkOperation; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#initializeUnorderedBulkOp */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#initializeUnorderedBulkOp */ initializeUnorderedBulkOp(options?: CommonOptions): UnorderedBulkOperation; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#insertOne */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#insertOne */ /** @deprecated Use insertOne, insertMany or bulkWrite */ insert(docs: Object, callback: MongoCallback): void; /** @deprecated Use insertOne, insertMany or bulkWrite */ insert(docs: Object, options?: CollectionInsertOneOptions): Promise; /** @deprecated Use insertOne, insertMany or bulkWrite */ insert(docs: Object, options: CollectionInsertOneOptions, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#insertMany */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#insertMany */ insertMany(docs: Object[], callback: MongoCallback): void; insertMany(docs: Object[], options?: CollectionInsertManyOptions): Promise; insertMany(docs: Object[], options: CollectionInsertManyOptions, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#insertOne */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#insertOne */ insertOne(docs: Object, callback: MongoCallback): void; insertOne(docs: Object, options?: CollectionInsertOneOptions): Promise; insertOne(docs: Object, options: CollectionInsertOneOptions, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#isCapped */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#isCapped */ isCapped(options?: {session: ClientSession}): Promise; isCapped(callback: MongoCallback): void; isCapped(options: {session: ClientSession}, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#listIndexes */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#listIndexes */ listIndexes(options?: { batchSize?: number, readPreference?: ReadPreference | string, session?: ClientSession }): CommandCursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#mapReduce */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#mapReduce */ mapReduce(map: Function | string, reduce: Function | string, callback: MongoCallback): void; mapReduce(map: Function | string, reduce: Function | string, options?: MapReduceOptions): Promise; mapReduce(map: Function | string, reduce: Function | string, options: MapReduceOptions, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#options */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#options */ options(options?: {session: ClientSession}): Promise; options(callback: MongoCallback): void; options(options: {session: ClientSession}, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#parallelCollectionScan */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#parallelCollectionScan */ parallelCollectionScan(callback: MongoCallback[]>): void; parallelCollectionScan(options?: ParallelCollectionScanOptions): Promise[]>; parallelCollectionScan(options: ParallelCollectionScanOptions, callback: MongoCallback[]>): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#reIndex */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#reIndex */ reIndex(options?: {session: ClientSession}): Promise; reIndex(callback: MongoCallback): void; reIndex(options: {session: ClientSession}, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#remove */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#remove */ /** @deprecated Use use deleteOne, deleteMany or bulkWrite */ remove(selector: Object, callback: MongoCallback): void; /** @deprecated Use use deleteOne, deleteMany or bulkWrite */ remove(selector: Object, options?: CommonOptions & { single?: boolean }): Promise; /** @deprecated Use use deleteOne, deleteMany or bulkWrite */ remove(selector: Object, options?: CommonOptions & { single?: boolean }, callback?: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#rename */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#rename */ rename(newName: string, callback: MongoCallback>): void; rename(newName: string, options?: { dropTarget?: boolean, session?: ClientSession }): Promise>; rename(newName: string, options: { dropTarget?: boolean, session?: ClientSession }, callback: MongoCallback>): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#replaceOne */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#replaceOne */ replaceOne(filter: FilterQuery, doc: Object, callback: MongoCallback): void; replaceOne(filter: FilterQuery, doc: Object, options?: ReplaceOneOptions): Promise; replaceOne(filter: FilterQuery, doc: Object, options: ReplaceOneOptions, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#save */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#save */ /** @deprecated Use insertOne, insertMany, updateOne or updateMany */ save(doc: Object, callback: MongoCallback): void; /** @deprecated Use insertOne, insertMany, updateOne or updateMany */ save(doc: Object, options?: CommonOptions): Promise; /** @deprecated Use insertOne, insertMany, updateOne or updateMany */ save(doc: Object, options: CommonOptions, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#stats */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#stats */ stats(callback: MongoCallback): void; stats(options?: { scale: number, session?: ClientSession }): Promise; stats(options: { scale: number, session?: ClientSession }, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#update */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#update */ /** @deprecated use updateOne, updateMany or bulkWrite */ update(filter: FilterQuery, update: Object, callback: MongoCallback): void; /** @deprecated use updateOne, updateMany or bulkWrite */ update(filter: FilterQuery, update: Object, options?: ReplaceOneOptions & { multi?: boolean }): Promise; /** @deprecated use updateOne, updateMany or bulkWrite */ update(filter: FilterQuery, update: Object, options: ReplaceOneOptions & { multi?: boolean }, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#updateMany */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#updateMany */ updateMany(filter: FilterQuery, update: Object, callback: MongoCallback): void; updateMany(filter: FilterQuery, update: Object, options?: CommonOptions & { upsert?: boolean }): Promise; updateMany(filter: FilterQuery, update: Object, options: CommonOptions & { upsert?: boolean }, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#updateOne */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#updateOne */ updateOne(filter: FilterQuery, update: Object, callback: MongoCallback): void; updateOne(filter: FilterQuery, update: Object, options?: ReplaceOneOptions): Promise; updateOne(filter: FilterQuery, update: Object, options: ReplaceOneOptions, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#watch */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#watch */ watch(pipeline?: Object[], options?: ChangeStreamOptions & { session?: ClientSession }): ChangeStream; } @@ -870,7 +887,7 @@ export interface WiredTigerData { }; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#aggregate */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#aggregate */ export interface CollectionAggregationOptions { readPreference?: ReadPreference | string; // Return the query as cursor, on 2.6 > it returns as a real cursor @@ -896,7 +913,7 @@ export interface CollectionAggregationOptions { } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#insertMany */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#insertMany */ export interface CollectionInsertManyOptions extends CommonOptions { // Serialize functions on any object. serializeFunctions?: boolean; @@ -908,17 +925,19 @@ export interface CollectionInsertManyOptions extends CommonOptions { ordered?: boolean; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#bulkWrite */ -export interface CollectionBluckWriteOptions extends CommonOptions { +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#bulkWrite */ +export interface CollectionBulkWriteOptions extends CommonOptions { // Serialize functions on any object. serializeFunctions?: boolean; // Execute write operation in ordered or unordered fashion. ordered?: boolean; // Allow driver to bypass schema validation in MongoDB 3.2 or higher. bypassDocumentValidation?: boolean; + //Force server to assign _id values instead of driver. + forceServerObjectId?: boolean; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#~BulkWriteOpResult */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#~BulkWriteOpResult */ export interface BulkWriteOpResultObject { insertedCount?: number; matchedCount?: number; @@ -930,7 +949,7 @@ export interface BulkWriteOpResultObject { result?: any; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#count */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#count */ export interface MongoCountPreferences { // The limit of documents to count. limit?: number; @@ -944,7 +963,7 @@ export interface MongoCountPreferences { session?: ClientSession; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#~deleteWriteOpResult */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#~deleteWriteOpResult */ export interface DeleteWriteOpResultObject { //The raw result returned from MongoDB, field will vary depending on server version. result: { @@ -959,7 +978,7 @@ export interface DeleteWriteOpResultObject { deletedCount?: number; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#~findAndModifyWriteOpResult */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#~findAndModifyWriteOpResult */ export interface FindAndModifyWriteOpResultObject { //Document returned from findAndModify command. value?: TSchema; @@ -969,7 +988,7 @@ export interface FindAndModifyWriteOpResultObject { ok?: number; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#findOneAndReplace */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#findOneAndReplace */ export interface FindOneAndReplaceOption { projection?: Object; sort?: Object; @@ -979,7 +998,7 @@ export interface FindOneAndReplaceOption { session?: ClientSession; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#geoHaystackSearch */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#geoHaystackSearch */ export interface GeoHaystackSearchOptions { readPreference?: ReadPreference | string; maxDistance?: number; @@ -988,7 +1007,7 @@ export interface GeoHaystackSearchOptions { session?: ClientSession; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#geoNear */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#geoNear */ export interface GeoNearOptions { readPreference?: ReadPreference | string; num?: number; @@ -1001,27 +1020,27 @@ export interface GeoNearOptions { includeLocs?: boolean; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Code.html */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Code.html */ export class Code { constructor(code: string | Function, scope?: Object) code: string | Function; scope: any; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/OrderedBulkOperation.html */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/OrderedBulkOperation.html */ export interface OrderedBulkOperation { length: number; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/OrderedBulkOperation.html#execute */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/OrderedBulkOperation.html#execute */ execute(callback: MongoCallback): void; execute(options?: FSyncOptions): Promise; execute(options: FSyncOptions, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/OrderedBulkOperation.html#find */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/OrderedBulkOperation.html#find */ find(selector: Object): FindOperatorsOrdered; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/OrderedBulkOperation.html#insert */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/OrderedBulkOperation.html#insert */ insert(doc: Object): OrderedBulkOperation; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/BulkWriteResult.html */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/BulkWriteResult.html */ export interface BulkWriteResult { ok: number; nInserted: number; @@ -1042,7 +1061,7 @@ export interface BulkWriteResult { hasWriteErrors(): boolean; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/WriteError.html */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/WriteError.html */ export interface WriteError { //Write concern error code. code: number; @@ -1052,7 +1071,7 @@ export interface WriteError { errmsg: string; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/WriteConcernError.html */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/WriteConcernError.html */ export interface WriteConcernError { //Write concern error code. code: number; @@ -1060,7 +1079,7 @@ export interface WriteConcernError { errmsg: string; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/FindOperatorsOrdered.html */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/FindOperatorsOrdered.html */ export interface FindOperatorsOrdered { delete(): OrderedBulkOperation; deleteOne(): OrderedBulkOperation; @@ -1070,21 +1089,21 @@ export interface FindOperatorsOrdered { upsert(): FindOperatorsOrdered; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/UnorderedBulkOperation.html */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/UnorderedBulkOperation.html */ export interface UnorderedBulkOperation { - /** http://mongodb.github.io/node-mongodb-native/3.0/api/lib_bulk_unordered.js.html line 339 */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/lib_bulk_unordered.js.html line 339 */ length: number; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/UnorderedBulkOperation.html#execute */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/UnorderedBulkOperation.html#execute */ execute(callback: MongoCallback): void; execute(options?: FSyncOptions): Promise; execute(options: FSyncOptions, callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/UnorderedBulkOperation.html#find */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/UnorderedBulkOperation.html#find */ find(selector: Object): FindOperatorsUnordered; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/UnorderedBulkOperation.html#insert */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/UnorderedBulkOperation.html#insert */ insert(doc: Object): UnorderedBulkOperation; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/FindOperatorsUnordered.html */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/FindOperatorsUnordered.html */ export interface FindOperatorsUnordered { length: number; remove(): UnorderedBulkOperation; @@ -1095,7 +1114,7 @@ export interface FindOperatorsUnordered { upsert(): FindOperatorsUnordered; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#findOne */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#findOne */ export interface FindOneOptions { limit?: number; sort?: Array | Object; @@ -1125,7 +1144,7 @@ export interface FindOneOptions { session?: ClientSession; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#~insertWriteOpResult */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#~insertWriteOpResult */ export interface InsertWriteOpResult { insertedCount: number; ops: Array; @@ -1134,7 +1153,7 @@ export interface InsertWriteOpResult { result: { ok: number, n: number } } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#insertOne */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#insertOne */ export interface CollectionInsertOneOptions extends CommonOptions { // Serialize functions on any object. serializeFunctions?: boolean; @@ -1144,7 +1163,7 @@ export interface CollectionInsertOneOptions extends CommonOptions { bypassDocumentValidation?: boolean } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#~insertOneWriteOpResult */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#~insertOneWriteOpResult */ export interface InsertOneWriteOpResult { insertedCount: number; ops: Array; @@ -1153,7 +1172,7 @@ export interface InsertOneWriteOpResult { result: { ok: number, n: number } } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#parallelCollectionScan */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#parallelCollectionScan */ export interface ParallelCollectionScanOptions { readPreference?: ReadPreference | string; batchSize?: number; @@ -1162,13 +1181,13 @@ export interface ParallelCollectionScanOptions { session?: ClientSession; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#replaceOne */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#replaceOne */ export interface ReplaceOneOptions extends CommonOptions { upsert?: boolean; bypassDocumentValidation?: boolean; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#~updateWriteOpResult */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#~updateWriteOpResult */ export interface UpdateWriteOpResult { result: { ok: number, n: number, nModified: number }; connection: any; @@ -1183,7 +1202,7 @@ export interface ReplaceWriteOpResult extends UpdateWriteOpResult { ops: Array } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#mapReduce */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#mapReduce */ export interface MapReduceOptions { readPreference?: ReadPreference | string; out?: Object; @@ -1199,106 +1218,106 @@ export interface MapReduceOptions { session?: ClientSession; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#~WriteOpResult */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#~WriteOpResult */ export interface WriteOpResult { ops: Array; connection: any; result: any; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#~resultCallback */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#~resultCallback */ export type CursorResult = any | void | boolean; type Default = any; -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html */ export class Cursor extends Readable { sortValue: string; timeout: boolean; readPreference: ReadPreference; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#addCursorFlag */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#addCursorFlag */ addCursorFlag(flag: string, value: boolean): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#addQueryModifier */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#addQueryModifier */ addQueryModifier(name: string, value: boolean): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#batchSize */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#batchSize */ batchSize(value: number): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#clone */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#clone */ clone(): Cursor; // still returns the same type - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#close */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#close */ close(): Promise; close(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#collation */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#collation */ collation(value: Object): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#comment */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#comment */ comment(value: string): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#count */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#count */ count(callback: MongoCallback): void; count(applySkipLimit: boolean, callback: MongoCallback): void; count(options: CursorCommentOptions, callback: MongoCallback): void; count(applySkipLimit: boolean, options: CursorCommentOptions, callback: MongoCallback): void; count(applySkipLimit?: boolean, options?: CursorCommentOptions): Promise; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#explain */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#explain */ explain(): Promise; explain(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#filter */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#filter */ filter(filter: Object): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#forEach */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#forEach */ forEach(iterator: IteratorCallback, callback: EndCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#hasNext */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#hasNext */ hasNext(): Promise; hasNext(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#hint */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#hint */ hint(hint: Object): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#isClosed */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#isClosed */ isClosed(): boolean; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#limit */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#limit */ limit(value: number): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#map */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#map */ map(transform: (document: T) => U): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#max */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#max */ max(max: number): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#maxAwaitTimeMS */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#maxAwaitTimeMS */ maxAwaitTimeMS(value: number): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#maxScan */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#maxScan */ maxScan(maxScan: Object): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#maxTimeMS */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#maxTimeMS */ maxTimeMS(value: number): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#min */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#min */ min(min: number): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#next */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#next */ next(): Promise; next(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#project */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#project */ project(value: Object): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#read */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#read */ read(size: number): string | Buffer | void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#next */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#next */ returnKey(returnKey: Object): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#rewind */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#rewind */ rewind(): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#setCursorOption */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#setCursorOption */ setCursorOption(field: string, value: Object): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#setReadPreference */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#setReadPreference */ setReadPreference(readPreference: string | ReadPreference): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#showRecordId */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#showRecordId */ showRecordId(showRecordId: Object): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#skip */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#skip */ skip(value: number): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#snapshot */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#snapshot */ snapshot(snapshot: Object): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#sort */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#sort */ sort(keyOrList: string | Object[] | Object, direction?: number): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#stream */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#stream */ stream(options?: { transform?: Function }): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#toArray */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#toArray */ toArray(): Promise; toArray(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#unshift */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#unshift */ unshift(stream: Buffer | string): void; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#count */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#count */ export interface CursorCommentOptions { skip?: number; limit?: number; @@ -1307,123 +1326,123 @@ export interface CursorCommentOptions { readPreference?: ReadPreference | string; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#~iteratorCallback */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#~iteratorCallback */ export interface IteratorCallback { (doc: T): void; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#~endCallback */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#~endCallback */ export interface EndCallback { (error: MongoError): void; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html#~resultCallback */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#~resultCallback */ export type AggregationCursorResult = any | void; -/** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html */ export class AggregationCursor extends Readable { - /** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html#batchSize */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#batchSize */ batchSize(value: number): AggregationCursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html#clone */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#clone */ clone(): AggregationCursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html#close */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#close */ close(): Promise; close(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html#each */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#each */ each(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html#explain */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#explain */ explain(): Promise; explain(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html#geoNear */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#geoNear */ geoNear(document: Object): AggregationCursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html#group */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#group */ group(document: Object): AggregationCursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html#isClosed */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#isClosed */ isClosed(): boolean; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html#limit */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#limit */ limit(value: number): AggregationCursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html#match */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#match */ match(document: Object): AggregationCursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html#maxTimeMS */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#maxTimeMS */ maxTimeMS(value: number): AggregationCursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html#next */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#next */ next(): Promise; next(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html#out */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#out */ out(destination: string): AggregationCursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html#project */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#project */ project(document: Object): AggregationCursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html#read */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#read */ read(size: number): string | Buffer | void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html#redact */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#redact */ redact(document: Object): AggregationCursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html#rewind */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#rewind */ rewind(): AggregationCursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html#setEncoding */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#setEncoding */ skip(value: number): AggregationCursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html#sort */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#sort */ sort(document: Object): AggregationCursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html#toArray */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#toArray */ toArray(): Promise; toArray(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html#unshift */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#unshift */ unshift(stream: Buffer | string): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/AggregationCursor.html#unwind */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#unwind */ unwind(field: string): AggregationCursor; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/CommandCursor.html */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/CommandCursor.html */ export class CommandCursor extends Readable { - /** http://mongodb.github.io/node-mongodb-native/3.0/api/CommandCursor.html#batchSize */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/CommandCursor.html#batchSize */ batchSize(value: number): CommandCursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/CommandCursor.html#clone */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/CommandCursor.html#clone */ clone(): CommandCursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/CommandCursor.html#close */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/CommandCursor.html#close */ close(): Promise; close(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/CommandCursor.html#each */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/CommandCursor.html#each */ each(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/CommandCursor.html#isClosed */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/CommandCursor.html#isClosed */ isClosed(): boolean; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/CommandCursor.html#maxTimeMS */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/CommandCursor.html#maxTimeMS */ maxTimeMS(value: number): CommandCursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/CommandCursor.html#next */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/CommandCursor.html#next */ next(): Promise; next(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/CommandCursor.html#read */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/CommandCursor.html#read */ read(size: number): string | Buffer | void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/CommandCursor.html#rewind */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/CommandCursor.html#rewind */ rewind(): CommandCursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/CommandCursor.html#setReadPreference */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/CommandCursor.html#setReadPreference */ setReadPreference(readPreference: string | ReadPreference): CommandCursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/CommandCursor.html#toArray */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/CommandCursor.html#toArray */ toArray(): Promise; toArray(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/CommandCursor.html#unshift */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/CommandCursor.html#unshift */ unshift(stream: Buffer | string): void; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucket.html */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/GridFSBucket.html */ export class GridFSBucket { constructor(db: Db, options?: GridFSBucketOptions); - /** http://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucket.html#delete */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/GridFSBucket.html#delete */ delete(id: ObjectID, callback?: GridFSBucketErrorCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucket.html#drop */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/GridFSBucket.html#drop */ drop(callback?: GridFSBucketErrorCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucket.html#find */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/GridFSBucket.html#find */ find(filter?: Object, options?: GridFSBucketFindOptions): Cursor; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucket.html#openDownloadStream */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/GridFSBucket.html#openDownloadStream */ openDownloadStream(id: ObjectID, options?: { start: number, end: number }): GridFSBucketReadStream; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucket.html#openDownloadStreamByName */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/GridFSBucket.html#openDownloadStreamByName */ openDownloadStreamByName(filename: string, options?: { revision: number, start: number, end: number }): GridFSBucketReadStream; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucket.html#openUploadStream */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/GridFSBucket.html#openUploadStream */ openUploadStream(filename: string, options?: GridFSBucketOpenUploadStreamOptions): GridFSBucketWriteStream; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucket.html#openUploadStreamWithId */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/GridFSBucket.html#openUploadStreamWithId */ openUploadStreamWithId(id: GridFSBucketWriteStreamId, filename: string, options?: GridFSBucketOpenUploadStreamOptions): GridFSBucketWriteStream; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucket.html#rename */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/GridFSBucket.html#rename */ rename(id: ObjectID, filename: string, callback?: GridFSBucketErrorCallback): void; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucket.html */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/GridFSBucket.html */ export interface GridFSBucketOptions { bucketName?: string; chunkSizeBytes?: number; @@ -1431,12 +1450,12 @@ export interface GridFSBucketOptions { ReadPreference?: Object; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucket.html#~errorCallback */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/GridFSBucket.html#~errorCallback */ export interface GridFSBucketErrorCallback { (err?: MongoError): void; } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucket.html#find */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/GridFSBucket.html#find */ export interface GridFSBucketFindOptions { batchSize?: number; limit?: number; @@ -1446,7 +1465,7 @@ export interface GridFSBucketFindOptions { sort?: Object; } -/** https://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucket.html#openUploadStream */ +/** https://mongodb.github.io/node-mongodb-native/3.1/api/GridFSBucket.html#openUploadStream */ export interface GridFSBucketOpenUploadStreamOptions { chunkSizeBytes?: number, metadata?: Object, @@ -1454,13 +1473,13 @@ export interface GridFSBucketOpenUploadStreamOptions { aliases?: Array } -/** https://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucketReadStream.html */ +/** https://mongodb.github.io/node-mongodb-native/3.1/api/GridFSBucketReadStream.html */ export class GridFSBucketReadStream extends Readable { id: ObjectID; constructor(chunks: Collection, files: Collection, readPreference: Object, filter: Object, options?: GridFSBucketReadStreamOptions); } -/** https://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucketReadStream.html */ +/** https://mongodb.github.io/node-mongodb-native/3.1/api/GridFSBucketReadStream.html */ export interface GridFSBucketReadStreamOptions { sort?: number, skip?: number, @@ -1468,13 +1487,13 @@ export interface GridFSBucketReadStreamOptions { end?: number } -/** https://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucketWriteStream.html */ +/** https://mongodb.github.io/node-mongodb-native/3.1/api/GridFSBucketWriteStream.html */ export class GridFSBucketWriteStream extends Writable { id: GridFSBucketWriteStreamId; constructor(bucket: GridFSBucket, filename: string, options?: GridFSBucketWriteStreamOptions); } -/** https://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucketWriteStream.html */ +/** https://mongodb.github.io/node-mongodb-native/3.1/api/GridFSBucketWriteStream.html */ export interface GridFSBucketWriteStreamOptions { id?: GridFSBucketWriteStreamId, chunkSizeBytes?: number, @@ -1483,26 +1502,26 @@ export interface GridFSBucketWriteStreamOptions { j?: number } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/ChangeStream.html */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/ChangeStream.html */ export class ChangeStream extends Readable { constructor(changeDomain: Db | Collection, pipeline: Object[], options?: ChangeStreamOptions); - /** http://mongodb.github.io/node-mongodb-native/3.0/api/ChangeStream.html#close */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/ChangeStream.html#close */ close(): Promise; close(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/ChangeStream.html#hasNext */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/ChangeStream.html#hasNext */ hasNext(): Promise; hasNext(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/ChangeStream.html#isClosed */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/ChangeStream.html#isClosed */ isClosed(): boolean; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/ChangeStream.html#next */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/ChangeStream.html#next */ next(): Promise; next(callback: MongoCallback): void; - /** http://mongodb.github.io/node-mongodb-native/3.0/api/ChangeStream.html#stream */ + /** http://mongodb.github.io/node-mongodb-native/3.1/api/ChangeStream.html#stream */ stream(options?: { transform: Function }): Cursor; } @@ -1532,7 +1551,7 @@ export interface LoggerState { date: number } -/** http://mongodb.github.io/node-mongodb-native/3.0/api/Logger.html */ +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Logger.html */ export class Logger { constructor(className: string, options?: LoggerOptions) // Log a message at the debug level diff --git a/types/mongodb/mongodb-tests.ts b/types/mongodb/mongodb-tests.ts index a5a27bd671..12403bda37 100644 --- a/types/mongodb/mongodb-tests.ts +++ b/types/mongodb/mongodb-tests.ts @@ -27,7 +27,8 @@ let options: mongodb.MongoClientOptions = { sslCert: new Buffer(999), sslKey: new Buffer(999), sslPass: new Buffer(999), - promoteBuffers: false + promoteBuffers: false, + useNewUrlParser: false } MongoClient.connect('mongodb://127.0.0.1:27017/test', options, function (err: mongodb.MongoError, client: mongodb.MongoClient) { if (err) throw err; @@ -37,27 +38,27 @@ MongoClient.connect('mongodb://127.0.0.1:27017/test', options, function (err: mo // Intentionally omitted type annotation from 'count'. // This way it requires a more accurate typedef which allows inferring that it's a number. - collection.count(function (err: mongodb.MongoError, count) { + collection.countDocuments(function (err: mongodb.MongoError, count) { console.log(format("count = %s", count)); }); - collection.count().then(function (count: number) { + collection.countDocuments().then(function (count: number) { console.log(format("count = %s", count)); }); - collection.count({ foo: 1 }, function (err: mongodb.MongoError, count: number) { + collection.countDocuments({ foo: 1 }, function (err: mongodb.MongoError, count: number) { console.log(format("count = %s", count)); }); - collection.count({ foo: 1 }).then(function (count: number) { + collection.countDocuments({ foo: 1 }).then(function (count: number) { console.log(format("count = %s", count)); }); - collection.count({ foo: 1 }, { limit: 10 }, function (err: mongodb.MongoError, count: number) { + collection.countDocuments({ foo: 1 }, { limit: 10 }, function (err: mongodb.MongoError, count: number) { console.log(format("count = %s", count)); }); - collection.count({ foo: 1 }, { limit: 10 }).then(function (count: number) { + collection.countDocuments({ foo: 1 }, { limit: 10 }).then(function (count: number) { console.log(format("count = %s", count)); }); @@ -121,6 +122,31 @@ MongoClient.connect('mongodb://127.0.0.1:27017/test', options, function (err: mo let payment: { total: number }; type payment = typeof payment; let cursor: mongodb.AggregationCursor = collection.aggregate([{}]) + + collection.aggregate([{ $match: { bar: 1 } }, { $limit: 10 }]) + collection.aggregate([{ $match: { bar: 1 } }]).limit(10) + collection.aggregate([]).match({ bar: 1 }).limit(10) + collection.aggregate().match({ bar: 1 }).limit(10) + + collection.aggregate( + [{ $match: { bar: 1 } }], + function (err: mongodb.MongoError, cursor: mongodb.AggregationCursor) { + cursor.limit(10) + } + ) + + collection.aggregate( + [], + function (err: mongodb.MongoError, cursor: mongodb.AggregationCursor) { + cursor.match({ bar: 1 }).limit(10) + } + ) + + collection.aggregate( + function (err: mongodb.MongoError, cursor: mongodb.AggregationCursor) { + cursor.match({ bar: 1 }).limit(10) + } + ) } // test for new typings diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 0c46add635..4a327e60f2 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Mongoose 5.0.15 +// Type definitions for Mongoose 5.2.1 // Project: http://mongoosejs.com/ // Definitions by: horiuchi // sindrenm @@ -7,6 +7,7 @@ // jendrikw // Ethan Resnick // vologa +// jussikinnula // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -376,6 +377,9 @@ declare module "mongoose" { /** Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info. */ ciphers?: string; ecdhCurve?: string; + + /** Flag for using new URL string parser instead of current (deprecated) one */ + useNewUrlParser?: boolean; // TODO safe?: any; diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index 796ae086e3..0188d0893a 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -28,7 +28,8 @@ const connection2: Promise = mongoose.connect(connectUri, { autoIndex: true }, mongos: true, - bufferCommands: false + bufferCommands: false, + useNewUrlParser: true }); const connection3: null = mongoose.connect(connectUri, function (error) { error.stack; diff --git a/types/move-concurrently/index.d.ts b/types/move-concurrently/index.d.ts index 277c1299f1..75434a4224 100644 --- a/types/move-concurrently/index.d.ts +++ b/types/move-concurrently/index.d.ts @@ -2,7 +2,7 @@ // Project: https://www.npmjs.com/package/move-concurrently // Definitions by: Melvin Groenhoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.8 /** * Recursively moves from to to and resolves its promise when finished. If to already exists then the promise will be rejected with an EEXIST error. diff --git a/types/mssql/index.d.ts b/types/mssql/index.d.ts index 272abb5e39..109a515515 100644 --- a/types/mssql/index.d.ts +++ b/types/mssql/index.d.ts @@ -1,6 +1,12 @@ // Type definitions for mssql 4.0.5 // Project: https://www.npmjs.com/package/mssql -// Definitions by: COLSA Corporation , Ben Farr , Vitor Buzinaro , Matt Richardson , Jørgen Elgaard Larsen , Peter Keuter +// Definitions by: COLSA Corporation +// Ben Farr +// Vitor Buzinaro +// Matt Richardson +// Jørgen Elgaard Larsen +// Peter Keuter +// David Gasperoni // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -311,8 +317,10 @@ export declare class PreparedStatement extends events.EventEmitter { public output(name: string, type: (() => ISqlType) | ISqlType): PreparedStatement; public prepare(statement?: string): Promise; public prepare(statement?: string, callback?: (err?: Error) => void): PreparedStatement; - public execute(values: Object): Promise; - public execute(values: Object, callback: (err?: Error) => void): Request; + public execute(values: Object): Promise>; + public execute(values: Object): Promise>; + public execute(values: Object, callback: (err?: Error, result?: IProcedureResult) => void): Request; + public execute(values: Object, callback: (err?: Error, result?: IProcedureResult) => void): Request; public unprepare(): Promise; public unprepare(callback: (err?: Error) => void): PreparedStatement; } diff --git a/types/nano/index.d.ts b/types/nano/index.d.ts index 7fafa72382..3e3faeb3cb 100644 --- a/types/nano/index.d.ts +++ b/types/nano/index.d.ts @@ -855,6 +855,9 @@ declare namespace nano { descending?: boolean; // Stop returning records when the specified key is reached. + endkey?: string; + + // Stop returning records when the specified key is reached. end_key is an alias for endkey end_key?: string; // Stop returning records when the specified document ID is reached. @@ -883,6 +886,9 @@ declare namespace nano { stale?: string; // Return records starting with the specified key. + startkey?: string; + + // Return records starting with the specified key. start_key is an alias for startkey start_key?: string; // Return records starting with the specified document ID. diff --git a/types/nanographql/index.d.ts b/types/nanographql/index.d.ts new file mode 100644 index 0000000000..36bec2367a --- /dev/null +++ b/types/nanographql/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for nanographql 2.0 +// Project: https://github.com/yoshuawuyts/nanographql +// Definitions by: Christopher Dieringer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +export = nanographql; + +declare function nanographql(query: TemplateStringsArray): (variables?: object) => string; diff --git a/types/nanographql/nanographql-tests.ts b/types/nanographql/nanographql-tests.ts new file mode 100644 index 0000000000..ecff5ce5e9 --- /dev/null +++ b/types/nanographql/nanographql-tests.ts @@ -0,0 +1,10 @@ +import gql = require('nanographql'); +const queryFactory = gql` +query($name: String!) { + movie (name: $name) { + releaseDate + } +} +`; +const query = queryFactory({ name: 'Back to the Future' }); +JSON.parse(query); diff --git a/types/nanographql/tsconfig.json b/types/nanographql/tsconfig.json new file mode 100644 index 0000000000..6784900b60 --- /dev/null +++ b/types/nanographql/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", + "nanographql-tests.ts" + ] +} diff --git a/types/nanographql/tslint.json b/types/nanographql/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/nanographql/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/next/document.d.ts b/types/next/document.d.ts index 0955877d61..0b21fb53c8 100644 --- a/types/next/document.d.ts +++ b/types/next/document.d.ts @@ -42,13 +42,21 @@ export interface DocumentProps { head?: Array>; errorHtml?: string; styles?: Array>; - [key: string]: any; } -export class Head extends React.Component {} +export interface HeadProps { + nonce?: string; + [key: string]: any; +} + +export interface NextScriptProps { + nonce?: string; +} + +export class Head extends React.Component {} export class Main extends React.Component {} -export class NextScript extends React.Component {} +export class NextScript extends React.Component {} export default class extends React.Component { static getInitialProps(ctx: NextDocumentContext): Promise | DocumentProps; } diff --git a/types/next/index.d.ts b/types/next/index.d.ts index 27ffa974fd..904209dd2d 100644 --- a/types/next/index.d.ts +++ b/types/next/index.d.ts @@ -5,6 +5,7 @@ // James Hegedus // Resi Respati // Scott Jones +// Joao Vieira // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 diff --git a/types/next/test/next-document-tests.tsx b/types/next/test/next-document-tests.tsx index f727262b0e..40f01adfef 100644 --- a/types/next/test/next-document-tests.tsx +++ b/types/next/test/next-document-tests.tsx @@ -11,6 +11,13 @@ const basicResults = ( ); +const withNonce = ( + + + + +); + class MyDoc extends Document { static async getInitialProps({ renderPage }: NextDocumentContext) { // without callback diff --git a/types/nock/index.d.ts b/types/nock/index.d.ts index 90eae08189..afebacf1e5 100644 --- a/types/nock/index.d.ts +++ b/types/nock/index.d.ts @@ -1,17 +1,20 @@ -// Type definitions for nock v9.1.3 +// Type definitions for nock v9.3.3 // Project: https://github.com/node-nock/nock // Definitions by: bonnici // Horiuchi_H // afharo // Matt R. Wilson // Garanzha Dmitriy +// GP // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// +import { Url } from 'url'; + export = nock; -declare function nock(basePath: string | RegExp, options?: nock.Options): nock.Scope; +declare function nock(basePath: string | RegExp | Url, options?: nock.Options): nock.Scope; declare namespace nock { export function cleanAll(): void; diff --git a/types/nock/nock-tests.ts b/types/nock/nock-tests.ts index 7ed4ecc25d..06f8458bcb 100644 --- a/types/nock/nock-tests.ts +++ b/types/nock/nock-tests.ts @@ -1,5 +1,6 @@ import nock = require('nock'); import * as fs from 'fs'; +import { URL } from 'url'; var scope: nock.Scope; var inst: nock.Interceptor; @@ -144,6 +145,11 @@ var couchdb = nock('http://myapp.iriscouch.com') email: 'pedro.teixeira@gmail.com' }); +// Using URL as input +var scope = nock(new URL('https://example.org/')) + .get('/resource') + .reply(200, 'url matched'); + // Specifying hostname var scope = nock('http://www.example.com') .get('/resource') diff --git a/types/node-dijkstra/index.d.ts b/types/node-dijkstra/index.d.ts new file mode 100644 index 0000000000..20c97d7425 --- /dev/null +++ b/types/node-dijkstra/index.d.ts @@ -0,0 +1,148 @@ +// Type definitions for node-dijkstra 2.5 +// Project: https://github.com/albertorestifo/node-dijkstra +// Definitions by: Jorge López +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare class Graph { + /** + * Creates a new Graph, optionally initializing it a nodes graph representation. + * + * A graph representation is an object that has as keys the name of the point and as values + * the points reachable from that node, with the cost to get there: + * + * { + * node (Number|String): { + * neighbor (Number|String): cost (Number), + * ..., + * }, + * } + * + * In alternative to an object, you can pass a `Map` of `Map`. This will + * allow you to specify numbers as keys. + * + * @param [graph] - Initial graph definition + * @example + * + * const route = new Graph(); + * + * // Pre-populated graph + * const route = new Graph({ + * A: { B: 1 }, + * B: { A: 1, C: 2, D: 4 }, + * }); + * + * // Passing a Map + * const g = new Map() + * + * const a = new Map() + * a.set('B', 1) + * + * const b = new Map() + * b.set('A', 1) + * b.set('C', 2) + * b.set('D', 4) + * + * g.set('A', a) + * g.set('B', b) + * + * const route = new Graph(g) + */ + constructor(nodes?: any[]); + + /** + * Adds a node to the graph + * + * @param name - Name of the node + * @param neighbors - Neighboring nodes and cost to reach them + * @example + * + * const route = new Graph(); + * + * route.addNode('A', { B: 1 }); + * + * // It's possible to chain the calls + * route + * .addNode('B', { A: 1 }) + * .addNode('C', { A: 3 }); + * + * // The neighbors can be expressed in a Map + * const d = new Map() + * d.set('A', 2) + * d.set('B', 8) + * + * route.addNode('D', d) + */ + addNode(name: string, neighbors: any): Graph; + + /** + * Removes a node and all of its references from the graph + * + * @param key - Key of the node to remove from the graph + * @example + * + * const route = new Graph({ + * A: { B: 1, C: 5 }, + * B: { A: 3 }, + * C: { B: 2, A: 2 }, + * }); + * + * route.removeNode('C'); + * // The graph now is: + * // { A: { B: 1 }, B: { A: 3 } } + */ + removeNode(name: string): Graph; + + /** + * Compute the shortest path between the specified nodes + * + * @param start - Starting node + * @param goal - Node we want to reach + * @param [options] - Options + * + * @param [options.trim] - Exclude the origin and destination nodes from the result + * @param [options.reverse] - Return the path in reversed order + * @param [options.cost] - Also return the cost of the path when set to true + * + * @return Computed path between the nodes. + * + * When `option.cost` is set to true, the returned value will be an object with shape: + * - `path` *(Array)*: Computed path between the nodes + * - `cost` *(Number)*: Cost of the path + * + * @example + * + * const route = new Graph() + * + * route.addNode('A', { B: 1 }) + * route.addNode('B', { A: 1, C: 2, D: 4 }) + * route.addNode('C', { B: 2, D: 1 }) + * route.addNode('D', { C: 1, B: 4 }) + * + * route.path('A', 'D') // => ['A', 'B', 'C', 'D'] + * + * // trimmed + * route.path('A', 'D', { trim: true }) // => [B', 'C'] + * + * // reversed + * route.path('A', 'D', { reverse: true }) // => ['D', 'C', 'B', 'A'] + * + * // include the cost + * route.path('A', 'D', { cost: true }) + * // => { + * // path: [ 'A', 'B', 'C', 'D' ], + * // cost: 4 + * // } + */ + path(start: any, goal: any, options ?: PathOption): any; +} + +interface PathOption { + trim ?: boolean; + reverse ?: boolean; + cost ?: boolean; + avoid ?: any[]; +} + +export = Graph; diff --git a/types/node-dijkstra/node-dijkstra-tests.ts b/types/node-dijkstra/node-dijkstra-tests.ts new file mode 100644 index 0000000000..b6a8fbff9a --- /dev/null +++ b/types/node-dijkstra/node-dijkstra-tests.ts @@ -0,0 +1,12 @@ +import Graph = require('node-dijkstra'); + +const graph = new Graph(); +const graph2 = new Graph([{A: {B: 1}}]); + +graph + .addNode('A', {B: 1}) + .removeNode('C'); + +graph2.path('A', 'B'); +graph.path('A', 'B', {cost: false, reverse: true}); +graph.path('A', 'B', {cost: true}); diff --git a/types/node-dijkstra/tsconfig.json b/types/node-dijkstra/tsconfig.json new file mode 100644 index 0000000000..41f3b852bf --- /dev/null +++ b/types/node-dijkstra/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "esModuleInterop": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "node-dijkstra-tests.ts" + ] +} diff --git a/types/node-dijkstra/tslint.json b/types/node-dijkstra/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/node-dijkstra/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/node-mysql-wrapper/index.d.ts b/types/node-mysql-wrapper/index.d.ts index 170ff5eca0..82170b4704 100644 --- a/types/node-mysql-wrapper/index.d.ts +++ b/types/node-mysql-wrapper/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/nodets/node-mysql-wrapper // Definitions by: Makis Maropoulos // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/node/index.d.ts b/types/node/index.d.ts index f7699a7361..c0e58d12c8 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -1249,6 +1249,7 @@ declare module "http" { } export class Agent { + maxFreeSockets: number; maxSockets: number; sockets: any; requests: any; @@ -4471,6 +4472,17 @@ declare module "fs" { /** Constant for fs.access(). File can be executed by the calling process. */ export const X_OK: number; + // File Copy Constants + + /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */ + export const COPYFILE_EXCL: number; + + /** Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink. If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used. */ + export const COPYFILE_FICLONE: number; + + /** Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink. If the underlying platform does not support copy-on-write, then the operation will fail with an error. */ + export const COPYFILE_FICLONE_FORCE: number; + // File Open Constants /** Constant for fs.open(). Flag indicating to open a file for read-only access. */ @@ -4584,9 +4596,6 @@ declare module "fs" { /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */ export const S_IXOTH: number; - - /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */ - export const COPYFILE_EXCL: number; } /** @@ -5894,10 +5903,10 @@ declare module "crypto" { export function pseudoRandomBytes(size: number): Buffer; export function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; - export function randomFillSync(buffer: ArrayBufferView, offset?: number, size?: number): ArrayBufferView; - export function randomFill(buffer: ArrayBufferView, callback: (err: Error | null, buf: ArrayBufferView) => void): void; - export function randomFill(buffer: ArrayBufferView, offset: number, callback: (err: Error | null, buf: ArrayBufferView) => void): void; - export function randomFill(buffer: ArrayBufferView, offset: number, size: number, callback: (err: Error | null, buf: ArrayBufferView) => void): void; + export function randomFillSync(buffer: T, offset?: number, size?: number): T; + export function randomFill(buffer: T, callback: (err: Error | null, buf: T) => void): void; + export function randomFill(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void; + export function randomFill(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void; export interface ScryptOptions { N?: number; @@ -6417,6 +6426,8 @@ declare module "assert" { export function rejects(block: Function | Promise, error: Function | RegExp | Object | Error, message?: string): Promise; export function doesNotReject(block: Function | Promise, message?: string): Promise; export function doesNotReject(block: Function | Promise, error: Function | RegExp | Object | Error, message?: string): Promise; + + export var strict: typeof internal; } export = internal; @@ -6700,6 +6711,9 @@ declare module "constants" { export var R_OK: number; export var W_OK: number; export var X_OK: number; + export var COPYFILE_EXCL: number; + export var COPYFILE_FICLONE: number; + export var COPYFILE_FICLONE_FORCE: number; export var UV_UDP_REUSEADDR: number; export var SIGQUIT: number; export var SIGTRAP: number; diff --git a/types/node/node-tests.ts b/types/node/node-tests.ts index e9319d705d..ac27280687 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -87,6 +87,8 @@ namespace assert_tests { assert.strictEqual(1, 1, "uses === comparator"); assert.throws(() => { throw new Error("a hammer at your face"); }, undefined, "DODGED IT"); + + assert.strict.strict.deepEqual([[[1, 2, 3]], 4, 5], [[[1, 2, '3']], 4, 5]); } } @@ -390,8 +392,12 @@ namespace fs_tests { { fs.copyFile('/path/to/src', '/path/to/dest', (err) => console.error(err)); fs.copyFile('/path/to/src', '/path/to/dest', fs.constants.COPYFILE_EXCL, (err) => console.error(err)); + fs.copyFile('/path/to/src', '/path/to/dest', fs.constants.COPYFILE_FICLONE, (err) => console.error(err)); + fs.copyFile('/path/to/src', '/path/to/dest', fs.constants.COPYFILE_FICLONE_FORCE, (err) => console.error(err)); fs.copyFileSync('/path/to/src', '/path/to/dest', fs.constants.COPYFILE_EXCL); + fs.copyFileSync('/path/to/src', '/path/to/dest', fs.constants.COPYFILE_FICLONE); + fs.copyFileSync('/path/to/src', '/path/to/dest', fs.constants.COPYFILE_FICLONE_FORCE); const cf = util.promisify(fs.copyFile); cf('/path/to/src', '/path/to/dest', fs.constants.COPYFILE_EXCL).then(console.log); diff --git a/types/node/v0/index.d.ts b/types/node/v0/index.d.ts index b88dd54a0c..dce2a1a54d 100644 --- a/types/node/v0/index.d.ts +++ b/types/node/v0/index.d.ts @@ -594,6 +594,7 @@ declare module "http" { } export class Agent { + maxFreeSockets: number; maxSockets: number; sockets: any; requests: any; diff --git a/types/node/v4/index.d.ts b/types/node/v4/index.d.ts index 3b5a8e4594..bdce459efe 100644 --- a/types/node/v4/index.d.ts +++ b/types/node/v4/index.d.ts @@ -854,6 +854,7 @@ declare module "http" { } export class Agent { + maxFreeSockets: number; maxSockets: number; sockets: any; requests: any; diff --git a/types/node/v6/index.d.ts b/types/node/v6/index.d.ts index ded12da186..9cceb11e71 100644 --- a/types/node/v6/index.d.ts +++ b/types/node/v6/index.d.ts @@ -929,6 +929,7 @@ declare module "http" { } export class Agent { + maxFreeSockets: number; maxSockets: number; sockets: any; requests: any; diff --git a/types/node/v7/index.d.ts b/types/node/v7/index.d.ts index fd9b32f673..b93c70017b 100644 --- a/types/node/v7/index.d.ts +++ b/types/node/v7/index.d.ts @@ -926,6 +926,7 @@ declare module "http" { } export class Agent { + maxFreeSockets: number; maxSockets: number; sockets: any; requests: any; diff --git a/types/node/v8/index.d.ts b/types/node/v8/index.d.ts index 3e153570d6..da0db26be4 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -1139,6 +1139,7 @@ declare module "http" { } export class Agent { + maxFreeSockets: number; maxSockets: number; sockets: any; requests: any; diff --git a/types/node/v9/index.d.ts b/types/node/v9/index.d.ts index d11f93e382..86866daa77 100644 --- a/types/node/v9/index.d.ts +++ b/types/node/v9/index.d.ts @@ -1227,6 +1227,7 @@ declare module "http" { } export class Agent { + maxFreeSockets: number; maxSockets: number; sockets: any; requests: any; diff --git a/types/numeral/index.d.ts b/types/numeral/index.d.ts index 3a22584b3c..16d5a68692 100644 --- a/types/numeral/index.d.ts +++ b/types/numeral/index.d.ts @@ -22,6 +22,14 @@ interface NumeralJSLocale { }; } +interface NumeralJSOptions { + currentLocale: string; + zeroFormat: string; + nullFormat: string; + defaultFormat: string; + scalePercentBy100: boolean; +} + type RoundingFunction = (value: number) => number; // http://numeraljs.com/#custom-formats @@ -41,7 +49,8 @@ interface Numeral { (value?: any): Numeral; version: string; isNumeral: boolean; - + options: NumeralJSOptions; + /** * This function sets the current locale. If no arguments are passed in, * it will simply return the current global locale key. diff --git a/types/numeral/numeral-tests.ts b/types/numeral/numeral-tests.ts index b58d6e7411..79f66efed4 100644 --- a/types/numeral/numeral-tests.ts +++ b/types/numeral/numeral-tests.ts @@ -90,3 +90,8 @@ numeral.locale('fr'); // return the current locale numeral.locale(); // 'fr' + +// test changing an option +numeral.options.scalePercentBy100 = false +numeral(50).formatCurrency('0%') +// '50%' \ No newline at end of file diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 4b6773e7f0..e44bf07c3c 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Office.js // Project: http://dev.office.com -// Definitions by: OfficeDev , Lance Austin , Michael Zlatkovsky , Kim Brandl , Ricky Kirkham , Alex Jerabek +// Definitions by: OfficeDev , Lance Austin , Michael Zlatkovsky , Kim Brandl , Ricky Kirkham , Alex Jerabek , Elizabeth Samuel // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -405,7 +405,7 @@ declare namespace Office { * @remarks *
HostsAccess, Excel, Outlook, PowerPoint, Project, Word
*/ - error: Error; + error: Office.Error; /** * Gets the payload or content of this asynchronous operation, if any. * @@ -447,7 +447,7 @@ declare namespace Office { /** * Gets the locale (language) specified by the user for the UI of the Office host application. * @remarks - * When using in Outlook,the applicable modes are Compose or read. + * When using in Outlook, the applicable modes are Compose or read. */ displayLanguage: string; /** @@ -478,7 +478,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ mailbox: Mailbox; /** @@ -503,7 +503,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ roamingSettings: RoamingSettings; /** @@ -554,7 +554,7 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted * - * Applicable Outlook modeCompose or Read + * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read */ interface Event { @@ -576,7 +576,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param options Optional. An object literal that contains one or more of the following properties. * allowEvent: A boolean value. When the completed method is used to signal completion of an event handler, this value indicates of the handled event should continue execution or be canceled. For example, an add-in that handles the ItemSend event can set allowEvent = false to cancel sending of the message. @@ -608,6 +608,9 @@ declare namespace Office { * * *
HostsWord, Excel, Outlook, PowerPoint
Requirement setsDialogApi, Mailbox 1.4
+ * + * This method is available in the DialogApi requirement set for Word, Excel, or PowerPoint add-ins, and in the Mailbox requirement set 1.4 for Outlook. + * For more on how to specify a requirement set in your manifest, see {@link https://docs.microsoft.com/en-us/office/dev/add-ins/develop/specify-office-hosts-and-api-requirements | Specify Office hosts and API requirements}. * * The initial page must be on the same domain as the parent page (the startAddress parameter). After the initial page loads, you can go to other domains. * @@ -749,6 +752,8 @@ declare namespace Office { interface Auth { /** * Calls the Azure Active Directory V 2.0 endpoint to get an access token to your add-in's web application. Allows add-ins to identify users. Server side code can use this token to access Microsoft Graph for the add-in's web application by using the {@link https://docs.microsoft.com/azure/active-directory/develop/active-directory-v2-protocols-oauth-on-behalf-of | "on behalf of" OAuth flow}. + * + * Important: In Outlook, this API is not supported if the add-in is loaded in an Outlook.com or Gmail mailbox. * * @remarks * @@ -1508,7 +1513,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - addHandlerAsync(eventType: EventType, handler: any, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Returns the data contained within the binding. * @@ -1535,7 +1540,7 @@ declare namespace Office { * @param options Provides options to determine which event handler or handlers are removed. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - removeHandlerAsync(eventType: EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; /** * Writes data to the bound section of the document represented by the specified binding object. * @@ -1816,7 +1821,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getAllAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAllAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Retrieves a binding based on its Name * @@ -1831,7 +1836,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getByIdAsync(id: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getByIdAsync(id: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes the binding from the document * @@ -1846,7 +1851,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - releaseByIdAsync(id: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + releaseByIdAsync(id: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } /** * Represents an XML node in a tree in a document. @@ -1896,7 +1901,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getNodesAsync(xPath: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getNodesAsync(xPath: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets the node value. * @@ -1908,7 +1913,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getNodeValueAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getNodeValueAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets the text of an XML node in a custom XML part. * @@ -1920,7 +1925,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getTextAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getTextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets the node's XML. * @@ -1932,7 +1937,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getXmlAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getXmlAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets the node value. * @@ -1945,7 +1950,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - setNodeValueAsync(value: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setNodeValueAsync(value: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously sets the text of an XML node in a custom XML part. * @@ -1958,7 +1963,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - setTextAsync(text: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setTextAsync(text: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets the node XML. * @@ -1971,7 +1976,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - setXmlAsync(xml: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setXmlAsync(xml: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } /** * Represents a single CustomXMLPart in an {@link Office.CustomXmlParts} collection. @@ -2023,7 +2028,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - addHandlerAsync(eventType: EventType, handler: (result: any) => void, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: (result: any) => void, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Deletes the Custom XML Part. * @@ -2035,7 +2040,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - deleteAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + deleteAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets any CustomXmlNodes in this custom XML part which match the specified XPath. * @@ -2048,7 +2053,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getNodesAsync(xPath: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getNodesAsync(xPath: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the XML inside this custom XML part. * @@ -2060,7 +2065,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getXmlAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getXmlAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes an event handler for the specified event type. * @@ -2074,7 +2079,7 @@ declare namespace Office { * @param options Provides options to determine which event handler or handlers are removed. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - removeHandlerAsync(eventType: EventType, handler?: (result: any) => void, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, handler?: (result: any) => void, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; } /** @@ -2162,7 +2167,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - addAsync(xml: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addAsync(xml: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the specified custom XML part by its id. * @@ -2175,7 +2180,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getByIdAsync(id: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getByIdAsync(id: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the specified custom XML part(s) by its namespace. * @@ -2188,7 +2193,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getByNamespaceAsync(ns: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getByNamespaceAsync(ns: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } /** * Represents a collection of CustomXmlPart objects. @@ -2212,7 +2217,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - addNamespaceAsync(prefix: string, ns: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addNamespaceAsync(prefix: string, ns: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the namespace mapped to the specified prefix. * @@ -2227,7 +2232,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getNamespaceAsync(prefix: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getNamespaceAsync(prefix: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the prefix for the specified namespace. * @@ -2242,7 +2247,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getPrefixAsync(ns: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getPrefixAsync(ns: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } /** * An abstract class that represents the document the add-in is interacting with. @@ -2303,7 +2308,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - addHandlerAsync(eventType: EventType, handler: any, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Returns the state of the current view of the presentation (edit or read). * @@ -2317,7 +2322,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getActiveViewAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getActiveViewAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Returns the entire document file in slices of up to 4194304 bytes (4 MB). For add-ins for iOS, file slice is supported up to 65536 (64 KB). Note that specifying file slice size of above permitted limit will result in an "Internal Error" failure. * @@ -2356,7 +2361,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getFilePropertiesAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getFilePropertiesAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Reads the data contained in the current selection in the document. * @@ -2410,7 +2415,7 @@ declare namespace Office { * * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getSelectedDataAsync(coercionType: CoercionType, options?: GetSelectedDataOptions, callback?: (result: AsyncResult) => void): void; + getSelectedDataAsync(coerciontype: Office.CoercionType, options?: GetSelectedDataOptions, callback?: (result: AsyncResult) => void): void; /** * Goes to the specified object or location in the document. * @@ -2447,7 +2452,7 @@ declare namespace Office { * @param options Provides options to determine which event handler or handlers are removed. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - removeHandlerAsync(eventType: EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; /** * Writes the specified data into the current selection. * @@ -2460,54 +2465,29 @@ declare namespace Office { * * The following application-specific actions apply when writing data to a selection. * - * - Word + *
HostsExcel, OneNote, Outlook, PowerPoint, Word
+ * + * + * + * + * + * + * * - * - If there is no selection and the insertion point is at a valid location, the specified `data` is inserted at the insertion point as follows: + * + * + * + * + * + * + * * - * - If `data` is a string, the specified text is inserted. + * + * * - * - If `data` is an array of arrays ("matrix") or a TableData object, a new Word table is inserted. + * + *
WordIf there is no selection and the insertion point is at a valid location, the specified `data` is inserted at the insertion pointIf `data` is a string, the specified text is inserted.
If `data` is an array of arrays ("matrix") or a TableData object, a new Word table is inserted.
If `data` is HTML, the specified HTML is inserted. (Important: If any of the HTML you insert is invalid, Word won't raise an error. Word will insert as much of the HTML as it can and omits any invalid data).
If `data` is Office Open XML, the specified XML is inserted.
If `data` is a base64 encoded image stream, the specified image is inserted.
If there is a selectionIt will be replaced with the specified `data` following the same rules as above.
Insert imagesInserted images are placed inline. The imageLeft and imageTop parameters are ignored. The image aspect ratio is always locked. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
ExcelIf a single cell is selectedIf `data` is a string, the specified text is inserted as the value of the current cell.
If `data` is an array of arrays ("matrix"), the specified set of rows and columns are inserted, if no other data in surrounding cells will be overwritten.
If `data` is a TableData object, a new Excel table with the specified set of rows and headers is inserted, if no other data in surrounding cells will be overwritten.
If multiple cells are selectedIf the shape does not match the shape of `data`, an error is returned.
If the shape of the selection exactly matches the shape of `data`, the values of the selected cells are updated based on the values in `data`.
Insert imagesInserted images are floating. The position imageLeft and imageTop parameters are relative to currently selected cell(s). Negative imageLeft and imageTop values are allowed and possibly readjusted by Excel to position the image inside a worksheet. Image aspect ratio is locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
All other casesAn error is returned.
Excel OnlineIn addition to the behaviors described for Excel above, these limits apply when writing data in Excel OnlineThe total number of cells you can write to a worksheet with the `data` parameter can't exceed 20,000 in a single call to this method.
The number of formatting groups passed to the `cellFormat` parameter can't exceed 100. A single formatting group consists of a set of formatting applied to a specified range of cells.
PowerPointInsert imageInserted images are floating. The position imageLeft and imageTop parameters are optional but if provided, both should be present. If a single value is provided, it will be ignored. Negative imageLeft and imageTop values are allowed and can position an image outside of a slide. If no optional parameter is given and slide has a placeholder, the image will replace the placeholder in the slide. Image aspect ratio will be locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
* - * - If `data` is HTML, the specified HTML is inserted. (Important: If any of the HTML you insert is invalid, Word won't raise an error. Word will insert as much of the HTML as it can and omits any invalid data). - * - * - If `data` is Office Open XML, the specified XML is inserted. - * - * - If `data` is a base64 encoded image stream, the specified image is inserted. - * - * - If there is a selection, it will be replaced with the specified `data` following the same rules as above. - * - * - Insert images: Inserted images are placed inline. The imageLeft and imageTop parameters are ignored. The image aspect ratio is always locked. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio. - * - * - Excel - * - * - If a single cell is selected: - * - * - If `data` is a string, the specified text is inserted as the value of the current cell. - * - * - If `data` is an array of arrays ("matrix"), the specified set of rows and columns are inserted, if no other data in surrounding cells will be overwritten. - * - * - If `data` is a TableData object, a new Excel table with the specified set of rows and headers is inserted, if no other data in surrounding cells will be overwritten. - * - * - If multiple cells are selected and the shape does not match the shape of `data`, an error is returned. - * - * - If multiple cells are selected and the shape of the selection exactly matches the shape of `data`, the values of the selected cells are updated based on the values in `data`. - * - * - Insert images: Inserted images are floating. The position imageLeft and imageTop parameters are relative to currently selected cell(s). Negative imageLeft and imageTop values are allowed and possibly readjusted by Excel to position the image inside a worksheet. Image aspect ratio is locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio. - * - * - In all other cases, an error is returned. - * - * - Excel Online - * - * - In addition to the behaviors described for Excel above, the following limits apply when writing data in Excel Online. - * - * - The total number of cells you can write to a worksheet with the `data` parameter can't exceed 20,000 in a single call to this method. - * - * - The number of formatting groups passed to the `cellFormat` parameter can't exceed 100. A single formatting group consists of a set of formatting applied to a specified range of cells. - * - * - PowerPoint - * - * - Inserted images are floating. The position imageLeft and imageTop parameters are optional but if provided, both should be present. If a single value is provided, it will be ignored. Negative imageLeft and imageTop values are allowed and can position an image outside of a slide. If no optional parameter is given and slide has a placeholder, the image will replace the placeholder in the slide. Image aspect ratio will be locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio. - * * @param data The data to be set. Either a string or {@link Office.CoercionType} value, 2d array or TableData object. * * The possible CoercionTypes that can be used for the data parameter, or for the coercionType option, vary by host: @@ -2546,7 +2526,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getProjectFieldAsync(fieldId: number, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getProjectFieldAsync(fieldId: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get resource field for provided resource Id. (Ex.ResourceName) * @param resourceId Either a string or value of the Resource Id. @@ -2554,32 +2534,32 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getResourceFieldAsync(resourceId: string, fieldId: number, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getResourceFieldAsync(resourceId: string, fieldId: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the current selected Resource's Id. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getSelectedResourceAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getSelectedResourceAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the current selected Task's Id. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getSelectedTaskAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getSelectedTaskAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the current selected View Type (Ex. Gantt) and View Name. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getSelectedViewAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getSelectedViewAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the Task Name, WSS Task Id, and ResourceNames for given taskId. * @param taskId Either a string or value of the Task Id. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getTaskAsync(taskId: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getTaskAsync(taskId: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get task field for provided task Id. (Ex. StartDate). * @param taskId Either a string or value of the Task Id. @@ -2587,13 +2567,75 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getTaskFieldAsync(taskId: string, fieldId: number, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getTaskFieldAsync(taskId: string, fieldId: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the WSS Url and list name for the Tasks List, the MPP is synced too. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getWSSUrlAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getWSSUrlAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + /** + * Project documents only. Get the maximum index of the collection of resources in the current project. + * + * Important: This API works only in Project 2016 on Windows desktop. + * + * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + */ + getMaxResourceIndexAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + /** + * Project documents only. Get the maximum index of the collection of tasks in the current project. + * + * Important: This API works only in Project 2016 on Windows desktop. + * + * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + */ + getMaxTaskIndexAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + /** + * Project documents only. Get the GUID of the resource that has the specified index in the resource collection. + * + * Important: This API works only in Project 2016 on Windows desktop. + * + * @param resourceIndex The index of the resource in the collection of resources for the project. + * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + */ + getResourceByIndexAsync(resourceIndex: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + /** + * Project documents only. Get the GUID of the task that has the specified index in the task collection. + * + * Important: This API works only in Project 2016 on Windows desktop. + * + * @param taskIndex The index of the task in the collection of tasks for the project. + * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + */ + getTaskByIndexAsync(taskIndex: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + /** + * Project documents only. Set resource field for specified resource Id. + * + * Important: This API works only in Project 2016 on Windows desktop. + * + * @param resourceId Either a string or value of the Resource Id. + * @param fieldId Resource Fields. + * @param fieldValue Value of the target field. + * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + */ + setResourceFieldAsync(resourceId: string, fieldId: number, fieldValue: string | number | boolean | object, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + /** + * Project documents only. Set task field for specified task Id. + * + * Important: This API works only in Project 2016 on Windows desktop. + * + * @param taskId Either a string or value of the Task Id. + * @param fieldId Task Fields. + * @param fieldValue Value of the target field. + * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + */ + setTaskFieldAsync(taskId: string, fieldId: number, fieldValue: string | number | boolean | object, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } /** * Provides information about the document that raised the SelectionChanged event. @@ -2803,7 +2845,7 @@ declare namespace Office { * * */ - addHandlerAsync(eventType: EventType, handler: any, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Retrieves the specified setting. * @@ -2892,7 +2934,7 @@ declare namespace Office { * When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter. * In the callback function passed to the removeHandlerAsync method, you can use the properties of the AsyncResult object to return the following information. */ - removeHandlerAsync(eventType: EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; /** * Persists the in-memory copy of the settings property bag in the document. * @@ -3065,7 +3107,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - addColumnsAsync(tableData: TableData | any[][], options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addColumnsAsync(tableData: TableData | any[][], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds the specified data to the table as additional rows. * @@ -3090,7 +3132,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - addRowsAsync(rows: TableData | any[][], options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addRowsAsync(rows: TableData | any[][], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Deletes all non-header rows and their values in the table, shifting appropriately for the host application. * @@ -3104,7 +3146,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - deleteAllDataValuesAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + deleteAllDataValuesAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Clears formatting on the bound table. * @@ -3118,7 +3160,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - clearFormatsAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + clearFormatsAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets the formatting on specified items in the table. * @param cellReference An object literal containing name-value pairs that specify the range of cells to get formatting from. @@ -3126,7 +3168,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - getFormatsAsync(cellReference?: any, formats?: any[], options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getFormatsAsync(cellReference?: any, formats?: any[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets formatting on specified items and data in the table. * @@ -3173,9 +3215,9 @@ declare namespace Office { * * * Office.Table.Headers - * + * Specifies only the header row. * - * + *
* * The `format:` property specifies values that correspond to a subset of the settings available in the Format Cells dialog box in Excel (Right-click > Format Cells or Home > Format > Format Cells). * @@ -3247,7 +3289,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ - setFormatsAsync(cellFormat?: any[], options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setFormatsAsync(cellFormat?: any[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Updates table formatting options on the bound table. * @@ -3287,7 +3329,7 @@ declare namespace Office { * */ - setTableOptionsAsync(tableOptions: any, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setTableOptionsAsync(tableOptions: any, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } /** * Represents the data in a table or a {@link Office.TableBinding}. @@ -5470,7 +5512,9 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * Applicable Outlook mode: Compose or read + *
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} + * Compose or read
*/ enum AttachmentType { /** @@ -5492,7 +5536,9 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * Applicable Outlook mode: Compose or read + *
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} + * Compose or read
* * @beta */ @@ -5544,7 +5590,9 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * Applicable Outlook mode: Compose or read + *
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} + * Compose or read
*/ enum EntityType { /** @@ -5582,7 +5630,9 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - * Applicable Outlook mode: Compose or read + *
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} + * Compose or read
*/ enum ItemNotificationMessageType { /** @@ -5604,7 +5654,9 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * Applicable Outlook mode: Compose or read + *
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} + * Compose or read
*/ enum ItemType { /** @@ -5622,8 +5674,10 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * Applicable Outlook mode: Compose or read - * + *
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} + * Compose or read
+ * * @beta */ enum Month { @@ -5682,7 +5736,9 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * Applicable Outlook mode: Compose or read + *
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} + * Compose or read
*/ enum RecipientType { /** @@ -5708,8 +5764,10 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * Applicable Outlook mode: Compose or read - * + *
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} + * Compose or read
+ * * @beta */ enum RecurrenceTimeZone { @@ -6266,8 +6324,10 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * Applicable Outlook mode: Compose or read - * + *
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} + * Compose or read
+ * * @beta */ enum RecurrenceType { @@ -6298,7 +6358,9 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * Applicable Outlook mode: Compose or read + *
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} + * Compose or read
*/ enum ResponseType { /** @@ -6328,7 +6390,9 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - * Applicable Outlook mode: Compose or read + *
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} + * Compose or read
*/ enum RestVersion { /** @@ -6350,8 +6414,10 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * Applicable Outlook mode: Compose or read - * + *
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} + * Compose or read
+ * * @beta */ enum WeekNumber { @@ -6390,6 +6456,160 @@ declare namespace Office { */ Subject } + /** + * The AppointmentForm namespace is used to access the currently selected appointment. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ */ + interface AppointmentForm { + /** + * Gets an object that provides methods for manipulating the body of an item. + * + * [Api set: Mailbox 1.1] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ */ + body: string; + /** + * Gets or sets the date and time that the appointment is to end. + * + * The end property is expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the end property value to the client's local date and time. + * + * *Read mode* + * + * The end property returns a Date object. + * + * *Compose mode* + * + * The end property returns a Time object. + * + * When you use the Time.setAsync method to set the end time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ */ + end: Date; + /** + * Gets or sets the location of an appointment. + * + * *Read mode* + * + * The location property returns a string that contains the location of the appointment. + * + * *Compose mode* + * + * The location property returns a Location object that provides methods that are used to get and set the location of the appointment. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ */ + location: string; + /** + * Provides access to the optional attendees of an event. The type of object and level of access depends on the mode of the current item. + * + * *Read mode* + * + * The optionalAttendees property returns an array that contains an EmailAddressDetails object for each optional attendee to the meeting. + * + * *Compose mode* + * + * The optionalAttendees property returns a Recipients object that provides methods to get or update the optional attendees for a meeting. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ */ + optionalAttendees: string[] | EmailAddressDetails[]; + resources: string[]; + /** + * Provides access to the required attendees of an event. The type of object and level of access depends on the mode of the current item. + * + * *Read mode* + * + * The requiredAttendees property returns an array that contains an EmailAddressDetails object for each required attendee to the meeting. + * + * *Compose mode* + * + * The requiredAttendees property returns a Recipients object that provides methods to get or update the required attendees for a meeting. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ */ + requiredAttendees: string[] | EmailAddressDetails[]; + /** + * Gets or sets the date and time that the appointment is to begin. + * + * The start property is expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the value to the client's local date and time. + * + * *Read mode* + * + * The start property returns a Date object. + * + * *Compose mode* + * + * The start property returns a Time object. + * + * When you use the Time.setAsync method to set the start time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ */ + start: Date; + /** + * Gets or sets the description that appears in the subject field of an item. + * + * The subject property gets or sets the entire subject of the item, as sent by the email server. + * + * *Read mode* + * + * The subject property returns a string. Use the normalizedSubject property to get the subject minus any leading prefixes such as RE: and FW:. + * + * *Compose mode* + * + * The subject property returns a Subject object that provides methods to get and set the subject. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ */ + subject: string; + } /** * Represents an attachment on an item from the server. Read mode only. * @@ -6400,7 +6620,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read */ interface AttachmentDetails { /** @@ -6436,7 +6656,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ interface Body { /** @@ -6451,18 +6671,18 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * In addition to the main signature, this method also has this signature: * - * `getAsync(coercionType: CoercionType, callback: (result: AsyncResult) => void): void;` + * `getAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void;` * * @param coercionType The format for the returned body. * @param options Optional. An object literal that contains one or more of the following properties: * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. The body is provided in the requested format in the asyncResult.value property. */ - getAsync(coercionType: CoercionType, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAsync(coerciontype: Office.CoercionType, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Returns the current body in a specified format. * @@ -6475,12 +6695,12 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param coercionType The format for the returned body. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. The body is provided in the requested format in the asyncResult.value property. */ - getAsync(coercionType: CoercionType, callback: (result: AsyncResult) => void): void; + getAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; /** * Gets a value that indicates whether the content is in HTML or text format. @@ -6490,13 +6710,13 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. The content type is returned as one of the CoercionType values in the asyncResult.value property. */ - getTypeAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getTypeAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds the specified content to the beginning of the item body. * @@ -6509,13 +6729,13 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.
* * In addition to the main signature, this method also has these signatures: * - * `prependAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions): void;` + * `prependAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` * * `prependAsync(data: string, callback: (result: AsyncResult) => void): void;` * @@ -6527,7 +6747,7 @@ declare namespace Office { * coercionType: The desired format for the body. The string in the data parameter will be converted to this format. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. Any errors encountered will be provided in the asyncResult.error property. */ - prependAsync(data: string, options?: AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; + prependAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Adds the specified content to the beginning of the item body. * @@ -6540,7 +6760,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.
* @@ -6549,7 +6769,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * coercionType: The desired format for the body. The string in the data parameter will be converted to this format. */ - prependAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions): void; + prependAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; /** * Adds the specified content to the beginning of the item body. * @@ -6561,7 +6781,7 @@ declare namespace Office { * * @remarks * - * + * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.
* * @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters. @@ -6579,7 +6799,7 @@ declare namespace Office { * * @remarks * - * + * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.
* * @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters. @@ -6597,13 +6817,13 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.
InvalidFormatError - The options.coercionType parameter is set to Office.CoercionType.Html and the message body is in plain text.
* * In addition to the main signature, this method also has these signatures: * - * `setAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions): void;` + * `setAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` * * `setAsync(data: string, callback: (result: AsyncResult) => void): void;` * @@ -6615,7 +6835,7 @@ declare namespace Office { * coercionType: The desired format for the body. The string in the data parameter will be converted to this format. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. Any errors encountered will be provided in the asyncResult.error property. */ - setAsync(data: string, options?: AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; + setAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Replaces the entire body with the specified text. * @@ -6628,7 +6848,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.
InvalidFormatError - The options.coercionType parameter is set to Office.CoercionType.Html and the message body is in plain text.
* @@ -6637,7 +6857,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * coercionType: The desired format for the body. The string in the data parameter will be converted to this format. */ - setAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions): void; + setAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; /** * Replaces the entire body with the specified text. * @@ -6650,7 +6870,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.
InvalidFormatError - The options.coercionType parameter is set to Office.CoercionType.Html and the message body is in plain text.
* @@ -6670,7 +6890,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.
InvalidFormatError - The options.coercionType parameter is set to Office.CoercionType.Html and the message body is in plain text.
* @@ -6690,13 +6910,13 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.
InvalidFormatError - The options.coercionType parameter is set to Office.CoercionType.Html and the message body is in plain text.
* * In addition to the main signature, this method also has these signatures: * - * `setSelectedDataAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions): void;` + * `setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` * * `setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;` * @@ -6708,7 +6928,7 @@ declare namespace Office { * coercionType: The desired format for the body. The string in the data parameter will be converted to this format. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. Any errors encountered will be provided in the asyncResult.error property. */ - setSelectedDataAsync(data: string, options?: AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Replaces the selection in the body with the specified text. * @@ -6721,7 +6941,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.
InvalidFormatError - The options.coercionType parameter is set to Office.CoercionType.Html and the message body is in plain text.
* @@ -6730,7 +6950,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * coercionType: The desired format for the body. The string in the data parameter will be converted to this format. */ - setSelectedDataAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions): void; + setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; /** * Replaces the selection in the body with the specified text. * @@ -6743,7 +6963,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.
InvalidFormatError - The options.coercionType parameter is set to Office.CoercionType.Html and the message body is in plain text.
* @@ -6763,7 +6983,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.
InvalidFormatError - The options.coercionType parameter is set to Office.CoercionType.Html and the message body is in plain text.
* @@ -6781,7 +7001,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read */ interface Contact { /** @@ -6819,7 +7039,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ interface CustomProperties { /** @@ -6832,7 +7052,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ get(name: string): any; /** @@ -6847,7 +7067,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param name The name of the property to be set. * @param value The value of the property to be set. @@ -6864,7 +7084,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ remove(name: string): void; /** @@ -6882,7 +7102,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ saveAsync(callback?: (result: AsyncResult) => void, asyncContext?: any): void; } @@ -6894,7 +7114,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ interface Diagnostics { /** @@ -6907,7 +7127,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ hostName: string; /** @@ -6920,7 +7140,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ hostVersion: string; /** @@ -6943,7 +7163,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ OWAView: "string"; } @@ -6955,7 +7175,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ interface EmailAddressDetails { /** @@ -6983,7 +7203,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read */ interface EmailUser { /** @@ -7015,7 +7235,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read */ interface Entities { /** @@ -7056,7 +7276,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * * @beta */ @@ -7073,7 +7293,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * * In addition to this signature, the method also has the following signature: * @@ -7083,7 +7303,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. */ - getAsync(options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** * Gets the from value of a message. * @@ -7097,7 +7317,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. */ @@ -7117,6 +7337,44 @@ declare namespace Office { * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of `Office.context.mailbox.item`. Refer to the Object Model pages for more information. */ interface AppointmentCompose extends Appointment, ItemCompose { + /** + * Gets an object that provides methods for manipulating the body of an item. + * + * [Api set: Mailbox 1.1] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ */ + body: Office.Body; + /** + * Gets the date and time that an item was created. Read mode only. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ */ + dateTimeCreated: Date; + /** + * Gets the date and time that an item was last modified. Read mode only. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * Note: This member is not supported in Outlook for iOS or Outlook for Android. + */ + dateTimeModifed: Date; /** * Gets or sets the date and time that the appointment is to end. * @@ -7130,102 +7388,9 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer */ end: Time; - /** - * Gets or sets the {@link Office.Location} of an appointment. The location property returns a Location object that provides methods that are used to get and set the location of the appointment. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
- */ - location: Location; - /** - * Provides access to the optional attendees of an event. The type of object and level of access depends on the mode of the current item. The optionalAttendees property returns an {@link Office.Recipients} object that provides methods to get or update the optional attendees for a meeting. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
- */ - optionalAttendees: Recipients; - /** - * Provides access to the required attendees of an event. The type of object and level of access depends on the mode of the current item. The requiredAttendees property returns an {@link Office.Recipients} object that provides methods to get or update the required attendees for a meeting. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
- */ - requiredAttendees: Recipients; - /** - * Gets or sets the date and time that the appointment is to begin. - * - * The start property is an {@link Office.Time} object expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the value to the client's local date and time. - * - * When you use the Time.setAsync method to set the start time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
- */ - start: Time; - - // Repeated Item fields // - - /** - * Gets an object that provides methods for manipulating the body of an item. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
- */ - body: Body; - /** - * Gets the date and time that an item was created. Read mode only. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
- */ - dateTimeCreated: Date; - /** - * Gets the date and time that an item was last modified. Read mode only. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
- * - * Note: This member is not supported in Outlook for iOS or Outlook for Android. - */ - dateTimeModifed: Date; /** * Gets the type of item that an instance represents. * @@ -7237,9 +7402,21 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer */ itemType: Office.MailboxEnums.ItemType; + /** + * Gets or sets the {@link Office.Location} of an appointment. The location property returns a Location object that provides methods that are used to get and set the location of the appointment. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ */ + location: Location; /** * Gets the notification messages for an item. * @@ -7249,10 +7426,21 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer */ - notificationMessages: NotificationMessages; - + notificationMessages: Office.NotificationMessages; + /** + * Provides access to the optional attendees of an event. The type of object and level of access depends on the mode of the current item. The optionalAttendees property returns an {@link Office.Recipients} object that provides methods to get or update the optional attendees for a meeting. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ */ + optionalAttendees: Recipients; /** * Gets or sets the recurrence pattern of an appointment. * @@ -7268,12 +7456,23 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer * * @beta */ recurrence: Recurrence; - + /** + * Provides access to the required attendees of an event. The type of object and level of access depends on the mode of the current item. The requiredAttendees property returns an {@link Office.Recipients} object that provides methods to get or update the required attendees for a meeting. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ */ + requiredAttendees: Recipients; /** * Gets the id of the series that an instance belongs to. * @@ -7289,129 +7488,28 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer * * @beta */ seriesId: string; - /** - * Adds an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] + * Gets or sets the date and time that the appointment is to begin. * - * @remarks - * - * + * The start property is an {@link Office.Time} object expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the value to the client's local date and time. * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
- * - * In addition to this signature, the method also has the following signature: - * - * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` - * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param options Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; - - /** - * Adds an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] + * When you use the Time.setAsync method to set the start time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. + * + * [Api set: Mailbox 1.0] * * @remarks * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
- * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta + * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer */ - addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; - - /** - * Asynchronously loads custom properties for this add-in on the selected item. - * - * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. - * - * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
- * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. - */ - loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; - - /** - * Removes an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
- * - * In addition to this signature, the method also has the following signature: - * - * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` - * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param options Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; - - /** - * Removes an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
- * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; - - /** + start: Time; + /** * Gets or sets the description that appears in the subject field of an item. * * The subject property gets or sets the entire subject of the item, as sent by the email server. @@ -7424,7 +7522,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer */ subject: Subject; /** @@ -7439,7 +7537,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeAppointment Organizer
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -7447,7 +7545,7 @@ declare namespace Office { * * `addFileAttachmentAsync(uri: string, attachmentName: string): void;` * - * `addFileAttachmentAsync(uri: string, attachmentName: string, options: AsyncContextOptions): void;` + * `addFileAttachmentAsync(uri: string, attachmentName: string, options: Office.AsyncContextOptions): void;` * * `addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void;` * @@ -7458,7 +7556,7 @@ declare namespace Office { * inInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the attachment list. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. * @@ -7471,7 +7569,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeAppointment Organizer
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -7491,7 +7589,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeAppointment Organizer
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -7501,7 +7599,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * inInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the attachment list. */ - addFileAttachmentAsync(uri: string, attachmentName: string, options: AsyncContextOptions): void; + addFileAttachmentAsync(uri: string, attachmentName: string, options: Office.AsyncContextOptions): void; /** * Adds a file to a message or appointment as an attachment. * @@ -7514,7 +7612,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeAppointment Organizer
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -7523,7 +7621,52 @@ declare namespace Office { * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void; - + /** + * Adds an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * In addition to this signature, the method also has the following signature: + * + * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param options Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Adds an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -7538,7 +7681,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeAppointment Organizer
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -7546,7 +7689,7 @@ declare namespace Office { * * `addItemAttachmentAsync(itemId: any, attachmentName: string): void;` * - * `addItemAttachmentAsync(itemId: any, attachmentName: string, options: AsyncContextOptions): void;` + * `addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void;` * * `addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void;` * @@ -7556,7 +7699,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -7571,7 +7714,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeAppointment Organizer
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -7593,7 +7736,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeAppointment Organizer
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -7602,7 +7745,7 @@ declare namespace Office { * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options: AsyncContextOptions): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -7617,7 +7760,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeAppointment Organizer
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -7626,7 +7769,6 @@ declare namespace Office { * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void; - /** * Closes the current item that is being composed * @@ -7642,7 +7784,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
Applicable Outlook modeAppointment Organizer
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer */ close(): void; /** @@ -7656,7 +7798,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer * * More information on {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | actionable messages}. * @@ -7666,7 +7808,7 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * @@ -7683,14 +7825,14 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeAppointment Organizer
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer * * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. If HTML, the method returns the selected text, whether it is plaintext or HTML. * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. */ - getSelectedDataAsync(coercionType: CoercionType, options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + getSelectedDataAsync(coerciontype: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * @@ -7707,12 +7849,31 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeAppointment Organizer
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer * * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. If HTML, the method returns the selected text, whether it is plaintext or HTML. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. */ - getSelectedDataAsync(coercionType: CoercionType, callback: (result: AsyncResult) => void): void; + getSelectedDataAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; + /** + * Asynchronously loads custom properties for this add-in on the selected item. + * + * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. + * + * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. + */ + loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; /** * Removes an attachment from a message or appointment. * @@ -7724,7 +7885,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeAppointment Organizer
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -7732,7 +7893,7 @@ declare namespace Office { * * `removeAttachmentAsync(attachmentIndex: string): void;` * - * `removeAttachmentAsync(attachmentIndex: string, options: AsyncContextOptions): void;` + * `removeAttachmentAsync(attachmentIndex: string, options: Office.AsyncContextOptions): void;` * * `removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void;` * @@ -7741,7 +7902,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentIndex: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + removeAttachmentAsync(attachmentIndex: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * @@ -7753,7 +7914,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeAppointment Organizer
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -7771,7 +7932,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeAppointment Organizer
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -7779,7 +7940,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. */ - removeAttachmentAsync(attachmentIndex: string, options: AsyncContextOptions): void; + removeAttachmentAsync(attachmentIndex: string, options: Office.AsyncContextOptions): void; /** * Removes an attachment from a message or appointment. * @@ -7791,7 +7952,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeAppointment Organizer
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -7799,7 +7960,52 @@ declare namespace Office { * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void; - + /** + * Removes an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * In addition to this signature, the method also has the following signature: + * + * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param options Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Removes an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * @@ -7821,7 +8027,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeAppointment Organizer
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -7829,7 +8035,7 @@ declare namespace Office { * * `saveAsync(): void;` * - * `saveAsync(options: AsyncContextOptions): void;` + * `saveAsync(options: Office.AsyncContextOptions): void;` * * `saveAsync(callback: (result: AsyncResult) => void): void;` * @@ -7837,7 +8043,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - saveAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + saveAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * @@ -7859,7 +8065,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeAppointment Organizer
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -7886,14 +8092,14 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeAppointment Organizer
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. */ - saveAsync(options: AsyncContextOptions): void; + saveAsync(options: Office.AsyncContextOptions): void; /** * Asynchronously saves an item. * @@ -7915,7 +8121,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeAppointment Organizer
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -7933,7 +8139,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeAppointment Organizer
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -7941,7 +8147,7 @@ declare namespace Office { * * `setSelectedDataAsync(data: string): void;` * - * `setSelectedDataAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions): void;` + * `setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` * * `setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;` * @@ -7951,7 +8157,7 @@ declare namespace Office { * coercionType: If text, the current style is applied in Outlook Web App and Outlook. If the field is an HTML editor, only the text data is inserted, even if the data is HTML. If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; if the field is text, then plain text is used. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - setSelectedDataAsync(data: string, options?: AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -7963,7 +8169,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeAppointment Organizer
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -7981,7 +8187,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeAppointment Organizer
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -7990,7 +8196,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * coercionType: If text, the current style is applied in Outlook Web App and Outlook. If the field is an HTML editor, only the text data is inserted, even if the data is HTML. If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; if the field is text, then plain text is used. */ - setSelectedDataAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions): void; + setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -8002,7 +8208,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeAppointment Organizer
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -8011,12 +8217,66 @@ declare namespace Office { */ setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; } + /** * The appointment attendee mode of {@link Office.Item | Office.context.mailbox.item}. * * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of 'Office.context.mailbox.item'. Refer to the Object Model pages for more information. */ interface AppointmentRead extends Appointment, ItemRead { + /** + * Gets an array of attachments for the item. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * Note: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. For more information, see {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. + * + */ + attachments: Office.AttachmentDetails[]; + /** + * Gets an object that provides methods for manipulating the body of an item. + * + * [Api set: Mailbox 1.1] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ */ + body: Office.Body; + /** + * Gets the date and time that an item was created. Read mode only. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ */ + dateTimeCreated: Date; + /** + * Gets the date and time that an item was last modified. Read mode only. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * Note: This member is not supported in Outlook for iOS or Outlook for Android. + */ + dateTimeModifed: Date; /** * Gets the date and time that the appointment is to end. * @@ -8030,318 +8290,9 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee */ end: Date; - /** - * Gets the location of an appointment. - * - * The location property returns a string that contains the location of the appointment. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- */ - location: string; - /** - * Provides access to the optional attendees of an event. The type of object and level of access depends on the mode of the current item. - * - * The optionalAttendees property returns an array that contains an {@link Office.EmailAddressDetails} object for each optional attendee to the meeting. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- */ - optionalAttendees: EmailAddressDetails[]; - /** - * Gets the email address of the meeting organizer for a specified meeting. Read mode only. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- */ - organizer: EmailAddressDetails; - /** - * Provides access to the required attendees of an event. The type of object and level of access depends on the mode of the current item. - * - * The requiredAttendees property returns an array that contains an {@link Office.EmailAddressDetails} object for each required attendee to the meeting. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- */ - requiredAttendees: EmailAddressDetails[]; - /** - * Gets the date and time that the appointment is to begin. - * - * The start property is a Date object expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the value to the client's local date and time. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- */ - start: Date; - - // Repeated Item Fields // - - /** - * Gets an object that provides methods for manipulating the body of an item. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- */ - body: Body; - /** - * Gets the date and time that an item was created. Read mode only. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- */ - dateTimeCreated: Date; - /** - * Gets the date and time that an item was last modified. Read mode only. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- * - * Note: This member is not supported in Outlook for iOS or Outlook for Android. - */ - dateTimeModifed: Date; - /** - * Gets the type of item that an instance represents. - * - * The itemType property returns one of the ItemType enumeration values, indicating whether the item object instance is a message or an appointment. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- */ - itemType: Office.MailboxEnums.ItemType; - /** - * Gets the notification messages for an item. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- */ - notificationMessages: NotificationMessages; - - /** - * Gets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. - * - * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance in a series. null is returned for single appointments and meeting requests of single appointments. - * - * Note: Meeting requests have an itemClass value of IPM.Schedule.Meeting.Request. - * - * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment and NOT a part of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- * - * @beta - */ - recurrence: Recurrence; - - /** - * Gets the id of the series that an instance belongs to. - * - * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. However, in iOS and Android, the seriesId returns the REST ID of the parent item. - * - * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. - * - * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests and returns undefined for any other items that are not meeting requests. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- * - * @beta - */ - seriesId: string; - - /** - * Adds an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- * - * In addition to this signature, the method also has the following signature: - * - * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` - * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param options Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; - - /** - * Adds an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; - - /** - * Asynchronously loads custom properties for this add-in on the selected item. - * - * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. - * - * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. - */ - loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; - - /** - * Removes an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- * - * In addition to this signature, the method also has the following signature: - * - * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` - * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param options Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; - - /** - * Removes an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; - - /** - * Gets an array of attachments for the item. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- * - * Note: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. For more information, see {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. - * - */ - attachments: AttachmentDetails[]; /** * Gets the Exchange Web Services item class of the selected item. * @@ -8354,7 +8305,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * * The itemClass property specifies the message class of the selected item. The following are the default message classes for the message or appointment item. * @@ -8378,7 +8329,6 @@ declare namespace Office { * */ itemClass: string; - /** * Gets the Exchange Web Services item identifier for the current item. * @@ -8392,9 +8342,37 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee */ itemId: string; + /** + * Gets the type of item that an instance represents. + * + * The itemType property returns one of the ItemType enumeration values, indicating whether the item object instance is a message or an appointment. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ */ + itemType: Office.MailboxEnums.ItemType; + /** + * Gets the location of an appointment. + * + * The location property returns a string that contains the location of the appointment. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ */ + location: string; /** * Gets the subject of an item, with all prefixes removed (including RE: and FWD:). * @@ -8406,9 +8384,115 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee */ normalizedSubject: string; + /** + * Gets the notification messages for an item. + * + * [Api set: Mailbox 1.3] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ */ + notificationMessages: Office.NotificationMessages; + /** + * Provides access to the optional attendees of an event. The type of object and level of access depends on the mode of the current item. + * + * The optionalAttendees property returns an array that contains an {@link Office.EmailAddressDetails} object for each optional attendee to the meeting. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ */ + optionalAttendees: EmailAddressDetails[]; + /** + * Gets the email address of the meeting organizer for a specified meeting. Read mode only. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ */ + organizer: EmailAddressDetails; + /** + * Gets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. + * + * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance in a series. null is returned for single appointments and meeting requests of single appointments. + * + * Note: Meeting requests have an itemClass value of IPM.Schedule.Meeting.Request. + * + * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment and NOT a part of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * @beta + */ + recurrence: Recurrence; + /** + * Provides access to the required attendees of an event. The type of object and level of access depends on the mode of the current item. + * + * The requiredAttendees property returns an array that contains an {@link Office.EmailAddressDetails} object for each required attendee to the meeting. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ */ + requiredAttendees: EmailAddressDetails[]; + /** + * Gets the date and time that the appointment is to begin. + * + * The start property is a Date object expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the value to the client's local date and time. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ */ + start: Date; + /** + * Gets the id of the series that an instance belongs to. + * + * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. However, in iOS and Android, the seriesId returns the REST ID of the parent item. + * + * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. + * + * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests and returns undefined for any other items that are not meeting requests. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * @beta + */ + seriesId: string; /** * Gets the description that appears in the subject field of an item. * @@ -8422,9 +8506,57 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee */ subject: string; + + /** + * Adds an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * In addition to this signature, the method also has the following signature: + * + * `addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param options Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + + /** + * Adds an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Displays a reply form that includes the sender and all recipients of the selected message or the organizer and all attendees of the selected appointment. * @@ -8441,7 +8573,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * * @param formData A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB * OR @@ -8465,7 +8597,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * * @param formData A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB. * OR @@ -8483,7 +8615,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * * In addition to this signature, the method also has the following signature: * @@ -8495,7 +8627,7 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. * @@ -8507,7 +8639,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. On success, the initialization data is provided in the asyncResult.value property as a string. If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. * @@ -8525,7 +8657,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee */ getEntities(): Entities; /** @@ -8543,7 +8675,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
Applicable Outlook modeAppointment Attendee
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * * While the minimum permission level to use this method is Restricted, some entity types require ReadItem to access, as specified in the following table. * @@ -8604,7 +8736,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * * @param name The name of the ItemHasKnownEntity rule element that defines the filter to match. * @returns If there is no ItemHasKnownEntity element in the manifest with a FilterName element value that matches the name parameter, the method returns null. If the name parameter does match an ItemHasKnownEntity element in the manifest, but there are no entities in the current item that match, the method return an empty array. @@ -8628,7 +8760,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee */ getRegExMatches(): any; /** @@ -8649,7 +8781,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * * @param name The name of the ItemHasRegularExpressionMatch rule element that defines the filter to match. */ @@ -8665,7 +8797,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * * @param name The name of the ItemHasRegularExpressionMatch rule element that defines the filter to match. */ @@ -8688,332 +8820,9 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee */ getSelectedRegExMatches(): any; - } - - /** - * The AppointmentForm namespace is used to access the currently selected appointment. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
Applicable Outlook modeCompose or read
- */ - interface AppointmentForm { - /** - * Gets an object that provides methods for manipulating the body of an item. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
- */ - body: string; - /** - * Gets or sets the date and time that the appointment is to end. - * - * The end property is expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the end property value to the client's local date and time. - * - * *Read mode* - * - * The end property returns a Date object. - * - * *Compose mode* - * - * The end property returns a Time object. - * - * When you use the Time.setAsync method to set the end time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
- */ - end: Date; - /** - * Gets or sets the location of an appointment. - * - * *Read mode* - * - * The location property returns a string that contains the location of the appointment. - * - * *Compose mode* - * - * The location property returns a Location object that provides methods that are used to get and set the location of the appointment. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
- */ - location: string; - /** - * Provides access to the optional attendees of an event. The type of object and level of access depends on the mode of the current item. - * - * *Read mode* - * - * The optionalAttendees property returns an array that contains an EmailAddressDetails object for each optional attendee to the meeting. - * - * *Compose mode* - * - * The optionalAttendees property returns a Recipients object that provides methods to get or update the optional attendees for a meeting. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
- */ - optionalAttendees: string[] | EmailAddressDetails[]; - resources: string[]; - /** - * Provides access to the required attendees of an event. The type of object and level of access depends on the mode of the current item. - * - * *Read mode* - * - * The requiredAttendees property returns an array that contains an EmailAddressDetails object for each required attendee to the meeting. - * - * *Compose mode* - * - * The requiredAttendees property returns a Recipients object that provides methods to get or update the required attendees for a meeting. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
- */ - requiredAttendees: string[] | EmailAddressDetails[]; - /** - * Gets or sets the date and time that the appointment is to begin. - * - * The start property is expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the value to the client's local date and time. - * - * *Read mode* - * - * The start property returns a Date object. - * - * *Compose mode* - * - * The start property returns a Time object. - * - * When you use the Time.setAsync method to set the start time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
- */ - start: Date; - /** - * Gets or sets the description that appears in the subject field of an item. - * - * The subject property gets or sets the entire subject of the item, as sent by the email server. - * - * *Read mode* - * - * The subject property returns a string. Use the normalizedSubject property to get the subject minus any leading prefixes such as RE: and FW:. - * - * *Compose mode* - * - * The subject property returns a Subject object that provides methods to get and set the subject. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
- */ - subject: string; - } - - /** - * The item namespace is used to access the currently selected message, meeting request, or appointment. You can determine the type of the item by using the `itemType` property. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
Applicable Outlook modeCompose or read
- */ - interface Item { - /** - * Gets an object that provides methods for manipulating the body of an item. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
- */ - body: Body; - /** - * Gets the date and time that an item was created. Read mode only. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
- */ - dateTimeCreated: Date; - /** - * Gets the date and time that an item was last modified. Read mode only. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
- * - * Note: This member is not supported in Outlook for iOS or Outlook for Android. - */ - dateTimeModifed: Date; - /** - * Gets the type of item that an instance represents. - * - * The itemType property returns one of the ItemType enumeration values, indicating whether the item object instance is a message or an appointment. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
- */ - itemType: Office.MailboxEnums.ItemType; - /** - * Gets the notification messages for an item. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
- */ - notificationMessages: NotificationMessages; - - /** - * Gets or sets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. Read and compose modes for appointment items. Read mode for meeting request items. - * - * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance in a series. null is returned for single appointments and meeting requests of single appointments. undefined is returned for messages that are not meeting requests. - * - * Note: Meeting requests have an itemClass value of IPM.Schedule.Meeting.Request. - * - * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment and NOT a part of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
- * - * @beta - */ - recurrence: Recurrence; - - /** - * Gets the id of the series that an instance belongs to. - * - * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. However, in iOS and Android, the seriesId returns the REST ID of the parent item. - * - * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. - * - * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests and returns undefined for any other items that are not meeting requests. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
- * - * @beta - */ - seriesId: string; - - /** - * Adds an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
- * - * In addition to this signature, the method also has the following signature: - * - * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` - * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param options Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; - - /** - * Adds an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
- * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; - /** * Asynchronously loads custom properties for this add-in on the selected item. * @@ -9027,7 +8836,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. @@ -9045,7 +8854,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * * In addition to this signature, the method also has the following signature: * @@ -9060,6 +8869,213 @@ declare namespace Office { * @beta */ removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Removes an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; + } + + /** + * The item namespace is used to access the currently selected message, meeting request, or appointment. You can determine the type of the item by using the `itemType` property. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ */ + interface Item { + /** + * Gets an object that provides methods for manipulating the body of an item. + * + * [Api set: Mailbox 1.1] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ */ + body: Office.Body; + /** + * Gets the date and time that an item was created. Read mode only. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ */ + dateTimeCreated: Date; + /** + * Gets the date and time that an item was last modified. Read mode only. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * Note: This member is not supported in Outlook for iOS or Outlook for Android. + */ + dateTimeModifed: Date; + /** + * Gets the type of item that an instance represents. + * + * The itemType property returns one of the ItemType enumeration values, indicating whether the item object instance is a message or an appointment. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ */ + itemType: Office.MailboxEnums.ItemType; + /** + * Gets the notification messages for an item. + * + * [Api set: Mailbox 1.3] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ */ + notificationMessages: Office.NotificationMessages; + + /** + * Gets or sets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. Read and compose modes for appointment items. Read mode for meeting request items. + * + * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance in a series. null is returned for single appointments and meeting requests of single appointments. undefined is returned for messages that are not meeting requests. + * + * Note: Meeting requests have an itemClass value of IPM.Schedule.Meeting.Request. + * + * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment and NOT a part of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * @beta + */ + recurrence: Office.Recurrence; + + /** + * Gets the id of the series that an instance belongs to. + * + * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. However, in iOS and Android, the seriesId returns the REST ID of the parent item. + * + * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. + * + * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests and returns undefined for any other items that are not meeting requests. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * @beta + */ + seriesId: string; + + /** + * Adds an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * In addition to this signature, the method also has the following signature: + * + * `addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param options Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + + /** + * Adds an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void; + + /** + * Asynchronously loads custom properties for this add-in on the selected item. + * + * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. + * + * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. + */ + loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; /** * Removes an event handler for a supported event. @@ -9072,7 +9088,34 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read + * + * In addition to this signature, the method also has the following signature: + * + * `removeHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param options Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + removeHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + + /** + * Removes an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
* * @param eventType The event that should invoke the handler. * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. @@ -9080,7 +9123,7 @@ declare namespace Office { * * @beta */ - removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void; } /** * The compose mode of {@link Office.Item | Office.context.mailbox.item}. @@ -9101,7 +9144,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ subject: Subject; /** @@ -9116,7 +9159,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -9124,7 +9167,7 @@ declare namespace Office { * * `addFileAttachmentAsync(uri: string, attachmentName: string): void;` * - * `addFileAttachmentAsync(uri: string, attachmentName: string, options: AsyncContextOptions): void;` + * `addFileAttachmentAsync(uri: string, attachmentName: string, options: Office.AsyncContextOptions): void;` * * `addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void;` * @@ -9135,7 +9178,7 @@ declare namespace Office { * inInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the attachment list. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. * @@ -9148,7 +9191,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -9168,7 +9211,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -9178,7 +9221,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * inInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the attachment list. */ - addFileAttachmentAsync(uri: string, attachmentName: string, options: AsyncContextOptions): void; + addFileAttachmentAsync(uri: string, attachmentName: string, options: Office.AsyncContextOptions): void; /** * Adds a file to a message or appointment as an attachment. * @@ -9191,7 +9234,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -9215,7 +9258,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -9223,7 +9266,7 @@ declare namespace Office { * * `addItemAttachmentAsync(itemId: any, attachmentName: string): void;` * - * `addItemAttachmentAsync(itemId: any, attachmentName: string, options: AsyncContextOptions): void;` + * `addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void;` * * `addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void;` * @@ -9233,7 +9276,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -9248,7 +9291,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -9270,7 +9313,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -9279,7 +9322,7 @@ declare namespace Office { * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options: AsyncContextOptions): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -9294,7 +9337,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -9319,7 +9362,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
Applicable Outlook modeCompose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose */ close(): void; /** @@ -9333,7 +9376,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read * * More information on {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | actionable messages}. * @@ -9343,7 +9386,7 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * @@ -9360,12 +9403,12 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. If HTML, the method returns the selected text, whether it is plaintext or HTML. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. */ - getSelectedDataAsync(coercionType: CoercionType, callback: (result: AsyncResult) => void): void; + getSelectedDataAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * @@ -9382,14 +9425,14 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. If HTML, the method returns the selected text, whether it is plaintext or HTML. * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. */ - getSelectedDataAsync(coercionType: CoercionType, options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + getSelectedDataAsync(coerciontype: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * @@ -9401,7 +9444,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -9409,7 +9452,7 @@ declare namespace Office { * * `removeAttachmentAsync(attachmentIndex: string): void;` * - * `removeAttachmentAsync(attachmentIndex: string, options: AsyncContextOptions): void;` + * `removeAttachmentAsync(attachmentIndex: string, options: Office.AsyncContextOptions): void;` * * `removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void;` * @@ -9418,7 +9461,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentIndex: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + removeAttachmentAsync(attachmentIndex: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * @@ -9430,7 +9473,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -9448,7 +9491,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -9456,7 +9499,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. */ - removeAttachmentAsync(attachmentIndex: string, options: AsyncContextOptions): void; + removeAttachmentAsync(attachmentIndex: string, options: Office.AsyncContextOptions): void; /** * Removes an attachment from a message or appointment. * @@ -9468,7 +9511,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -9498,7 +9541,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -9506,7 +9549,7 @@ declare namespace Office { * * `saveAsync(): void;` * - * `saveAsync(options: AsyncContextOptions): void;` + * `saveAsync(options: Office.AsyncContextOptions): void;` * * `saveAsync(callback: (result: AsyncResult) => void): void;` * @@ -9514,7 +9557,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - saveAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + saveAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * @@ -9536,7 +9579,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -9563,14 +9606,14 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. */ - saveAsync(options: AsyncContextOptions): void; + saveAsync(options: Office.AsyncContextOptions): void; /** * Asynchronously saves an item. * @@ -9592,7 +9635,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -9610,7 +9653,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -9618,7 +9661,7 @@ declare namespace Office { * * `setSelectedDataAsync(data: string): void;` * - * `setSelectedDataAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions): void;` + * `setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` * * `setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;` * @@ -9628,7 +9671,7 @@ declare namespace Office { * coercionType: If text, the current style is applied in Outlook Web App and Outlook. If the field is an HTML editor, only the text data is inserted, even if the data is HTML. If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; if the field is text, then plain text is used. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - setSelectedDataAsync(data: string, options?: AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -9640,7 +9683,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -9658,7 +9701,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -9667,7 +9710,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * coercionType: If text, the current style is applied in Outlook Web App and Outlook. If the field is an HTML editor, only the text data is inserted, even if the data is HTML. If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; if the field is text, then plain text is used. */ - setSelectedDataAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions): void; + setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -9679,7 +9722,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -9702,12 +9745,12 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read * * Note: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. For more information, see {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. * */ - attachments: AttachmentDetails[]; + attachments: Office.AttachmentDetails[]; /** * Gets the Exchange Web Services item class of the selected item. * @@ -9720,7 +9763,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read * * The itemClass property specifies the message class of the selected item. The following are the default message classes for the message or appointment item. * @@ -9756,7 +9799,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read */ itemId: string; /** @@ -9770,7 +9813,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read */ normalizedSubject: string; /** @@ -9786,7 +9829,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ subject: string; /** @@ -9805,7 +9848,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read * * @param formData A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB * OR @@ -9829,7 +9872,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read * * @param formData A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB. * OR @@ -9847,7 +9890,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read * * In addition to this signature, the method also has the following signature: * @@ -9859,7 +9902,7 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. * @@ -9871,7 +9914,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read * * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. On success, the initialization data is provided in the asyncResult.value property as a string. If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. * @@ -9889,7 +9932,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read */ getEntities(): Entities; /** @@ -9907,7 +9950,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read * * While the minimum permission level to use this method is Restricted, some entity types require ReadItem to access, as specified in the following table. * @@ -9968,7 +10011,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read * * @param name The name of the ItemHasKnownEntity rule element that defines the filter to match. * @returns If there is no ItemHasKnownEntity element in the manifest with a FilterName element value that matches the name parameter, the method returns null. If the name parameter does match an ItemHasKnownEntity element in the manifest, but there are no entities in the current item that match, the method return an empty array. @@ -9992,7 +10035,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read */ getRegExMatches(): any; /** @@ -10013,7 +10056,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read * * @param name The name of the ItemHasRegularExpressionMatch rule element that defines the filter to match. */ @@ -10029,7 +10072,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read * * @param name The name of the ItemHasRegularExpressionMatch rule element that defines the filter to match. */ @@ -10052,7 +10095,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read */ getSelectedRegExMatches(): any; } @@ -10075,7 +10118,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ conversationId: string; } @@ -10095,9 +10138,21 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose */ bcc: Recipients; + /** + * Gets an object that provides methods for manipulating the body of an item. + * + * [Api set: Mailbox 1.1] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ */ + body: Office.Body; /** * Provides access to the Cc (carbon copy) recipients of a message. The type of object and level of access depends on the mode of the current item. * @@ -10109,9 +10164,51 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose */ cc: Recipients; + /** + * Gets an identifier for the email conversation that contains a particular message. + * + * You can get an integer for this property if your mail app is activated in read forms or responses in compose forms. If subsequently the user changes the subject of the reply message, upon sending the reply, the conversation ID for that message will change and that value you obtained earlier will no longer apply. + * + * You get null for this property for a new item in a compose form. If the user sets a subject and saves the item, the conversationId property will return a value. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ */ + conversationId: string; + /** + * Gets the date and time that an item was created. Read mode only. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ */ + dateTimeCreated: Date; + /** + * Gets the date and time that an item was last modified. Read mode only. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * Note: This member is not supported in Outlook for iOS or Outlook for Android. + */ + dateTimeModifed: Date; /** * Gets the email address of the sender of a message. * @@ -10125,66 +10222,11 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose * * @beta */ - from: From; - /** - * Provides access to the recipients on the To line of a message. The type of object and level of access depends on the mode of the current item. - * - * The to property returns a Recipients object that provides methods to get or update the recipients on the To line of the message. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
- */ - to: Recipients; - - // Repeated Item Fields // - - /** - * Gets an object that provides methods for manipulating the body of an item. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
- */ - body: Body; - /** - * Gets the date and time that an item was created. Read mode only. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
- */ - dateTimeCreated: Date; - /** - * Gets the date and time that an item was last modified. Read mode only. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
- * - * Note: This member is not supported in Outlook for iOS or Outlook for Android. - */ - dateTimeModifed: Date; + from: Office.From; /** * Gets the type of item that an instance represents. * @@ -10196,7 +10238,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose */ itemType: Office.MailboxEnums.ItemType; /** @@ -10208,10 +10250,9 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose */ - notificationMessages: NotificationMessages; - + notificationMessages: Office.NotificationMessages; /** * Gets or sets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. Read and compose modes for appointment items. Read mode for meeting request items. * @@ -10227,12 +10268,11 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose * * @beta */ recurrence: Recurrence; - /** * Gets the id of the series that an instance belongs to. * @@ -10248,129 +10288,12 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose * * @beta */ seriesId: string; - /** - * Adds an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
- * - * In addition to this signature, the method also has the following signature: - * - * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` - * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param options Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; - - /** - * Adds an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
- * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; - - /** - * Asynchronously loads custom properties for this add-in on the selected item. - * - * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. - * - * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
- * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. - */ - loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; - - /** - * Removes an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
- * - * In addition to this signature, the method also has the following signature: - * - * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` - * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param options Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; - - /** - * Removes an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
- * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; - - /** * Gets or sets the description that appears in the subject field of an item. * * The subject property gets or sets the entire subject of the item, as sent by the email server. @@ -10383,9 +10306,24 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose */ subject: Subject; + /** + * Provides access to the recipients on the To line of a message. The type of object and level of access depends on the mode of the current item. + * + * The to property returns a Recipients object that provides methods to get or update the recipients on the To line of the message. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ */ + to: Recipients; + /** * Adds a file to a message or appointment as an attachment. * @@ -10398,7 +10336,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeMessage Compose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -10430,7 +10368,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeMessage Compose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -10450,7 +10388,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeMessage Compose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -10473,7 +10411,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeMessage Compose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -10482,7 +10420,52 @@ declare namespace Office { * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void; - + /** + * Adds an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * In addition to this signature, the method also has the following signature: + * + * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param options Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Adds an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -10497,7 +10480,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeMessage Compose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -10505,7 +10488,7 @@ declare namespace Office { * * `addItemAttachmentAsync(itemId: any, attachmentName: string): void;` * - * `addItemAttachmentAsync(itemId: any, attachmentName: string, options: AsyncContextOptions): void;` + * `addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void;` * * `addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void;` * @@ -10515,7 +10498,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -10530,7 +10513,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeMessage Compose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -10552,7 +10535,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeMessage Compose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -10561,7 +10544,7 @@ declare namespace Office { * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options: AsyncContextOptions): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -10576,7 +10559,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeMessage Compose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* @@ -10585,7 +10568,6 @@ declare namespace Office { * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void; - /** * Closes the current item that is being composed * @@ -10601,7 +10583,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
Applicable Outlook modeMessage Compose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose */ close(): void; /** @@ -10615,7 +10597,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose * * More information on {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | actionable messages}. * @@ -10625,7 +10607,7 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * @@ -10642,12 +10624,12 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeMessage Compose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose * * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. If HTML, the method returns the selected text, whether it is plaintext or HTML. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. */ - getSelectedDataAsync(coercionType: CoercionType, callback: (result: AsyncResult) => void): void; + getSelectedDataAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * @@ -10664,14 +10646,33 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeMessage Compose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose * * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. If HTML, the method returns the selected text, whether it is plaintext or HTML. * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. */ - getSelectedDataAsync(coercionType: CoercionType, options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + getSelectedDataAsync(coerciontype: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; + /** + * Asynchronously loads custom properties for this add-in on the selected item. + * + * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. + * + * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. + */ + loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; /** * Removes an attachment from a message or appointment. * @@ -10683,7 +10684,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeMessage Compose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -10691,7 +10692,7 @@ declare namespace Office { * * `removeAttachmentAsync(attachmentIndex: string): void;` * - * `removeAttachmentAsync(attachmentIndex: string, options: AsyncContextOptions): void;` + * `removeAttachmentAsync(attachmentIndex: string, options: Office.AsyncContextOptions): void;` * * `removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void;` * @@ -10700,7 +10701,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentIndex: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + removeAttachmentAsync(attachmentIndex: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * @@ -10712,7 +10713,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeMessage Compose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -10730,7 +10731,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeMessage Compose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -10738,7 +10739,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. */ - removeAttachmentAsync(attachmentIndex: string, options: AsyncContextOptions): void; + removeAttachmentAsync(attachmentIndex: string, options: Office.AsyncContextOptions): void; /** * Removes an attachment from a message or appointment. * @@ -10750,7 +10751,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeMessage Compose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -10758,7 +10759,52 @@ declare namespace Office { * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void; - + /** + * Removes an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * In addition to this signature, the method also has the following signature: + * + * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param options Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Removes an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * @@ -10780,7 +10826,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeMessage Compose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -10788,7 +10834,7 @@ declare namespace Office { * * `saveAsync(): void;` * - * `saveAsync(options: AsyncContextOptions): void;` + * `saveAsync(options: Office.AsyncContextOptions): void;` * * `saveAsync(callback: (result: AsyncResult) => void): void;` * @@ -10796,7 +10842,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - saveAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + saveAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * @@ -10818,7 +10864,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeMessage Compose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -10845,14 +10891,14 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeMessage Compose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. */ - saveAsync(options: AsyncContextOptions): void; + saveAsync(options: Office.AsyncContextOptions): void; /** * Asynchronously saves an item. * @@ -10874,7 +10920,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeMessage Compose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -10892,7 +10938,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeMessage Compose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -10900,7 +10946,7 @@ declare namespace Office { * * `setSelectedDataAsync(data: string): void;` * - * `setSelectedDataAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions): void;` + * `setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` * * `setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;` * @@ -10910,7 +10956,7 @@ declare namespace Office { * coercionType: If text, the current style is applied in Outlook Web App and Outlook. If the field is an HTML editor, only the text data is inserted, even if the data is HTML. If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; if the field is text, then plain text is used. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - setSelectedDataAsync(data: string, options?: AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -10922,7 +10968,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeMessage Compose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -10940,7 +10986,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeMessage Compose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -10949,7 +10995,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * coercionType: If text, the current style is applied in Outlook Web App and Outlook. If the field is an HTML editor, only the text data is inserted, even if the data is HTML. If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; if the field is text, then plain text is used. */ - setSelectedDataAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions): void; + setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -10961,7 +11007,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeMessage Compose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* @@ -10976,6 +11022,33 @@ declare namespace Office { * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the Object Model pages for more information. */ interface MessageRead extends Message, ItemRead { + /** + * Gets an array of attachments for the item. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * Note: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. For more information, see {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. + * + */ + attachments: Office.AttachmentDetails[]; + /** + * Gets an object that provides methods for manipulating the body of an item. + * + * [Api set: Mailbox 1.1] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ */ + body: Office.Body; /** * Provides access to the Cc (carbon copy) recipients of a message. The type of object and level of access depends on the mode of the current item. * @@ -10987,9 +11060,51 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read */ cc: EmailAddressDetails[]; + /** + * Gets an identifier for the email conversation that contains a particular message. + * + * You can get an integer for this property if your mail app is activated in read forms or responses in compose forms. If subsequently the user changes the subject of the reply message, upon sending the reply, the conversation ID for that message will change and that value you obtained earlier will no longer apply. + * + * You get null for this property for a new item in a compose form. If the user sets a subject and saves the item, the conversationId property will return a value. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ */ + conversationId: string; + /** + * Gets the date and time that an item was created. Read mode only. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ */ + dateTimeCreated: Date; + /** + * Gets the date and time that an item was last modified. Read mode only. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * Note: This member is not supported in Outlook for iOS or Outlook for Android. + */ + dateTimeModifed: Date; /** * Gets the email address of the sender of a message. * @@ -11005,7 +11120,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read */ from: EmailAddressDetails; /** @@ -11017,280 +11132,9 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read */ internetMessageId: string; - /** - * Gets the email address of the sender of an email message. - * - * The from and sender properties represent the same person unless the message is sent by a delegate. In that case, the from property represents the delegator, and the sender property represents the delegate. - * - * Note: The recipientType property of the EmailAddressDetails object in the sender property is undefined. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- */ - sender: EmailAddressDetails; - /** - * Provides access to the recipients on the To line of a message. The type of object and level of access depends on the mode of the current item. - * - * The to property returns an array that contains an EmailAddressDetails object for each recipient listed on the To line of the message. The collection is limited to a maximum of 100 members. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- */ - to: EmailAddressDetails[]; - - // Repeated Item Fields // - - /** - * Gets an object that provides methods for manipulating the body of an item. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- */ - body: Body; - /** - * Gets the date and time that an item was created. Read mode only. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- */ - dateTimeCreated: Date; - /** - * Gets the date and time that an item was last modified. Read mode only. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- * - * Note: This member is not supported in Outlook for iOS or Outlook for Android. - */ - dateTimeModifed: Date; - /** - * Gets the type of item that an instance represents. - * - * The itemType property returns one of the ItemType enumeration values, indicating whether the item object instance is a message or an appointment. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- */ - itemType: Office.MailboxEnums.ItemType; - /** - * Gets the notification messages for an item. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
- */ - notificationMessages: NotificationMessages; - - /** - * Gets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. Read and compose modes for appointment items. Read mode for meeting request items. - * - * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance in a series. null is returned for single appointments and meeting requests of single appointments. undefined is returned for messages that are not meeting requests. - * - * Note: Meeting requests have an itemClass value of IPM.Schedule.Meeting.Request. - * - * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment and NOT a part of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- * - * @beta - */ - recurrence: Recurrence; - - /** - * Gets the id of the series that an instance belongs to. - * - * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. However, in iOS and Android, the seriesId returns the REST ID of the parent item. - * - * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. - * - * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests and returns undefined for any other items that are not meeting requests. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- * - * @beta - */ - seriesId: string; - - /** - * Adds an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- * - * In addition to this signature, the method also has the following signature: - * - * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` - * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param options Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; - - /** - * Adds an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; - - /** - * Asynchronously loads custom properties for this add-in on the selected item. - * - * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. - * - * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. - */ - loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; - - /** - * Removes an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- * - * In addition to this signature, the method also has the following signature: - * - * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` - * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param options Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; - - /** - * Removes an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; - - /** - * Gets an array of attachments for the item. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- * - * Note: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. For more information, see {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. - * - */ - attachments: AttachmentDetails[]; /** * Gets the Exchange Web Services item class of the selected item. * @@ -11302,7 +11146,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read * The itemClass property specifies the message class of the selected item. The following are the default message classes for the message or appointment item. * @@ -11339,9 +11183,23 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read */ itemId: string; + /** + * Gets the type of item that an instance represents. + * + * The itemType property returns one of the ItemType enumeration values, indicating whether the item object instance is a message or an appointment. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ */ + itemType: Office.MailboxEnums.ItemType; /** * Gets the subject of an item, with all prefixes removed (including RE: and FWD:). * @@ -11353,9 +11211,77 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read */ normalizedSubject: string; + /** + * Gets the notification messages for an item. + * + * [Api set: Mailbox 1.3] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ */ + notificationMessages: Office.NotificationMessages; + /** + * Gets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. Read and compose modes for appointment items. Read mode for meeting request items. + * + * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance in a series. null is returned for single appointments and meeting requests of single appointments. undefined is returned for messages that are not meeting requests. + * + * Note: Meeting requests have an itemClass value of IPM.Schedule.Meeting.Request. + * + * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment and NOT a part of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * @beta + */ + recurrence: Recurrence; + /** + * Gets the id of the series that an instance belongs to. + * + * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. However, in iOS and Android, the seriesId returns the REST ID of the parent item. + * + * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. + * + * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests and returns undefined for any other items that are not meeting requests. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * @beta + */ + seriesId: string; + /** + * Gets the email address of the sender of an email message. + * + * The from and sender properties represent the same person unless the message is sent by a delegate. In that case, the from property represents the delegator, and the sender property represents the delegate. + * + * Note: The recipientType property of the EmailAddressDetails object in the sender property is undefined. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ */ + sender: EmailAddressDetails; /** * Gets the description that appears in the subject field of an item. * @@ -11369,9 +11295,71 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read */ subject: string; + /** + * Provides access to the recipients on the To line of a message. The type of object and level of access depends on the mode of the current item. + * + * The to property returns an array that contains an EmailAddressDetails object for each recipient listed on the To line of the message. The collection is limited to a maximum of 100 members. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ */ + to: EmailAddressDetails[]; + + /** + * Adds an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * In addition to this signature, the method also has the following signature: + * + * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param options Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + + /** + * Adds an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Displays a reply form that includes the sender and all recipients of the selected message or the organizer and all attendees of the selected appointment. * @@ -11388,7 +11376,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read * * @param formData A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB * OR @@ -11412,7 +11400,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read * * @param formData A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB. * OR @@ -11430,7 +11418,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read * * In addition to this signature, the method also has the following signature: * @@ -11442,7 +11430,7 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. * @@ -11454,7 +11442,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read * * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. On success, the initialization data is provided in the asyncResult.value property as a string. If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. * @@ -11472,7 +11460,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read */ getEntities(): Entities; /** @@ -11491,7 +11479,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read * * While the minimum permission level to use this method is Restricted, some entity types require ReadItem to access, as specified in the following table. * @@ -11552,7 +11540,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read * * @param name The name of the ItemHasKnownEntity rule element that defines the filter to match. * @returns If there is no ItemHasKnownEntity element in the manifest with a FilterName element value that matches the name parameter, the method returns null. If the name parameter does match an ItemHasKnownEntity element in the manifest, but there are no entities in the current item that match, the method return an empty array. @@ -11576,7 +11564,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read */ getRegExMatches(): any; /** @@ -11597,7 +11585,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read * * @param name The name of the ItemHasRegularExpressionMatch rule element that defines the filter to match. */ @@ -11613,7 +11601,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read * * @param name The name of the ItemHasRegularExpressionMatch rule element that defines the filter to match. */ @@ -11636,9 +11624,74 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read */ getSelectedRegExMatches(): any; + /** + * Asynchronously loads custom properties for this add-in on the selected item. + * + * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. + * + * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. + */ + loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; + /** + * Removes an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * In addition to this signature, the method also has the following signature: + * + * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param options Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Removes an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; } /** @@ -11650,7 +11703,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read */ interface LocalClientTime { /** @@ -11694,7 +11747,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose */ interface Location { /** @@ -11711,14 +11764,14 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * * In addition to this signature, the method also has the following signature: * * `getAsync(callback: (result: AsyncResult) => void): void;` * */ - getAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets the location of an appointment. * @@ -11731,7 +11784,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose */ getAsync(callback: (result: AsyncResult) => void): void; /** @@ -11749,7 +11802,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The location parameter is longer than 255 characters.
* @@ -11757,11 +11810,11 @@ declare namespace Office { * * `setAsync(location: string): void;` * - * `setAsync(location: string, options: AsyncContextOptions): void;` + * `setAsync(location: string, options: Office.AsyncContextOptions): void;` * * `setAsync(location: string, callback: (result: AsyncResult) => void): void;` */ - setAsync(location: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setAsync(location: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets the location of an appointment. * @@ -11774,7 +11827,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The location parameter is longer than 255 characters.
*/ @@ -11793,11 +11846,11 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The location parameter is longer than 255 characters.
*/ - setAsync(location: string, options: AsyncContextOptions): void; + setAsync(location: string, options: Office.AsyncContextOptions): void; /** * Sets the location of an appointment. * @@ -11811,7 +11864,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The location parameter is longer than 255 characters.
*/ @@ -11833,7 +11886,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ interface Mailbox { /** @@ -11854,9 +11907,9 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ - diagnostics: Diagnostics; + diagnostics: Office.Diagnostics; /** * Gets the URL of the Exchange Web Services (EWS) endpoint for this email account. Read mode only. * @@ -11870,7 +11923,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * The ewsUrl value can be used by a remote service to make EWS calls to the user's mailbox. For example, you can create a remote service to {@link https://msdn.microsoft.com/library/office/dn148008.aspx | get attachments from the selected item}. * @@ -11896,7 +11949,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * The restUrl value can be used to make {@link https://docs.microsoft.com/outlook/rest/ | REST API} calls to the user's mailbox. */ @@ -11906,7 +11959,7 @@ declare namespace Office { * * More information is under {@link Office.UserProfile} */ - userProfile: UserProfile; + userProfile: Office.UserProfile; /** * Adds an event handler for a supported event. * @@ -11918,14 +11971,14 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param eventType The event that should invoke the handler. * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param options Optional. Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. */ - addHandlerAsync(eventType: EventType, handler: (type: EventType) => void, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: (type: EventType) => void, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Converts an item ID formatted for REST into EWS format. * @@ -11939,7 +11992,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param itemId An item ID formatted for the Outlook REST APIs. * @param restVersion A value indicating the version of the Outlook REST API used to retrieve the item ID. @@ -11958,7 +12011,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param timeValue A Date object. */ @@ -11974,7 +12027,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * Item IDs retrieved via EWS or via the itemId property use a different format than the format used by REST APIs (such as the {@link https://msdn.microsoft.com/office/office365/APi/mail-rest-operations | Outlook Mail API} or the {@link http://graph.microsoft.io/ | Microsoft Graph}. The convertToRestId method converts an EWS-formatted ID into the proper format for REST. * @@ -11993,7 +12046,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param input The local time value to convert. * @returns A Date object with the time expressed in UTC. @@ -12018,7 +12071,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param itemId The Exchange Web Services (EWS) identifier for an existing calendar appointment. */ @@ -12042,7 +12095,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param itemId The Exchange Web Services (EWS) identifier for an existing message. */ @@ -12066,7 +12119,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read * * @param parameters An AppointmentForm describing the new appointment. All properties are optional. */ @@ -12084,7 +12137,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read * * @param parameters A dictionary containing all values to be filled in for the user in the new form. All parameters are optional. * toRecipients: An array of strings containing the email addresses or an array containing an {@link Office.EmailAddressDetails} object for each of the recipients on the To line. The array is limited to a maximum of 100 entries. @@ -12125,7 +12178,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose and read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read * * In addition to this signature, the method has the following signatures: * @@ -12138,7 +12191,7 @@ declare namespace Office { * asyncContext: Any state data that is passed to the asynchronous method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. The token is provided as a string in the asyncResult.value property. */ - getCallbackTokenAsync(options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + getCallbackTokenAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** * Gets a string that contains a token used to get an attachment or item from an Exchange Server. * @@ -12156,7 +12209,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose and read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. The token is provided as a string in the asyncResult.value property. */ @@ -12178,7 +12231,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose and read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. The token is provided as a string in the asyncResult.value property. * @param userContext Optional. Any state data that is passed to the asynchronous method. @@ -12195,7 +12248,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose and read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read * * The getUserIdentityTokenAsync method returns a token that you can use to identify and {@link https://msdn.microsoft.com/library/office/fp179828.aspx | authenticate the add-in and user with a third-party system}. * @@ -12236,7 +12289,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteMailbox
Applicable Outlook modeCompose and read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read * * @param data The EWS request. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. @@ -12257,7 +12310,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read */ interface MeetingSuggestion { /** @@ -12293,7 +12346,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ interface NotificationMessageDetails { /** @@ -12325,7 +12378,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ interface NotificationMessages { /** @@ -12344,18 +12397,18 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * In addition to this signature, the method also has the following signatures: * * `addAsync(key: string, JSONmessage: NotificationMessageDetails): void;` * - * `addAsync(key: string, JSONmessage: NotificationMessageDetails, options: AsyncContextOptions): void;` + * `addAsync(key: string, JSONmessage: NotificationMessageDetails, options: Office.AsyncContextOptions): void;` * * `addAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void;` * */ - addAsync(key: string, JSONmessage: NotificationMessageDetails, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addAsync(key: string, JSONmessage: NotificationMessageDetails, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds a notification to an item. * @@ -12369,7 +12422,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ addAsync(key: string, JSONmessage: NotificationMessageDetails): void; /** @@ -12387,9 +12440,9 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ - addAsync(key: string, JSONmessage: NotificationMessageDetails, options: AsyncContextOptions): void; + addAsync(key: string, JSONmessage: NotificationMessageDetails, options: Office.AsyncContextOptions): void; /** * Adds a notification to an item. * @@ -12404,7 +12457,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ addAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void; /** @@ -12415,7 +12468,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * In addition to the main signature, this method also has this signature: * @@ -12425,7 +12478,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. */ - getAllAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAllAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Returns all keys and messages for an item. * @@ -12434,7 +12487,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. */ @@ -12447,13 +12500,13 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * In addition to the main signature, this method also has these signatures: * * `removeAsync(key: string): void;` * - * `removeAsync(key: string, options: AsyncContextOptions): void;` + * `removeAsync(key: string, options: Office.AsyncContextOptions): void;` * * `removeAsync(key: string, callback: (result: AsyncResult) => void): void;` * @@ -12462,7 +12515,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. */ - removeAsync(key: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + removeAsync(key: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes a notification message for an item. * @@ -12471,7 +12524,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param key The key for the notification message to remove. */ @@ -12484,13 +12537,13 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param key The key for the notification message to remove. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. */ - removeAsync(key: string, options: AsyncContextOptions): void; + removeAsync(key: string, options: Office.AsyncContextOptions): void; /** * Removes a notification message for an item. * @@ -12499,7 +12552,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param key The key for the notification message to remove. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. @@ -12515,13 +12568,13 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * In addition to the main signature, this method also has these signatures: * * `replaceAsync(key: string, JSONmessage: NotificationMessageDetails): void;` * - * `replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options: AsyncContextOptions): void;` + * `replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options: Office.AsyncContextOptions): void;` * * `replaceAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void;` * @@ -12531,7 +12584,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. */ - replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Replaces a notification message that has a given key with another message. * @@ -12542,7 +12595,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param key The key for the notification message to replace. It can't be longer than 32 characters. * @param JSONmessage A JSON object that contains the new notification message to replace the existing message. It contains a NotificationMessageDetails object. @@ -12558,14 +12611,14 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param key The key for the notification message to replace. It can't be longer than 32 characters. * @param JSONmessage A JSON object that contains the new notification message to replace the existing message. It contains a NotificationMessageDetails object. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. */ - replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options: AsyncContextOptions): void; + replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options: Office.AsyncContextOptions): void; /** * Replaces a notification message that has a given key with another message. * @@ -12576,7 +12629,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param key The key for the notification message to replace. It can't be longer than 32 characters. * @param JSONmessage A JSON object that contains the new notification message to replace the existing message. It contains a NotificationMessageDetails object. @@ -12594,7 +12647,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read */ interface PhoneNumber { /** @@ -12616,7 +12669,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose */ interface Recipients { /** @@ -12635,7 +12688,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
* @@ -12643,7 +12696,7 @@ declare namespace Office { * * `addAsync(recipients: (string | EmailUser | EmailAddressDetails)[]): void;` * - * `addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: AsyncContextOptions): void;` + * `addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: Office.AsyncContextOptions): void;` * * `addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void;` * @@ -12652,7 +12705,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If adding the recipients fails, the asyncResult.error property will contain an error code. */ - addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds a recipient list to the existing recipients for an appointment or message. * @@ -12669,7 +12722,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
* @@ -12692,7 +12745,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
* @@ -12700,7 +12753,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. */ - addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: AsyncContextOptions): void; + addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: Office.AsyncContextOptions): void; /** * Adds a recipient list to the existing recipients for an appointment or message. * @@ -12717,7 +12770,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
* @@ -12735,7 +12788,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * * In addition to the main signature, this method also has this signature: * @@ -12745,7 +12798,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. */ - getAsync(options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** * Gets a recipient list for an appointment or message. * @@ -12756,7 +12809,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. */ @@ -12779,7 +12832,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
* @@ -12787,7 +12840,7 @@ declare namespace Office { * * `setAsync(recipients: (string | EmailUser | EmailAddressDetails)[]): void;` * - * `setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: AsyncContextOptions): void;` + * `setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: Office.AsyncContextOptions): void;` * * `setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void;` * @@ -12796,7 +12849,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If setting the recipients fails the asyncResult.error property will contain a code that indicates any error that occurred while adding the data. */ - setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets a recipient list for an appointment or message. * @@ -12815,7 +12868,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
* @@ -12840,7 +12893,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
* @@ -12848,7 +12901,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. */ - setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: AsyncContextOptions): void; + setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: Office.AsyncContextOptions): void; /** * Sets a recipient list for an appointment or message. * @@ -12867,7 +12920,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
* @@ -12887,7 +12940,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * **States** * @@ -12941,7 +12994,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ recurrenceProperties: RecurrenceProperties; /** @@ -12953,9 +13006,9 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ - recurrenceTimeZone: MailboxEnums.RecurrenceTimeZone; + recurrenceTimeZone: Office.MailboxEnums.RecurrenceTimeZone; /** * Gets or sets the type of the recurring appointment series. @@ -12966,9 +13019,9 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ - recurrenceType: MailboxEnums.RecurrenceType; + recurrenceType: Office.MailboxEnums.RecurrenceType; /** * The {@link Office.SeriesTime} object enables you to manage the start and end dates of the recurring appointment series and the usual start and end times of instances. **This object is not in UTC time.** Instead, it is set in the time zone specified by the recurrenceTimeZone value or defaulted to the item's time zone. @@ -12979,9 +13032,9 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ - seriesTime: SeriesTime; + seriesTime: Office.SeriesTime; /** * Returns the current recurrence object of an appointment series. @@ -12994,7 +13047,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * In addition to the main signature, this method also has this signature: * @@ -13004,7 +13057,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. */ - getAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Returns the current recurrence object of an appointment series. @@ -13017,7 +13070,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. */ @@ -13034,7 +13087,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before its start time.
* @@ -13047,7 +13100,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. */ - setAsync(recurrencePattern: Recurrence, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setAsync(recurrencePattern: Recurrence, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets the recurrence pattern of an appointment series. @@ -13060,7 +13113,7 @@ declare namespace Office { * * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before its start time.
* @@ -13079,7 +13132,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @beta */ @@ -13095,23 +13148,23 @@ declare namespace Office { /** * Represents the day of the week or type of day, for example, weekend day vs weekday. */ - dayOfWeek: MailboxEnums.Days; + dayOfWeek: Office.MailboxEnums.Days; /** * Represents the set of days for this recurrence. Valid values are: 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', and 'Sun'. */ - days: MailboxEnums.Days[]; + days: Office.MailboxEnums.Days[]; /** * Represents the number of the week in the selected month e.g. 'first' for first week of the month. */ - weekNumber: MailboxEnums.WeekNumber; + weekNumber: Office.MailboxEnums.WeekNumber; /** * Represents the month. */ - month: MailboxEnums.Month; + month: Office.MailboxEnums.Month; /** * Represents your chosen first day of the week otherwise the default is the value in the current user's settings. Valid values are: 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', and 'Sun'. */ - firstDayOfWeek: MailboxEnums.Days; + firstDayOfWeek: Office.MailboxEnums.Days; } /** @@ -13173,7 +13226,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ interface RoamingSettings { /** @@ -13184,7 +13237,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param name The case-sensitive name of the setting to retrieve. * @returns Type: String | Number | Boolean | Object | Array @@ -13198,7 +13251,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param name The case-sensitive name of the setting to remove. */ @@ -13213,7 +13266,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param callback Optional? When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. */ @@ -13232,7 +13285,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param name The case-sensitive name of the setting to set or create. * @param value Specifies the value to be stored. @@ -13248,7 +13301,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @beta */ @@ -13261,7 +13314,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ getDuration(): number; @@ -13273,7 +13326,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ getEndDate(): string; @@ -13285,7 +13338,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ getEndTime(): string; @@ -13297,7 +13350,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ getStartDate(): string; @@ -13309,7 +13362,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ getStartTime(): string; @@ -13321,7 +13374,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * * @param minutes The length of the appointment in minutes. */ @@ -13335,7 +13388,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid date format - The date is not in an acceptable format.
* @@ -13356,7 +13409,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid date format - The date is not in an acceptable format.
* @@ -13371,7 +13424,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid date format - The date is not in an acceptable format.
* @@ -13393,7 +13446,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid date format - The date is not in an acceptable format.
* @@ -13409,7 +13462,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid time format - The time is not in an acceptable format.
* @@ -13430,7 +13483,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid time format - The time is not in an acceptable format.
* @@ -13447,7 +13500,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose */ interface Subject { /** @@ -13460,7 +13513,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * * In addition to the main signature, this method also has this signature: * @@ -13470,7 +13523,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. */ - getAsync(options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** * Gets the subject of an appointment or message. * The getAsync method starts an asynchronous call to the Exchange server to get the subject of an appointment or message. @@ -13480,7 +13533,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. */ @@ -13495,7 +13548,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The subject parameter is longer than 255 characters.
* @@ -13503,7 +13556,7 @@ declare namespace Office { * * `setAsync(subject: string): void;` * - * `setAsync(subject: string, options: AsyncContextOptions): void;` + * `setAsync(subject: string, options: Office.AsyncContextOptions): void;` * * `setAsync(subject: string, callback: (result: AsyncResult) => void): void;` * @@ -13512,7 +13565,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If setting the subject fails, the asyncResult.error property will contain an error code. */ - setAsync(subject: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setAsync(subject: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets the subject of an appointment or message. * @@ -13523,7 +13576,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The subject parameter is longer than 255 characters.
* @@ -13540,7 +13593,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The subject parameter is longer than 255 characters.
* @@ -13548,7 +13601,7 @@ declare namespace Office { * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. */ - setAsync(data: string, options: AsyncContextOptions): void; + setAsync(data: string, options: Office.AsyncContextOptions): void; /** * Sets the subject of an appointment or message. * @@ -13559,7 +13612,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The subject parameter is longer than 255 characters.
* @@ -13579,7 +13632,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeRead
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read */ interface TaskSuggestion { /** @@ -13599,7 +13652,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose */ interface Time { /** @@ -13612,7 +13665,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * * In addition to the main signature, this method also has this signature: * @@ -13622,7 +13675,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. */ - getAsync(options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** * Gets the start or end time of an appointment. * @@ -13633,7 +13686,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. */ @@ -13650,7 +13703,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before the appointment start time.
* @@ -13658,7 +13711,7 @@ declare namespace Office { * * `setAsync(dateTime: Date): void;` * - * `setAsync(dateTime: Date, options: AsyncContextOptions): void;` + * `setAsync(dateTime: Date, options: Office.AsyncContextOptions): void;` * * `setAsync(dateTime: Date, callback: (result: AsyncResult) => void): void;` * @@ -13667,7 +13720,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If setting the date and time fails, the asyncResult.error property will contain an error code. */ - setAsync(dateTime: Date, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setAsync(dateTime: Date, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets the start or end time of an appointment. * @@ -13680,7 +13733,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before the appointment start time.
* @@ -13699,7 +13752,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before the appointment start time.
* @@ -13707,7 +13760,7 @@ declare namespace Office { * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. */ - setAsync(dateTime: Date, options: AsyncContextOptions): void; + setAsync(dateTime: Date, options: Office.AsyncContextOptions): void; /** * Sets the start or end time of an appointment. * @@ -13720,7 +13773,7 @@ declare namespace Office { * @remarks * * - * + * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
Applicable Outlook modeCompose
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before the appointment start time.
* @@ -13738,7 +13791,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ interface UserProfile { /** @@ -13752,7 +13805,7 @@ declare namespace Office { * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * The possible account types are listed in the following table. * @@ -13788,7 +13841,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ displayName: string; /** @@ -13799,7 +13852,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ emailAddress: string; /** @@ -13810,7 +13863,7 @@ declare namespace Office { * @remarks * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ timeZone: string; } @@ -14350,35 +14403,47 @@ declare namespace Excel { */ delayForCellEdit?: boolean; } + /** + * Executes a batch script that performs actions on the Excel object model, using the RequestContext of a previously-created API object. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. + * @param object - A previously-created API object. The batch will use the same RequestContext as the passed-in object, which means that any changes applied to the object will be picked up by "context.sync()". + * @param batch - A function that takes in a RequestContext and returns a promise (typically, just the result of "context.sync()"). The context parameter facilitates requests to the Excel application. Since the Office add-in and the Excel application run in two different processes, the RequestContext is required to get access to the Excel object model from the add-in. + */ + export function run(object: OfficeExtension.ClientObject, batch: (context: Excel.RequestContext) => Promise): Promise; + + /** + * Executes a batch script that performs actions on the Excel object model, using the RequestContext of previously-created API objects. + * @param objects - An array of previously-created API objects. The array will be validated to make sure that all of the objects share the same context. The batch will use this shared RequestContext, which means that any changes applied to these objects will be picked up by "context.sync()". + * @param batch - A function that takes in a RequestContext and returns a promise (typically, just the result of "context.sync()"). The context parameter facilitates requests to the Excel application. Since the Office add-in and the Excel application run in two different processes, the RequestContext is required to get access to the Excel object model from the add-in. + */ + export function run(objects: OfficeExtension.ClientObject[], batch: (context: Excel.RequestContext) => Promise): Promise; + + /** + * Executes a batch script that performs actions on the Excel object model, using the RequestContext of a previously-created API object. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. + * @param options - The additional options for this Excel.run which specify previous objects, whether to delay the request for cell edit, session info, etc. + * @param batch - A function that takes in a RequestContext and returns a promise (typically, just the result of "context.sync()"). The context parameter facilitates requests to the Excel application. Since the Office add-in and the Excel application run in two different processes, the RequestContext is required to get access to the Excel object model from the add-in. + */ + export function run(options: Excel.RunOptions, batch: (context: Excel.RequestContext) => Promise): Promise; /** - * Executes a batch script that performs actions on the Excel object model, using a new RequestContext. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. - * @param batch - A function that takes in a RequestContext and returns a promise (typically, just the result of `context.sync()`). The context parameter facilitates requests to the Excel application. Since the Office add-in and the Excel application run in two different processes, the RequestContext is required to get access to the Excel object model from the add-in. - */ - function run(batch: (context: Excel.RequestContext) => Promise): Promise; + * Executes a batch script that performs actions on the Excel object model, using a new RequestContext. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. + * @param batch - A function that takes in a RequestContext and returns a promise (typically, just the result of "context.sync()"). The context parameter facilitates requests to the Excel application. Since the Office add-in and the Excel application run in two different processes, the RequestContext is required to get access to the Excel object model from the add-in. + */ + export function run(batch: (context: Excel.RequestContext) => Promise): Promise; /** - * Executes a batch script that performs actions on the Excel object model, using the RequestContext of a previously-created object. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. - * @param contextObject - A previously-created object. The batch will use the same RequestContext as the passed-in object, which means that any changes applied to the object will be picked up by `context.sync()`. - * @param batch - A function that takes in a RequestContext and returns a promise (typically, just the result of `context.sync()`). The context parameter facilitates requests to the Excel application. Since the Office add-in and the Excel application run in two different processes, the RequestContext is required to get access to the Excel object model from the add-in. - */ - function run(contextObject: OfficeExtension.ClientRequestContext, batch: (context: Excel.RequestContext) => Promise): Promise; - /** - * Executes a batch script that performs actions on the Excel object model, using the RequestContext of a previously-created API object. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. - * @param object - A previously-created API object. The batch will use the same RequestContext as the passed-in object, which means that any changes applied to the object will be picked up by `context.sync()`. - * @param batch - A function that takes in a RequestContext and returns a promise (typically, just the result of `context.sync()`). The context parameter facilitates requests to the Excel application. Since the Office add-in and the Excel application run in two different processes, the RequestContext is required to get access to the Excel object model from the add-in. - */ - function run(object: OfficeExtension.ClientObject, batch: (context: Excel.RequestContext) => Promise): Promise; - /** - * Executes a batch script that performs actions on the Excel object model, using the RequestContext of previously-created API objects. - * @param objects - An array of previously-created API objects. The array will be validated to make sure that all of the objects share the same context. The batch will use this shared RequestContext, which means that any changes applied to these objects will be picked up by `context.sync()`. - * @param batch - A function that takes in a RequestContext and returns a promise (typically, just the result of `context.sync()`). The context parameter facilitates requests to the Excel application. Since the Office add-in and the Excel application run in two different processes, the RequestContext is required to get access to the Excel object model from the add-in. - */ - function run(objects: OfficeExtension.ClientObject[], batch: (context: Excel.RequestContext) => Promise): Promise; - /** - * Executes a batch script that performs actions on the Excel object model, using the RequestContext of a previously-created API object. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. - * @param options - The additional options for this Excel.run which specify previous objects, whether to delay the request for cell edit, session info, etc. - * @param batch - A function that takes in a RequestContext and returns a promise (typically, just the result of `context.sync()`). The context parameter facilitates requests to the Excel application. Since the Office add-in and the Excel application run in two different processes, the RequestContext is required to get access to the Excel object model from the add-in. - */ - function run(options: Excel.RunOptions, batch: (context: Excel.RequestContext) => Promise): Promise; + * Executes a batch script that performs actions on the Excel object model, using the RequestContext of a previously-created object. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. + * @param contextObject - A previously-created object. The batch will use the same RequestContext as the passed-in object, which means that any changes applied to the object will be picked up by "context.sync()". + * @param batch - A function that takes in a RequestContext and returns a promise (typically, just the result of "context.sync()"). The context parameter facilitates requests to the Excel application. Since the Office add-in and the Excel application run in two different processes, the RequestContext is required to get access to the Excel object model from the add-in. + * @remarks + * In addition to this signature, the method also has the following signatures: + * + * `run(object: OfficeExtension.ClientObject, batch: (context: Excel.RequestContext) => Promise): Promise;` + * + * `run(objects: OfficeExtension.ClientObject[], batch: (context: Excel.RequestContext) => Promise): Promise;` + * + * `run(options: Excel.RunOptions, batch: (context: Excel.RequestContext) => Promise): Promise;` + * + * `run(batch: (context: Excel.RequestContext) => Promise): Promise;` + */ + export function run(contextObject: OfficeExtension.ClientRequestContext, batch: (context: Excel.RequestContext) => Promise): Promise; /** * * Provides information about the binding that raised the SelectionChanged event. @@ -49301,18 +49366,24 @@ declare namespace Word { * @param batch - A function that takes in a RequestContext and returns a promise (typically, just the result of "context.sync()"). The context parameter facilitates requests to the Word application. Since the Office add-in and the Word application run in two different processes, the RequestContext is required to get access to the Word object model from the add-in. */ function run(batch: (context: Word.RequestContext) => Promise): Promise; - /** - * Executes a batch script that performs actions on the Word object model, using the RequestContext of a previously-created API object. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. - * @param object - A previously-created API object. The batch will use the same RequestContext as the passed-in object, which means that any changes applied to the object will be picked up by "context.sync()". - * @param batch - A function that takes in a RequestContext and returns a promise (typically, just the result of "context.sync()"). The context parameter facilitates requests to the Word application. Since the Office add-in and the Word application run in two different processes, the RequestContext is required to get access to the Word object model from the add-in. - */ - function run(object: OfficeExtension.ClientObject, batch: (context: Word.RequestContext) => Promise): Promise; /** * Executes a batch script that performs actions on the Word object model, using the RequestContext of previously-created API objects. * @param objects - An array of previously-created API objects. The array will be validated to make sure that all of the objects share the same context. The batch will use this shared RequestContext, which means that any changes applied to these objects will be picked up by "context.sync()". * @param batch - A function that takes in a RequestContext and returns a promise (typically, just the result of "context.sync()"). The context parameter facilitates requests to the Word application. Since the Office add-in and the Word application run in two different processes, the RequestContext is required to get access to the Word object model from the add-in. */ function run(objects: OfficeExtension.ClientObject[], batch: (context: Word.RequestContext) => Promise): Promise; + /** + * Executes a batch script that performs actions on the Word object model, using the RequestContext of a previously-created API object. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. + * @param object - A previously-created API object. The batch will use the same RequestContext as the passed-in object, which means that any changes applied to the object will be picked up by "context.sync()". + * @param batch - A function that takes in a RequestContext and returns a promise (typically, just the result of "context.sync()"). The context parameter facilitates requests to the Word application. Since the Office add-in and the Word application run in two different processes, the RequestContext is required to get access to the Word object model from the add-in. + * @remarks + * In addition to this signature, the method also has the following signatures: + * + * `run(batch: (context: Word.RequestContext) => Promise): Promise;` + * + * `run(objects: OfficeExtension.ClientObject[], batch: (context: Word.RequestContext) => Promise): Promise;` + */ + function run(object: OfficeExtension.ClientObject, batch: (context: Word.RequestContext) => Promise): Promise; } @@ -55144,18 +55215,24 @@ declare namespace OneNote { * @param batch - A function that takes in an OneNote.RequestContext and returns a promise (typically, just the result of "context.sync()"). The context parameter facilitates requests to the OneNote application. Since the Office add-in and the OneNote application run in two different processes, the request context is required to get access to the OneNote object model from the add-in. */ function run(batch: (context: OneNote.RequestContext) => Promise): Promise; - /** - * Executes a batch script that performs actions on the OneNote object model, using the request context of a previously-created API object. - * @param object - A previously-created API object. The batch will use the same request context as the passed-in object, which means that any changes applied to the object will be picked up by "context.sync()". - * @param batch - A function that takes in an OneNote.RequestContext and returns a promise (typically, just the result of "context.sync()"). When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. - */ - function run(object: OfficeExtension.ClientObject, batch: (context: OneNote.RequestContext) => Promise): Promise; /** * Executes a batch script that performs actions on the OneNote object model, using the request context of previously-created API objects. * @param object - An array of previously-created API objects. The array will be validated to make sure that all of the objects share the same context. The batch will use this shared request context, which means that any changes applied to these objects will be picked up by "context.sync()". * @param batch - A function that takes in an OneNote.RequestContext and returns a promise (typically, just the result of "context.sync()"). When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. */ function run(objects: OfficeExtension.ClientObject[], batch: (context: OneNote.RequestContext) => Promise): Promise; + /** + * Executes a batch script that performs actions on the OneNote object model, using the request context of a previously-created API object. + * @param object - A previously-created API object. The batch will use the same request context as the passed-in object, which means that any changes applied to the object will be picked up by "context.sync()". + * @param batch - A function that takes in an OneNote.RequestContext and returns a promise (typically, just the result of "context.sync()"). When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. + * @remarks + * In addition to this signature, the method also has the following signatures: + * + * `run(batch: (context: OneNote.RequestContext) => Promise): Promise;` + * + * `run(objects: OfficeExtension.ClientObject[], batch: (context: OneNote.RequestContext) => Promise): Promise;` + */ + function run(object: OfficeExtension.ClientObject, batch: (context: OneNote.RequestContext) => Promise): Promise; } @@ -57398,18 +57475,27 @@ declare namespace Visio { * @param batch - A function that takes in an Visio.RequestContext and returns a promise (typically, just the result of "context.sync()"). When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. */ function run(object: OfficeExtension.ClientObject | OfficeExtension.EmbeddedSession, batch: (context: Visio.RequestContext) => Promise): Promise; - /** - * Executes a batch script that performs actions on the Visio object model, using the RequestContext of a previously-created object. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. - * @param contextObject - A previously-created Visio.RequestContext. This context will get re-used by the batch function (instead of having a new context created). This means that the batch will be able to pick up changes made to existing API objects, if those objects were derived from this same context. - * @param batch - A function that takes in a RequestContext and returns a promise (typically, just the result of "context.sync()"). The context parameter facilitates requests to the Visio application. Since the Office add-in and the Visio application run in two different processes, the RequestContext is required to get access to the Visio object model from the add-in. - */ - function run(contextObject: OfficeExtension.ClientRequestContext, batch: (context: Visio.RequestContext) => Promise): Promise; + /** * Executes a batch script that performs actions on the Visio object model, using the request context of previously-created API objects. * @param objects - An array of previously-created API objects. The array will be validated to make sure that all of the objects share the same context. The batch will use this shared request context, which means that any changes applied to these objects will be picked up by "context.sync()". * @param batch - A function that takes in a Visio.RequestContext and returns a promise (typically, just the result of "context.sync()"). When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. */ function run(objects: OfficeExtension.ClientObject[], batch: (context: Visio.RequestContext) => Promise): Promise; + /** + * Executes a batch script that performs actions on the Visio object model, using the RequestContext of a previously-created object. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. + * @param contextObject - A previously-created Visio.RequestContext. This context will get re-used by the batch function (instead of having a new context created). This means that the batch will be able to pick up changes made to existing API objects, if those objects were derived from this same context. + * @param batch - A function that takes in a RequestContext and returns a promise (typically, just the result of "context.sync()"). The context parameter facilitates requests to the Visio application. Since the Office add-in and the Visio application run in two different processes, the RequestContext is required to get access to the Visio object model from the add-in. + * @remarks + * In addition to this signature, the method also has the following signatures: + * + * `run(batch: (context: Visio.RequestContext) => Promise): Promise;` + * + * `run(object: OfficeExtension.ClientObject | OfficeExtension.EmbeddedSession, batch: (context: Visio.RequestContext) => Promise): Promise;` + * + * `run(objects: OfficeExtension.ClientObject[], batch: (context: Visio.RequestContext) => Promise): Promise;` + */ + function run(contextObject: OfficeExtension.ClientRequestContext, batch: (context: Visio.RequestContext) => Promise): Promise; } diff --git a/types/onoff/index.d.ts b/types/onoff/index.d.ts index c080025735..72c25d11f5 100644 --- a/types/onoff/index.d.ts +++ b/types/onoff/index.d.ts @@ -12,7 +12,8 @@ declare namespace __ONOFF { var version:string; interface GpioOptions { - debounceTimeout:number; + debounceTimeout?:number; + activeLow?:boolean; } class Gpio { @@ -50,4 +51,4 @@ declare namespace __ONOFF { unexport():void; } -} \ No newline at end of file +} diff --git a/types/orientjs/index.d.ts b/types/orientjs/index.d.ts index 19f615efd0..31980678bb 100644 --- a/types/orientjs/index.d.ts +++ b/types/orientjs/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/orientechnologies/orientjs // Definitions by: [Saeed Tabrizi] // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 // Last Update : 20-7-2017 // Compatible with Orientdb >= 2.2.15 and orientjs >= 2.2.x features . diff --git a/types/overwatch-api/index.d.ts b/types/overwatch-api/index.d.ts index 8eaac311c8..bd7af1dcf0 100644 --- a/types/overwatch-api/index.d.ts +++ b/types/overwatch-api/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for overwatch-api 0.4 +// Type definitions for overwatch-api 0.5 // Project: https://github.com/alfg/overwatch-api -// Definitions by: JoshuaHall +// Definitions by: Joshua Hall // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -70,6 +70,7 @@ export interface OverwatchApiResponse { username: string; level: number; portrait: string; + private: boolean; } export interface ProfileApiResponse extends OverwatchApiResponse { diff --git a/types/overwatch-api/overwatch-api-tests.ts b/types/overwatch-api/overwatch-api-tests.ts index bd4df128a0..9364e87780 100644 --- a/types/overwatch-api/overwatch-api-tests.ts +++ b/types/overwatch-api/overwatch-api-tests.ts @@ -1,4 +1,4 @@ -import { getProfile, OverwatchPlatform, OverwatchServerRegion, ProfileApiResponse, owl } from 'overwatch-api'; +import { getProfile, OverwatchPlatform, OverwatchServerRegion, ProfileApiResponse, owl, getStats, StatsApiResponse, CompetitiveTopHeroData } from 'overwatch-api'; const platform: OverwatchPlatform = 'pc'; const region: OverwatchServerRegion = 'us'; @@ -6,10 +6,36 @@ const battleTag = 'sparK#12434'; getProfile(platform, region, battleTag, (err: Error | null, data: ProfileApiResponse) => { if (err === null) { - console.log(`Username: ${data.username}`); - console.log(`Level: ${data.level}`); - console.log(`Rank: ${data.competitive.rank} SR`); - console.log(`Win Rate in Competitive: ${data.games.competitive.win_rate}`); + if (data.private) { + console.log(`Profile for battletag ${battleTag} is private, cannot retrieve profile`); + } else { + console.log(`Username: ${data.username}`); + console.log(`Level: ${data.level}`); + console.log(`Rank: ${data.competitive.rank} SR`); + console.log(`Win Rate in Competitive: ${data.games.competitive.win_rate}`); + } + } else { + console.log(err); + } +}); + +getStats(platform, region, battleTag, (err: Error | null, data: StatsApiResponse) => { + if (err === null) { + if (data.private) { + console.log(`Profile for battletag ${battleTag} is private, cannot retrieve stats`); + } else { + console.log(`Username: ${data.username}`); + console.log(`Level: ${data.level}`); + console.log(`Competitive Stats`); + const topHeroesComp: CompetitiveTopHeroData = data.stats.top_heroes.competitive; + console.log(`Hero with most games won: ${topHeroesComp.games_won[0].hero}`); + console.log(`Hero with highest winrate: ${topHeroesComp.win_rate[0].hero}`); + console.log(`Hero with most time played ${topHeroesComp.played[0].hero}\n`); + + for (const stat of data.stats.game.competitive) { + console.log(`${stat.title}: ${stat.value}`); + } + } } else { console.log(err); } diff --git a/types/papaparse/index.d.ts b/types/papaparse/index.d.ts index 49dcdfdd95..4c83399955 100644 --- a/types/papaparse/index.d.ts +++ b/types/papaparse/index.d.ts @@ -109,9 +109,12 @@ export interface ParseConfig { } export interface UnparseConfig { - quotes?: boolean; // default: false - delimiter?: string; // default: "," - newline?: string; // default: "\r\n" + quotes?: boolean; // default: false + quoteChar?: string; // default: '"' + escapeChar?: string; // default: '"' + delimiter?: string; // default: "," + header?: boolean; // default: true + newline?: string; // default: "\r\n" } export interface UnparseObject { diff --git a/types/paper/index.d.ts b/types/paper/index.d.ts index 5b3e46a146..e942fcec2e 100644 --- a/types/paper/index.d.ts +++ b/types/paper/index.d.ts @@ -1,6 +1,8 @@ -// Type definitions for Paper.js v0.9.24 +// Type definitions for Paper.js v0.11.5 // Project: http://paperjs.org/ -// Definitions by: Clark Stevenson , Jon Lucas +// Definitions by: Clark Stevenson , +// Jon Lucas , +// Sebastian Lopez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped type NativeMouseEvent = MouseEvent; @@ -1408,6 +1410,25 @@ declare module paper { */ hitTest(point: Point, options?: { tolerance?: number; class?: string; fill?: boolean; stroke?: boolean; segments?: boolean; curves?: boolean; handles?: boolean; ends?: boolean; bounds?: boolean; center?: boolean; guides?: boolean; selected?: boolean; match?: (hit: HitResult) => boolean; }): HitResult; + /** + * Perform a hit-test on the items contained within the project at the location of the specified point, returning all found hits. + * The options object allows you to control the specifics of the hit-test and may contain a combination of the following values: + * @param point - the point where the hit-test should be performed + * @param options.tolerance -the tolerance of the hit-test in points. Can also be controlled through paperScope.settings.hitTolerance + * @param options.class - only hit-test again a certain item class and its sub-classes: Group, Layer, Path, CompoundPath, Shape, Raster, PlacedSymbol, PointText, etc. + * @param options.fill - hit-test the fill of items. + * @param options.stroke - hit-test the stroke of path items, taking into account the setting of stroke color and width. + * @param options.segments - hit-test for segment.point of Path items. + * @param options.curves - hit-test the curves of path items, without taking the stroke color or width into account. + * @param options.handles - hit-test for the handles. (segment.handleIn / segment.handleOut) of path segments. + * @param options.ends - only hit-test for the first or last segment points of open path items. + * @param options.bounds - hit-test the corners and side-centers of the bounding rectangle of items (item.bounds). + * @param options.center - hit-test the rectangle.center of the bounding rectangle of items (item.bounds). + * @param options.guides - hit-test items that have Item#guide set to true. + * @param options.selected - only hit selected items. + */ + hitTestAll(point: Point, options?: { tolerance?: number; class?: string; fill?: boolean; stroke?: boolean; segments?: boolean; curves?: boolean; handles?: boolean; ends?: boolean; bounds?: boolean; center?: boolean; guides?: boolean; selected?: boolean; match?: (hit: HitResult) => boolean; }): HitResult[]; + /** * Checks whether the item matches the criteria described by the given object, by iterating over all of its properties and matching against their values through matches(name, compare). * See project.getItems(match) for a selection of illustrated examples. @@ -3237,7 +3258,7 @@ declare module paper { * Deselects all selected items in the project. */ deselectAll(): void; - + /** * Adds the specified layer at the end of the this project’s layers list. */ diff --git a/types/parse-github-url/index.d.ts b/types/parse-github-url/index.d.ts new file mode 100644 index 0000000000..c5793277e8 --- /dev/null +++ b/types/parse-github-url/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for parse-github-url 1.0 +// Project: https://github.com/jonschlinkert/parse-github-url +// Definitions by: Klaus Meinhardt +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { Url } from 'url'; + +declare namespace gh { + interface Result extends Url { + filepath: string | null; + owner: string | null; + name: string | null; + repo: string | null; + repository: string | null; + branch: string; + } +} + +declare function gh(url: string): gh.Result | null; + +export = gh; diff --git a/types/parse-github-url/parse-github-url-tests.ts b/types/parse-github-url/parse-github-url-tests.ts new file mode 100644 index 0000000000..7c5a7c50f7 --- /dev/null +++ b/types/parse-github-url/parse-github-url-tests.ts @@ -0,0 +1,3 @@ +import gh = require('parse-github-url'); + +gh('github:monkey/business'); // $ExpectType Result | null diff --git a/types/parse-github-url/tsconfig.json b/types/parse-github-url/tsconfig.json new file mode 100644 index 0000000000..e5a7fcab63 --- /dev/null +++ b/types/parse-github-url/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", + "parse-github-url-tests.ts" + ] +} diff --git a/types/parse-github-url/tslint.json b/types/parse-github-url/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/parse-github-url/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/passport-strategy/index.d.ts b/types/passport-strategy/index.d.ts index f8b227bfd6..1a0b2dd4f5 100644 --- a/types/passport-strategy/index.d.ts +++ b/types/passport-strategy/index.d.ts @@ -16,7 +16,7 @@ import passport = require('passport'); import express = require('express'); -declare class Strategy extends passport.Strategy { +declare class Strategy implements passport.Strategy { /** * Performs authentication for the request. * Note: Virtual function - re-implement in the strategy. diff --git a/types/physijs/index.d.ts b/types/physijs/index.d.ts index 86ea3b9f38..79698c4697 100644 --- a/types/physijs/index.d.ts +++ b/types/physijs/index.d.ts @@ -143,8 +143,8 @@ declare namespace Physijs { onSimulationResume():void; removeConstraint(constraint:Constraint):void; execute(cmd:string, params:any):void; - add(object:THREE.Object3D):void; - remove(object:THREE.Object3D):void; + add(object:THREE.Object3D):this; + remove(object:THREE.Object3D):this; setFixedTimeStep(fixedTimeStep:number):void; setGravity(gravity:THREE.Vector3):void; simulate(timeStep?:number, maxSubSteps?:number):boolean; diff --git a/types/plotly.js/index.d.ts b/types/plotly.js/index.d.ts index 854960025d..39ecb64d37 100644 --- a/types/plotly.js/index.d.ts +++ b/types/plotly.js/index.d.ts @@ -355,7 +355,7 @@ export interface ModeBarButton { // Data -export type Datum = string | number | Date; +export type Datum = string | number | Date | null; export type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array; export type Dash = 'solid' | 'dot' | 'dash' | 'longdash' | 'dashdot' | 'longdashdot'; diff --git a/types/pluralize/index.d.ts b/types/pluralize/index.d.ts index 7a11a23839..14da5f38ec 100644 --- a/types/pluralize/index.d.ts +++ b/types/pluralize/index.d.ts @@ -1,79 +1,78 @@ // Type definitions for pluralize // Project: https://www.npmjs.com/package/pluralize // Definitions by: Syu Kato +// Karol Majewski // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -interface PluralizeStatic { - /** - * Pluralize or singularize a word based on the passed in count. - * - * @param word - * @param count - * @param inclusive - */ - (word: string, count?: number, inclusive?: boolean): string; +/** + * Pluralize or singularize a word based on the passed in count. + * + * @param word + * @param count + * @param inclusive + */ +declare function pluralize(word: string, count?: number, inclusive?: boolean): string; - /** - * Pluralize a word based. - * - * @param word - */ - plural(word: string): string; +declare namespace pluralize { + /** + * Pluralize a word based. + * + * @param word + */ + function plural(word: string): string; - /** - * Singularize a word based. - * - * @param word - */ - singular(word: string): string; + /** + * Singularize a word based. + * + * @param word + */ + function singular(word: string): string; - /** - * Add a pluralization rule to the collection. - * - * @param rule - * @param replacement - */ - addPluralRule(rule: string|RegExp, replacemant: string): void; + /** + * Add a pluralization rule to the collection. + * + * @param rule + * @param replacement + */ + function addPluralRule(rule: string | RegExp, replacemant: string): void; - /** - * Add a singularization rule to the collection. - * - * @param rule - * @param replacement - */ - addSingularRule(rule: string|RegExp, replacemant: string): void; + /** + * Add a singularization rule to the collection. + * + * @param rule + * @param replacement + */ + function addSingularRule(rule: string | RegExp, replacemant: string): void; - /** - * Add an irregular word definition. - * - * @param single - * @param plural - */ - addIrregularRule(single: string, plural: string): void; + /** + * Add an irregular word definition. + * + * @param single + * @param plural + */ + function addIrregularRule(single: string, plural: string): void; - /** - * Add an uncountable word rule. - * - * @param word - */ - addUncountableRule(word: string|RegExp): void; + /** + * Add an uncountable word rule. + * + * @param word + */ + function addUncountableRule(word: string | RegExp): void; - /** - * Test if provided word is plural. - * - * @param word - */ - isPlural(word: string): boolean; + /** + * Test if provided word is plural. + * + * @param word + */ + function isPlural(word: string): boolean; - /** - * Test if provided word is singular. - * - * @param word - */ - isSingular(word: string): boolean; + /** + * Test if provided word is singular. + * + * @param word + */ + function isSingular(word: string): boolean; } -declare module "pluralize" { - export = pluralize; -} -declare var pluralize: PluralizeStatic; +export = pluralize; +export as namespace pluralize; diff --git a/types/prettier/index.d.ts b/types/prettier/index.d.ts index 881ca6b182..acb6b09af6 100644 --- a/types/prettier/index.d.ts +++ b/types/prettier/index.d.ts @@ -29,6 +29,8 @@ export type BuiltInParserName = | 'less' | 'scss' | 'json' + | 'json5' + | 'json-stringify' | 'graphql' | 'markdown' | 'vue'; diff --git a/types/pretty-bytes/index.d.ts b/types/pretty-bytes/index.d.ts index 7cd856b4f5..5259fcb92a 100644 --- a/types/pretty-bytes/index.d.ts +++ b/types/pretty-bytes/index.d.ts @@ -1,8 +1,14 @@ -// Type definitions for pretty-bytes 4.0 +// Type definitions for pretty-bytes 5.1 // Project: https://github.com/sindresorhus/pretty-bytes // Definitions by: York Yao +// Daniela Yassuda // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare function prettyBytes(bytes: number): string; -export = prettyBytes; -declare namespace prettyBytes { } +declare function PrettyBytes(number: number, options?: PrettyBytes.PrettyBytesOptions): string; +export = PrettyBytes; +declare namespace PrettyBytes { + interface PrettyBytesOptions { + signed?: boolean; + locale?: boolean | string; + } +} diff --git a/types/pretty-bytes/pretty-bytes-tests.ts b/types/pretty-bytes/pretty-bytes-tests.ts index 71745d9a1b..7aa89483bc 100644 --- a/types/pretty-bytes/pretty-bytes-tests.ts +++ b/types/pretty-bytes/pretty-bytes-tests.ts @@ -1,7 +1,18 @@ -import prettyBytes = require('pretty-bytes'); +import * as prettyBytes from 'pretty-bytes'; prettyBytes(1337); // => '1.34 kB' prettyBytes(100); // => '100 B' + +// Display file size differences +prettyBytes(42, { signed: true }); +// => '+42 B' + +// Localized output using German locale +prettyBytes(1337, { locale: 'de' }); +// => '1,34 kB' + +// Localized output using system/browser locale +prettyBytes(1337, { locale: true }); diff --git a/types/pretty-bytes/tsconfig.json b/types/pretty-bytes/tsconfig.json index fd11c640b4..44e6385192 100644 --- a/types/pretty-bytes/tsconfig.json +++ b/types/pretty-bytes/tsconfig.json @@ -20,4 +20,4 @@ "index.d.ts", "pretty-bytes-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/pretty-bytes/tslint.json b/types/pretty-bytes/tslint.json index e60c15844f..f93cf8562a 100644 --- a/types/pretty-bytes/tslint.json +++ b/types/pretty-bytes/tslint.json @@ -1,3 +1,3 @@ { "extends": "dtslint/dt.json" -} \ No newline at end of file +} diff --git a/types/pretty-bytes/v4/index.d.ts b/types/pretty-bytes/v4/index.d.ts new file mode 100644 index 0000000000..7cd856b4f5 --- /dev/null +++ b/types/pretty-bytes/v4/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for pretty-bytes 4.0 +// Project: https://github.com/sindresorhus/pretty-bytes +// Definitions by: York Yao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function prettyBytes(bytes: number): string; +export = prettyBytes; +declare namespace prettyBytes { } diff --git a/types/pretty-bytes/v4/pretty-bytes-tests.ts b/types/pretty-bytes/v4/pretty-bytes-tests.ts new file mode 100644 index 0000000000..71745d9a1b --- /dev/null +++ b/types/pretty-bytes/v4/pretty-bytes-tests.ts @@ -0,0 +1,7 @@ +import prettyBytes = require('pretty-bytes'); + +prettyBytes(1337); +// => '1.34 kB' + +prettyBytes(100); +// => '100 B' diff --git a/types/pretty-bytes/v4/tsconfig.json b/types/pretty-bytes/v4/tsconfig.json new file mode 100644 index 0000000000..e23e4370ac --- /dev/null +++ b/types/pretty-bytes/v4/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "paths": { + "pretty-bytes": [ "pretty-bytes/v4" ] + }, + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "pretty-bytes-tests.ts" + ] +} diff --git a/types/pretty-bytes/v4/tslint.json b/types/pretty-bytes/v4/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/pretty-bytes/v4/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/prismic-dom/index.d.ts b/types/prismic-dom/index.d.ts index ba101e1041..56536895f2 100644 --- a/types/prismic-dom/index.d.ts +++ b/types/prismic-dom/index.d.ts @@ -9,7 +9,12 @@ interface RichText { asText(richText: any, joinString?: string): string; } -export const RichText: RichText; +interface Link { + url(link: any, linkResolver?: (doc: any) => string): string; +} -declare const _default: { RichText: RichText }; +export const RichText: RichText; +export const Link: Link; + +declare const _default: { RichText: RichText, Link: Link }; export default _default; diff --git a/types/project-oxford/index.d.ts b/types/project-oxford/index.d.ts index f84676c94c..83c73da3f7 100644 --- a/types/project-oxford/index.d.ts +++ b/types/project-oxford/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/felixrieseberg/project-oxford // Definitions by: Scott Southwood // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/promise-ftp-common/index.d.ts b/types/promise-ftp-common/index.d.ts new file mode 100644 index 0000000000..4db7fd4405 --- /dev/null +++ b/types/promise-ftp-common/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for promise-ftp-common 1.1 +// Project: https://github.com/realtymaps/promise-ftp-common +// Definitions by: coolreader18 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +export enum STATUSES { + NOT_YET_CONNECTED = "not yet connected", + CONNECTING = "connecting", + CONNECTED = "connected", + LOGGING_OUT = "logging out", + DISCONNECTING = "disconnecting", + DISCONNECTED = "disconnected", + RECONNECTING = "reconnecting" +} +export class FtpConnectionError extends Error {} +export class FtpReconnectError extends Error { + constructor( + disconnectError?: string | Error, + connectError?: string | Error, + onCwd?: boolean + ); + connectError: string | Error; + disconnectError: string | Error; +} diff --git a/types/promise-ftp-common/promise-ftp-common-tests.ts b/types/promise-ftp-common/promise-ftp-common-tests.ts new file mode 100644 index 0000000000..57424a8449 --- /dev/null +++ b/types/promise-ftp-common/promise-ftp-common-tests.ts @@ -0,0 +1,16 @@ +import * as PromiseFtpCommon from "promise-ftp-common"; + +// $ExpectType typeof STATUSES +PromiseFtpCommon.STATUSES; + +// $ExpectType typeof FtpReconnectError +PromiseFtpCommon.FtpReconnectError; + +// $ExpectType typeof FtpConnectionError +PromiseFtpCommon.FtpConnectionError; + +// $ExpectType FtpReconnectError +new PromiseFtpCommon.FtpReconnectError(); + +// $ExpectType FtpConnectionError +new PromiseFtpCommon.FtpConnectionError(); diff --git a/types/promise-ftp-common/tsconfig.json b/types/promise-ftp-common/tsconfig.json new file mode 100644 index 0000000000..d8f09b36b9 --- /dev/null +++ b/types/promise-ftp-common/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": ["index.d.ts", "promise-ftp-common-tests.ts"] +} diff --git a/types/promise-ftp-common/tslint.json b/types/promise-ftp-common/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/promise-ftp-common/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/promise-ftp/index.d.ts b/types/promise-ftp/index.d.ts new file mode 100644 index 0000000000..23aa5333e0 --- /dev/null +++ b/types/promise-ftp/index.d.ts @@ -0,0 +1,257 @@ +// Type definitions for promise-ftp 1.3 +// Project: https://github.com/realtymaps/promise-ftp +// Definitions by: coolreader18 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +import * as FtpClient from "ftp"; +import * as PromiseFtpCommon from "promise-ftp-common"; +import * as Promise from "bluebird"; + +declare namespace PromiseFtp { + interface ERROR_CODES { + 421: "Service not available, closing control connection"; + 425: "Can't open data connection"; + 426: "Connection closed, transfer aborted"; + 450: "Requested file action not taken / File unavailable (e.g., file busy)"; + 451: "Requested action aborted: local error in processing"; + 452: "Requested action not taken / Insufficient storage space in system"; + 500: "Syntax error / Command unrecognized"; + 501: "Syntax error in parameters or arguments"; + 502: "Command not implemented"; + 503: "Bad sequence of commands"; + 504: "Command not implemented for that parameter"; + 530: "Not logged in"; + 532: "Need account for storing files"; + 550: "Requested action not taken / File unavailable (e.g., file not found, no access)"; + 551: "Requested action aborted: page type unknown"; + 552: "Requested file action aborted / Exceeded storage allocation (for current directory or dataset)"; + 553: "Requested action not taken / File name not allowed"; + } + const ERROR_CODES: ERROR_CODES; + // tslint:disable-next-line strict-export-declare-modifiers + export import FtpConnectionError = PromiseFtpCommon.FtpConnectionError; + // tslint:disable-next-line strict-export-declare-modifiers + export import FtpReconnectError = PromiseFtpCommon.FtpReconnectError; + // tslint:disable-next-line strict-export-declare-modifiers + export import STATUSES = PromiseFtpCommon.STATUSES; + + /** + * Options for FtpPromise#connect() + */ + // tslint:disable-next-line strict-export-declare-modifiers + export import Options = FtpClient.Options; + + /** + * Element returned by FtpPromise#list() + */ + // tslint:disable-next-line strict-export-declare-modifiers + export import ListingElement = FtpClient.ListingElement; +} + +declare class PromiseFtp { + /** + * The underlying FtpClient instance + */ + rawClient: FtpClient; + + getConnectionStatus(): PromiseFtpCommon.STATUSES; + /** + * Connect to an FTP server. + */ + connect: (options: PromiseFtp.Options) => Promise; + + /** + * Reconnect with the same options as previously connected with `#connect()`. + */ + reconnect: () => Promise; + + /** + * Close the connection to the server after any/all enqueued + * commands have been executed. + * @returns a promise that resolves with the last error recieved if there + * was an error, true if there was an error but the client didn't recieve it, + * or false if there was no error. + */ + end(): Promise; + + /** + * Close the connection to the server immediately. + */ + destroy(): boolean; + + /** + * Retrieve the directory listing of path. + * @param path - defaults to the current working directory. + * @param useCompression - defaults to false. + * @returns the contents of the specified directory + */ + list(path?: string, useCompression?: boolean): FtpClient.ListingElement[]; + list(useCompression: boolean): FtpClient.ListingElement[]; + + /** + * Optional "standard" commands (RFC 959) + * Retrieve the directory listing of path. + * Similar to `#list()`, except the directory is temporarily changed to path to + * retrieve the directory listing. This is useful for servers that do not + * handle characters like spaces and quotes in directory names well for the + * LIST command. This function is "optional" because it relies on `#pwd()` + * being available. + * @param path - defaults to the current working directory. + * @param useCompression - defaults to false. + * @returns the contents of the specified directory + */ + listSafe( + path?: string, + useCompression?: boolean + ): FtpClient.ListingElement[]; + listSafe(useCompression: boolean): FtpClient.ListingElement[]; + + /** + * Retrieve a file at path from the server. + * @param path - the path of the file to get. + * @param useCompression - defaults to false. + * @returns a stream which empties to the contents of the specified file. + */ + get(path: string, useCompression?: boolean): Promise; + + /** + * Send data to the server to be stored as a file. + * @param input - can be a ReadableStream, a Buffer, or a path to a local file. + * @param destPath - the path of the file to write to. + * @param useCompression - defaults to false. + */ + put( + input: NodeJS.ReadableStream | Buffer | string, + destPath: string, + useCompression?: boolean + ): Promise; + + /** + * Create a new file on the server or append to one that already exists. + * @param input - can be a ReadableStream, a Buffer, or a pathto a local file. + * @param destPath - the path of the file to create or append to. + * @param useCompression - defaults to false. + */ + append( + input: NodeJS.ReadableStream | Buffer | string, + destPath: string, + useCompression?: boolean + ): Promise; + + /** + * Rename a file on the server. + * @param oldPath - the old path of the file. + * @param newPath - the new path to move it to. + */ + rename: (oldPath: string, newPath: string) => Promise; + + /** + * Logout the user from the server. + */ + logout: () => Promise; + + /** + * Delete a file on the server. + */ + delete: (path: string) => Promise; + + /** + * Change the current working directory. + * @param cwd - the path to change the CWD to. + * @returns the current directory if the server replies with the path in the + * response text, otherwise undefined. + */ + cwd(path: string): Promise; + + /** + * Abort the current data transfer (e.g. from `#get()`, `#put()`, or `#list()`) + */ + abort(): Promise; + + /** + * Send command using SITE. + * @param command - the command to send, e.g 'CHMOD 755 foo' or 'QUOTA'. + */ + site(command: string): Promise<{ text: string; code: number }>; + + /** + * Retrieve human-readable information about the server's status. + * @returns a string with the server's status. + */ + status: () => Promise; + + /** + * Set the transfer data type to ASCII. + */ + ascii(): Promise; + + /** + * Set the transfer data type to binary (default at time of connection). + */ + binary(): Promise; + + /** + * Optional "standard" commands (RFC 959) + * Create a new directory on the server. + * @param path - the path of the new directory. + * @param recursive - enables a `mkdir -p` algorithm, defaults to false. + */ + mkdir(path: string, recursive?: boolean): Promise; + + /** + * Optional "standard" commands (RFC 959) + * Remove a directory on the server. + * @param path - the path of the directory to remove. + * @param recursive - enables deleting the directory if not empty, defaults to false. + */ + rmdir(path: string, recursive?: boolean): Promise; + + /** + * Optional "standard" commands (RFC 959) + * Change the working directory to the parent of the current directory. + * Like `cd ..`. + */ + cdup(): Promise; + + /** + * Optional "standard" commands (RFC 959) + * Retrieve the current working directory. + */ + pwd(): Promise; + + /** + * Optional "standard" commands (RFC 959) + * Retrieve information about the system running the server. + * @returns the server's OS. + */ + system(): Promise; + + /** + * Extended commands (RFC 3659) + * Retrieve the size of a file on the server. + * @param path - the path of the file whose size is to be retrieved. + * @returns the size of the specified file. + */ + size(path: string): Promise; + + /** + * Extended commands (RFC 3659) + * Retrieve the last modified date and time for a file or directory. + * @param path - the path of the file/directory whose modified date is to + * be retrieved. + * @returns the last modified date at the specified path. + */ + lastMod(path: string): Promise; + + /** + * Extended commands (RFC 3659) + * Set the file byte offset for the next file transfer action (get/put). + * @param byteOffset - The file byte offset. + */ + restart(byteOffset: number): Promise; +} + +export = PromiseFtp; diff --git a/types/promise-ftp/promise-ftp-tests.ts b/types/promise-ftp/promise-ftp-tests.ts new file mode 100644 index 0000000000..963d38a386 --- /dev/null +++ b/types/promise-ftp/promise-ftp-tests.ts @@ -0,0 +1,4 @@ +import PromiseFtp = require("promise-ftp"); + +// $ExpectType FtpConnectionError +new PromiseFtp.FtpConnectionError(); diff --git a/types/promise-ftp/tsconfig.json b/types/promise-ftp/tsconfig.json new file mode 100644 index 0000000000..cf284b61bc --- /dev/null +++ b/types/promise-ftp/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": ["index.d.ts", "promise-ftp-tests.ts"] +} diff --git a/types/promise-ftp/tslint.json b/types/promise-ftp/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/promise-ftp/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/promise-sftp/index.d.ts b/types/promise-sftp/index.d.ts new file mode 100644 index 0000000000..fc75bd9bee --- /dev/null +++ b/types/promise-sftp/index.d.ts @@ -0,0 +1,605 @@ +// Type definitions for promise-sftp 1.3 +// Project: https://github.com/realtymaps/promise-sftp +// Definitions by: coolreader18 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +import * as PromiseFtpCommon from "promise-ftp-common"; +import * as Promise from "bluebird"; +import * as ssh2 from "ssh2"; +import * as ssh2Streams from "ssh2-streams"; +import * as fs from "fs"; + +declare namespace PromiseSftp { + enum ERROR_CODES { + OK, + EOF, + NO_SUCH_FILE, + PERMISSION_DENIED, + FAILURE, + BAD_MESSAGE, + NO_CONNECTION, + CONNECTION_LOST, + OP_UNSUPPORTED, + INVALID_HANDLE, + NO_SUCH_PATH, + FILE_ALREADY_EXISTS, + WRITE_PROTECT, + NO_MEDIA, + NO_SPACE_ON_FILESYSTEM, + QUOTA_EXCEEDED, + UNKNOWN_PRINCIPAL, + LOCK_CONFLICT, + DIR_NOT_EMPTY, + NOT_A_DIRECTORY, + INVALID_FILENAME, + LINK_LOOP, + CANNOT_DELETE, + INVALID_PARAMETER, + FILE_IS_A_DIRECTORY, + BYTE_RANGE_LOCK_CONFLICT, + BYTE_RANGE_LOCK_REFUSED, + DELETE_PENDING, + FILE_CORRUPT, + OWNER_INVALID, + GROUP_INVALID, + NO_MATCHING_BYTE_RANGE_LOCK + } + // tslint:disable-next-line strict-export-declare-modifiers + export import FtpConnectionError = PromiseFtpCommon.FtpConnectionError; + // tslint:disable-next-line strict-export-declare-modifiers + export import FtpReconnectError = PromiseFtpCommon.FtpReconnectError; + // tslint:disable-next-line strict-export-declare-modifiers + export import STATUSES = PromiseFtpCommon.STATUSES; + + /** + * Options for SftpPromise#connect() + */ + type Options = ssh2.ConnectConfig & { + /** + * When using password-based user authentication, set this option to + * handle password change requests. If this option isn't set, and the + * server requests a password change, I haven't tested what will happen. + */ + changePassword?: (message: string, language: string) => Promise; + + /** + * Whether to attempt to automatically reconnect using the existing + * config if the connection is unexpectedly closed. Auto-reconnection is + * lazy, and so will wait until a command needs to be issued before + * attempting to reconnect. + */ + autoReconnect?: boolean; + + /** + * Path and name of a file containing a private key as would be passed + * to the privateKey option. If privateKey is also set, priority is + * given to the privateKey option. + */ + privateKeyFile?: string; + + /** + * Set this option to a function to try keyboard-interactive user + * authentication if primary user authentication method fails. + * + * NOTE: This function may be called more than once, with the same or different prompts. + * @param name - is generally what you'd use as a header or GUI window + * title to describe the purpose of the `prompts` + */ + tryKeyboard?: ( + name: string, + instructions: string, + instructionsLang: string, + prompts: Array<{ + /** The query to pose to the user */ + prompt: string; + /** Whether the user's input should be displayed on-screen */ + echo: boolean; + }> + ) => Array> | Promise; + + /** Alias for `username` */ + user?: string; + + /** Alias for `readyTimeout` */ + connTimeout?: number; + + /** Alias for `readyTimeout` */ + pasvTimeout?: number; + + /** Alias for `keepaliveInterval` */ + keepalive?: number; + }; + + /** Output of `PromiseSftp#list()` */ + interface DirectoryListing { + /** `d` for directory, `-` for file, and `l` for symlink only on *NIX. */ + type: "d" | "-" | "l"; + + /** The name of the entry. */ + name: string; + + /** The last modified date of the entry. */ + date: Date; + + /** The various permissions for this entry. *NIX only */ + rights?: { + user: string; + group: string; + other: string; + }; + + /** The user name or ID that this entry belongs to. *NIX only */ + owner?: string; + + /** The group name or ID that this entry belongs to. *NIX only */ + group?: string; + + /** For symlink entries, this is the symlink's target. *NIX only */ + target?: string; + + /** True if the sticky bit is set for this entry */ + sticky?: boolean; + } + + /** Options for `PromiseSftp#fast{Get,Put}` */ + interface FastOptions { + /** + * Number of concurrent reads + * @default 25 + */ + concurrency?: number; + + /** + * Size of each read in bytes + * @default 32768 + */ + chunkSize: number; + + /** Called every time a part of a file is transferred */ + step?: (totalTransferred: number, chunk: number, total: number) => void; + } + + /** From the [statvfs struct](http://linux.die.net/man/2/statvfs). */ + interface Statvfs { + /** file system block size */ + f_bsize: number; + /** fragment size */ + f_frsize: number; + /** size of fs in f_frsize units */ + f_blocks: number; + /** free blocks */ + f_bfree: number; + /** free blocks for unprivileged users */ + f_bavail: number; + /** inodes */ + f_files: number; + /** free inodes */ + f_ffree: number; + /** free inodes for unprivileged users */ + f_favail: number; + /** file system ID */ + f_fsid: number; + /** mount flags */ + f_flag: number; + /** maximum filename length */ + f_namemax: number; + } +} + +declare class PromiseSftp { + /** + * Connects to an SFTP server; returned promise resolves to the server's + * greeting message. If multiple authentication methods are available based + * on the passed config, they are attempted in the following order: Password + * > Private Key > Agent > keyboard-interactive (if tryKeyboard is set) > + * Host-based > None. NOTE: many of the config properties below are NOT + * relevant for promise-ftp. However, all promise-ftp connect options will + * work here, except for secure, secureOptions, and preserveCwd. + */ + connect(options: PromiseSftp.Options): null | ssh2.SFTPWrapper; + + /** + * Connects to an SFTP server using the config from the most recent call to + * #connect(). + * @returns promise that resolves to the server's greeting message. + */ + reconnect(): Promise; + + /** + * Closes the connection to the server after any/all enqueued commands have + * been executed. + * @returns a promise that resolves to whether or not there was an error + * associated with closing the connection. + */ + end(): Promise; + + /** Alias to `#end()` */ + logout(): Promise; + + /** + * Closes the connection to the server immediately. + * @returns whether the connection was connected prior to the call to **destroy()**. + */ + destroy(): boolean; + + /** + * @returns a string describing the current connection state. + */ + getConnectionStatus(): PromiseSftp.STATUSES; + + /** + * Retrieves a directory listing. + * @param path - The path of the directory to get the listing of. + */ + list(path?: string): Promise; + + /** Alias to `#list()` */ + listSafe(path: string): Promise; + + /** + * Retrieve a file from the server. + * @param path - The file to retrieve from the server. + */ + get(path: string): Promise; + + /** + * Sends data to the server. + * @param destPath - The file to store the data in. If string the path to a + * local file. + */ + put( + input: NodeJS.ReadableStream | Buffer | string, + destPath: string + ): Promise; + + /** + * Same as `#append()`, but appends to `destPath` if it already exists. + */ + append( + input: NodeJS.ReadableStream | Buffer | string, + destPath: string + ): Promise; + + /** + * Renames/moves one file/directory to another on the server. + * @param oldPath - The source file/directory. + * @param newPath - The destination file/directory. + */ + rename(oldPath: string, newPath: string): Promise; + + /** + * Create a new directory. + * @param path - The path to create a new directory at. + * @param recursive - Enables a `mkdir -p` algorithm, defaults to false. + * @param attributes - The attributes to use when creating directories. + */ + mkdir( + path: string, + recursive?: boolean, + attributes?: ssh2Streams.InputAttributes + ): Promise; + mkdir(path: string, attributes: ssh2Streams.InputAttributes): Promise; + + /** + * Remove a directory on the server. + * @param path - The path of the directory to remove. + */ + rmdir(path: string): Promise; + + /** + * Retrieve the size of a file on the server. + * @param path - The path to the file to retrieve the size of. + */ + size(path: string): Promise; + + /** + * Retrieve the last modified date of a file on the server. + * @param path - The path to the file to get the last modified date of. + */ + lastMod(path: string): Date; + + /** + * Sets the file byte offset for the next file transfer action initiated via + * #get() or #put() to `byteOffset`. + */ + restart(byteOffset: number): Promise; + + /** + * Download a file from the server using parallel reads for faster throughput. + * @param remotePath - The path to the remote file to read from. + * @param localPath - The path to the local file to write to. + */ + fastGet( + remotePath: string, + localPath: string, + options?: PromiseSftp.FastOptions + ): Promise; + + /** + * Upload a file to the server using parallel reads for faster throughput. + * @param localPath - The path to the local file to read from. + * @param remotePath - The path to the remote file to write to. + */ + fastPut( + localPath: string, + remotePath: string, + options?: PromiseSftp.FastOptions + ): Promise; + + /** + * Creates a read stream from a file on the server. + * @param path - The path of the file to create a read stream from. + * @returns a new `ReadableStream` for `path`. + */ + createReadStream( + path: string, + options?: + | string + | { + flags?: string; + encoding?: string; + fd?: number; + mode?: number; + autoClose?: boolean; + start?: number; + end?: number; + highWaterMark?: number; + } + ): Promise; + + /** + * Creates a write stream to a file on the server. + * @param path - The path of the file to create a write stream to. + * @returns a new `WriteableStream` for `path`. + */ + createWriteStream( + path: string, + options?: + | string + | { + flags?: string; + encoding?: string; + fd?: number; + mode?: number; + autoClose?: boolean; + start?: number; + end?: number; + highWaterMark?: number; + } + ): Promise; + + /** + * Opens a file on the server. + * @param filename - The path of the file to open. + * @param mode - Any of the modes supported by `fs.open()`. + * @returns a promise that resolves to a `Buffer` containing a handle to the file. + */ + open( + filename: string, + mode: string | number, + attributes?: ssh2Streams.InputAttributes + ): Promise; + + /** + * Close a resource on the server. + * @param handle - A file handle returned from `#open()` or `#opendir()`. + */ + close(handle: Buffer): Promise; + + /** + * Read binary data from a file on the server to a buffer. + * @param handle - A file handle returned from `#open()` or `#opendir()`. + * @param buffer - The buffer to write to. + * @param offset - The offset from the start of the buffer to begin writing to. + * @param length - The number of bytes to read from the resource. + * @param position - The position of the file to begin reading from. + */ + read( + handle: Buffer, + buffer: Buffer, + offset: number, + length: number, + position: number + ): Promise<{ + /** The number of bytes successfully read */ + bytesRead: number; + + /** The buffer passed to `#read()`, but offset-adjusted */ + buffer: Buffer; + + /** The position passed to `#read()` */ + position: number; + }>; + + /** + * Write binary data from a buffer to a file on the server. + * @param handle - A file handle returned from `#open()` or `#opendir()`. + * @param buffer - The buffer to read from. + * @param offset - The offset from the start of the buffer to begin reading from. + * @param length - The number of bytes to read from the buffer. + * @param position - The position of the file to begin writing to. + */ + read( + handle: Buffer, + buffer: Buffer, + offset: number, + length: number, + position: number + ): Promise; + + /** + * Retrieves attributes from a resource on the server. + * @param handle - A file handle returned from `#open()` or `#opendir()` + */ + fstat(handle: Buffer): Promise; + + /** + * Set the attributes for a resource on the server. + * @param handle - A resource handle returned from `#open()` or `#fopen()`. + */ + fsetstat(handle: Buffer, attributes: ssh2Streams.Attributes): Promise; + + /** + * Set the access and modified times for a resource on the server. + * @param handle - A resource handle returned from `#open()` or `#fopen()`. + * @param atime - A Date or unix timestamp representing the new access time for the resource + * @param mtime - A Date or unix timestamp representing the new modify time for the resource + */ + futimes( + handle: Buffer, + atime: Date | number, + mtime: Date | number + ): Promise; + + /** + * Set the ownership for a resource on the server. + * @param handle - A resource handle returned from `#open()` or `#fopen()`. + * @param uid - The id of the new owner user. + * @param gid - The id of the new owner group. + */ + fchown(handle: Buffer, uid: number, gid: number): Promise; + + /** + * Set the mode for a resource on the server. + * @param handle - A resource handle returned from `#open()` or `#fopen()`. + * @param mode - The new mode, a number or a string with an octal number. + */ + fchmod(handle: Buffer, mode: number | string): Promise; + + /** + * Open a directory on the server. + * @param path - The path of the directory to open. + * @returns a buffer with the handle of the opened directory. + */ + opendir(path: string): Promise; + + /** + * Read a directory on the server. + * @param location - The path of the directory to read or a handle returned from `#opendir()`. + */ + readdir( + location: Buffer | string + ): Promise<{ + filename: string; + longname: string; + attrs: ssh2Streams.Attributes; + }>; + + /** + * Remove a file or symlink on the server. + * @param path - The path of the file/symlink to remove. + */ + unlink(path: string): Promise; + + /** Alias for `#unlink()` */ + remove(path: string): Promise; + + /** + * Retrieve attributes for a resource on the server. + * @param path - The path to the resource to retrieve the attributes of. + */ + stat(path: string): Promise; + + /** + * Retrieve attributes for a resource on the server. If the resource is a + * symlink, it retrieves the stats for the link itself instead of the + * resource it refers to. + * @param path - The path to the resource to retrieve the attributes of. + */ + lstat(path: string): Promise; + + /** + * Set the attributes of a resource on the server. + * @param path - The path to the resource to set the attributes of. + * @param attributes - The new attributes for the resource. + */ + setstat(path: string, attributes: ssh2Streams.Attributes): Promise; + + /** + * Set the access and modified times for a resource on the server. + * @param path - The path of the resource to set times of. + * @param atime - A Date or unix timestamp representing the new access time for the resource + * @param mtime - A Date or unix timestamp representing the new modify time for the resource + */ + utimes( + path: string, + atime: Date | number, + mtime: Date | number + ): Promise; + + /** + * Set the ownership for a resource on the server. + * @param path - The path to the resource to change ownership of. + * @param uid - The id of the new owner user. + * @param gid - The id of the new owner group. + */ + chown(path: string, uid: number, gid: number): Promise; + + /** + * Set the mode for a resource on the server. + * @param path - The path of the resource to set the mode of. + * @param mode - The new mode, a number or a string with an octal number. + */ + chmod(path: string, mode: number | string): Promise; + + /** + * Read the target of a symlink on the server. + * @param path - The path of the symlink to read the target of. + */ + readlink(path: string): Promise; + + /** + * Create a symlink on the server. + * @param targetPath - The path to the target of the symlink. + * @param linkPath - The path of the new symlink. + */ + symlink(targetPath: string, linkPath: string): Promise; + + /** + * Get the absolute path from a relative path on the server. + * @param path - The path to get the absolute path of. + */ + realpath(path: string): Promise; + + /** + * **OpenSSH extension** + * Performs POSIX rename(3) on a resource on the server. + * @param srcPath - The original path of the resource. + * @param destPath - The new path to rename the resource to. + */ + ext_openssh_rename(srcPath: string, destPath: string): Promise; + + /** + * **OpenSSH extension** + * Perform POSIX fstatvfs(2) on a resource on the server. + * @param path - The path to get the statvfs of. + */ + ext_openssh_statvfs(path: string): Promise; + + /** + * **OpenSSH extension** + * Perform POSIX fstatvfs(2) on a resource on the server. + * @param handle - A resource handle returned from `#open()` or `#fopen()`. + */ + ext_openssh_fstatvfs(handle: Buffer): Promise; + + /** + * **OpenSSH extension** + * Performs POSIX link(2) to create a hard link on the server. + * @param targetPath - The path of a file to hardlink from. + * @param linkPath - The path of the newly created hardlink. + */ + ext_openssh_hardlink(targetPath: string, linkPath: string): Promise; + + /** + * **OpenSSH extension** + * Perform POSIX fsync(3) on a resource on the server. + * @param handle - A resource handle returned from `#open()` or `#fopen()`. + */ + ext_openssh_fsync(handle: Buffer): Promise; +} + +export = PromiseSftp; diff --git a/types/promise-sftp/promise-sftp-tests.ts b/types/promise-sftp/promise-sftp-tests.ts new file mode 100644 index 0000000000..90a46ab490 --- /dev/null +++ b/types/promise-sftp/promise-sftp-tests.ts @@ -0,0 +1,9 @@ +import PromiseSftp = require("promise-sftp"); + +const sftp = new PromiseSftp(); + +// $ExpectType () => boolean +sftp.destroy; + +// $ExpectType typeof STATUSES +PromiseSftp.STATUSES; diff --git a/types/promise-sftp/tsconfig.json b/types/promise-sftp/tsconfig.json new file mode 100644 index 0000000000..0cdbf4fb36 --- /dev/null +++ b/types/promise-sftp/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": ["index.d.ts", "promise-sftp-tests.ts"] +} diff --git a/types/promise-sftp/tslint.json b/types/promise-sftp/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/promise-sftp/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/qlik-engineapi/index.d.ts b/types/qlik-engineapi/index.d.ts index f0f95301c3..ccb16bbda6 100644 --- a/types/qlik-engineapi/index.d.ts +++ b/types/qlik-engineapi/index.d.ts @@ -4412,12 +4412,7 @@ declare namespace EngineAPI { /** * NxCellRows... */ - interface INxCellRows { - /** - * Array of data. - */ - NxCellRows: INxCell[]; - } + type INxCellRows = INxCell[]; /** * INxDataPage... @@ -8715,7 +8710,7 @@ declare namespace EngineAPI { /** * Information on the measure. */ - qMeasureInfo: INxMeasureInfo; + qMeasureInfo: INxMeasureInfo[]; /** * Sort order of the columns in the hypercube. diff --git a/types/qrcode.react/index.d.ts b/types/qrcode.react/index.d.ts index f730ee7581..d38d8ce89b 100644 --- a/types/qrcode.react/index.d.ts +++ b/types/qrcode.react/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for qrcode.react 0.6 +// Type definitions for qrcode.react 0.8 // Project: https://github.com/zpao/qrcode.react // Definitions by: Mleko // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -13,6 +13,7 @@ declare namespace qrcode { bgColor?: string; fgColor?: string; level?: "L"|"M"|"Q"|"H"; + renderAs?: "svg" | "canvas"; } type QRCode = React.ComponentClass; diff --git a/types/qrcode.react/qrcode.react-tests.tsx b/types/qrcode.react/qrcode.react-tests.tsx index 25136d1a97..b91c1e7944 100644 --- a/types/qrcode.react/qrcode.react-tests.tsx +++ b/types/qrcode.react/qrcode.react-tests.tsx @@ -9,4 +9,5 @@ const qrcodes = [ , , , + , ]; diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 44ef2167ae..ad57afda3f 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -971,6 +971,7 @@ declare namespace R { * Returns a list containing the names of all the enumerable own * properties of the supplied object. */ + keys(x: T): Array; keys(x: T): string[]; /** diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index 1b78af72b2..e47aa01e3c 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -1574,7 +1574,10 @@ class Rectangle { }; () => { - R.keys({a: 1, b: 2, c: 3}); // => ['a', 'b', 'c'] + const objKeys = R.keys({a: 1, b: 2, c: 3}); // => ['a', 'b', 'c'] + const numberKeys = R.keys(1); + const arrayKeys = R.keys([]); + const stringKeys = R.keys('foo'); }; () => { diff --git a/types/randomcolor/index.d.ts b/types/randomcolor/index.d.ts index afa6bf4a69..8a95bf6d65 100644 --- a/types/randomcolor/index.d.ts +++ b/types/randomcolor/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for randomColor 0.4.1 +// Type definitions for randomColor 0.5.0 // Project: https://github.com/davidmerfield/randomColor // Definitions by: Mathias Feitzinger , Brady Liles // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -11,6 +11,7 @@ interface RandomColorOptions { count?: number; seed?: number | string; format?: "hsvArray" | "hslArray" | "hsl" | "hsla" | "rgbArray" | "rgb" | "rgba" | "hex"; + alpha?: number; } declare module "randomcolor" { diff --git a/types/rc-tree/index.d.ts b/types/rc-tree/index.d.ts index 1ec7cc1e26..206f8abeaa 100644 --- a/types/rc-tree/index.d.ts +++ b/types/rc-tree/index.d.ts @@ -110,6 +110,8 @@ export interface OnDropData { node: InternalTreeNode; dragNode: InternalTreeNode; dragNodesKeys: string[]; + dropPosition: number; + dropToGap?: boolean; } export interface OnDragEndData { diff --git a/types/react-albus/index.d.ts b/types/react-albus/index.d.ts new file mode 100644 index 0000000000..dabdb4b81a --- /dev/null +++ b/types/react-albus/index.d.ts @@ -0,0 +1,38 @@ +// Type definitions for react-albus 2.0 +// Project: https://github.com/americanexpress/react-albus#readme +// Definitions by: Sindre Seppola +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from "react"; +import { History } from "history"; + +export interface WizardStepObject { + id: string; +} + +export interface WizardContext { + step: WizardStepObject; + steps: WizardStepObject[]; + history: History; + next: () => void; + previous: () => void; + go: (n: number) => void; + push: (id?: string) => void; + replace: (id?: string) => void; +} + +export const Wizard: React.ComponentType<{ + onNext?: (wizard: WizardContext) => void; + render?: (wizard: WizardContext) => React.ReactNode; + history?: History; +}>; + +export const Steps: React.ComponentType<{ + step?: WizardStepObject; +}>; + +export const Step: React.ComponentType<{ + id: string; + render: (wizard: WizardContext) => React.ReactNode; +}>; diff --git a/types/react-albus/react-albus-tests.tsx b/types/react-albus/react-albus-tests.tsx new file mode 100644 index 0000000000..3654845923 --- /dev/null +++ b/types/react-albus/react-albus-tests.tsx @@ -0,0 +1,52 @@ +import * as React from "react"; +import { Wizard, Step, Steps } from "react-albus"; + +const Example = () => ( + { + wiz.go(0); + const location = wiz.history.location; + wiz.next(); + wiz.previous(); + wiz.push("merlin"); + wiz.replace(wiz.step.id); + wiz.steps.map(step => { + wiz.push(step.id); + }); + }} + render={wiz => ( + + ( +
+

Merlin

+ +
+ )} + /> + ( +
+

Gandalf

+ + +
+ )} + /> + ( +
+

Dumbledore

+ +
+ )} + /> +
+ )} + /> +); diff --git a/types/react-albus/tsconfig.json b/types/react-albus/tsconfig.json new file mode 100644 index 0000000000..23dcedc16b --- /dev/null +++ b/types/react-albus/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-albus-tests.tsx" + ] +} diff --git a/types/react-albus/tslint.json b/types/react-albus/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-albus/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-big-calendar/index.d.ts b/types/react-big-calendar/index.d.ts index bcaee40549..b73ffcc0d9 100644 --- a/types/react-big-calendar/index.d.ts +++ b/types/react-big-calendar/index.d.ts @@ -3,14 +3,17 @@ // Definitions by: Piotr Witek // Austin Turner // Krzysztof Bezrąk +// Sebastian Silbermann // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.7 import * as React from 'react'; export type stringOrDate = string | Date; export type View = 'month' | 'week' | 'work_week' | 'day' | 'agenda'; export type Navigate = 'PREV' | 'NEXT' | 'TODAY' | 'DATE'; + +export type Event = object; export interface Format { /** * Format for the day of the month heading in the Month view. @@ -127,17 +130,17 @@ export interface Messages { showMore?: (count: number) => string; } -export interface BigCalendarProps extends React.Props { +export interface BigCalendarProps extends React.Props> { date?: stringOrDate; now?: Date; view?: View; - events?: object[]; + events?: T[]; onNavigate?: (newDate: Date, action: Navigate) => void; onView?: (view: View) => void; onDrillDown?: (date: Date, view: View) => void; onSelectSlot?: (slotInfo: { start: stringOrDate, end: stringOrDate, slots: Date[] | string[], action: 'select' | 'click' | 'doubleClick' }) => void; - onDoubleClickEvent?: (event: object, e: React.SyntheticEvent) => void; - onSelectEvent?: (event: object, e: React.SyntheticEvent) => void; + onDoubleClickEvent?: (event: T, e: React.SyntheticEvent) => void; + onSelectEvent?: (event: T, e: React.SyntheticEvent) => void; onSelecting?: (range: { start: stringOrDate, end: stringOrDate }) => boolean | undefined | null; selected?: any; views?: View[] | { @@ -156,7 +159,7 @@ export interface BigCalendarProps extends React.Props { step?: number; timeslots?: number; rtl?: boolean; - eventPropGetter?: (event: object, start: stringOrDate, end: stringOrDate, isSelected: boolean) => { className?: string, style?: React.CSSProperties }; + eventPropGetter?: (event: T, start: stringOrDate, end: stringOrDate, isSelected: boolean) => { className?: string, style?: React.CSSProperties }; slotPropGetter?: (date: Date) => { className?: string, style?: object }; dayPropGetter?: (date: Date) => { className?: string, style?: object }; showMultiDayTimes?: boolean; @@ -167,21 +170,21 @@ export interface BigCalendarProps extends React.Props { formats?: Format; components?: Components; messages?: Messages; - titleAccessor?: string | ((event: any) => string); - allDayAccessor?: string | ((event: any) => boolean); - startAccessor?: string | ((event: any) => Date); - endAccessor?: string | ((event: any) => Date); - resourceAccessor?: string | ((event: any) => any); + titleAccessor?: keyof T | ((event: T) => string); + allDayAccessor?: keyof T | ((event: T) => boolean); + startAccessor?: keyof T | ((event: T) => Date); + endAccessor?: keyof T | ((event: T) => Date); + resourceAccessor?: keyof T | ((event: T) => any); resources?: any[]; - resourceIdAccessor?: string | ((event: any) => any); - resourceTitleAccessor?: string | ((event: any) => string); + resourceIdAccessor?: keyof T | ((event: T) => any); + resourceTitleAccessor?: keyof T | ((event: T) => string); defaultView?: View; defaultDate?: Date; className?: string; elementProps?: React.HTMLAttributes; } -export default class BigCalendar extends React.Component { +export default class BigCalendar extends React.Component> { /** * Setup the localizer by providing the moment Object */ diff --git a/types/react-big-calendar/react-big-calendar-tests.tsx b/types/react-big-calendar/react-big-calendar-tests.tsx index dbb1753332..fe0ba7fe7c 100644 --- a/types/react-big-calendar/react-big-calendar-tests.tsx +++ b/types/react-big-calendar/react-big-calendar-tests.tsx @@ -45,7 +45,7 @@ console.log('Test Results -> BasicExample', basicExampleHtml); // Full API Example Test - based on API Documentation // http://intljusticemission.github.io/react-big-calendar/examples/index.html#api -class FullAPIExample extends React.Component { +class FullAPIExample extends React.Component> { render() { return ( { diff --git a/types/react-bootstrap/index.d.ts b/types/react-bootstrap/index.d.ts index d015ce6402..2427c5cbc6 100644 --- a/types/react-bootstrap/index.d.ts +++ b/types/react-bootstrap/index.d.ts @@ -14,7 +14,7 @@ // Johann Rakotoharisoa // Andrew Makarov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from 'react'; diff --git a/types/react-circular-progressbar/index.d.ts b/types/react-circular-progressbar/index.d.ts index 2d3e7f228e..8c8664a69f 100644 --- a/types/react-circular-progressbar/index.d.ts +++ b/types/react-circular-progressbar/index.d.ts @@ -18,16 +18,9 @@ export interface Props { backgroundPadding?: number; initialAnimation?: boolean; counterClockwise?: boolean; - classForPercentage?: FalseyCallback; - textForPercentage?: FalseyCallback; + text?: string; } -export type FalseyCallback = - | '' - | false - | null - | ((percentage: number) => string); - export interface GroupOverride { root?: T; trail?: T; diff --git a/types/react-circular-progressbar/react-circular-progressbar-tests.tsx b/types/react-circular-progressbar/react-circular-progressbar-tests.tsx index a6fecb5fa4..25785d76cd 100644 --- a/types/react-circular-progressbar/react-circular-progressbar-tests.tsx +++ b/types/react-circular-progressbar/react-circular-progressbar-tests.tsx @@ -10,13 +10,13 @@ render( (val > 50 ? val.toString() : '')} + text={'55%'} strokeWidth={16} /> , diff --git a/types/react-coinhive/index.d.ts b/types/react-coinhive/index.d.ts new file mode 100644 index 0000000000..e266db590b --- /dev/null +++ b/types/react-coinhive/index.d.ts @@ -0,0 +1,44 @@ +// Type definitions for react-coinhive 1.0 +// Project: https://github.com/dragma/react-coinhive +// Definitions by: sktbcbbs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from 'react'; + +export interface CoinHiveProps { + autoThreads?: boolean; + + run?: boolean; + + siteKey: string; + + src?: string; + + threads?: number; + + throttle?: number; + + userName?: string; + + onInit?: (callback: any) => void; + + onStart?: (callback: any) => void; + + onStop?: (callback: any) => void; +} + +export default class CoinHive extends React.Component { + static getMinerData(miner: any): any; + + static src: { + authedmine: string; + coinhive: string; + }; + + onInit(miner: any): any; + + onStart(miner: any): any; + + onStop(miner: any): any; +} diff --git a/types/react-coinhive/react-coinhive-tests.tsx b/types/react-coinhive/react-coinhive-tests.tsx new file mode 100644 index 0000000000..c108c7cddb --- /dev/null +++ b/types/react-coinhive/react-coinhive-tests.tsx @@ -0,0 +1,23 @@ +import * as React from "react"; +import CoinHive, { CoinHiveProps } from "react-coinhive"; + +export class CoinHiveTest extends React.Component { + render() { + const props: CoinHiveProps = { + userName: "Maya", + siteKey: "tbzWvRTBa3VAKefxUmDZx6P6wjCSHXz0", + autoThreads: false, + threads: 2, + src: CoinHive.src.authedmine, + onInit: () => {}, + onStart: () => {}, + onStop: () => {}, + }; + + return ( +
+ +
+ ); + } +} diff --git a/types/react-native-navigation/tsconfig.json b/types/react-coinhive/tsconfig.json similarity index 85% rename from types/react-native-navigation/tsconfig.json rename to types/react-coinhive/tsconfig.json index a8e66bb44a..bd9fbfee80 100644 --- a/types/react-native-navigation/tsconfig.json +++ b/types/react-coinhive/tsconfig.json @@ -15,10 +15,10 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, - "jsx": "react-native" + "jsx": "react" }, "files": [ "index.d.ts", - "react-native-navigation-tests.tsx" + "react-coinhive-tests.tsx" ] -} \ No newline at end of file +} diff --git a/types/react-coinhive/tslint.json b/types/react-coinhive/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-coinhive/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-copy-write/index.d.ts b/types/react-copy-write/index.d.ts new file mode 100644 index 0000000000..30ce123c85 --- /dev/null +++ b/types/react-copy-write/index.d.ts @@ -0,0 +1,52 @@ +// Type definitions for react-copy-write 0.7 +// Project: https://github.com/aweary/react-copy-write +// Definitions by: Sam A. Horvath-Hunt +// Dave Jeffery +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { Component } from 'react'; + +// It'd be nice if this could somehow be improved! Perhaps we need variadic +// kinds plus infer keyword? Alternatively unions may solve our issue if we had +// the ability to restrict type widening. +type AnyDeepMemberOfState = any; + +type MutateFn = (draft: T, state: Readonly) => void; +type Mutator = (mutator: MutateFn) => void; + +type SelectorFn = (state: T) => AnyDeepMemberOfState; + +type RenderFn = (...state: Array>>>) => JSX.Element | JSX.Element[] | null; + +interface ConsumerPropsBase { + select?: Array>; +} + +interface ConsumerPropsExplicitRender extends ConsumerPropsBase { + render?: RenderFn; +} + +interface ConsumerPropsImplicitRender extends ConsumerPropsBase { + children?: RenderFn; +} + +type ConsumerProps = ConsumerPropsExplicitRender | ConsumerPropsImplicitRender; + +declare class Consumer extends Component> {} + +interface ProviderProps { + children: JSX.Element | JSX.Element[]; + initialState?: Partial; +} + +declare class Provider extends Component> {} + +declare function create(state: T): { + Provider: new() => Provider, + Consumer: new() => Consumer, + createSelector: SelectorFn, + mutate: Mutator, +}; + +export default create; diff --git a/types/react-copy-write/react-copy-write-tests.tsx b/types/react-copy-write/react-copy-write-tests.tsx new file mode 100644 index 0000000000..8effd45986 --- /dev/null +++ b/types/react-copy-write/react-copy-write-tests.tsx @@ -0,0 +1,30 @@ +import * as React from 'react'; +import { render } from 'react-dom'; +import createStore from 'react-copy-write'; + +const { Provider, Consumer, mutate } = createStore({ + letter: 'a', + number: 1, +}); + +const incrementNumber = () => mutate((draft) => { + draft.number++; +}); + +const App = () => ( + +
+ + {state => ( +
Letter: {state.letter}
+ )} +
+ + ( +
Number (increment): {state.number}
+ )} /> +
+
+); + +render(, document.body); diff --git a/types/react-copy-write/tsconfig.json b/types/react-copy-write/tsconfig.json new file mode 100644 index 0000000000..3c361b02f5 --- /dev/null +++ b/types/react-copy-write/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-copy-write-tests.tsx" + ] +} diff --git a/types/react-copy-write/tslint.json b/types/react-copy-write/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-copy-write/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-custom-scrollbars/index.d.ts b/types/react-custom-scrollbars/index.d.ts index 7f60cc8a2a..f21ec7adba 100644 --- a/types/react-custom-scrollbars/index.d.ts +++ b/types/react-custom-scrollbars/index.d.ts @@ -44,8 +44,8 @@ declare module "react-custom-scrollbars" { universal?: boolean; autoHeight?: boolean; - autoHeightMin?: number; - autoHeightMax?: number; + autoHeightMin?: number | string; + autoHeightMax?: number | string; } export default class Scrollbars extends React.Component { diff --git a/types/react-data-grid/index.d.ts b/types/react-data-grid/index.d.ts index 82070c673c..9c6ca297eb 100644 --- a/types/react-data-grid/index.d.ts +++ b/types/react-data-grid/index.d.ts @@ -130,6 +130,17 @@ declare namespace AdazzleReactDataGrid { * @param sortDirection The direction to sort ('ASC'/'DESC'/'NONE') */ onGridSort?: (sortColumn: string, sortDirection: 'ASC' | 'DESC' | 'NONE') => void + + /** + * Initial sorting direction + */ + sortDirection?: 'ASC' | 'DESC' | 'NONE' + + /** + * key of the initial sorted column + */ + sortColumn?: string + /** * Called when the user filters a column by some value. * Should restrict the rows in rowGetter to only things that match the filter. diff --git a/types/react-datepicker/index.d.ts b/types/react-datepicker/index.d.ts index 75fc9c47bb..5f48988dd4 100644 --- a/types/react-datepicker/index.d.ts +++ b/types/react-datepicker/index.d.ts @@ -5,12 +5,14 @@ // Greg Smith , // Platon Pronko // Roy Xue -// Koala Human +// Koala Human +// Sean Kelley // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 import * as React from "react"; import * as moment from "moment"; +import * as Popper from "popper.js"; export interface ReactDatePickerProps { adjustDateOnChange?: boolean; @@ -18,7 +20,7 @@ export interface ReactDatePickerProps { autoComplete?: string; autoFocus?: boolean; calendarClassName?: string; - children?: any; + children?: React.ReactNode; className?: string; customInput?: React.ReactNode; customInputRef?: string; @@ -29,24 +31,27 @@ export interface ReactDatePickerProps { disabledKeyboardNavigation?: boolean; dropdownMode?: 'scroll' | 'select'; endDate?: moment.Moment; - excludeDates?: any[]; + excludeDates?: moment.Moment[]; + excludeTimes?: moment.Moment[]; filterDate?(date: moment.Moment): boolean; fixedHeight?: boolean; forceShowMonthNavigation?: boolean; formatWeekNumber?(date: moment.Moment): string | number; - highlightDates?: any[]; + highlightDates?: moment.Moment[]; id?: string; - includeDates?: any[]; - includeTimes?: any[]; + includeDates?: moment.Moment[]; + includeTimes?: moment.Moment[]; inline?: boolean; isClearable?: boolean; locale?: string; maxDate?: moment.Moment; + maxTime?: moment.Moment; minDate?: moment.Moment; + minTime?: moment.Moment; monthsShown?: number; name?: string; onBlur?(event: React.FocusEvent): void; - onChange(date: moment.Moment | null, event: React.SyntheticEvent | undefined): any; + onChange(date: moment.Moment | null, event: React.SyntheticEvent | undefined): void; onChangeRaw?(event: React.FocusEvent): void; onClickOutside?(event: React.MouseEvent): void; onFocus?(event: React.FocusEvent): void; @@ -60,41 +65,38 @@ export interface ReactDatePickerProps { placeholderText?: string; popperClassName?: string; popperContainer?(props: { children: React.ReactNode[] }): React.ReactNode; - popperModifiers?: any; + popperModifiers?: Popper.Modifiers; popperPlacement?: string; preventOpenOnFocus?: boolean; readOnly?: boolean; required?: boolean; - scrollableYearDropdown?: boolean; scrollableMonthYearDropdown?: boolean; + scrollableYearDropdown?: boolean; selected?: moment.Moment | null; selectsEnd?: boolean; selectsStart?: boolean; + shouldCloseOnSelect?: boolean; showDisabledMonthNavigation?: boolean; showMonthDropdown?: boolean; showMonthYearDropdown?: boolean; + showTimeSelect?: boolean; + showTimeSelectOnly?: boolean; showWeekNumbers?: boolean; showYearDropdown?: boolean; startDate?: moment.Moment; startOpen?: boolean; tabIndex?: number; + timeFormat?: string; + timeIntervals?: number; title?: string; todayButton?: string; - useWeekdaysShort?: boolean; useShortMonthInDropdown?: boolean; + useWeekdaysShort?: boolean; utcOffset?: number; value?: string; weekLabel?: string; withPortal?: boolean; yearDropdownItemNumber?: number; - shouldCloseOnSelect?: boolean; - showTimeSelect?: boolean; - showTimeSelectOnly?: boolean; - timeFormat?: string; - timeIntervals?: number; - minTime?: moment.Moment; - maxTime?: moment.Moment; - excludeTimes?: any[]; } declare const ReactDatePicker: React.ClassicComponentClass; export default ReactDatePicker; diff --git a/types/react-datepicker/package.json b/types/react-datepicker/package.json index 19e5fb0d14..fc763e4d4b 100644 --- a/types/react-datepicker/package.json +++ b/types/react-datepicker/package.json @@ -1,6 +1,7 @@ { "private": true, "dependencies": { - "moment": ">=2.14.0" + "moment": ">=2.14.0", + "popper.js": "^1.14.1" } } diff --git a/types/react-datepicker/react-datepicker-tests.tsx b/types/react-datepicker/react-datepicker-tests.tsx index 8f450adcab..1414672684 100644 --- a/types/react-datepicker/react-datepicker-tests.tsx +++ b/types/react-datepicker/react-datepicker-tests.tsx @@ -1,36 +1,18 @@ import * as React from 'react'; -import moment = require('moment'); +import * as moment from 'moment'; import DatePicker from 'react-datepicker'; -class ReactDatePicker extends React.Component<{}, { startDate: moment.Moment; displayName: string; }> { - constructor(props: {}) { - super(props); - this.handleChange = this.handleChange.bind(this); - } - state = { - startDate: moment(), - displayName: 'Example' - }; - - handleChange = function(date?: moment.Moment | null) { - this.setState({ - startDate: date - }); - }; - - handleYearChange = (date: moment.Moment) => { - this.setState({ - startDate: date - }); - } - - render() { - return ( - - ); - } -} + {}} + onYearChange={(date: moment.Moment) => {}} + popperModifiers={{ + flip: { + enabled: false + } + }} + includeTimes={[moment()]} +> +
+ +; diff --git a/types/react-gateway/Gateway.d.ts b/types/react-gateway/Gateway.d.ts new file mode 100644 index 0000000000..8fabcc95d5 --- /dev/null +++ b/types/react-gateway/Gateway.d.ts @@ -0,0 +1,9 @@ +import * as React from 'react'; + +declare namespace Gateway { + interface GatewayProps { + into: string; + } +} +declare class Gateway extends React.Component { } +export = Gateway; diff --git a/types/react-gateway/GatewayDest.d.ts b/types/react-gateway/GatewayDest.d.ts new file mode 100644 index 0000000000..4fd7928b2f --- /dev/null +++ b/types/react-gateway/GatewayDest.d.ts @@ -0,0 +1,11 @@ +import * as React from 'react'; + +declare namespace GatewayDest { + interface GatewayDestProps { + name: string; + tagName?: string; + component?: string | React.Component; + } +} +declare class GatewayDest extends React.Component { } +export = GatewayDest; diff --git a/types/react-gateway/GatewayProvider.d.ts b/types/react-gateway/GatewayProvider.d.ts new file mode 100644 index 0000000000..2d971539ea --- /dev/null +++ b/types/react-gateway/GatewayProvider.d.ts @@ -0,0 +1,4 @@ +import * as React from 'react'; + +declare class GatewayProvider extends React.Component { } +export = GatewayProvider; diff --git a/types/react-gateway/GatewayRegistry.d.ts b/types/react-gateway/GatewayRegistry.d.ts new file mode 100644 index 0000000000..260a7e03be --- /dev/null +++ b/types/react-gateway/GatewayRegistry.d.ts @@ -0,0 +1,20 @@ +declare class GatewayRegistry { + _containers: { [name: string]: React.Component | null | undefined }; + _children: { [name: string]: { [gatewayId: string]: React.ReactNode } | undefined }; + _currentId: number; + + _renderContainer(name: string): void; + + addContainer(name: string, container: React.Component): void; + + removeContainer(name: string): void; + + addChild(name: string, gatewayId: string, child: React.ReactNode): void; + + clearChild(name: string, gatewayId: string): void; + + register(name: string, child: React.ReactNode): string; + + unregister(name: string, gatewayId: string): void; +} +export = GatewayRegistry; diff --git a/types/react-gateway/index.d.ts b/types/react-gateway/index.d.ts new file mode 100644 index 0000000000..7c90464019 --- /dev/null +++ b/types/react-gateway/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for react-gateway 2.8 +// Project: https://github.com/cloudflare/react-gateway +// Definitions by: Jason Unger +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import Gateway = require('./Gateway'); +import { GatewayProps } from './Gateway'; +import GatewayDest = require('./GatewayDest'); +import { GatewayDestProps } from './GatewayDest'; +import GatewayProvider = require('./GatewayProvider'); +import GatewayRegistry = require('./GatewayRegistry'); + +export { + Gateway, + GatewayProps, + GatewayDest, + GatewayDestProps, + GatewayProvider, + GatewayRegistry +}; diff --git a/types/react-gateway/react-gateway-tests.tsx b/types/react-gateway/react-gateway-tests.tsx new file mode 100644 index 0000000000..bbf24dd741 --- /dev/null +++ b/types/react-gateway/react-gateway-tests.tsx @@ -0,0 +1,36 @@ +import * as React from 'react'; +import { Gateway, GatewayProvider, GatewayDest } from 'react-gateway'; + +class ReactGateway extends React.Component { + render() { + return ( + +
+ Text goes here. +
+
+ ); + } +} + +class ReactGatewayProvider extends React.Component { + render() { + return ( + + +
+ All the way down... +
+ Almost there... +
+ Getting close... +
+ +
+
+
+
+
+ ); + } +} diff --git a/types/react-gateway/tsconfig.json b/types/react-gateway/tsconfig.json new file mode 100644 index 0000000000..58ecf35a63 --- /dev/null +++ b/types/react-gateway/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, + "jsx": "react" + }, + "files": [ + "Gateway.d.ts", + "GatewayDest.d.ts", + "GatewayProvider.d.ts", + "GatewayRegistry.d.ts", + "index.d.ts", + "react-gateway-tests.tsx" + ] +} diff --git a/types/react-gateway/tslint.json b/types/react-gateway/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-gateway/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-hammerjs/index.d.ts b/types/react-hammerjs/index.d.ts new file mode 100644 index 0000000000..e3bb4a826c --- /dev/null +++ b/types/react-hammerjs/index.d.ts @@ -0,0 +1,45 @@ +// Type definitions for react-hammerjs 0.5 +// Project: https://github.com/JedWatson/react-hammerjs#readme +// Definitions by: Jason Unger +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as Hammer from 'hammerjs'; +import * as React from 'react'; + +type Omit = Pick>; + +type HammerOptionsWithRecognizers = Omit & { + recognizers?: { [gesture: string]: RecognizerOptions }; +}; + +declare namespace ReactHammer { + interface ReactHammerProps { + direction?: number; + options?: HammerOptionsWithRecognizers; + recognizeWith?: { [gesture: string]: Recognizer | string }; + vertical?: boolean; + action?: HammerListener; + onDoubleTap?: HammerListener; + onPan?: HammerListener; + onPanCancel?: HammerListener; + onPanEnd?: HammerListener; + onPanStart?: HammerListener; + onPinch?: HammerListener; + onPinchCancel?: HammerListener; + onPinchEnd?: HammerListener; + onPinchIn?: HammerListener; + onPinchStart?: HammerListener; + onPress?: HammerListener; + onPressUp?: HammerListener; + onRotate?: HammerListener; + onRotateCancel?: HammerListener; + onRotateEnd?: HammerListener; + onRotateMove?: HammerListener; + onRotateStart?: HammerListener; + onSwipe?: HammerListener; + onTap?: HammerListener; + } +} +declare const ReactHammer: React.ComponentClass; +export = ReactHammer; diff --git a/types/react-hammerjs/react-hammerjs-tests.tsx b/types/react-hammerjs/react-hammerjs-tests.tsx new file mode 100644 index 0000000000..7743cf3a4b --- /dev/null +++ b/types/react-hammerjs/react-hammerjs-tests.tsx @@ -0,0 +1,17 @@ +import * as React from 'react'; +import Hammer from 'react-hammerjs'; + +class ReactHammer extends React.Component { + swipe: Hammer.ReactHammerProps['onSwipe'] = input => { + console.log(input.deltaX); + } + + render() { + const { children, ...props } = this.props; + return ( + + {children} + + ); + } +} diff --git a/types/react-hammerjs/tsconfig.json b/types/react-hammerjs/tsconfig.json new file mode 100644 index 0000000000..f981b934ea --- /dev/null +++ b/types/react-hammerjs/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react", + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "react-hammerjs-tests.tsx" + ] +} diff --git a/types/react-hammerjs/tslint.json b/types/react-hammerjs/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-hammerjs/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-i18next/index.d.ts b/types/react-i18next/index.d.ts index 5ea0e7cb91..3f019617c1 100644 --- a/types/react-i18next/index.d.ts +++ b/types/react-i18next/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for react-i18next 7.6 +// Type definitions for react-i18next 7.8 // Project: https://github.com/i18next/react-i18next // Definitions by: Giedrius Grabauskas // Simon Baumann +// Benedict Etzel // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 diff --git a/types/react-i18next/src/trans.d.ts b/types/react-i18next/src/trans.d.ts index c5652315c7..3ef535cf5d 100644 --- a/types/react-i18next/src/trans.d.ts +++ b/types/react-i18next/src/trans.d.ts @@ -5,13 +5,20 @@ export interface TOptions { [key: string]: any; } +export interface Values { + [key: string]: any; +} + export interface TransProps { i18nKey?: string; count?: number; - parent?: string; + parent?: React.ReactNode | (() => React.ReactNode); i18n?: i18n; t?: TranslationFunction; tOptions?: TOptions; + defaults?: string; + values?: Values; + components?: React.ReactNode[]; } export default class Trans extends React.Component { } diff --git a/types/react-i18next/test/react-i18next-tests.tsx b/types/react-i18next/test/react-i18next-tests.tsx index 7f49913c44..d3afe7643a 100644 --- a/types/react-i18next/test/react-i18next-tests.tsx +++ b/types/react-i18next/test/react-i18next-tests.tsx @@ -114,12 +114,23 @@ loadNamespaces({components: [App], i18n}).then(() => { ; ; ; +}/>; +
}/>; ; ; ; ; +placeholder + ]} + values={{ + universe: "World" + }} +/>; type Key = "view" | "nav"; diff --git a/types/react-icon-base/index.d.ts b/types/react-icon-base/index.d.ts index 7459349b82..2103acc3c3 100644 --- a/types/react-icon-base/index.d.ts +++ b/types/react-icon-base/index.d.ts @@ -8,6 +8,8 @@ import * as React from "react"; export interface IconBaseProps extends React.SVGProps { size?: string | number; + style?: any; + color?: string; } export default class IconBaseClass extends React.Component {} diff --git a/types/react-js-pagination/index.d.ts b/types/react-js-pagination/index.d.ts new file mode 100644 index 0000000000..b4de877d79 --- /dev/null +++ b/types/react-js-pagination/index.d.ts @@ -0,0 +1,40 @@ +// Type definitions for react-js-pagination 3.0 +// Project: https://github.com/vayser/react-js-pagination +// Definitions by: Ernesto Cruz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +import * as React from "react"; + +export interface ReactJsPaginationProps { + totalItemsCount: number; + onChange: (pageNumber: number) => void; + activePage: number; + itemsCountPerPage?: number; + pageRangeDisplayed?: number; + prevPageText?: string| React.ReactElement; + nextPageText?: string | React.ReactElement; + lastPageText?: string | React.ReactElement; + firstPageText?: string | React.ReactElement; + disabledClass?: string; + hideDisabled?: boolean; + hideNavigation?: boolean; + innerClass?: string; + itemClass?: string; + itemClassFirst?: string; + itemClassPrev?: string; + itemClassNext?: string; + itemClassLast?: string; + linkClass?: string; + activeClass?: string; + activeLinkClass?: string; + linkClassFirst?: string; + linkClassPrev?: string; + linkClassNext?: string; + linkClassLast?: string; + hideFirstLastPages?: boolean; + getPageUrl?(): string; +} +declare const Pagination: React.ClassicComponentClass; + +export default Pagination; diff --git a/types/react-js-pagination/react-js-pagination-tests.tsx b/types/react-js-pagination/react-js-pagination-tests.tsx new file mode 100644 index 0000000000..d9c0a917a5 --- /dev/null +++ b/types/react-js-pagination/react-js-pagination-tests.tsx @@ -0,0 +1,24 @@ +import * as React from 'react'; +import Pagination from 'react-js-pagination'; + +class ReactPagination extends React.Component<{}, {activePage: number}> { + constructor(props: {}) { + super(props); + this.state = { + activePage: 1 + }; + this.handleChange = this.handleChange.bind(this); + } + handleChange(pageNumber: number) { + this.setState({ + activePage: pageNumber + }); + } + render() { + return ( + + ); + } +} diff --git a/types/react-js-pagination/tsconfig.json b/types/react-js-pagination/tsconfig.json new file mode 100644 index 0000000000..38a9519496 --- /dev/null +++ b/types/react-js-pagination/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "react-js-pagination-tests.tsx" + ] +} \ No newline at end of file diff --git a/types/react-js-pagination/tslint.json b/types/react-js-pagination/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/react-js-pagination/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/react-jsonschema-form/index.d.ts b/types/react-jsonschema-form/index.d.ts index 52903e8375..ff061cfcdb 100644 --- a/types/react-jsonschema-form/index.d.ts +++ b/types/react-jsonschema-form/index.d.ts @@ -5,6 +5,7 @@ // Ivan Jiang // Kurt Preston // Philippe Bourdages +// Lucian Buzzo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -133,8 +134,8 @@ declare module "react-jsonschema-form" { }; export type ArrayFieldTemplateProps = { - DescriptionField: object; - TitleField: object; + DescriptionField: React.StatelessComponent<{ id: string, description: string | React.ReactElement }>; + TitleField: React.StatelessComponent<{ id: string, title: string, required: boolean }>; canAdd: boolean; className: string; disabled: boolean; @@ -166,8 +167,8 @@ declare module "react-jsonschema-form" { }; export type ObjectFieldTemplateProps = { - DescriptionField: object; - TitleField: object; + DescriptionField: React.StatelessComponent<{ id: string, description: string | React.ReactElement }>; + TitleField: React.StatelessComponent<{ id: string, title: string, required: boolean }>; title: string; description: string; properties: { diff --git a/types/react-modal/index.d.ts b/types/react-modal/index.d.ts index 9a0d534af2..9dfbf7bdf7 100644 --- a/types/react-modal/index.d.ts +++ b/types/react-modal/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-modal 3.1 +// Type definitions for react-modal 3.2 // Project: https://github.com/reactjs/react-modal // Definitions by: Rajab Shakirov , // Drew Noakes , @@ -92,6 +92,12 @@ declare namespace ReactModal { /* String indicating how the content container should be announced to screenreaders. */ contentLabel?: string; + + /* Function accepting the ref for the content */ + contentRef?: (instance: HTMLDivElement) => void; + + /* Function accepting the ref for the overlay */ + overlayRef?: (instance: HTMLDivElement) => void; } } diff --git a/types/react-modal/react-modal-tests.tsx b/types/react-modal/react-modal-tests.tsx index 76958adbb3..463ac1c7be 100644 --- a/types/react-modal/react-modal-tests.tsx +++ b/types/react-modal/react-modal-tests.tsx @@ -8,6 +8,8 @@ ReactModal.setAppElement("#main"); ReactModal.setAppElement(document.getElementById("#main")); class ExampleOfUsingReactModal extends React.Component { + contentRef: HTMLDivElement; + overlayRef: HTMLDivElement; render() { const onAfterOpenFn = () => { }; const onRequestCloseFn = () => { }; @@ -61,6 +63,8 @@ class ExampleOfUsingReactModal extends React.Component { overlayClassName={customOverlayClasses} bodyOpenClassName={'bodyOpenClassName'} aria={customAriaVariables} + contentRef={instance => this.contentRef = instance} + overlayRef={instance => this.overlayRef = instance} >

Modal Content

Etc.

diff --git a/types/react-motion-ui-pack/index.d.ts b/types/react-motion-ui-pack/index.d.ts new file mode 100644 index 0000000000..0e0e518f70 --- /dev/null +++ b/types/react-motion-ui-pack/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for react-motion-ui-pack 0.10 +// Project: https://github.com/souporserious/react-motion-ui-pack +// Definitions by: Jason Unger +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from 'react'; +import * as motion from 'react-motion'; + +declare namespace Transition { + interface TransitionProps { + component?: string | boolean | React.ReactElement; + runOnMount?: boolean; + appear?: motion.Style; + enter?: motion.Style; + leave?: motion.Style; + onEnter?: (style: motion.PlainStyle) => void; + onLeave?: (style: motion.Style) => void; + } +} + +declare const Transition: React.ComponentClass; +export default Transition; diff --git a/types/react-motion-ui-pack/react-motion-ui-pack-tests.tsx b/types/react-motion-ui-pack/react-motion-ui-pack-tests.tsx new file mode 100644 index 0000000000..3bbeafc295 --- /dev/null +++ b/types/react-motion-ui-pack/react-motion-ui-pack-tests.tsx @@ -0,0 +1,16 @@ +import * as React from "react"; +import { spring } from "react-motion"; +import Transition from "react-motion-ui-pack"; + +class ReactMotionUIPackTransition extends React.Component { + render() { + return ( + +
Hello world.
+
+ ); + } +} diff --git a/types/react-motion-ui-pack/tsconfig.json b/types/react-motion-ui-pack/tsconfig.json new file mode 100644 index 0000000000..a30b04f804 --- /dev/null +++ b/types/react-motion-ui-pack/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "react-motion-ui-pack-tests.tsx" + ] +} diff --git a/types/react-motion-ui-pack/tslint.json b/types/react-motion-ui-pack/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-motion-ui-pack/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-native-navigation/index.d.ts b/types/react-native-navigation/index.d.ts deleted file mode 100644 index 0b115935be..0000000000 --- a/types/react-native-navigation/index.d.ts +++ /dev/null @@ -1,315 +0,0 @@ -// Type definitions for react-native-navigation 1.1 -// Project: https://github.com/wix/react-native-navigation -// Definitions by: Egor Shulga -// Jason Merino -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 - -import * as React from 'react'; - -export namespace Navigation { - function registerComponent(screenID: string, generator: () => React.ComponentType, store?: any, provider?: any, options?: any): void; - function startTabBasedApp(params: TabBasedApp): void; - function startSingleScreenApp(params: SingleScreenApp): void; - function showModal(params: ModalScreen): void; - function dismissModal(params?: { animationType?: 'none' | 'slide-down' }): void; - function dismissAllModals(params?: { animationType?: 'none' | 'slide-down' }): void; - function showLightBox(params?: LightBox): void; - function dismissLightBox(): void; - function handleDeepLink(params?: { link: string; payload?: string; }): void; - function registerScreen(screenId: string, generator: () => React.ComponentType): void; - function getCurrentlyVisibleScreenId(): Promise; - function isAppLaunched(): Promise; -} - -export interface TabBasedApp { - tabs: TabScreen[]; - tabsStyle?: { - tabBarButtonColor?: string; - tabBarSelectedButtonColor?: string; - tabBarBackgroundColor?: string; - initialTabIndex?: number; - }; - appStyle?: { - orientation?: 'auto' | 'landscape' | 'portrait'; - bottomTabBadgeTextColor?: string; - bottomTabBadgeBackgroundColor?: string; - backButtonImage?: any; - hideBackButtonTitle?: boolean; - }; - drawer?: Drawer; - passProps?: object; - animationType?: 'none' | 'slide-down' | 'fade'; -} - -export interface IconInsets { - top?: number; - left?: number; - bottom?: number; - right?: number; -} - -export interface TabScreen { - label?: string; - screen: string; - icon?: any; - iconInsets?: IconInsets; - selectedIcon?: any; - title?: string; - navigatorStyle?: NavigatorStyle; - navigatorButtons?: NavigatorButtons; - titleImage?: any; -} - -export interface SingleScreenApp { - screen: Screen; - drawer?: Drawer; - passProps?: object; - animationType?: 'none' | 'slide-down' | 'fade'; - appStyle?: { - orientation?: 'auto' | 'landscape' | 'portrait'; - backButtonImage?: any; - hideBackButtonTitle?: boolean; - }; -} - -export interface Screen { - screen: string; - title?: string; - navigatorStyle?: NavigatorStyle; - navigatorButtons?: NavigatorButtons; - overrideBackPress?: boolean; -} - -export interface ModalScreen extends Screen { - passProps?: object; - animationType?: 'slide-up' | 'none'; -} - -export interface ResetScreen

extends Screen { - passProps?: P; - animated?: boolean; - animationType?: 'fade' | 'slide-horizontal'; -} - -export interface PushedScreen

extends ResetScreen

{ - titleImage?: any; - backButtonTitle?: string; - backButtonHidden?: boolean; - previewView?: React.Component | number; - previewHeight?: number; - previewCommit?: boolean; - previewActions?: Action[]; -} - -export interface Action { - id: string; - title: string; - style?: 'selected' | 'destructive'; - actions: Action[]; -} - -export interface LightBox { - screen: string; - passProps?: object; - style?: { - backgroundBlur?: 'dark' | 'light' | 'xlight' | 'none'; - backgroundColor?: string; - }; - adjustSoftInput?: 'nothing' | 'pan' | 'resize' | 'unspecified'; -} - -export interface NavigatorEvent { - id: 'willAppear' | 'didAppear' | 'willDisappear' | 'didDisappear' | 'willCommitPreview' | 'backPress' | 'bottomTabSelected' | 'bottomTabReselected' | string; - type: 'NavBarButtonPress' | 'DeepLink'; -} - -export class Navigator { - push

(params: PushedScreen

): void; - pop(params?: { animated?: boolean; animationType?: 'fade' | 'slide-horizontal'; }): void; - popToRoot(params?: { animated?: boolean; animationType?: 'fade' | 'slide-horizontal'; }): void; - resetTo

(params: PushedScreen

): void; - showModal(params: ModalScreen): void; - dismissModal(params?: { animationType?: 'none' | 'slide-down' }): void; - dismissAllModals(params?: { animationType?: 'none' | 'slide-down' }): void; - showLightBox(params: LightBox): void; - dismissLightBox(): void; - showInAppNotification(params?: { screen: string; passProps?: object; autoDismissTimerSec?: number }): void; - handleDeepLink(params: { link: string }): void; - setButtons(params: NavigatorButtons & { animated?: boolean }): void; - setTitle(params: { title: string }): void; - setSubTitle(params: { subtitle: string }): void; - toggleDrawer(params: { side: 'left' | 'right'; animated?: boolean; to?: 'open' | 'closed' }): void; - setDrawerEnabled(params: { side: 'left' | 'right'; enabled: boolean }): void; - toggleTabs(params: { to: 'hidden' | 'shown'; animated?: boolean }): void; - setTabBadge(params?: { tabIndex?: number; badge: number | null; badgeColor?: string; }): void; - setTabButton(params?: { tabIndex?: number; icon?: any; selectedIcon?: any; label?: string; }): void; - switchToTab(params?: { tabIndex?: number }): void; - toggleNavBar(params: { to: 'hidden' | 'shown'; animated?: boolean }): void; - setOnNavigatorEvent(callback: (event: NavigatorEvent) => void): void; - addOnNavigatorEvent(callback: (event: NavigatorEvent) => void): () => void; - screenIsCurrentlyVisible(): Promise; - setStyle(params: NavigatorStyle): void; -} - -export class ScreenVisibilityListener { - constructor(params: ScreenVisibilityListenerParams); - register(): void; - unregister(): void; -} - -export class NativeEventsReceiver { - constructor(); - appLaunched(callback: () => void): void; -} - -export interface ScreenVisibilityListenerParams { - willAppear?: (params: ListenerParams) => void; - didAppear?: (params: ListenerParams) => void; - willDisappear?: (params: ListenerParams) => void; - didDisappear?: (params: ListenerParams) => void; -} - -export interface ListenerParams { - screen: string; - startTime: number; - endTime: number; - commandType: string; -} - -export interface NavigationComponentProps { - navigator: Navigator; -} - -export interface NavigatorStyle { - navBarTextColor?: string; - navBarTextFontSize?: number; - navBarTextFontFamily?: string; - navBarBackgroundColor?: string; - navBarCustomView?: string; - navBarComponentAlignment?: 'center' | 'fill'; - navBarCustomViewInitialProps?: object; - navBarButtonColor?: string; - topBarElevationShadowEnabled?: boolean; - navBarHidden?: boolean; - navBarHideOnScroll?: boolean; - navBarTranslucent?: boolean; - navBarTransparent?: boolean; - navBarNoBorder?: boolean; - drawUnderNavBar?: boolean; - drawUnderTabBar?: boolean; - navBarBlur?: boolean; - tabBarHidden?: boolean; - statusBarHidden?: boolean; - statusBarTextColorScheme?: string; - navBarSubtitleColor?: string; - navBarSubtitleFontFamily?: string; - navBarSubtitleFontSize?: number; - screenBackgroundColor?: string; - orientation?: 'auto' | 'landscape' | 'portrait'; - disabledButtonColor?: string; - // iOS only - statusBarTextColorSchemeSingleScreen?: string; - statusBarHideWithNavBar?: boolean; - statusBarBlur?: boolean; - disabledBackGesture?: boolean; - disabledSimultaneousGesture?: boolean; - screenBackgroundImageName?: string; - rootBackgroundImageName?: string; - navBarButtonFontSize?: number; - navBarButtonFontWeight?: string | number; - navBarLeftButtonFontSize?: number; - navBarLeftButtonColor?: string; - navBarLeftButtonFontWeight?: string | number; - navBarRightButtonFontSize?: number; - navBarRightButtonColor?: string; - navBarRightButtonFontWeight?: string | number; - topBarShadowColor?: string; - topBarShadowOpacity?: number; - topBarShadowOffset?: number; - topBarShadowRadius?: number; - preferredContentSize?: { width: number, height: number }; - modalPresentationStyle?: 'formSheet' | 'pageSheet' | 'overFullScreen' | 'overCurrentContext' | 'fullScreen'; - largeTitle?: boolean; - // Android only - navigationBarColor?: string; - navBarTitleTextCentered?: boolean; - navBarButtonFontFamily?: string; - statusBarColor?: string; - drawUnderStatusBar?: boolean; - collapsingToolBarImage?: object; - collapsingToolBarCollapsedColor?: string; - navBarTextFontBold?: boolean; - navBarHeight?: number; - navBarTopPadding?: number; - topTabsHeight?: number; - topBarBorderColor?: string; - topBarBorderWidth?: number; -} - -export interface NavigatorButtons { - leftButtons?: NavigatorButton[]; - rightButtons?: NavigatorButton[]; - fab?: FABAndroid; -} - -export type IdAndroid = 'back' | 'cancel' | 'accept' | 'sideMenu'; - -export type SystemItemIOS = 'done' | 'cancel' | 'edit' | 'save' | 'add' | - 'flexibleSpace' | 'fixedSpace' | 'compose' | 'reply' | 'action' | 'organize' | - 'bookmarks' | 'search' | 'refresh' | 'stop' | 'camera' | 'trash' | 'play' | - 'pause' | 'rewind' | 'fastForward' | 'undo' | 'redo'; - -export type ShowAsActionAndroid = 'ifRoom' | 'always' | 'withText' | 'never'; - -export interface NavigatorButton { - id: string | IdAndroid; - title?: string; - icon?: any; - component?: string; - passProps?: object; - testID?: string; - disabled?: boolean; - disableIconTint?: boolean; - buttonColor?: string; - buttonFontSize?: number; - buttonFontWeight?: string | number; - systemItem?: SystemItemIOS; - showAsAction?: ShowAsActionAndroid; -} - -export interface FABAndroid { - collapsedId?: string; - collapsedIcon?: any; - collapsedIconColor?: string; - expendedId?: string; - expendedIcon?: any; - expendedIconColor?: string; - backgroundColor?: string; - actions?: NavigatorButton[]; -} - -export interface Drawer { - left?: { - screen: string; - passProps?: any; - disableOpenGesture?: boolean; - fixedWidth?: number; - }; - right?: { - screen: string; - passProps?: any; - disableOpenGesture?: boolean; - fixedWidth?: number; - }; - style?: { - drawerShadow?: boolean; - contentOverlayColor?: string; - leftDrawerWidth?: number; - rightDrawerWidth?: number; - shouldStretchDrawer?: boolean; - }; - type?: string; - animationType?: string; - disableOpenGesture?: boolean; -} diff --git a/types/react-native-navigation/react-native-navigation-tests.tsx b/types/react-native-navigation/react-native-navigation-tests.tsx deleted file mode 100644 index 0a3d593a2b..0000000000 --- a/types/react-native-navigation/react-native-navigation-tests.tsx +++ /dev/null @@ -1,216 +0,0 @@ -import * as React from 'react'; -import { Text, View } from 'react-native'; -import { - Navigation, - NavigationComponentProps, - NavigatorStyle, - NavigatorButtons, - NavigatorEvent, - NativeEventsReceiver, -} from 'react-native-navigation'; - -type Props = NavigationComponentProps & { height: number }; - -class Screen1 extends React.Component { - constructor(props: Props) { - super(props); - this.props.navigator.setOnNavigatorEvent(this.onNavigatorEvent); - } - - onNavigatorEvent = (event: NavigatorEvent) => { - if (event.id === 'willAppear') { - console.log('will appear'); - } else if (event.type === 'NavBarButtonPress' && event.id === 'sideMenu') { - console.log('side menu pressed'); - } - } - - static navigatorButtons: NavigatorButtons = { - leftButtons: [{ - id: 'sideMenu' - }] - }; - - componentDidMount() { - this.props.navigator.push({ - screen: 'example.Screen2', - overrideBackPress: false, - passProps: { name: 'Henrik' }, - }); - this.props.navigator.setTabBadge({ badge: null }); - } - - render() { - return ( - - Screen 1 - - ); - } -} - -interface Screen2OwnProps { - name: string; -} - -type Screen2Props = Screen2OwnProps & NavigationComponentProps; - -class Screen2 extends React.Component { - static navigatorStyle: NavigatorStyle = { - drawUnderNavBar: true, - navBarTranslucent: true - }; - - componentDidMount() { - this.props.navigator.resetTo({ screen: 'example.Screen1' }); - } - - render() { - return ( - - Screen 2 - Hello {this.props.name} - - ); - } -} - -const Drawer = (props: NavigationComponentProps) => { - return ( - - Drawer - - ); -}; - -interface TestProviderProps { - test: string; -} - -class TestProvider extends React.Component { - getChildContext() { - return { - test: this.props.test - }; - } - - render() { - return this.props.children; - } -} - -Navigation.registerComponent('example.Screen1', () => Screen1, {}, TestProvider, {test: "test"}); -Navigation.registerComponent('example.Screen2', () => Screen2); -Navigation.registerComponent('example.Drawer', () => Drawer); - -Navigation.isAppLaunched().then(appLaunched => { - if (appLaunched) { - startApp(); // App is launched -> show UI - } - new NativeEventsReceiver().appLaunched(startApp); // App hasn't been launched yet -> show the UI only when needed. -}); - -function startApp() { - // do something here -} - -Navigation.startTabBasedApp({ - tabs: [ - { - label: 'One', - screen: 'example.FirstTabScreen', - icon: require('../img/one.png'), - selectedIcon: require('../img/one_selected.png'), - iconInsets: { - top: 6, - left: 0, - bottom: -6, - right: 0 - }, - title: 'Screen One', - titleImage: {}, - navigatorStyle: {}, - navigatorButtons: {}, - }, - { - label: 'Two', - screen: 'example.SecondTabScreen', - icon: require('../img/two.png'), - selectedIcon: require('../img/two_selected.png'), - title: 'Screen Two' - } - ], - tabsStyle: { - tabBarButtonColor: '#ffff00', - tabBarSelectedButtonColor: '#ff9900', - tabBarBackgroundColor: '#551A8B', - initialTabIndex: 1, - }, - appStyle: { - orientation: 'portrait', - bottomTabBadgeTextColor: 'red', - bottomTabBadgeBackgroundColor: 'green', - backButtonImage: {}, - hideBackButtonTitle: true - }, - drawer: { - left: { - screen: 'example.FirstSideMenu', - passProps: {}, - fixedWidth: 500, - }, - right: { - screen: 'example.SecondSideMenu', - passProps: {}, - fixedWidth: 500, - }, - style: { - drawerShadow: true, - contentOverlayColor: 'rgba(0,0,0,0.25)', - leftDrawerWidth: 50, - rightDrawerWidth: 50, - shouldStretchDrawer: true - }, - type: 'MMDrawer', - animationType: 'door', - - disableOpenGesture: false - }, - passProps: {}, - animationType: 'slide-down' -}); - -Navigation.startSingleScreenApp({ - screen: { - screen: 'example.WelcomeScreen', - title: 'Welcome', - navigatorStyle: {}, - navigatorButtons: {} - }, - drawer: { - left: { - screen: 'example.FirstSideMenu', - passProps: {}, - disableOpenGesture: false, - fixedWidth: 500 - }, - right: { - screen: 'example.SecondSideMenu', - passProps: {}, - disableOpenGesture: false, - fixedWidth: 500 - }, - style: { - drawerShadow: true, - contentOverlayColor: 'rgba(0,0,0,0.25)', - leftDrawerWidth: 50, - rightDrawerWidth: 50 - }, - type: 'MMDrawer', - animationType: 'door', - - disableOpenGesture: false - }, - passProps: {}, - animationType: 'slide-down' -}); diff --git a/types/react-native-navigation/tslint.json b/types/react-native-navigation/tslint.json deleted file mode 100644 index 486c3a94ef..0000000000 --- a/types/react-native-navigation/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json", "rules": {"no-unnecessary-generics": false} } diff --git a/types/react-native-popup-dialog/index.d.ts b/types/react-native-popup-dialog/index.d.ts index c295a21ca2..5ddb40e0b2 100644 --- a/types/react-native-popup-dialog/index.d.ts +++ b/types/react-native-popup-dialog/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for react-native-popup-dialog 0.9 +// Type definitions for react-native-popup-dialog 1.0 // Project: https://github.com/jacklam718/react-native-popup-dialog/blob/master/README.md // Definitions by: Paito Anderson // connectdotz +// Michele Bombardi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -83,4 +84,7 @@ export class SlideAnimation { export class DialogButton extends React.Component { } export class DialogTitle extends React.Component { } export class Overlay extends React.Component { } -export default class PopupDialog extends React.Component { } +export default class PopupDialog extends React.Component { + show(onShown?: () => void): void; + dismiss(onDismissed?: () => void): void; +} diff --git a/types/react-native-popup-dialog/react-native-popup-dialog-tests.tsx b/types/react-native-popup-dialog/react-native-popup-dialog-tests.tsx index fdc53cfb88..379d4fd788 100644 --- a/types/react-native-popup-dialog/react-native-popup-dialog-tests.tsx +++ b/types/react-native-popup-dialog/react-native-popup-dialog-tests.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { StyleSheet, View } from 'react-native'; +import { StyleSheet, View, Button } from 'react-native'; import PopupDialog, { DialogTitle, DialogButton, @@ -13,26 +13,52 @@ const scaleAnimation = new ScaleAnimation(); const fadeAnimation = new FadeAnimation({ animationDuration: 150 }); class Test extends React.Component { + fadingPopupDialog: PopupDialog | null; + scalingPopupDialog: PopupDialog | null; + slidingPopupDialog: PopupDialog | null; + + showPopupDialog(popupDialog: PopupDialog | null) { + if (popupDialog !== null) { + popupDialog.show(() => console.log('show callback')); + } + } + + dismissPopupDialog(popupDialog: PopupDialog | null) { + if (popupDialog !== null) { + popupDialog.dismiss(() => console.log('dismiss callback')); + } + } + render() { return ( - this.showPopupDialog(this.fadingPopupDialog)} + title="Show Fading Dialog" /> + ); diff --git a/types/react-tracking/test/react-tracking-without-types-tests.tsx b/types/react-tracking/test/react-tracking-without-types-tests.tsx index 02a89d929c..a3cf2b4330 100644 --- a/types/react-tracking/test/react-tracking-without-types-tests.tsx +++ b/types/react-tracking/test/react-tracking-without-types-tests.tsx @@ -14,6 +14,11 @@ class ClassPage extends React.Component { // ... other stuff } + @track((_props, _state, [e]) => ({ event: `drag started at ${e.screenX}x${e.screenY}` })) + handleDrag(event: any) { + // no-op + } + // Only need to cast this to `any` because the settings for this project is to disallow implicit `any`. @track((props: any, state: any) => ({ event: `got ${props.someProp} and clicked ${state.isClicked}` })) render() { diff --git a/types/react-virtualized/index.d.ts b/types/react-virtualized/index.d.ts index c5a1a60aaa..2714e9a93c 100644 --- a/types/react-virtualized/index.d.ts +++ b/types/react-virtualized/index.d.ts @@ -65,7 +65,8 @@ export { ScrollParams, SectionRenderedParams, SizeAndPositionData, - VisibleCellRange + VisibleCellRange, + ScrollbarPresenceParams } from "./dist/es/Grid"; export { InfiniteLoader, diff --git a/types/react-widgets/index.d.ts b/types/react-widgets/index.d.ts index f02d9f016d..8115208fa8 100644 --- a/types/react-widgets/index.d.ts +++ b/types/react-widgets/index.d.ts @@ -4,6 +4,7 @@ // Balázs Sándor // Frode Hansen // Andrew Makarov +// Maxime Billemaz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 diff --git a/types/react-widgets/lib/DateTimePicker.d.ts b/types/react-widgets/lib/DateTimePicker.d.ts index ee0428c67b..65a683b1fe 100644 --- a/types/react-widgets/lib/DateTimePicker.d.ts +++ b/types/react-widgets/lib/DateTimePicker.d.ts @@ -77,7 +77,7 @@ interface DateTimePickerProps extends ReactWidgetsCommonDropdownProps Date | string[]; + parse?: ((str: string) => Date) | string[] | string; /** * The starting and lowest level view the calendar can navigate down to. * @enum "month" "year" "decade" "century" diff --git a/types/react-widgets/lib/DropdownList.d.ts b/types/react-widgets/lib/DropdownList.d.ts index eea9b3d534..644d0c4873 100644 --- a/types/react-widgets/lib/DropdownList.d.ts +++ b/types/react-widgets/lib/DropdownList.d.ts @@ -2,16 +2,25 @@ import * as React from 'react'; import { ReactWidgetsCommonDropdownProps, AutoFocus } from './CommonProps'; interface DropdownListProps extends ReactWidgetsCommonDropdownProps, AutoFocus { + + /** + * Allow to create a new option on the data list. + */ + allowCreate?: boolean | 'onFilter' /** * The current value of the DropdownList. This can be an object (such as a member of the * data array) or a primitive value, hinted to by the valueField. The widget value does not * need to be in the data array; widgets can have values that are not in their list. */ value?: any; - /** - * Default value. - */ + /** + * Default value. + */ defaultValue?: any; + /** + * Create event Handler that is called when a new option is added to the data list. + */ + onCreate?: (value: any) => void; /** * Change event Handler that is called when the value is changed. */ @@ -40,6 +49,10 @@ interface DropdownListProps extends ReactWidgetsCommonDropdownProps string); + /** + * Text to display for the create option + * @default: "Create option {text}" + */ + createOption?: string | ((props: DropdownListProps) => string); } -interface DropdownList extends React.ReactElement {} -interface DropdownListClass extends React.ComponentClass {} +interface DropdownList extends React.ReactElement { } +interface DropdownListClass extends React.ComponentClass { } declare var DropdownList: DropdownListClass; export = DropdownList; diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 1cd5f4ef09..332d3ac640 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -306,7 +306,7 @@ declare namespace React { // In the future, if we can define its call signature conditionally // on the existence of `children` in `P`, then we should remove this. readonly props: Readonly<{ children?: ReactNode }> & Readonly

; - readonly state: null | Readonly; + state: Readonly; /** * @deprecated * https://reactjs.org/docs/legacy-context.html diff --git a/types/react/test/index.ts b/types/react/test/index.ts index 3a04a0ab79..3b7e5193fd 100644 --- a/types/react/test/index.ts +++ b/types/react/test/index.ts @@ -59,14 +59,7 @@ declare const container: Element; inputValue: string; seconds: number; } - /** - * This is a "pre EcmaScript class property era" style of setting state within constructor. - * This occurs also if you need to provide som logic before mounting your component. - * To mitigate this error you need to provide state property definition upfront. - */ class SettingStateFromCtorComponent extends React.Component { - // uncomenting this fixes the error :) - // state: State; constructor(props: Props) { super(props); // $ExpectError @@ -78,16 +71,17 @@ declare const container: Element; } class BadlyInitializedState extends React.Component { - // ExpectError -> this throws error on TS 2.6 + // $ExpectError -> this throws error on TS 2.6 uncomment once TS requirement is TS >= 2.7 // state = { // secondz: 0, // inputValuez: 'hello' // }; + render() { return null; } } class BetterPropsAndStateChecksComponent extends React.Component { render() { return null; } componentDidMount() { - // $ExpectError + // $ExpectError -> this will be true in next BC release where state is gonna be `null | Readonly` console.log(this.state.inputValue); } mutateState() { diff --git a/types/recharts/index.d.ts b/types/recharts/index.d.ts index 5159fd827b..a46cbd09b8 100644 --- a/types/recharts/index.d.ts +++ b/types/recharts/index.d.ts @@ -8,6 +8,7 @@ // Dan Torberg // Peter Keuter // Jamie Saunders +// Paul Melnikow // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -832,7 +833,7 @@ export class Treemap extends React.Component { } export class Label extends React.Component { } -export interface LabelProps { +export interface LabelProps extends Partial { angle?: number; viewBox?: ViewBox | PolarViewBox; formatter?: LabelFormatter; diff --git a/types/recharts/recharts-tests.tsx b/types/recharts/recharts-tests.tsx index 739afefc55..855a5c9e75 100644 --- a/types/recharts/recharts-tests.tsx +++ b/types/recharts/recharts-tests.tsx @@ -88,7 +88,7 @@ class Component extends React.Component<{}, ComponentState> { - + diff --git a/types/redlock/index.d.ts b/types/redlock/index.d.ts index 27e6784886..9b3af6d0b7 100644 --- a/types/redlock/index.d.ts +++ b/types/redlock/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Ilya Mochalov // BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as Promise from 'bluebird'; import { EventEmitter } from 'events'; diff --git a/types/redlock/v2/index.d.ts b/types/redlock/v2/index.d.ts index d683ec83a4..9ca431c449 100644 --- a/types/redlock/v2/index.d.ts +++ b/types/redlock/v2/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/mike-marcacci/node-redlock // Definitions by: Ilya Mochalov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as redis from 'redis'; import * as Promise from 'bluebird'; diff --git a/types/redux-first-router/index.d.ts b/types/redux-first-router/index.d.ts index f15d27ceb7..928be92c6c 100644 --- a/types/redux-first-router/index.d.ts +++ b/types/redux-first-router/index.d.ts @@ -4,6 +4,7 @@ // viggyfresh // janb87 // corydeppen +// jscinoz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -12,7 +13,7 @@ import { Store, Reducer, Middleware, - GenericStoreEnhancer + StoreEnhancer } from 'redux'; import { History } from 'history'; @@ -233,7 +234,7 @@ export function connectRoutes( reducer: Reducer>; middleware: Middleware; thunk(store: Store): Promise>>; - enhancer: GenericStoreEnhancer; + enhancer: StoreEnhancer; initialDispatch?(): void; }; diff --git a/types/redux-first-router/package.json b/types/redux-first-router/package.json index cc21197405..7f5b19d45b 100644 --- a/types/redux-first-router/package.json +++ b/types/redux-first-router/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "redux": "^3.7.0" + "redux": "^4.0.0" } } diff --git a/types/redux-first-router/redux-first-router-tests.ts b/types/redux-first-router/redux-first-router-tests.ts index 7d14b755c3..cf3f772d9e 100644 --- a/types/redux-first-router/redux-first-router-tests.ts +++ b/types/redux-first-router/redux-first-router-tests.ts @@ -10,6 +10,7 @@ import { pathToAction } from 'redux-first-router'; import { + AnyAction, createStore, applyMiddleware, Middleware, @@ -18,7 +19,7 @@ import { Dispatch, compose, Action, - GenericStoreEnhancer, + StoreEnhancer, StoreEnhancerStoreCreator, combineReducers } from 'redux'; @@ -32,7 +33,6 @@ interface Keys { } interface State { location: LocationState; - stale: boolean; } type StoreCreator = StoreEnhancerStoreCreator; @@ -78,7 +78,7 @@ const dumbMiddleware: Middleware = store => next => action => next(action); const composedMiddleware = applyMiddleware(middleware, dumbMiddleware); -const storeEnhancer = compose( +const storeEnhancer = compose( enhancer, composedMiddleware ); @@ -112,7 +112,7 @@ const action: ReduxFirstRouterAction = { }; redirect(action); // $ExpectType Action -// $ExpectType Store +// $ExpectType Store store; store.getState().location.routesMap; // $ExpectType RoutesMap diff --git a/types/redux-form/immutable/index.d.ts b/types/redux-form/immutable/index.d.ts index 6e7d9f54e6..742027ccad 100644 --- a/types/redux-form/immutable/index.d.ts +++ b/types/redux-form/immutable/index.d.ts @@ -2,6 +2,9 @@ export { Field, FieldArray, Fields, + Form, + FormName, + FormSection, reduxForm, reducer, formValueSelector, @@ -19,6 +22,7 @@ export { isInvalid, isPristine, isSubmitting, + isAsyncValidating, isValid, SubmissionError } from "../"; diff --git a/types/redux-form/index.d.ts b/types/redux-form/index.d.ts index 6ba9b9e0f6..5ff24c90a0 100644 --- a/types/redux-form/index.d.ts +++ b/types/redux-form/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for redux-form 7.3 +// Type definitions for redux-form 7.4 // Project: https://github.com/erikras/redux-form // Definitions by: Carson Full // Daniel Lytkin @@ -47,6 +47,7 @@ export * from "./lib/Field"; export * from "./lib/Fields"; export * from "./lib/FieldArray"; export * from "./lib/Form"; +export * from "./lib/FormName"; export * from "./lib/FormSection"; export * from "./lib/formValues"; export * from "./lib/formValueSelector"; diff --git a/types/redux-form/lib/Field.d.ts b/types/redux-form/lib/Field.d.ts index a6c2b2e5bb..d27a10ce47 100644 --- a/types/redux-form/lib/Field.d.ts +++ b/types/redux-form/lib/Field.d.ts @@ -46,6 +46,7 @@ export interface BaseFieldProps

extends Partial { validate?: Validator | Validator[]; warn?: Validator | Validator[]; withRef?: boolean; + immutableProps?: string[]; } export interface GenericField

extends Component & P> { diff --git a/types/redux-form/lib/Form.d.ts b/types/redux-form/lib/Form.d.ts index 11ba0e2734..e708b0f965 100644 --- a/types/redux-form/lib/Form.d.ts +++ b/types/redux-form/lib/Form.d.ts @@ -1,5 +1,4 @@ import { Component, FormHTMLAttributes, FormEvent, FormEventHandler } from "react"; -import { Dispatch } from "redux"; import { FormProps, FormErrors, FormSubmitHandler, Omit } from "../index"; interface FormSubmitProp { diff --git a/types/redux-form/lib/FormName.d.ts b/types/redux-form/lib/FormName.d.ts new file mode 100644 index 0000000000..20fd50dae8 --- /dev/null +++ b/types/redux-form/lib/FormName.d.ts @@ -0,0 +1,9 @@ +import { ReactNode, StatelessComponent } from "react"; + +export interface FormNameProps { + children: (props: { form: string }) => ReactNode, +} + +export const FormName: StatelessComponent; + +export default FormName; diff --git a/types/redux-form/lib/actions.d.ts b/types/redux-form/lib/actions.d.ts index adc6e9842b..4e0fd58558 100644 --- a/types/redux-form/lib/actions.d.ts +++ b/types/redux-form/lib/actions.d.ts @@ -30,7 +30,8 @@ export interface InitializeOptions { keepValues: boolean; } -export declare function initialize(form: string, data: any, keepDirty?: boolean | InitializeOptions, options?: InitializeOptions): FormAction; +export declare function initialize(form: string, data: any, keepDirty?: boolean, options?: Partial): FormAction; +export declare function initialize(form: string, data: any, options?: Partial): FormAction; export declare function registerField(form: string, name: string, type: FieldType): FormAction; export declare function reset(form: string): FormAction; export declare function resetSection(form: string, ...sections: string[]): FormAction; diff --git a/types/redux-form/lib/reducer.d.ts b/types/redux-form/lib/reducer.d.ts index 6324ab92e6..f2ee374cf2 100644 --- a/types/redux-form/lib/reducer.d.ts +++ b/types/redux-form/lib/reducer.d.ts @@ -1,4 +1,4 @@ -import { Action, Reducer } from "redux"; +import { Reducer } from "redux"; import { FieldType } from "../index"; export interface FormReducer extends Reducer { @@ -8,6 +8,8 @@ export interface FormReducer extends Reducer { export const reducer: FormReducer; export interface FormReducerMapObject { + // and `` to make it compatible with redux@3 + // tslint:disable-next-line use-default-type-parameter [formName: string]: Reducer; } diff --git a/types/redux-form/lib/selectors.d.ts b/types/redux-form/lib/selectors.d.ts index eea4444275..c996388d5c 100644 --- a/types/redux-form/lib/selectors.d.ts +++ b/types/redux-form/lib/selectors.d.ts @@ -4,6 +4,7 @@ export type DataSelector = (formName: string, getForm export type ErrorSelector = (formName: string, getFormState?: GetFormState) => (state: State) => FormErrors; export type BooleanSelector = (formName: string, getFormState?: GetFormState) => (state: State) => boolean; export type NamesSelector = (getFormState?: GetFormState) => (state: State) => string[]; +export type FormOrFieldsBooleanSelector = (formName: string, getFormState?: GetFormState) => (state: State, ...fields: string[]) => boolean; export const getFormValues: DataSelector; export const getFormInitialValues: DataSelector; @@ -14,10 +15,11 @@ export const getFormSyncWarnings: ErrorSelector; export const getFormSubmitErrors: ErrorSelector; export const getFormError: ErrorSelector; export const getFormNames: NamesSelector; -export const isDirty: BooleanSelector; -export const isPristine: BooleanSelector; +export const isDirty: FormOrFieldsBooleanSelector; +export const isPristine: FormOrFieldsBooleanSelector; export const isValid: BooleanSelector; export const isInvalid: BooleanSelector; export const isSubmitting: BooleanSelector; +export const isAsyncValidating: BooleanSelector; export const hasSubmitSucceeded: BooleanSelector; export const hasSubmitFailed: BooleanSelector; diff --git a/types/redux-form/package.json b/types/redux-form/package.json index 6d68bf2f9b..998f8e9b38 100644 --- a/types/redux-form/package.json +++ b/types/redux-form/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "redux": "^3.6.0" + "redux": "^3.6.0 || ^4.0.0" } } diff --git a/types/redux-form/redux-form-tests.tsx b/types/redux-form/redux-form-tests.tsx index f4317ade87..06344b54c5 100644 --- a/types/redux-form/redux-form-tests.tsx +++ b/types/redux-form/redux-form-tests.tsx @@ -4,6 +4,7 @@ import { reduxForm, InjectedFormProps, Form, + FormName, GenericForm, FormSection, GenericFormSection, @@ -399,3 +400,13 @@ class HandleSubmitTest extends React.Component { return ; } } + +class FormNameTest extends React.Component { + render() { + return ( + + {({ form }) => Form Name is: {form}} + + ); + } +} diff --git a/types/remote-redux-devtools/index.d.ts b/types/remote-redux-devtools/index.d.ts index 4725bc4c58..de6a5efce1 100644 --- a/types/remote-redux-devtools/index.d.ts +++ b/types/remote-redux-devtools/index.d.ts @@ -1,13 +1,17 @@ // Type definitions for remote-redux-devtools 0.5 // Project: https://github.com/zalmoxisus/remote-redux-devtools -// Definitions by: Colin Eberhardt , Daniel Perez Alvarez +// Definitions by: Colin Eberhardt +// Daniel Perez Alvarez +// Maximo Dominguez +// Colin Dekker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import { Action, ActionCreator, ActionCreatorsMapObject, - GenericStoreEnhancer + StoreEnhancer } from "redux"; export interface RemoteReduxDevToolsOptions { @@ -108,5 +112,5 @@ export interface RemoteReduxDevToolsOptions { id?: string; } -export function composeWithDevTools(options?: RemoteReduxDevToolsOptions): (...funcs: GenericStoreEnhancer[]) => GenericStoreEnhancer; -export function composeWithDevTools(...funcs: GenericStoreEnhancer[]): GenericStoreEnhancer; +export function composeWithDevTools(options?: RemoteReduxDevToolsOptions): (...funcs: StoreEnhancer[]) => StoreEnhancer; +export function composeWithDevTools(...funcs: StoreEnhancer[]): StoreEnhancer; diff --git a/types/remote-redux-devtools/package.json b/types/remote-redux-devtools/package.json index 6d68bf2f9b..7f5b19d45b 100644 --- a/types/remote-redux-devtools/package.json +++ b/types/remote-redux-devtools/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "redux": "^3.6.0" + "redux": "^4.0.0" } } diff --git a/types/request-promise/index.d.ts b/types/request-promise/index.d.ts index 8b2382d049..895213e770 100644 --- a/types/request-promise/index.d.ts +++ b/types/request-promise/index.d.ts @@ -5,7 +5,7 @@ // Aya Morisawa // Matt R. Wilson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import request = require('request'); import http = require('http'); diff --git a/types/restify/index.d.ts b/types/restify/index.d.ts index 68193a9b85..bcaf74c140 100644 --- a/types/restify/index.d.ts +++ b/types/restify/index.d.ts @@ -1230,6 +1230,8 @@ export namespace plugins { reviver?: any; maxFieldsSize?: number; + + maxFileSize: number; } /** @@ -1284,6 +1286,7 @@ export namespace plugins { multipartHandler?: any; mapParams?: boolean; mapFiles?: boolean; + maxFileSize?: number; } /** diff --git a/types/restling/index.d.ts b/types/restling/index.d.ts index 79bc2d8c2c..b4f03a6633 100644 --- a/types/restling/index.d.ts +++ b/types/restling/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/lucasfeliciano/restling // Definitions by: Alessandro vergani // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as Promise from "bluebird"; import * as Restler from "restler"; diff --git a/types/retry-as-promised/index.d.ts b/types/retry-as-promised/index.d.ts index 429e0bb6d1..6287827def 100644 --- a/types/retry-as-promised/index.d.ts +++ b/types/retry-as-promised/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/mickhansen/retry-as-promised // Definitions by: Florian Oellerich // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import Promise = require('bluebird'); diff --git a/types/schwifty/index.d.ts b/types/schwifty/index.d.ts index e95de1af55..9ac2556c2b 100644 --- a/types/schwifty/index.d.ts +++ b/types/schwifty/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/hapipal/schwifty // Definitions by: ozum // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.8 // HELP NEEDED: If possible, find a better way to define Server.models, Request.models and ResponseToolkit.models // They are dynamic types extended from SchwiftyModel. diff --git a/types/sequelize-fixtures/index.d.ts b/types/sequelize-fixtures/index.d.ts index 06e7aaf157..773bb43982 100644 --- a/types/sequelize-fixtures/index.d.ts +++ b/types/sequelize-fixtures/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/domasx2/sequelize-fixtures // Definitions by: Christian Schwarz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as Sequelize from "sequelize"; diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index f003b77731..ecbdba3602 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -15,7 +15,7 @@ // Nick Schultz // Thomas Breleur // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 // Based on original work by: samuelneff @@ -5263,7 +5263,7 @@ declare namespace sequelize { * Set to true or a string with the attribute name you want to use to enable. */ version?: boolean | string; - + /** * Throws an error when no records found */ diff --git a/types/sequelize/v3/index.d.ts b/types/sequelize/v3/index.d.ts index 11b6775846..484edd089d 100644 --- a/types/sequelize/v3/index.d.ts +++ b/types/sequelize/v3/index.d.ts @@ -6,7 +6,7 @@ // Nick Mueller // James D. Callahan III // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 // Based on original work by: samuelneff @@ -3140,7 +3140,7 @@ declare namespace sequelize { /** * Shortcut for types used in FindOptions.attributes */ - type FindOptionsAttributesArray = Array; + type FindOptionsAttributesArray = Array; /** * Options that are passed to any model creating a SELECT query @@ -6183,7 +6183,7 @@ declare namespace sequelize { camelizeIf(str: string, condition: boolean): string; underscoredIf(str: string, condition: boolean): string; - + _: SequelizeLoDash; /** diff --git a/types/serialport/index.d.ts b/types/serialport/index.d.ts index 1e8aa9faa5..2f5f8fc55d 100644 --- a/types/serialport/index.d.ts +++ b/types/serialport/index.d.ts @@ -87,7 +87,7 @@ declare namespace SerialPort { constructor(); } class Delimiter extends Stream.Transform { - constructor(options: {delimiter: string | Buffer | number[]}); + constructor(options: {delimiter: string | Buffer | number[], includeDelimiter?: boolean}); } class Readline extends Delimiter { constructor(options: {delimiter: string | Buffer | number[], encoding?: 'ascii'|'utf8'|'utf16le'|'ucs2'|'base64'|'binary'|'hex'}); diff --git a/types/sharp/index.d.ts b/types/sharp/index.d.ts index e1108575ab..c889f1f4fa 100644 --- a/types/sharp/index.d.ts +++ b/types/sharp/index.d.ts @@ -332,6 +332,14 @@ declare namespace sharp { * @throws {Error} Invalid parameters * @returns A sharp instance that can be used to chain operations */ + linear(multiplier?: number, offset?: number): SharpInstance; + /** + * Apply a gamma correction by reducing the encoding (darken) pre-resize at a factor of 1/gamma then increasing the encoding (brighten) post-resize at a factor of gamma. + * @param multiplier value between 0.0 and 1.0. (optional, default 1.0) + * @param offset value between 0.0 and 1.0. (optional, default 0.0) + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ boolean(operand: string | Buffer, operator: string, options?: { raw: Raw }): SharpInstance; /** * Write output image data to a file. diff --git a/types/simple-oauth2/index.d.ts b/types/simple-oauth2/index.d.ts index f5f7659b99..21718c0722 100644 --- a/types/simple-oauth2/index.d.ts +++ b/types/simple-oauth2/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Michael Müller , // Troy Lamerton // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import Bluebird = require("bluebird"); diff --git a/types/six-runtime/index.d.ts b/types/six-runtime/index.d.ts new file mode 100644 index 0000000000..e31a526666 --- /dev/null +++ b/types/six-runtime/index.d.ts @@ -0,0 +1,219 @@ +// Type definitions for six-runtime 0.1 +// Project: https://github.com/493636333/six +// Definitions by: liyong +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +declare const six: Six; + +interface Six { + /** + * process.env.NODE_ENV + */ + readonly NODE_ENV: string; + + /** + * NODE_ENV的缩短版 + * + * production、prod => prod + * + * dev、develop、development => dev + */ + readonly ENV: string; + + /** + * Six的rootPath + */ + readonly ROOT_PATH: string; + + /** + * Six的plugin的map + */ + readonly plugins: Six.PluginsMap; + + /** + * 针对这次请求生效的数据缓存 set + */ + set(key: string, value: any): void; + + /** + * 针对这次请求生效的数据缓存 get + */ + get(key: string): any; + + /** + * DataProvider类,所有的data-provider必须继承这个类 + */ + DataProvider: Six.plugins.dataProvider.DataProvider; + + /** + * 执行某个data-provider,并返回执行之后的值 + */ + dp(name: string): any; + + /** + * 发送请求的工具方法,会将用户的cookie和traceId透传过去 + */ + http: Six.plugins.http; + + /** + * 打日志方法 + */ + log: Six.plugins.log; + + /** + * rpc调用工具方法,返回ThriftPool实例 + */ + rpc: Six.plugins.rpc; + + /** + * 时间统计工具 + */ + time: Six.plugins.time.timmer; + + /** + * 渲染函数 + */ + render: Six.plugins.view.render; +} + +declare namespace Six { + interface PluginsMap { + sso: plugins.sso.ssoFactory; + upm: plugins.upm.upmFactory; + uac: plugins.uac.uacFactory; + static: plugins.static.staticFactory; + } + + type next = () => any; + + type middleware = (ctx: object, next: next) => any; + + namespace plugins { + type whiteList = (ctx: object) => boolean; + + namespace sso { + type ssoFactory = (conf: ssoConf) => any; + + interface ssoConf { + whiteList: string|RegExp|string[]|whiteList; + ssoConf: ssoClientConf; + enableCache: boolean; + hasLoginCacheMaxAge: number; + adapter(user: object): object; + } + interface ssoClientConf { + clientId: string; + secret: string; + env: string; + token: token; + protocol: string; + errorHook(error: Error): void; + callbackUrl: string; + } + + interface token { + name: string; + path: string; + httpOnly: boolean; + expiredTime: number; + } + } + + namespace upm { + type upmFactory = (conf: upmConf) => any; + + interface upmConf { + whiteList: string|RegExp|string[]|whiteList; + enableMock: boolean; + domain: string; + path: string; + clientId: string; + clientSecret: string; + skipOffline: boolean; + failHook(err: Error, ctx: object, next: next): any; + getPath(ctx: object): string; + } + } + + namespace uac { + type uacFactory = (conf: uacConf) => any; + interface uacConf { + whiteList: string|RegExp|string[]|whiteList; + enableMock: boolean; + client_id: string; + client_secret: string; + skipOffline: boolean; + failHook(err: Error, ctx: object, next: next): any; + getPath(ctx: object): string; + } + } + + namespace dataProvider { + abstract class DataProvider { + static deps: string[]; + static timeout: number; + static retry: number; + prepare(ctx: object, depsRes: object): any; + abstract execute(ctx: object, args: any): any; + } + } + + interface http { + proxy(options: object): middleware; + get(url: any, options?: object): Promise; + post(url: any, options?: object): Promise; + put(url: any, options?: object): Promise; + patch(url: any, options?: object): Promise; + del(url: any, options?: object): Promise; + head(url: any, options?: object): Promise; + } + + interface log { + debug(msg: string, ...restOfVar: any[]): void; + info(msg: string, ...restOfVar: any[]): void; + warn(msg: string, ...restOfVar: any[]): void; + error(msg: string|Error, ...restOfVar: any[]): void; + } + + type rpc = (config: object) => object; + + namespace static { + type staticFactory = (conf: staticConf) => middleware; + interface staticConf { + rootPath: string; + cacheConf: cacheConf; + } + + interface cacheConf { + defer: boolean; + cache: boolean; + maxAge: number; + index: string; + gzip: boolean; + extensions: boolean|string[]; + } + } + + namespace time { + interface timmer { + now(): any; + start(key: string): void; + end(key: string): number; + serialize(between?: string, end?: string, filter?: filter): string; + } + + type filter = (key: string) => boolean; + } + + namespace view { + type render = (name: string, runtimeConf?: runtimeConf|null, data?: object) => Promise; + + interface runtimeConf { + codeKey: string; + msgKey: string; + dataKey: string; + } + } + } +} diff --git a/types/six-runtime/six-runtime-tests.ts b/types/six-runtime/six-runtime-tests.ts new file mode 100644 index 0000000000..906ddbd233 --- /dev/null +++ b/types/six-runtime/six-runtime-tests.ts @@ -0,0 +1 @@ +six.log.warn('xxx'); diff --git a/types/six-runtime/tsconfig.json b/types/six-runtime/tsconfig.json new file mode 100644 index 0000000000..60a8cb89af --- /dev/null +++ b/types/six-runtime/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", + "six-runtime-tests.ts" + ] +} \ No newline at end of file diff --git a/types/six-runtime/tslint.json b/types/six-runtime/tslint.json new file mode 100644 index 0000000000..30a1bdde2e --- /dev/null +++ b/types/six-runtime/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/slack-winston/package.json b/types/slack-winston/package.json new file mode 100644 index 0000000000..33e1a4f018 --- /dev/null +++ b/types/slack-winston/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "@types/winston": "^2.3.9" + } +} diff --git a/types/slate-base64-serializer/index.d.ts b/types/slate-base64-serializer/index.d.ts new file mode 100644 index 0000000000..86f626fc86 --- /dev/null +++ b/types/slate-base64-serializer/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for slate-base64-serializer 0.2 +// Project: https://github.com/ianstormtaylor/slate +// Definitions by: Brandon Shelton +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 +import { Slate } from "slate"; + +export function deserialize(string: string, options?: object): Slate.Value; +export function deserializeNode(string: string, options?: object): Slate.Node; +export function serialize(value: Slate.Value, options?: object): string; +export function serializeNode(node: Slate.Node, options?: object): string; diff --git a/types/slate-base64-serializer/slate-base64-serializer-tests.ts b/types/slate-base64-serializer/slate-base64-serializer-tests.ts new file mode 100644 index 0000000000..3d1b2888b6 --- /dev/null +++ b/types/slate-base64-serializer/slate-base64-serializer-tests.ts @@ -0,0 +1,6 @@ +import * as Base64 from "slate-base64-serializer"; +import { Slate } from "slate"; + +const val = Slate.Value.create(); +const serialized = Base64.serialize(val); +const deserialized = Base64.deserialize(serialized); diff --git a/types/slate-base64-serializer/tsconfig.json b/types/slate-base64-serializer/tsconfig.json new file mode 100644 index 0000000000..1e496b8735 --- /dev/null +++ b/types/slate-base64-serializer/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", + "slate-base64-serializer-tests.ts" + ] +} diff --git a/types/slate-base64-serializer/tslint.json b/types/slate-base64-serializer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/slate-base64-serializer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/slate-html-serializer/index.d.ts b/types/slate-html-serializer/index.d.ts new file mode 100644 index 0000000000..eb9290955a --- /dev/null +++ b/types/slate-html-serializer/index.d.ts @@ -0,0 +1,40 @@ +// Type definitions for slate-html-serializer 0.6 +// Project: https://github.com/ianstormtaylor/slate +// Definitions by: Brandon Shelton +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 +import * as React from 'react'; +import { Slate } from 'slate'; + +export interface Rule { + deserialize?: (el: Element, next: (elements: Element[] | NodeList | Array) => any) => any; + serialize?: (obj: any, children: string) => React.ReactNode; +} + +export interface HtmlOptions { + rules?: Rule[]; + defaultBlock?: Slate.BlockProperties; + parseHtml?: (html: string) => HTMLElement; +} + +export default class Html { + constructor(options?: HtmlOptions); + + deserialize(html: string, options: { toJSON: true }): Slate.ValueJSON; + deserialize(html: string, options?: { toJSON?: false }): Slate.Value; + + serialize(value: Slate.Value, options?: { render?: true }): string; + serialize(value: Slate.Value, options: { render: false }): Element[]; + + protected rules: Rule[]; + protected defaultBlock: Slate.BlockProperties; + protected parseHtml: (html: string) => HTMLElement; + + protected deserializeElements: (elements: HTMLElement[]) => Slate.Node[]; + protected deserializeElement: (element: HTMLElement) => any; + protected deserializeMark: (mark: Slate.Mark) => Slate.Node[]; + + protected serializeNode: (node: Slate.Node) => string; + protected serializeLeaf: (leaf: Slate.Leaf) => string; + protected serializeString: (string: string) => string; +} diff --git a/types/slate-html-serializer/slate-html-serializer-tests.ts b/types/slate-html-serializer/slate-html-serializer-tests.ts new file mode 100644 index 0000000000..f7a2a26149 --- /dev/null +++ b/types/slate-html-serializer/slate-html-serializer-tests.ts @@ -0,0 +1,10 @@ +import Html, { Rule } from "slate-html-serializer"; + +const myRule: Rule = { + deserialize: (el, next) => {}, + serialize: () => null +}; + +const serializer = new Html({ + rules: [myRule] +}); diff --git a/types/slate-html-serializer/tsconfig.json b/types/slate-html-serializer/tsconfig.json new file mode 100644 index 0000000000..5222c4dbc4 --- /dev/null +++ b/types/slate-html-serializer/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", + "slate-html-serializer-tests.ts" + ] +} diff --git a/types/slate-html-serializer/tslint.json b/types/slate-html-serializer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/slate-html-serializer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/slate-plain-serializer/index.d.ts b/types/slate-plain-serializer/index.d.ts new file mode 100644 index 0000000000..778f523168 --- /dev/null +++ b/types/slate-plain-serializer/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for slate-plain-serializer 0.5 +// Project: https://github.com/ianstormtaylor/slate +// Definitions by: Brandon Shelton +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 +import { Slate } from 'slate'; + +export interface DeserializeOptions { + toJson?: boolean; + defaultBlock?: Slate.BlockProperties; + defaultMarks?: Slate.MarkProperties[] | Set; +} + +export function deserialize(string: string, options?: DeserializeOptions): Slate.Value; +export function serialize(value: Slate.Value): string; diff --git a/types/slate-plain-serializer/slate-plain-serializer-tests.ts b/types/slate-plain-serializer/slate-plain-serializer-tests.ts new file mode 100644 index 0000000000..7d7db6ff84 --- /dev/null +++ b/types/slate-plain-serializer/slate-plain-serializer-tests.ts @@ -0,0 +1,6 @@ +import * as Plain from "slate-plain-serializer"; +import { Slate } from "slate"; + +const val = Slate.Value.create(); +const serialized = Plain.serialize(val); +const deserialized = Plain.deserialize(serialized); diff --git a/types/slate-plain-serializer/tsconfig.json b/types/slate-plain-serializer/tsconfig.json new file mode 100644 index 0000000000..d6d789b9a5 --- /dev/null +++ b/types/slate-plain-serializer/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", + "slate-plain-serializer-tests.ts" + ] +} diff --git a/types/slate-plain-serializer/tslint.json b/types/slate-plain-serializer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/slate-plain-serializer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/slate-react/index.d.ts b/types/slate-react/index.d.ts new file mode 100644 index 0000000000..492156363a --- /dev/null +++ b/types/slate-react/index.d.ts @@ -0,0 +1,108 @@ +// Type definitions for slate-react 0.12 +// Project: https://github.com/ianstormtaylor/slate +// Definitions by: Andy Kent +// Jamie Talbot +// Jan Löbel +// Patrick Sachs +// Brandon Shelton +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 +import { Slate } from 'slate'; +import * as Immutable from 'immutable'; +import * as React from 'react'; + +// Values prefixed with "data-..." (Used for spellchecking according to docs) +export interface RenderAttributes { + [key: string]: any; +} + +export interface RenderMarkProps { + attributes: RenderAttributes; + children: React.ReactNode; + editor: Editor; + mark: Slate.Mark; + marks: Immutable.Set; + node: Slate.Node; + offset: number; + text: string; +} + +export interface RenderNodeProps { + attributes: RenderAttributes; + children: React.ReactNode; + editor: Editor; + isSelected: boolean; + key: string; + node: Slate.Block; + parent: Slate.Node; +} + +export interface Plugin { + onBeforeInput?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; + onBlur?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; + onFocus?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; + onClick?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; + onCopy?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; + onCut?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; + onDrop?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; + onKeyDown?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; + onKeyUp?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; + onPaste?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; + onSelect?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; + onChange?: (change: Slate.Change) => any; + renderEditor?: (props: RenderAttributes, editor: Editor) => object | void; + schema?: Slate.Schema; + decorateNode?: (node: Slate.Node) => Slate.Range[] | void; + renderMark?: (props: RenderMarkProps) => any; + renderNode?: (props: RenderNodeProps) => any; + renderPlaceholder?: (props: RenderAttributes) => any; + renderPortal?: (props: RenderAttributes) => any; + validateNode?: (node: Node) => any; +} + +export interface BasicEditorProps { + value: Slate.Value; + autoCorrect?: boolean; + autoFocus?: boolean; + className?: string; + onChange?: (change: Slate.Change) => any; + placeholder?: any; + plugins?: Plugin[]; + readOnly?: boolean; + role?: string; + schema?: Slate.Schema; + spellCheck?: boolean; + style?: { [key: string]: string }; + tabIndex?: number; +} + +// tsling:disable interface-over-type-literal +export type EditorProps = BasicEditorProps & Plugin; + +export interface EditorState { + schema: Slate.Schema; + value: Slate.Value; + stack: Slate.Stack; // [TODO] define stack +} + +export class Editor extends React.Component { + schema: Slate.Schema; + value: Slate.Value; + stack: Slate.Stack; + + // Instance Methods + blur(): void; + change(fn: (change: Slate.Change) => any): void; + change(...args: any[]): void; + focus(): void; +} + +export type SlateType = 'fragment' | 'html' | 'node' | 'rich' | 'text' | 'files'; + +export function findDOMNode(node: Slate.Node): Element; +export function findDOMRange(range: Slate.Range): Range; +export function findNode(element: Element, value: Slate.Value): Slate.Node; +export function findRange(selection: Selection, value: Slate.Value): Slate.Range; +export function getEventRange(event: Event, value: Slate.Value): Slate.Range; +export function getEventTransfer(event: Event): { type: SlateType; node: Slate.Node }; +export function setEventTransfer(event: Event, type: SlateType, data: any): void; diff --git a/types/slate-react/package.json b/types/slate-react/package.json new file mode 100644 index 0000000000..58698c580a --- /dev/null +++ b/types/slate-react/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "immutable": "^3.8.2" + } +} diff --git a/types/slate-react/slate-react-tests.tsx b/types/slate-react/slate-react-tests.tsx new file mode 100644 index 0000000000..f576ea580c --- /dev/null +++ b/types/slate-react/slate-react-tests.tsx @@ -0,0 +1,28 @@ +import { Editor, Plugin, EditorProps } from "slate-react"; +import { Slate } from "slate"; +import * as React from "react"; + +class MyPlugin implements Plugin { + onChange(change: Slate.Change): void { + change.blur(); + } +} + +const myPlugin = new MyPlugin(); + +interface MyEditorState { + value: Slate.Value; +} + +class MyEditor extends React.Component { + constructor(props: EditorProps) { + super(props); + this.state = { + value: Slate.Value.create() + }; + } + + render() { + return ; + } +} diff --git a/types/slate-react/tsconfig.json b/types/slate-react/tsconfig.json new file mode 100644 index 0000000000..902d90178c --- /dev/null +++ b/types/slate-react/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, + "jsx": "preserve", + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "slate-react-tests.tsx" + ] +} diff --git a/types/slate-react/tslint.json b/types/slate-react/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/slate-react/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/socketio-jwt/index.d.ts b/types/socketio-jwt/index.d.ts new file mode 100644 index 0000000000..9435ec68f4 --- /dev/null +++ b/types/socketio-jwt/index.d.ts @@ -0,0 +1,62 @@ +// Type definitions for socketio-jwt 0.0 +// Project: https://github.com/auth0/socketio-jwt +// Definitions by: Eric Hallander +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +import SocketIO = require("socket.io"); + +/** + * This function returns a middleware function for use with Socket.IO that authenticates a new connection. + * + * @param options is an object literal that contains options. + * @param callback function - not implemented + */ +export function authorize(options: JwtAuthOptions, callback?: JwtAuthorizeCallback): (socket: SocketIO.Socket) => void; + +/** + * This is an object literal that contains options. + */ +export interface JwtAuthOptions { + secret: string | JwtSecretFunc; + timeout?: number; // In milliseconds to handle the second round trip. + callback?: boolean; // To disconnect socket server-side without a client-side callback if no valid token. + decodedPropertyName: string; // Property to store the docoded token to. + handshake?: boolean; // Used to trigger a single round trip authentication. +} + +export interface JwtData { + message: string; + code: string; + type: string; +} + +/** + * An Error Object used by the package. + */ +export class UnauthorizedError extends Error { + constructor(code: string, error: Error); + + message: string; + inner: Error; + data: JwtData; +} + +/** + * This is a function with two args payload, and done. + * + * `request` is the original request + * `payload` is the decoded JWT payload + * `callback` is an error-first callback defined below + */ +export type JwtSecretFunc = (request: any, payload: any, callback: JwtSecretFuncCallback) => void; + +/** + * If JwtAuthOptions.secret is a function, then this is the signature of the callback function provided to that function + */ +export type JwtSecretFuncCallback = (err: Error | null, secret: string) => void; + +/** + * socketio-jwt contains an optional second argument, that contains no implementation usage. + */ +export type JwtAuthorizeCallback = () => void; diff --git a/types/socketio-jwt/socketio-jwt-tests.ts b/types/socketio-jwt/socketio-jwt-tests.ts new file mode 100644 index 0000000000..2341de7747 --- /dev/null +++ b/types/socketio-jwt/socketio-jwt-tests.ts @@ -0,0 +1,47 @@ +import * as fs from 'fs'; +import * as http from 'http'; +import * as SocketIo from 'socket.io'; +import { authorize, JwtSecretFuncCallback } from 'socketio-jwt'; + +const app = http.createServer((req: any, rsp: any) => { + fs.readFile(__dirname + '/index.html', + (err: Error, data: any) => { + if (err) { + rsp.writeHead(500); + return rsp.end('Error loading index.html'); + } + + rsp.writeHead(200); + rsp.end(data); + }); +}); + +const io = SocketIo(app); + +// This example test code is using the Node Http Server + +io.on('connection', authorize({ + secret: 'Your Secret Here', + decodedPropertyName: 'anyNameYouWant' +})); + +io.on('authenticated', (socket: SocketIo.Socket) => { + console.log('authenticated!!'); + console.log(JSON.stringify(( socket).anyNameYouWant)); +}); + +const secrets: any = { + user1: 'secret 1', + user2: 'secret 2' +}; + +// Assume a claim name of userId +function secretFunc(request: any, payload: any, callback: JwtSecretFuncCallback): void { + callback(null, secrets[payload.userId]); +} + +// This example test code provides a callback function to get the secret +io.on('connection', authorize({ + secret: secretFunc, + decodedPropertyName: 'anyNameYouWant' +})); diff --git a/types/socketio-jwt/tsconfig.json b/types/socketio-jwt/tsconfig.json new file mode 100644 index 0000000000..4ea9eb5ac7 --- /dev/null +++ b/types/socketio-jwt/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "socketio-jwt-tests.ts" + ] +} \ No newline at end of file diff --git a/types/socketio-jwt/tslint.json b/types/socketio-jwt/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/socketio-jwt/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/splunk-bunyan-logger/index.d.ts b/types/splunk-bunyan-logger/index.d.ts new file mode 100644 index 0000000000..5a1c8bf7d5 --- /dev/null +++ b/types/splunk-bunyan-logger/index.d.ts @@ -0,0 +1,28 @@ +// Type definitions for splunk-bunyan-logger 0.9 +// Project: http://dev.splunk.com +// Definitions by: Alex Brick +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +import { Stream as BunyanStream } from 'bunyan'; +import { + Config, + EventFormatter, + Logger as SplunkLogger, + SendContext +} from 'splunk-logging'; + +export interface SplunkStream extends NodeJS.WritableStream { + logger: SplunkLogger; +} + +export interface SplunkBunyanStream extends BunyanStream { + flush(callback?: (error: Error, req: any, res: any) => void): void; + on(event: string, callback: (err: Error, context: SendContext) => void): void; + setEventFormatter(eventFormatter: EventFormatter): void; + stream: SplunkStream; +} + +export function createStream(config: Config): SplunkBunyanStream; diff --git a/types/splunk-bunyan-logger/splunk-bunyan-logger-tests.ts b/types/splunk-bunyan-logger/splunk-bunyan-logger-tests.ts new file mode 100644 index 0000000000..78c9ed44eb --- /dev/null +++ b/types/splunk-bunyan-logger/splunk-bunyan-logger-tests.ts @@ -0,0 +1,62 @@ +import { createStream } from 'splunk-bunyan-logger'; +import { Config } from 'splunk-logging'; +import { createLogger } from 'bunyan'; + +const config = { + token: "your-token-here", + url: "https://splunk.local:8088" +}; + +const splunkStream = createStream(config); +// Enable SSL certificate validation +splunkStream.stream.logger.requestOptions.strictSSL = true; + +splunkStream.on("error", (err, context) => { + // Handle errors here + console.log("Error", err, "Context", context); +}); + +splunkStream.flush((err, resp, body) => { + // If successful, body will be { text: 'Success', code: 0 } + console.log("Response from Splunk", body); +}); + +splunkStream.setEventFormatter((message, severity) => { + let event = `[${severity}]`; + + if (typeof message === "object") { + for (const key in message) { + event += `${key}=${message[key]} `; + } + } else { + event += "message=" + message; + } + + return event; +}); + +// Note: splunkStream must be set to an element in the streams array +const Logger = createLogger({ + name: "my logger", + streams: [ + splunkStream + ] +}); + +// Fully-specified config + +const fullConfig: Config = { + token: 'token', + name: 'loggerName', + host: 'splunkHost', + maxRetries: 2, + path: 'splunkPath', + protocol: 'https', + port: 234, + level: 'info', + batchInterval: 200, + maxBatchSize: 300, + maxBatchCount: 400, +}; + +createStream(fullConfig); diff --git a/types/splunk-bunyan-logger/tsconfig.json b/types/splunk-bunyan-logger/tsconfig.json new file mode 100644 index 0000000000..6197901424 --- /dev/null +++ b/types/splunk-bunyan-logger/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", + "splunk-bunyan-logger-tests.ts" + ] +} diff --git a/types/splunk-bunyan-logger/tslint.json b/types/splunk-bunyan-logger/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/splunk-bunyan-logger/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/splunk-logging/index.d.ts b/types/splunk-logging/index.d.ts new file mode 100644 index 0000000000..ecbc38f32c --- /dev/null +++ b/types/splunk-logging/index.d.ts @@ -0,0 +1,50 @@ +// Type definitions for splunk-logging 0.9 +// Project: http://dev.splunk.com +// Definitions by: Alex Brick +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { CoreOptions as RequestOptions } from 'request'; + +export interface Config { + token: string; + name?: string; + host?: string; + maxRetries?: number; + path?: string; + protocol?: 'http' | 'https'; + port?: number; + url?: string; + level?: string; + batchInterval?: number; + maxBatchSize?: number; + maxBatchCount?: number; +} + +export interface SendContextMetadata { + host?: string; + index?: string; + source?: string; + sourcetype?: string; +} + +export interface SendContext { + message: any; + severity?: string; + metadata?: SendContextMetadata; +} + +export type Callback = (error: Error | undefined, req: any, res: any) => void; +export type EventFormatter = (message: any, severity: string) => any; + +export class Logger { + error: (error: Error, context: SendContext) => void; + eventFormatter: EventFormatter; + requestOptions: RequestOptions; + readonly serializedEventQueue: any[]; + + constructor(config: Config); + + flush(callback?: Callback): void; + send(context: SendContext, callback?: Callback): void; +} diff --git a/types/splunk-logging/splunk-logging-tests.ts b/types/splunk-logging/splunk-logging-tests.ts new file mode 100644 index 0000000000..4a60057ace --- /dev/null +++ b/types/splunk-logging/splunk-logging-tests.ts @@ -0,0 +1,54 @@ +import { Logger } from 'splunk-logging'; + +const config = { + token: "your-token-here", + url: "https://splunk.local:8088" +}; + +const logger = new Logger(config); +logger.requestOptions.strictSSL = true; +logger.eventFormatter = (msg, sev) => ({}); +logger.error = (err, context) => { context.message; }; +logger.serializedEventQueue[0] = { foo: 'bar' }; + +const payload = { + message: { + temperature: "70F", + chickenCount: 500 + } +}; + +logger.send(payload, (err, resp, body) => { + // If successful, body will be { text: 'Success', code: 0 } + body.text = 'foo'; + body.code = 0; +}); + +const fullPayload = { + message: [ 1, 2, 3 ], + severity: 'error', + metadata: { + host: 'myHost', + index: 'splunkIndex', + source: 'source', + sourcetype: 'sourcetype', + }, +}; + +logger.send(fullPayload); + +const fullConfig = { + token: 'token', + name: 'loggerName', + host: 'splunkHost', + maxRetries: 1, + path: 'splunkPath', + procotol: 'https', + port: 2, + level: 'info', + batchInterval: 3, + maxBatchSize: 4, + maxBatchCount: 5, +}; + +new Logger(fullConfig); diff --git a/types/splunk-logging/tsconfig.json b/types/splunk-logging/tsconfig.json new file mode 100644 index 0000000000..a4ca1dc9c5 --- /dev/null +++ b/types/splunk-logging/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", + "splunk-logging-tests.ts" + ] +} diff --git a/types/splunk-logging/tslint.json b/types/splunk-logging/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/splunk-logging/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/stampit/index.d.ts b/types/stampit/index.d.ts index def08b887d..87d96e4f4b 100644 --- a/types/stampit/index.d.ts +++ b/types/stampit/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for stampit 3.0 // Project: https://github.com/stampit-org/stampit // Definitions by: Vasyl Boroviak +// Harris Lummis // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** @@ -11,12 +12,12 @@ type Init = (factoryArg: any, ctx?: Context) => any; /** * Composer function */ -type Composer = ({ stamp, composables }: { stamp: Stamp; composables: Composable[] }) => any; +type Composer = ({ stamp, composables }: { stamp: stampit.Stamp; composables: Composable[] }) => any; /** The stamp Descriptor */ interface Descriptor { /** Create a new stamp based on this descriptor */ - (...composables: Composable[]): Stamp; + (...composables: Composable[]): stampit.Stamp; /** * A hash containing methods (functions) of any future created instance. */ @@ -49,7 +50,7 @@ interface Descriptor { } /** Any composable object (stamp or descriptor) */ -type Composable = Stamp | Descriptor; +type Composable = stampit.Stamp | Descriptor; /** * The .init() function argument. @@ -63,7 +64,7 @@ interface Context { /** * The stamp the object has been instantiated with. */ - stamp: Stamp; + stamp: stampit.Stamp; /** * The arguments list passed to the stamp. @@ -132,231 +133,230 @@ interface Options { composers?: Composer[]; } -/** - * A factory function that will produce new objects using the - * prototypes that are passed in or composed. - */ -interface Stamp { - /** - * Invokes the stamp and returns a new object instance. - * @param state Properties you wish to set on the new objects. - * @param encloseArgs The remaining arguments are passed to all .enclose() functions. - * WARNING Avoid using two different .enclose() functions that expect different arguments. - * .enclose() functions that take arguments should not be considered safe to compose - * with other .enclose() functions that also take arguments. Taking arguments with - * an .enclose() function is an anti-pattern that should be avoided, when possible. - * @return A new object composed of the Stamps and prototypes provided. - */ - (state?: {}, ...encloseArgs: any[]): any; - - /** - * Just like calling stamp(), stamp.create() invokes the stamp and returns a new instance. - * @param state Properties you wish to set on the new objects. - * @param encloseArgs The remaining arguments are passed to all .enclose() functions. - * WARNING Avoid using two different .enclose() functions that expect different arguments. - * .enclose() functions that take arguments should not be considered safe to compose - * with other .enclose() functions that also take arguments. Taking arguments with - * an .enclose() function is an anti-pattern that should be avoided, when possible. - * @return A new object composed of the Stamps and prototypes provided. - */ - create(state?: {}, ...encloseArgs: any[]): any; - - /** - * Stamp metadata/composer function - */ - compose: Descriptor; - - /** - * Add methods to the methods prototype. Creates and returns new Stamp. Chainable. - * @param methods Object(s) containing map of method names and bodies for delegation. - * @return A new Stamp. - */ - methods(...methods: Array<{}>): Stamp; - - /** - * Take n objects and add them to the state prototype. Creates and returns new Stamp. Chainable. - * @param states Object(s) containing map of property names and values to clone for each new object. - * @return A new Stamp. - */ - refs(...states: Array<{}>): Stamp; - - /** - * Take a variable number of objects and shallow assign them to any future - * created instance of the Stamp. Creates and returns new Stamp. Chainable. - * @param objects Object(s) to shallow assign for each new object. - * @return A new Stamp. - */ - props(...objects: Array<{}>): Stamp; - - /** - * Take a variable number of objects and shallow assign them to any future - * created instance of the Stamp. Creates and returns new Stamp. Chainable. - * @param objects Object(s) to shallow assign for each new object. - * @return A new Stamp. - */ - properties(...objects: Array<{}>): Stamp; - - /** - * Take a variable number of objects and deeply merge them to any future - * created instance of the Stamp. Creates and returns a new Stamp. - * Chainable. - * @param deepObjects The object(s) to deeply merge for each new object - * @returns A new Stamp - */ - deepProps(...deepObjects: Array<{}>): Stamp; - - /** - * Take a variable number of objects and deeply merge them to any future - * created instance of the Stamp. Creates and returns a new Stamp. - * Chainable. - * @param deepObjects The object(s) to deeply merge for each new object - * @returns A new Stamp - */ - deepProperties(...deepObjects: Array<{}>): Stamp; - - /** - * @deprecated Use .init() instead. - */ - enclose(...functions: Init[]): Stamp; - - /** - * @deprecated Use .init() instead. - */ - enclose(...functions: Array<{}>): Stamp; - - /** - * Take in a variable number of functions and add them to the enclose - * prototype as initializers. - * @param functions Initializer functions used to create private data and - * privileged methods - * @returns A new stamp - */ - init(...functions: Init[]): Stamp; - - /** - * Take in a variable number of functions and add them to the enclose - * prototype as initializers. - * @param functions Initializer functions used to create private data and - * privileged methods - * @returns A new stamp - */ - init(functions: Init[]): Stamp; - - /** - * Take in a variable number of functions and add them to the enclose - * prototype as initializers. - * @param functions Initializer functions used to create private data and - * privileged methods - * @returns A new stamp - */ - initializers(...functions: Init[]): Stamp; - - /** - * Take in a variable number of functions and add them to the enclose - * prototype as initializers. - * @param functions Initializer functions used to create private data and - * privileged methods - * @returns A new stamp - */ - initializers(functions: Init[]): Stamp; - - /** - * Take n objects and add them to a new stamp and any future stamp it composes with. - * Creates and returns new Stamp. Chainable. - * @param statics Object(s) containing map of property names and values to mixin into each new stamp. - * @return A new Stamp. - */ - statics(...statics: Array<{}>): Stamp; - - /** - * Take n objects and add them to a new stamp and any future stamp it composes with. - * Creates and returns new Stamp. Chainable. - * @param statics Object(s) containing map of property names and values to mixin into each new stamp. - * @return A new Stamp. - */ - staticProperties(...statics: Array<{}>): Stamp; - - /** - * Deeply merge a variable number of objects and add them to a new stamp and - * any future stamp it composes. Creates and returns a new Stamp. Chainable. - * @param deepStatics The object(s) containing static properties to be - * merged - * @returns A new stamp - */ - deepStatics(...deepStatics: Array<{}>): Stamp; - - /** - * Deeply merge a variable number of objects and add them to a new stamp and - * any future stamp it composes. Creates and returns a new Stamp. Chainable. - * @param deepStatics The object(s) containing static properties to be - * merged - * @returns A new stamp - */ - staticDeepProperties(...deepStatics: Array<{}>): Stamp; - - /** - * Shallowly assign properties of Stamp arbitrary metadata and add them to - * a new stamp and any future Stamp it composes. Creates and returns a new - * Stamp. Chainable. - * @param confs The object(s) containing metadata properties - * @returns A new Stamp - */ - conf(...confs: Array<{}>): Stamp; - - /** - * Shallowly assign properties of Stamp arbitrary metadata and add them to - * a new stamp and any future Stamp it composes. Creates and returns a new - * Stamp. Chainable. - * @param confs The object(s) containing metadata properties - * @returns A new Stamp - */ - configuration(...confs: Array<{}>): Stamp; - - /** - * Deeply merge properties of Stamp arbitrary metadata and add them to a new - * Stamp and any future Stamp it composes. Creates and returns a new Stamp. - * Chainable. - * @param deepConfs The object(s) containing metadata properties - * @returns A new Stamp - */ - deepConf(...deepConfs: Array<{}>): Stamp; - - /** - * Deeply merge properties of Stamp arbitrary metadata and add them to a new - * Stamp and any future Stamp it composes. Creates and returns a new Stamp. - * Chainable. - * @param deepConfs The object(s) containing metadata properties - * @returns A new Stamp - */ - deepConfiguration(...deepConfs: Array<{}>): Stamp; - - /** - * Apply ES5 property descriptors to object instances created by the new - * Stamp returned by the function and any future Stamp it composes. Creates - * and returns a new stamp. Chainable. - * @param descriptors - * @returns A new Stamp - */ - propertyDescriptors(...descriptors: Array<{}>): Stamp; - - /** - * Apply ES5 property descriptors to a Stamp and any future Stamp it - * composes. Creates and returns a new stamp. Chainable. - * @param descriptors - * @returns A new Stamp - */ - staticPropertyDescriptors(...descriptors: Array<{}>): Stamp; -} - /** * Return a factory (aka Stamp) function that will produce new objects using the * prototypes that are passed in or composed. * @param options Stampit options object containing refs, methods, * init, props, statics, configurations, and property descriptors. */ -declare function stampit(options?: Options): Stamp; +declare function stampit(options?: Options): stampit.Stamp; declare namespace stampit { + /** + * A factory function that will produce new objects using the + * prototypes that are passed in or composed. + */ + interface Stamp { + /** + * Invokes the stamp and returns a new object instance. + * @param state Properties you wish to set on the new objects. + * @param encloseArgs The remaining arguments are passed to all .enclose() functions. + * WARNING Avoid using two different .enclose() functions that expect different arguments. + * .enclose() functions that take arguments should not be considered safe to compose + * with other .enclose() functions that also take arguments. Taking arguments with + * an .enclose() function is an anti-pattern that should be avoided, when possible. + * @return A new object composed of the Stamps and prototypes provided. + */ + (state?: {}, ...encloseArgs: any[]): any; + + /** + * Just like calling stamp(), stamp.create() invokes the stamp and returns a new instance. + * @param state Properties you wish to set on the new objects. + * @param encloseArgs The remaining arguments are passed to all .enclose() functions. + * WARNING Avoid using two different .enclose() functions that expect different arguments. + * .enclose() functions that take arguments should not be considered safe to compose + * with other .enclose() functions that also take arguments. Taking arguments with + * an .enclose() function is an anti-pattern that should be avoided, when possible. + * @return A new object composed of the Stamps and prototypes provided. + */ + create(state?: {}, ...encloseArgs: any[]): any; + + /** + * Stamp metadata/composer function + */ + compose: Descriptor; + + /** + * Add methods to the methods prototype. Creates and returns new Stamp. Chainable. + * @param methods Object(s) containing map of method names and bodies for delegation. + * @return A new Stamp. + */ + methods(...methods: Array<{}>): Stamp; + + /** + * Take n objects and add them to the state prototype. Creates and returns new Stamp. Chainable. + * @param states Object(s) containing map of property names and values to clone for each new object. + * @return A new Stamp. + */ + refs(...states: Array<{}>): Stamp; + + /** + * Take a variable number of objects and shallow assign them to any future + * created instance of the Stamp. Creates and returns new Stamp. Chainable. + * @param objects Object(s) to shallow assign for each new object. + * @return A new Stamp. + */ + props(...objects: Array<{}>): Stamp; + + /** + * Take a variable number of objects and shallow assign them to any future + * created instance of the Stamp. Creates and returns new Stamp. Chainable. + * @param objects Object(s) to shallow assign for each new object. + * @return A new Stamp. + */ + properties(...objects: Array<{}>): Stamp; + + /** + * Take a variable number of objects and deeply merge them to any future + * created instance of the Stamp. Creates and returns a new Stamp. + * Chainable. + * @param deepObjects The object(s) to deeply merge for each new object + * @returns A new Stamp + */ + deepProps(...deepObjects: Array<{}>): Stamp; + + /** + * Take a variable number of objects and deeply merge them to any future + * created instance of the Stamp. Creates and returns a new Stamp. + * Chainable. + * @param deepObjects The object(s) to deeply merge for each new object + * @returns A new Stamp + */ + deepProperties(...deepObjects: Array<{}>): Stamp; + + /** + * @deprecated Use .init() instead. + */ + enclose(...functions: Init[]): Stamp; + + /** + * @deprecated Use .init() instead. + */ + enclose(...functions: Array<{}>): Stamp; + + /** + * Take in a variable number of functions and add them to the enclose + * prototype as initializers. + * @param functions Initializer functions used to create private data and + * privileged methods + * @returns A new stamp + */ + init(...functions: Init[]): Stamp; + + /** + * Take in a variable number of functions and add them to the enclose + * prototype as initializers. + * @param functions Initializer functions used to create private data and + * privileged methods + * @returns A new stamp + */ + init(functions: Init[]): Stamp; + + /** + * Take in a variable number of functions and add them to the enclose + * prototype as initializers. + * @param functions Initializer functions used to create private data and + * privileged methods + * @returns A new stamp + */ + initializers(...functions: Init[]): Stamp; + + /** + * Take in a variable number of functions and add them to the enclose + * prototype as initializers. + * @param functions Initializer functions used to create private data and + * privileged methods + * @returns A new stamp + */ + initializers(functions: Init[]): Stamp; + + /** + * Take n objects and add them to a new stamp and any future stamp it composes with. + * Creates and returns new Stamp. Chainable. + * @param statics Object(s) containing map of property names and values to mixin into each new stamp. + * @return A new Stamp. + */ + statics(...statics: Array<{}>): Stamp; + + /** + * Take n objects and add them to a new stamp and any future stamp it composes with. + * Creates and returns new Stamp. Chainable. + * @param statics Object(s) containing map of property names and values to mixin into each new stamp. + * @return A new Stamp. + */ + staticProperties(...statics: Array<{}>): Stamp; + + /** + * Deeply merge a variable number of objects and add them to a new stamp and + * any future stamp it composes. Creates and returns a new Stamp. Chainable. + * @param deepStatics The object(s) containing static properties to be + * merged + * @returns A new stamp + */ + deepStatics(...deepStatics: Array<{}>): Stamp; + + /** + * Deeply merge a variable number of objects and add them to a new stamp and + * any future stamp it composes. Creates and returns a new Stamp. Chainable. + * @param deepStatics The object(s) containing static properties to be + * merged + * @returns A new stamp + */ + staticDeepProperties(...deepStatics: Array<{}>): Stamp; + + /** + * Shallowly assign properties of Stamp arbitrary metadata and add them to + * a new stamp and any future Stamp it composes. Creates and returns a new + * Stamp. Chainable. + * @param confs The object(s) containing metadata properties + * @returns A new Stamp + */ + conf(...confs: Array<{}>): Stamp; + + /** + * Shallowly assign properties of Stamp arbitrary metadata and add them to + * a new stamp and any future Stamp it composes. Creates and returns a new + * Stamp. Chainable. + * @param confs The object(s) containing metadata properties + * @returns A new Stamp + */ + configuration(...confs: Array<{}>): Stamp; + + /** + * Deeply merge properties of Stamp arbitrary metadata and add them to a new + * Stamp and any future Stamp it composes. Creates and returns a new Stamp. + * Chainable. + * @param deepConfs The object(s) containing metadata properties + * @returns A new Stamp + */ + deepConf(...deepConfs: Array<{}>): Stamp; + + /** + * Deeply merge properties of Stamp arbitrary metadata and add them to a new + * Stamp and any future Stamp it composes. Creates and returns a new Stamp. + * Chainable. + * @param deepConfs The object(s) containing metadata properties + * @returns A new Stamp + */ + deepConfiguration(...deepConfs: Array<{}>): Stamp; + + /** + * Apply ES5 property descriptors to object instances created by the new + * Stamp returned by the function and any future Stamp it composes. Creates + * and returns a new stamp. Chainable. + * @param descriptors + * @returns A new Stamp + */ + propertyDescriptors(...descriptors: Array<{}>): Stamp; + + /** + * Apply ES5 property descriptors to a Stamp and any future Stamp it + * composes. Creates and returns a new stamp. Chainable. + * @param descriptors + * @returns A new Stamp + */ + staticPropertyDescriptors(...descriptors: Array<{}>): Stamp; + } /** * A shortcut methods for stampit().methods() * @param methods Object(s) containing map of method names and bodies for delegation. diff --git a/types/stampit/stampit-tests.ts b/types/stampit/stampit-tests.ts index 410e2d2218..5b7c41109a 100644 --- a/types/stampit/stampit-tests.ts +++ b/types/stampit/stampit-tests.ts @@ -142,3 +142,22 @@ t.thing; // 'initialized', t.foo(); // 'foo', t.bar(); // 'bar' + +interface SomeStampInstance { + a: string; + b: string; +} + +// Test import of stamp type +interface SomeStamp extends stampit.Stamp { + (params: { a: number; b: boolean}): SomeStampInstance; +} + +const SomeStamp = stampit() + .init((params: { a: number; b: boolean}) => { + this.a = '' + a; + this.b = '' + b; + }) as SomeStamp; + +SomeStamp({ a: 1, b: false }); // $ExpectType SomeStampInstance +SomeStamp({ a: 1, b: false }).a; // $ExpectType string diff --git a/types/stellar-sdk/index.d.ts b/types/stellar-sdk/index.d.ts index f7eb20af73..bc2a113334 100644 --- a/types/stellar-sdk/index.d.ts +++ b/types/stellar-sdk/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/stellar/js-stellar-sdk // Definitions by: Carl Foster // Triston Jones +// Paul Selden // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -505,16 +506,22 @@ export class Memo { static return(hash: string): Memo; static text(text: string): Memo; - constructor(type: 'MemoNone') - constructor(type: 'MemoID' | 'MemoText', value: string) - constructor(type: 'MemoHash' | 'MemoReturn', value: Buffer) + constructor(type: 'none'); + constructor(type: 'id' | 'text' | 'hash' | 'return', value: string) + constructor(type: 'hash' | 'return', value: Buffer) - type: 'MemoNone' | 'MemoID' | 'MemoText' | 'MemoHash' | 'MemoReturn'; + type: string; value: null | string | Buffer; toXDRObject(): xdr.Memo; } +export const MemoNone = 'none'; +export const MemoID = 'id'; +export const MemoText = 'text'; +export const MemoHash = 'hash'; +export const MemoReturn = 'return'; + export enum Networks { PUBLIC = 'Public Global Stellar Network ; September 2015', TESTNET = 'Test SDF Network ; September 2015', diff --git a/types/stellar-sdk/stellar-sdk-tests.ts b/types/stellar-sdk/stellar-sdk-tests.ts index 4bd84ccc33..dabf4f2b45 100644 --- a/types/stellar-sdk/stellar-sdk-tests.ts +++ b/types/stellar-sdk/stellar-sdk-tests.ts @@ -5,5 +5,6 @@ const destKey = StellarSdk.Keypair.random(); const account = new StellarSdk.Account(sourceKey.publicKey(), 1); const transaction = new StellarSdk.TransactionBuilder(account) .addOperation(StellarSdk.Operation.accountMerge({destination: destKey.publicKey()})) + .addMemo(new StellarSdk.Memo(StellarSdk.MemoText, "memo")) .build(); // $ExpectType () => Transaction transaction; // $ExpectType Transaction diff --git a/types/storybook__react/index.d.ts b/types/storybook__react/index.d.ts index d31ea08af2..853295de25 100644 --- a/types/storybook__react/index.d.ts +++ b/types/storybook__react/index.d.ts @@ -25,6 +25,7 @@ export function configure(fn: () => void, module: NodeModule): void; export function setAddon(addon: object): void; export function storiesOf(name: string, module: NodeModule): Story; export function storiesOf(name: string, module: NodeModule): Story & T; +export function forceReRender(): void; export interface StoryObject { name: string; diff --git a/types/storybook__react/storybook__react-tests.tsx b/types/storybook__react/storybook__react-tests.tsx index 9e7b8f5723..12edecb219 100644 --- a/types/storybook__react/storybook__react-tests.tsx +++ b/types/storybook__react/storybook__react-tests.tsx @@ -1,8 +1,10 @@ import * as React from 'react'; -import { storiesOf, setAddon, addDecorator, configure, getStorybook, RenderFunction, Story } from '@storybook/react'; +import { storiesOf, setAddon, addDecorator, configure, getStorybook, RenderFunction, Story, forceReRender } from '@storybook/react'; const Decorator = (story: RenderFunction) =>

; +forceReRender(); + storiesOf('Welcome', module) // local addDecorator .addDecorator(Decorator) diff --git a/types/stream-shift/index.d.ts b/types/stream-shift/index.d.ts new file mode 100644 index 0000000000..5b26fd3217 --- /dev/null +++ b/types/stream-shift/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for stream-shift 1.0 +// Project: https://github.com/mafintosh/stream-shift +// Definitions by: Daniel Cassidy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare function shift(stream: NodeJS.ReadableStream): Buffer | string | null; + +export = shift; diff --git a/types/stream-shift/stream-shift-tests.ts b/types/stream-shift/stream-shift-tests.ts new file mode 100644 index 0000000000..391419df96 --- /dev/null +++ b/types/stream-shift/stream-shift-tests.ts @@ -0,0 +1,6 @@ +import shift = require("stream-shift"); +import { createReadStream, createWriteStream } from "fs"; + +const stream = createReadStream(__filename); + +const x: Buffer | string | null = shift(stream); diff --git a/types/stream-shift/tsconfig.json b/types/stream-shift/tsconfig.json new file mode 100644 index 0000000000..59db2bfad5 --- /dev/null +++ b/types/stream-shift/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", + "stream-shift-tests.ts" + ] +} diff --git a/types/stream-shift/tslint.json b/types/stream-shift/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/stream-shift/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/streamtest/index.d.ts b/types/streamtest/index.d.ts new file mode 100644 index 0000000000..2efbd89708 --- /dev/null +++ b/types/streamtest/index.d.ts @@ -0,0 +1,126 @@ +// Type definitions for streamtest 1.2 +// Project: https://github.com/nfroidure/streamtest +// Definitions by: Harris Lummis +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 +/// +import { PassThrough, Readable, ReadableOptions, Writable, WritableOptions } from "stream"; + +export type Chunk = string | Buffer | Uint8Array; + +export type NonNull = {} | undefined; + +/** Allowed version names for streamtest */ +export type VersionName = "v1" | "v2"; + +/** + * List of supported versions (currently v1 and v2). v1 should be used for + * Node < 0.10 streams. + */ +export const versions: VersionName[]; + +/** v1 methods (Node version < 0.10) */ +export const v1: typeof v2; + +/** v2 methods (Node version >= 0.10) */ +export namespace v2 { + /** + * Create a readable stream streaming 'chunks' each after 'timeout' + * milliseconds and then end. Useful for testing buffer based streams. + * @param chunks The input chunks for the readable stream + * @param timeout The timeout (in milliseconds) used to space chunks. + * Defaults to 0. + * @returns A new readable stream + */ + function fromChunks(chunks: Chunk[], timeout?: number): Readable; + /** + * Create a readable stream streaming 'objects' each after 'timeout' + * milliseconds and then end. Useful for testing objectMode based streams. + * @param chunks The input objects for the readable stream + * @param timeout The timeout (in milliseconds) used to space chunks. + * Defaults to 0. + * @returns A new readable stream + */ + function fromObjects(objects: NonNull[], timeout?: number): Readable; + /** + * Create a readable stream streaming 'chunks' each after 'timeout' + * milliseconds, emit 'err,' and then end. Useful for testing buffer based + * streams. + * @param err The error to emit + * @param chunks The input objects for the readable stream + * @param timeout The timeout (in milliseconds) used to space chunks. + * Defaults to 0. + * @returns A new readable stream + */ + function fromErroredChunks(err: Error, chunks: Chunk[], timeout?: number): Readable; + /** + * Create a readable stream streaming 'objects' each after 'timeout' + * milliseconds, emit 'err,' and then end. Useful for testing objectMode + * based streams. + * @param err The error to emit + * @param chunks The input objects for the readable stream + * @param timeout The timeout (in milliseconds) used to space chunks. + * Defaults to 0. + * @returns A new readable stream + */ + function fromErroredObjects(err: Error, objects: NonNull[], timeout?: number): Readable; + /** + * Create a writable stream collecting written chunks and call the passed + * callback function when it finishes. + * @param cb The callback function. Takes an error as its first argument and + * an array of chunks as its second + * @returns A new writable stream + */ + function toChunks(cb: (err: Error, chunks: Chunk[]) => any): Writable; + /** + * Create a writable stream collecting written chunks and call the passed + * callback function when it finishes. + * @param cb The callback function. Takes an error as its first argument and + * an array of objects as its second + * @returns A new writable stream + */ + function toObjects(cb: (err: Error, objects: NonNull[]) => any): Writable; + /** + * Create a writable stream collecting written chunks and call the passed + * callback function when it finishes. + * @param cb The callback function. Takes an error as its first argument and + * an string as its second + * @returns A new writable stream + */ + function toText(cb: (err: Error, text: string) => any): Writable; + /** + * Create a new readable stream + * @param options The options used to create the stream + * @returns A new readable stream + */ + function readable(options?: ReadableOptions): Readable; + /** + * Create a new writable stream + * @param options The options used to create the stream + * @returns A new writable stream + */ + function writable(options?: WritableOptions): Writable; + /** + * Create a synchronous PassThrough stream + * @returns A PassThrough stream + */ + function syncReadableChunks(): PassThrough; + /** + * Create a synchronous PassThrough stream in object mode + * @returns A PassThrough stream + */ + function syncReadableObjects(): PassThrough; + /** + * Write chunks to a stream synchronously + * @param stream The stream to write to + * @param chunks The chunks to write + */ + function syncWrite(stream: Writable, chunks: Chunk[]): void; + /** + * Write chunks to a stream synchronously and emit an error when done + * @param stream The stream to write to + * @param err The error to emit + * @param chunks The chunks to write + */ + function syncError(stream: Writable, err: Error, chunks: Chunk[]): void; +} diff --git a/types/streamtest/streamtest-tests.ts b/types/streamtest/streamtest-tests.ts new file mode 100644 index 0000000000..b4d153eb7f --- /dev/null +++ b/types/streamtest/streamtest-tests.ts @@ -0,0 +1,99 @@ +import { PassThrough, Readable, Writable, Stream } from "stream"; +import * as StreamTest from "streamtest"; + +StreamTest.versions; // $ExpectType VersionName[] + +const fromObjectsTestArray = ['hello', { a: 1, b: false }, 1]; + +function runTest() { + StreamTest.versions.forEach((version) => { + StreamTest[version].fromChunks(['hello']); // $ExpectType Readable + StreamTest[version].fromChunks(['hello'], 10); // $ExpectType Readable + + StreamTest[version].fromObjects(fromObjectsTestArray); // $ExpectType Readable + StreamTest[version].fromObjects(fromObjectsTestArray, 10); // $ExpectType Readable + + const errorChunkStream1 = StreamTest[version].fromErroredChunks( + new Error('bad thing'), + [Buffer.from('some data')], + ); + errorChunkStream1; // $ExpectType Readable + errorChunkStream1.on('error', (err) => { + return; // keep on working + }); + + const errorChunkStream2 = StreamTest[version].fromErroredChunks( + new Error('bad thing'), + [Buffer.from('some data')], + 10 + ); + errorChunkStream2; // $ExpectType Readable + errorChunkStream2.on('error', (err) => { + return; // keep on working + }); + + const errorObjectStream1 = StreamTest[version].fromErroredObjects( + new Error('bad thing'), + fromObjectsTestArray, + ); + errorObjectStream1; // $ExpectType Readable + errorObjectStream1.on('error', (err) => { + return; // keep on working + }); + + const errorObjectStream2 = StreamTest[version].fromErroredObjects( + new Error('bad thing'), + fromObjectsTestArray, + 10, + ); + errorObjectStream2; // $ExpectType Readable + errorObjectStream2.on('error', (err) => { + return; // keep on working + }); + + const toChunks = StreamTest[version].toChunks((err, chunks) => { + if (err) { + throw err; + } + return; + }); + toChunks; // $ExpectType Writable + + const toObjects = StreamTest[version].toObjects((err, objects) => { + if (err) { + throw err; + } + return; + }); + toObjects; // $ExpectType Writable + + const toText = StreamTest[version].toText((err, text) => { + if (err) { + throw err; + } + return; + }); + toText; // $ExpectType Writable + + StreamTest[version].syncReadableChunks(); // $ExpectType PassThrough + + StreamTest[version].syncReadableObjects(); // $ExpectType PassThrough + + StreamTest[version].syncWrite(StreamTest[version].writable(), ['a chunk']); + + try { + StreamTest[version].syncError( + StreamTest[version].writable(), + new Error('bad thing'), + ['a chunk'] + ); + } catch (err) { + // If error not anticipated, throw again + if (err.message !== 'bad thing') { + throw err; + } + } + }); +} + +runTest(); diff --git a/types/streamtest/tsconfig.json b/types/streamtest/tsconfig.json new file mode 100644 index 0000000000..978e91ca36 --- /dev/null +++ b/types/streamtest/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", + "streamtest-tests.ts" + ] +} diff --git a/types/streamtest/tslint.json b/types/streamtest/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/streamtest/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/stripe-v3/index.d.ts b/types/stripe-v3/index.d.ts index 0c99525290..78ca2c0f8b 100644 --- a/types/stripe-v3/index.d.ts +++ b/types/stripe-v3/index.d.ts @@ -308,6 +308,7 @@ declare namespace stripe { } interface ElementChangeResponse { + elementType: string; brand: string; complete: boolean; empty: boolean; diff --git a/types/stripe-v3/stripe-v3-tests.ts b/types/stripe-v3/stripe-v3-tests.ts index f461006cf3..abd15d5afd 100644 --- a/types/stripe-v3/stripe-v3-tests.ts +++ b/types/stripe-v3/stripe-v3-tests.ts @@ -28,6 +28,9 @@ describe("Stripe", () => { card.on('ready', () => { console.log('ready'); }); + card.on('change', (resp: stripe.elements.ElementChangeResponse) => { + console.log(resp.elementType); + }); card.on('change', (resp: stripe.elements.ElementChangeResponse) => { console.log(resp.brand); }); diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index dc679c0be8..0704eef970 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -10,6 +10,7 @@ // Thomas Bruun // Gal Talmor // Hunter Tunnicliff +// Tyler Jones // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -1895,6 +1896,16 @@ declare namespace Stripe { */ amount_due: number; + /** + * The amount, in cents, that was paid. + */ + amount_paid: number; + + /** + * The amount remaining, in cents, that is due. + */ + amount_remaining: number; + /** * The fee in cents that will be applied to the invoice and transferred to the application owner's * Stripe account when the invoice is paid. @@ -1915,6 +1926,16 @@ declare namespace Stripe { */ attempted: boolean; + /** + * Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. + */ + billing: "charge_automatically" | "send_invoice"; + + /** + * Indicates the reason why the invoice was created. subscription_cycle indicates an invoice created by a subscription advancing into a new period. subscription_update indicates an invoice created due to creating or updating a subscription. subscription is set for all old invoices to indicate either a change to a subscription or a period advancement. manual is set for all invoices unrelated to a subscription (for example: created via the invoice editor). The upcoming value is reserved for simulated invoices per the upcoming invoice endpoint. + */ + billing_reason: "subscription_cycle" | "subscription_update" | "subscription" | "manual" | "upcoming"; + /** * ID of the latest charge generated for this invoice, if any. [Expandable] */ @@ -1926,17 +1947,35 @@ declare namespace Stripe { */ closed: boolean; + /** + * Three-letter ISO currency code, in lowercase. Must be a supported currency. + */ currency: string; + customer: string; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ date: number; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ description: string; + discount: coupons.IDiscount; + /** + * The date on which payment for this invoice is due. This value will be null for invoices where billing=charge_automatically. + */ + due_date: number | null; + /** * Ending customer balance after attempting to pay invoice. If the invoice has not been attempted yet, * this will be null. */ - ending_balance: number; + ending_balance: number | null; /** * Whether or not the invoice has been forgiven. Forgiving an invoice instructs us to update the subscription @@ -1945,6 +1984,16 @@ declare namespace Stripe { */ forgiven: boolean; + /** + * The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been frozen yet, this will be null. + */ + hosted_invoice_url: string | null; + + /** + * The link to download the PDF for the invoice. If the invoice has not been frozen yet, this will be null. + */ + invoice_pdf: string | null; + /** * The individual line items that make up the invoice. * @@ -1952,7 +2001,14 @@ declare namespace Stripe { */ lines: IList; + /** + * Has the value true if the object exists in live mode or the value false if the object exists in test mode. + */ livemode: boolean; + + /** + * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + */ metadata: IMetadata; /** @@ -1960,6 +2016,11 @@ declare namespace Stripe { */ next_payment_attempt: number; + /** + * A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer’s unique invoice_prefix if it is specified. + */ + number: string; + /** * Whether or not payment was successfully collected for this invoice. An invoice can be paid (most commonly) * with a charge or with credit from the customer's account balance. @@ -1988,7 +2049,7 @@ declare namespace Stripe { starting_balance: number; /** - * Extra information about an invoice for the customer�s credit card statement. + * Extra information about an invoice for the customer's credit card statement. */ statement_descriptor: string; @@ -2011,14 +2072,14 @@ declare namespace Stripe { * The amount of tax included in the total, calculated from tax_percent and the subtotal. If no tax_percent * is defined, this value will be null. */ - tax: number; + tax: number | null; /** * This percentage of the subtotal has been added to the total amount of the invoice, including invoice line * items and discounts. This field is inherited from the subscription's tax_percent field, but can be changed * before the invoice is paid. This field defaults to null. */ - tax_percent: number; + tax_percent: number | null; /** * Total after discount @@ -4278,7 +4339,7 @@ declare namespace Stripe { /** * Value is 'card' */ - object: string; + object: 'card'; /** * The card number @@ -4337,7 +4398,7 @@ declare namespace Stripe { /** * Cardholder name */ - name: string; + name: string | null; /** * Uniquely identifies this particular card number. You can use this attribute to check @@ -6666,12 +6727,24 @@ declare namespace Stripe { * request should never throw an error. You can optionally request that the response include the total count of all plans. To * do so, specify include[]=total_count in your request. */ - list(data: IListOptionsCreated, options: HeaderOptions, response?: IResponseFn>): Promise>; - list(data: IListOptionsCreated, response?: IResponseFn>): Promise>; + list(data: IPlanListOptions, options: HeaderOptions, response?: IResponseFn>): Promise>; + list(data: IPlanListOptions, response?: IResponseFn>): Promise>; list(options: HeaderOptions, response?: IResponseFn>): Promise>; list(response?: IResponseFn>): Promise>; } + interface IPlanListOptions extends IListOptionsCreated { + /** + * Only return plans that are active or inactive (e.g., pass false to list all inactive products). + */ + active?: boolean; + + /** + * Only return plans for the given product. + */ + product?: string + } + /** * @deprecated */ diff --git a/types/stripe/stripe-tests.ts b/types/stripe/stripe-tests.ts index ad5f1750fb..b6583c09f2 100644 --- a/types/stripe/stripe-tests.ts +++ b/types/stripe/stripe-tests.ts @@ -1220,6 +1220,13 @@ stripe.plans.del("gold-plan").then(function (confirmation) { // asynchronously called }); +stripe.plans.list({ active: true, product: 'prod_someproduct' }, function(err, plans) { + // asynchronously called +}); +stripe.plans.list({ active: true, product: 'prod_someproduct' }).then(function (plans) { + // asynchronously called +}); + stripe.plans.list(null, function (err, plans) { // asynchronously called }); diff --git a/types/styled-system/index.d.ts b/types/styled-system/index.d.ts index 5fcc4973b1..d99382e5fd 100644 --- a/types/styled-system/index.d.ts +++ b/types/styled-system/index.d.ts @@ -5,6 +5,7 @@ // Justin Bennett // Christopher Pappas // Eloy Durán +// Matthieu Vachon // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -409,7 +410,76 @@ export function flexBasis(...args: any[]): any; * Grid Layout */ -// TODO: Add grid values +export type GridGapValue = number | string; +export type ResponsiveGridGapValue = ResponsiveValue; + +export interface GridGapProps { + gridGap?: ResponsiveGridGapValue; +} + +export function gridGap(...args: any[]): any; + +export interface GridRowGapProps { + gridRowGap?: ResponsiveGridGapValue; +} + +export function gridRowGap(...args: any[]): any; + +export interface GridColumnGapProps { + gridColumnGap?: ResponsiveGridGapValue; +} + +export function gridColumnGap(...args: any[]): any; + +export type GridCellValue = string; +export type ResponsiveGridCellValue = ResponsiveValue; + +export interface GridColumnProps { + gridColumn?: ResponsiveGridCellValue; +} + +export function gridColumn(...args: any[]): any; + +export interface GridRowProps { + gridRow?: ResponsiveGridCellValue; +} + +export function gridRow(...args: any[]): any; + +export type GridAutoValue = string; + +export interface GridAutoFlowProps { + gridAutoFlow?: GridAutoValue; +} + +export function gridAutoFlow(...args: any[]): any; + +export interface GridAutoRowsProps { + gridAutoRows?: GridAutoValue; +} + +export function gridAutoRows(...args: any[]): any; + +export interface GridAutoColumnsProps { + gridAutoColumns?: GridAutoValue; +} + +export function gridAutoColumns(...args: any[]): any; + +export type GridTemplateValue = string; +export type ResponsiveGridTemplateValue = ResponsiveValue; + +export interface GridTemplatesRowsProps { + gridTemplateRows?: ResponsiveGridTemplateValue; +} + +export function gridTemplateRows(...args: any[]): any; + +export interface GridTemplatesColumnsProps { + gridTemplateColumns?: ResponsiveGridTemplateValue; +} + +export function gridTemplateColumns(...args: any[]): any; /** * Background diff --git a/types/styled-system/styled-system-tests.tsx b/types/styled-system/styled-system-tests.tsx index e58791662e..fa472f892a 100644 --- a/types/styled-system/styled-system-tests.tsx +++ b/types/styled-system/styled-system-tests.tsx @@ -92,7 +92,27 @@ import { active, ActiveProps, disabled, - DisabledProps + DisabledProps, + GridGapProps, + GridRowGapProps, + GridColumnGapProps, + GridRowProps, + GridColumnProps, + gridGap, + gridRowGap, + gridColumnGap, + gridRow, + gridColumn, + GridAutoFlowProps, + GridAutoColumnsProps, + GridAutoRowsProps, + GridTemplatesRowsProps, + GridTemplatesColumnsProps, + gridAutoFlow, + gridAutoRows, + gridAutoColumns, + gridTemplateColumns, + gridTemplateRows } from "styled-system"; interface BoxProps @@ -201,6 +221,30 @@ const Flex = styled.div.attrs({})` ${flexDirection}; `; +interface GridComponentProps + extends GridGapProps, + GridRowGapProps, + GridColumnGapProps, + GridRowProps, + GridColumnProps, + GridAutoFlowProps, + GridAutoColumnsProps, + GridAutoRowsProps, + GridTemplatesRowsProps, + GridTemplatesColumnsProps {} +const Grid = styled.div.attrs({})` + ${gridGap}; + ${gridRowGap}; + ${gridColumnGap}; + ${gridRow}; + ${gridColumn}; + ${gridAutoFlow}; + ${gridAutoRows}; + ${gridAutoColumns}; + ${gridTemplateRows}; + ${gridTemplateColumns}; +`; + const test = () => (
// width: 50% @@ -309,6 +353,34 @@ const test = () => ( // flexDirection (responsive) + // gridGap + + + // gridRowGap + + + // gridColumnGap + + + // gridRow + + // gridColumn + + // gridAutoFlow + + + // gridAutoRows + + + // gridAutoColumns + + + // gridTemplateRows + + + // gridTemplateColumns + + // flex (responsive) // justifySelf (responsive) diff --git a/types/summernote/index.d.ts b/types/summernote/index.d.ts new file mode 100644 index 0000000000..4d2307da70 --- /dev/null +++ b/types/summernote/index.d.ts @@ -0,0 +1,240 @@ +// Type definitions for Summernote 0.8 +// Project: https://github.com/summernote/summernote#readme +// Definitions by: Wouter Staelens +// Denny Harijanto +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +/// + +declare global { + namespace Summernote { + interface Options { + airMode?: boolean; + callbacks?: any; // todo + codemirror?: CodemirrorOptions; + colors?: colorsDef; + dialogsInBody?: boolean; + dialogsFade?: boolean; + direction?: string; + disableDragAndDrop?: boolean; + focus?: boolean; + fontNames?: string[]; + fontNamesIgnoreCheck?: string[]; + height?: number; + hint?: HintOptions; + icons?: IconsOptions; + insertTableMaxSize?: InsertTableMaxSizeOptions; + keyMap?: KeyMapOptions; + lang?: string; + lineHeights?: string[]; + minHeight?: number; + maxHeight?: number; + maximumImageFileSize?: any; + modules?: ModuleOptions; + popover?: PopoverOptions; + placeholder?: string; + shortcuts?: boolean; + styleTags?: styleTagsOptions[]; + styleWithSpan?: boolean; + tabsize?: number; + tableClassName?: string; + textareaAutoSync?: boolean; + toolbar?: toolbarDef; + width?: number; + } + + type toolbarStyleGroupOptions = 'style' | 'bold' | 'italic' | 'underline' | 'clear'; + type toolbarFontGroupOptions = 'strikethrough' | 'superscript' | 'subscript'; + type toolbarFontsizeGroupOptions = 'fontsize'; + type toolbarColorGroupOptions = 'color'; + type toolbarParaGroupOptions = 'ul' | 'ol' | 'paragraph'; + type toolbarHeightGroupOptions = 'height'; + type toolbarTableGroupOptions = 'table'; + type toolbarInsertGroupOptions = 'link' | 'picture' | 'hr'; + type toolbarViewGroupOptions = 'fullscreen' | 'codeview'; + type toolbarHelpGroupOptions = 'help'; + // type toolbarDef = [string, string[]][] + type toolbarDef = [ + ['style', toolbarStyleGroupOptions[]] + | ['font', toolbarFontGroupOptions[]] + | ['fontsize', toolbarFontsizeGroupOptions[]] + | ['color', toolbarColorGroupOptions[]] + | ['para', toolbarParaGroupOptions[]] + | ['height', toolbarHeightGroupOptions[]] + | ['table', toolbarTableGroupOptions[]] + | ['insert', toolbarInsertGroupOptions[]] + | ['view', toolbarViewGroupOptions[]] + | ['help', toolbarHelpGroupOptions[]] + ]; + + type colorsDef = Array<[string[]]>; + type styleTagsOptions = 'p' | 'blockquote' | 'pre' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'; + + interface InsertTableMaxSizeOptions { + col: number; + row: number; + } + + interface IconsOptions { + options?: any; // todo + } + + interface KeyMapOptions { + pc?: KeyMapPcOptions; + mac?: KeyMapMacOptions; + } + + interface KeyMapPcOptions { + options?: any; // todo + } + + interface KeyMapMacOptions { + options?: any; // todo + } + + type htmlElement = string; + + interface HintOptions { + words?: string[]; + mentions?: string[]; + match: RegExp; + search: (keyword: string, callback: (plausibleItems: string[]) => void) => void; + template?: (item: string) => htmlElement; + content?: (item: string) => htmlElement | JQuery.Node; + } + + interface CodemirrorOptions { + mode?: string; + htmlNode?: boolean; + lineNumbers?: boolean; + theme?: string; + } + + type popoverImageOptionsImagesize = 'imageSize100' | 'imageSize50' | 'imageSize25'; + type popoverImageOptionsFloat = 'floatLeft' | 'floatRight' | 'floatNone'; + type popoverImageOptionsRemove = 'removeMedia'; + type popoverImageDef = [ + ['imagesize', popoverImageOptionsImagesize[]], + ['float', popoverImageOptionsFloat[]], + ['remove', popoverImageOptionsRemove[]] + ]; + + type popoverLinkLinkOptions = 'linkDialogShow' | 'unlink'; + type popoverLinkDef = [ + ['link', popoverLinkLinkOptions[]] + ]; + + type popoverAirOptionsColor = 'color'; + type popoverAirOptionsFont = 'bold' | 'underline' | 'clear'; + type popoverAirOptionsPara = 'ul' | 'paragraph'; + type popoverAirOptionsTable = 'table'; + type popoverAirOptionsInsert = 'link' | 'picture'; + type popoverAirDef = [ + ['color', popoverAirOptionsColor], + ['font', popoverAirOptionsFont], + ['para', popoverAirOptionsPara], + ['table', popoverAirOptionsTable], + ['insert', popoverAirOptionsInsert] + ]; + + interface PopoverOptions { + image?: popoverImageDef; + link?: popoverLinkDef; + air?: popoverAirDef; + } + + interface ModuleOptions { + options?: any; // todo + } + + interface CreateLinkOptions { + text: string; + url: string; + newWindow: boolean; + } + + type EditImageCallback = ($image: JQuery.Node) => void; + } + + interface JQuery { + summernote(): JQuery; + summernote(command: string): JQuery; + summernote(options?: Summernote.Options): JQuery; + summernote(command: string, markupString: string): JQuery; + summernote(command: string, value: number): JQuery; + summernote(command: string, node: JQuery.Node): JQuery; + summernote(command: string, url: string, filename?: (string | Summernote.EditImageCallback)): JQuery; + + summernote(command: 'destroy'): JQuery; + summernote(command: 'code', markupStr?: string): JQuery; + summernote(command: 'editor.pasteHTML' | 'pasteHTML', markup: string): JQuery; + + // Basic API + summernote(command: 'editor.createRange' | 'createRange'): JQuery; + summernote(command: 'editor.saveRange' | 'saveRange'): JQuery; + summernote(command: 'editor.restoreRange' | 'restoreRange'): JQuery; + summernote(command: 'editor.undo' | 'undo'): JQuery; + summernote(command: 'editor.redo' | 'redo'): JQuery; + summernote(command: 'editor.focus' | 'focus'): JQuery; + summernote(command: 'editor.isEmpty' | 'isEmpty'): boolean; + summernote(command: 'reset'): JQuery; + summernote(command: 'disable'): JQuery; + summernote(command: 'enable'): JQuery; + // Font style API + summernote(fontStyle: 'editor.bold' | 'bold'): JQuery; + summernote(fontStyle: 'editor.italic' | 'italic'): JQuery; + summernote(fontStyle: 'editor.underline' | 'underline'): JQuery; + summernote(fontStyle: 'editor.strikethrough' | 'strikethrough'): JQuery; + summernote(command: 'editor.superscript' | 'superscript'): JQuery; + summernote(command: 'editor.subscript' | 'subscript'): JQuery; + summernote(command: 'editor.removeFormat' | 'removeFormat'): JQuery; + summernote(command: 'backColor', color: string): JQuery; + summernote(command: 'foreColor', color: string): JQuery; + summernote(command: 'fontName', fontName: string): JQuery; + summernote(command: 'editor.fontSize' | 'fontSize', fontSize: number): JQuery; + // Paragraph API + summernote(command: 'editor.justifyLeft' | 'justifyLeft'): JQuery; + summernote(command: 'editor.justifyRight' | 'justifyRight'): JQuery; + summernote(command: 'editor.justifyCenter' | 'justifyCenter'): JQuery; + summernote(command: 'editor.justifyFull' | 'justifyFull'): JQuery; + summernote(command: 'insertParagraph'): JQuery; + summernote(command: 'editor.insertOrderedList' | 'insertOrderedList'): JQuery; + summernote(command: 'editor.insertUnorderedList' | 'insertUnorderedList'): JQuery; + summernote(command: 'editor.indent' | 'indent'): JQuery; + summernote(command: 'editor.outdent' | 'outdent'): JQuery; + summernote(command: 'formatPara'): JQuery; + summernote(command: 'formatH1'): JQuery; + summernote(command: 'formatH2'): JQuery; + summernote(command: 'formatH3'): JQuery; + summernote(command: 'formatH4'): JQuery; + summernote(command: 'formatH5'): JQuery; + summernote(command: 'formatH6'): JQuery; + // Insertion API + summernote(command: 'editor.insertImage' | 'insertImage', url: string, filename?: (string | Summernote.EditImageCallback)): JQuery; + summernote(command: 'editor.insertNode' | 'insertNode', node: JQuery.Node): JQuery; + summernote(command: 'editor.insertText' | 'insertText', text: string): JQuery; + summernote(command: 'createLink', options: Summernote.CreateLinkOptions): JQuery; + // TODO: Callbacks + + // TODO: Editor + // editor.insertImagesOrCallback ?? + // editor.afterCommand ?? + // editor.resizeTo ?? + // editor.resize ?? + // editor.saveTarget ?? + // editor.isActivated ?? + // editor.formatBlock ?? + // editor.color ?? + // editor.lineHeight ?? + // editor.insertTable ?? + // editor.insertHorizontalRule ?? + // editor.floatMe ?? + // editor.removeMedia ?? + // editor.currentStyle ?? + // editor.getLinkInfo ?? + // editor.getSelectedText ?? + } +} + +export {}; diff --git a/types/summernote/summernote-tests.ts b/types/summernote/summernote-tests.ts new file mode 100644 index 0000000000..d984e4b6c0 --- /dev/null +++ b/types/summernote/summernote-tests.ts @@ -0,0 +1,8 @@ +import 'summernote'; + +$('#testElement').summernote({ + airMode: true +}); + +$('#testElement').summernote('code', '

hello

'); +$('#testElement').summernote('code'); diff --git a/types/summernote/tsconfig.json b/types/summernote/tsconfig.json new file mode 100644 index 0000000000..127f97e02f --- /dev/null +++ b/types/summernote/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", + "summernote-tests.ts" + ] +} diff --git a/types/summernote/tslint.json b/types/summernote/tslint.json new file mode 100644 index 0000000000..08016de61a --- /dev/null +++ b/types/summernote/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "unified-signatures": false + } +} diff --git a/types/superagent/index.d.ts b/types/superagent/index.d.ts index e5a52ce3cd..c07d2fff1c 100644 --- a/types/superagent/index.d.ts +++ b/types/superagent/index.d.ts @@ -13,6 +13,7 @@ import * as fs from 'fs'; import * as https from 'https'; import * as stream from 'stream'; +import * as cookiejar from 'cookiejar'; type CallbackHandler = (err: any, res: request.Response) => void; @@ -49,6 +50,7 @@ declare namespace request { } interface SuperAgent extends stream.Stream { + jar: cookiejar.CookieJar; attachCookies(req: Req): void; checkout(url: string, callback?: CallbackHandler): Req; connect(url: string, callback?: CallbackHandler): Req; diff --git a/types/supertest-as-promised/index.d.ts b/types/supertest-as-promised/index.d.ts index f88c80eaba..1b12d57b0f 100644 --- a/types/supertest-as-promised/index.d.ts +++ b/types/supertest-as-promised/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/WhoopInc/supertest-as-promised // Definitions by: Tanguy Krotoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as supertest from "supertest"; import * as superagent from "superagent"; diff --git a/types/supertest/index.d.ts b/types/supertest/index.d.ts index 0716f9e1b5..092ab89bb4 100644 --- a/types/supertest/index.d.ts +++ b/types/supertest/index.d.ts @@ -27,7 +27,7 @@ declare namespace supertest { expect(body: RegExp, callback?: CallbackHandler): this; expect(body: Object, callback?: CallbackHandler): this; expect(field: string, val: string, callback?: CallbackHandler): this; - expect(fzield: string, val: RegExp, callback?: CallbackHandler): this; + expect(field: string, val: RegExp, callback?: CallbackHandler): this; expect(checker: (res: Response) => any): this; end(callback?: CallbackHandler): this; } diff --git a/types/svg-sprite/index.d.ts b/types/svg-sprite/index.d.ts index fd63d3f37b..82a1607d21 100644 --- a/types/svg-sprite/index.d.ts +++ b/types/svg-sprite/index.d.ts @@ -7,7 +7,7 @@ /// import File = require('vinyl'); -import winston = require('winston'); +import { Logger } from 'winston'; declare namespace sprite { interface SVGSpriterConstructor extends NodeJS.EventEmitter { @@ -59,7 +59,7 @@ declare namespace sprite { /** * Logging verbosity or custom logger */ - log?: string | winston.LoggerInstance; + log?: string | Logger; /** * SVG shape configuration */ diff --git a/types/svg-sprite/package.json b/types/svg-sprite/package.json new file mode 100644 index 0000000000..0aa4cf368f --- /dev/null +++ b/types/svg-sprite/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "winston": "^3.0.0" + } +} diff --git a/types/swagger-ui-dist/index.d.ts b/types/swagger-ui-dist/index.d.ts new file mode 100644 index 0000000000..a4eb654e61 --- /dev/null +++ b/types/swagger-ui-dist/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for swagger-ui-dist 3.x +// Project: https://github.com/swagger-api/swagger-ui#readme +// Definitions by: Haowen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/* =================== USAGE =================== + + import * as SwaggerUIDist from "swagger-ui-dist" + const swaggerUiAssetPath = SwaggerUIDist.getAbsoluteFSPath() + + =============================================== */ + +export as namespace SwaggerUIDist; + +/** + * get an absolute path to swagger ui for static file serving + */ +export function getAbsoluteFSPath(): string; +export function absolutePath(): string; + +export const SwaggerUIBundle: any; +export const SwaggerUIStandalonePreset: any; diff --git a/types/swagger-ui-dist/swagger-ui-dist-tests.ts b/types/swagger-ui-dist/swagger-ui-dist-tests.ts new file mode 100644 index 0000000000..7597d81041 --- /dev/null +++ b/types/swagger-ui-dist/swagger-ui-dist-tests.ts @@ -0,0 +1,4 @@ +import * as SwaggerUIDist from "swagger-ui-dist"; + +SwaggerUIDist.getAbsoluteFSPath(); // $ExpectType string +SwaggerUIDist.absolutePath(); // $ExpectType string diff --git a/types/swagger-ui-dist/tsconfig.json b/types/swagger-ui-dist/tsconfig.json new file mode 100644 index 0000000000..cd74f32ec0 --- /dev/null +++ b/types/swagger-ui-dist/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", + "swagger-ui-dist-tests.ts" + ] +} diff --git a/types/swagger-ui-dist/tslint.json b/types/swagger-ui-dist/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/swagger-ui-dist/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/tapable/index.d.ts b/types/tapable/index.d.ts index 7fd0e6f08d..d2cae7e6dc 100644 --- a/types/tapable/index.d.ts +++ b/types/tapable/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for tapable v1.0.0 // Project: https://github.com/webpack/tapable.git // Definitions by: e-cloud +// John Reilly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -244,39 +245,39 @@ export interface Tap { context: boolean; } -export class Hook { - constructor(...args: any[]); +export class Hook { + constructor(tapArgumentNames?: string[]); taps: any[]; - interceptors: any[]; - call: (arg1?: T1, arg2?: T2, arg3?: T3, ...args: any[]) => any; - promise:(arg1?: T1, arg2?: T2, arg3?: T3, ...args: any[]) => Promise; - callAsync: (arg1?: T1, arg2?: T2, arg3?: T3, ...args: any[]) => any; + interceptors: HookInterceptor[]; + + call: (arg1?: TArg1, arg2?: TArg2, arg3?: TArg3, ...args: any[]) => THookResult; + promise:(arg1?: TArg1, arg2?: TArg2, arg3?: TArg3, ...args: any[]) => Promise; + callAsync: (arg1?: TArg1, arg2?: TArg2, arg3?: TArg3, ...args: any[]) => THookResult; compile(options: HookCompileOptions) : Function; - tap: (name: string | Tap, fn: (arg1: T1, arg2: T2, arg3: T3, ...args: any[]) => any) => void; - tapAsync: (name: string | Tap, fn: (arg1: T1, arg2: T2, arg3: T3, ...args: any[]) => void) => void; - tapPromise: (name: string | Tap, fn: (arg1: T1, arg2: T2, arg3: T3, ...args: any[]) => Promise) => void; + tap: (name: string | Tap, fn: (arg1: TArg1, arg2: TArg2, arg3: TArg3, ...args: any[]) => TTabResult) => void; + tapAsync: (name: string | Tap, fn: (arg1: TArg1, arg2: TArg2, arg3: TArg3, ...args: any[]) => void) => void; + tapPromise: (name: string | Tap, fn: (arg1: TArg1, arg2: TArg2, arg3: TArg3, ...args: any[]) => Promise) => void; intercept: (interceptor: HookInterceptor) => void; } -export class SyncHook extends Hook {} -export class SyncBailHook extends Hook {} -export class SyncLoopHook extends Hook {} -export class SyncWaterfallHook extends Hook {} +export class SyncHook extends Hook {} +export class SyncBailHook extends Hook {} +export class SyncLoopHook extends Hook {} +export class SyncWaterfallHook extends Hook {} -export class AsyncParallelHook extends Hook {} -export class AsyncParallelBailHook extends Hook {} -export class AsyncSeriesHook extends Hook {} -export class AsyncSeriesBailHook extends Hook {} -export class AsyncSeriesWaterfallHook extends Hook {} +export class AsyncParallelHook extends Hook {} +export class AsyncParallelBailHook extends Hook {} +export class AsyncSeriesHook extends Hook {} +export class AsyncSeriesBailHook extends Hook {} +export class AsyncSeriesWaterfallHook extends Hook {} export class HookInterceptor { - call: (...args: any[]) => void; - loop: (...args: any[]) => void; - tap: (tap: Tap) => void; - register: (tap: Tap) => Tap | undefined; - context: boolean; - name: string; + call?: (...args: any[]) => void; + loop?: (...args: any[]) => void; + tap?: (tap: Tap) => void; + register?: (tap: Tap) => Tap | undefined; + context?: boolean; } /** A HookMap is a helper class for a Map with Hooks */ diff --git a/types/tapable/tapable-tests.ts b/types/tapable/tapable-tests.ts index c78196c194..b1cbcf1e21 100644 --- a/types/tapable/tapable-tests.ts +++ b/types/tapable/tapable-tests.ts @@ -1,4 +1,16 @@ -import {Tapable, MultiHook, SyncHook} from "tapable"; +import { + Tapable, + MultiHook, + SyncHook, + SyncBailHook, + SyncWaterfallHook, + SyncLoopHook, + AsyncParallelHook, + AsyncParallelBailHook, + AsyncSeriesHook, + AsyncSeriesBailHook, + AsyncSeriesWaterfallHook +} from "tapable"; class DllPlugin { apply(compiler: Compiler) { @@ -45,3 +57,121 @@ compiler.applyPluginsParallelBailResult('doSomething', 'a', 'b'); compiler.applyPluginsParallelBailResult1('doSomething', 'a', callback); const multi = new MultiHook([new SyncHook(['hi'])]); + +const isNumber = (val: number) => val; +const isAny = (val: {a: { n: {y: '!'}}}) => val; +const isUndefined = (val: undefined) => val; + +// Without generics +(() => { + const hooks = { + syncHook: new SyncHook(['arg1']), + syncBailHook: new SyncBailHook(['arg1']), + syncWaterfallHook: new SyncWaterfallHook(['arg1']), + syncLoopHook: new SyncLoopHook(['arg1']), + asyncParallelHook: new AsyncParallelHook(['arg1']), + asyncParallelBailHook: new AsyncParallelBailHook(['arg1']), + asyncSeriesHook: new AsyncSeriesHook(['arg1']), + asyncSeriesBailHook: new AsyncSeriesBailHook(['arg1']), + asyncSeriesWaterfallHook: new AsyncSeriesWaterfallHook(['arg1']), + } + + // Without generics we won't get any information + // for the tap interface: + hooks.syncHook.tap('AHook', () => ('ReturnValue')); + hooks.syncBailHook.tap('AHook', () => ('ReturnValue')); + hooks.syncWaterfallHook.tap('AHook', () => ('ReturnValue')); + hooks.asyncParallelHook.tapPromise('AHook', async () => ('ReturnValue')); + hooks.asyncParallelBailHook.tapPromise('AHook', async () => ('ReturnValue')); + hooks.asyncSeriesHook.tapPromise('AHook', async () => ('ReturnValue')); + hooks.asyncSeriesBailHook.tapPromise('AHook', async () => ('ReturnValue')); + hooks.asyncSeriesWaterfallHook.tapPromise('AHook', async () => ('ReturnValue')); + + async function getHookResults() { + return { + syncHook: hooks.syncHook.call({ name: 'sue', age: 34 }), + syncBailHook: hooks.syncBailHook.call({ name: 'sue', age: 34 }), + syncWaterfallHook: hooks.syncWaterfallHook.call({ name: 'sue', age: 34 }), + syncLoopHook: hooks.syncLoopHook.call({ name: 'sue', age: 34 }), + asyncParallelHook: await hooks.asyncParallelHook.promise({ name: 'sue', age: 34 }), + asyncParallelBailHook: await hooks.asyncParallelBailHook.promise({ name: 'sue', age: 34 }), + asyncSeriesHook: await hooks.asyncSeriesHook.promise({ name: 'sue', age: 34 }), + asyncSeriesBailHook: await hooks.asyncSeriesBailHook.promise({ name: 'sue', age: 34 }), + asyncSeriesWaterfallHook: await hooks.asyncSeriesWaterfallHook.promise({ name: 'sue', age: 34 }), + } + } + + getHookResults().then((result) => { + // Allways undefined: + console.log(isUndefined(result.syncHook)); + console.log(isUndefined(result.asyncSeriesHook)); + console.log(isUndefined(result.asyncParallelHook)); + // Possible undefined: + console.log(isAny(result.syncBailHook!)); + console.log(isAny(result.asyncParallelHook!)); + console.log(isAny(result.syncBailHook!)); + console.log(isAny(result.asyncParallelHook!)); + console.log(isAny(result.asyncSeriesHook!)); + console.log(isAny(result.asyncSeriesBailHook!)); + // Allways defined: + console.log(isNumber(result.syncWaterfallHook.age)); + console.log(isNumber(result.asyncSeriesWaterfallHook.age)); + }); +})(); + +// With generics +(() => { + type Person = {name: string, age: number}; + const hooks = { + syncHook: new SyncHook(['arg1']), + syncBailHook: new SyncBailHook(['arg1']), + syncWaterfallHook: new SyncWaterfallHook(['arg1']), + syncLoopHook: new SyncLoopHook(['arg1']), + asyncParallelHook: new AsyncParallelHook(['arg1']), + asyncParallelBailHook: new AsyncParallelBailHook(['arg1']), + asyncSeriesHook: new AsyncSeriesHook(['arg1']), + asyncSeriesBailHook: new AsyncSeriesBailHook(['arg1']), + asyncSeriesWaterfallHook: new AsyncSeriesWaterfallHook(['arg1']), + } + + // Without generics we will get information + hooks.syncHook.tap('AHook', () => ('Any Return Value')); + hooks.syncBailHook.tap('AHook', (person) => person.age); + hooks.syncWaterfallHook.tap('AHook', (person) => ({ name: 'sue', age: person.age + 1 })); + hooks.asyncParallelHook.tapPromise('AHook', async () => ('ReturnValue')); + hooks.asyncParallelBailHook.tapPromise('AHook', async (person) => person.age); + hooks.asyncSeriesHook.tapPromise('AHook', async () => ('ReturnValue')); + hooks.asyncSeriesBailHook.tapPromise('AHook', async (person) => person.age); + hooks.asyncSeriesWaterfallHook.tapPromise('AHook', async (person) => ({ name: 'sue', age: person.age + 1 })); + + async function getHookResults() { + return { + syncHook: hooks.syncHook.call({ name: 'sue', age: 34 }), + syncBailHook: hooks.syncBailHook.call({ name: 'sue', age: 34 }), + syncWaterfallHook: hooks.syncWaterfallHook.call({ name: 'sue', age: 34 }), + syncLoopHook: hooks.syncLoopHook.call({ name: 'sue', age: 34 }), + asyncParallelHook: await hooks.asyncParallelHook.promise({ name: 'sue', age: 34 }), + asyncParallelBailHook: await hooks.asyncParallelBailHook.promise({ name: 'sue', age: 34 }), + asyncSeriesHook: await hooks.asyncSeriesHook.promise({ name: 'sue', age: 34 }), + asyncSeriesBailHook: await hooks.asyncSeriesBailHook.promise({ name: 'sue', age: 34 }), + asyncSeriesWaterfallHook: await hooks.asyncSeriesWaterfallHook.promise({ name: 'sue', age: 34 }), + } + } + + getHookResults().then((result) => { + // Allways undefined: + console.log(isUndefined(result.syncHook)); + console.log(isUndefined(result.asyncSeriesHook)); + console.log(isUndefined(result.asyncParallelHook)); + // Possible undefined: + console.log(isNumber(result.syncBailHook!)); + console.log(isNumber(result.asyncParallelHook!)); + console.log(isNumber(result.syncBailHook!)); + console.log(isNumber(result.asyncParallelHook!)); + console.log(isNumber(result.asyncSeriesHook!)); + console.log(isNumber(result.asyncSeriesBailHook!)); + // Allways defined: + console.log(isNumber(result.syncWaterfallHook.age)); + console.log(isNumber(result.asyncSeriesWaterfallHook.age)); + }); +})(); diff --git a/types/tedious/index.d.ts b/types/tedious/index.d.ts index 287e62d187..df6b726d40 100644 --- a/types/tedious/index.d.ts +++ b/types/tedious/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for tedious 1.8.0 -// Project: https://pekim.github.io/tedious +// Type definitions for tedious 2.6.2 +// Project: http://tediousjs.github.io/tedious/ // Definitions by: Rogier Schouten -// Chris Thompson +// Chris Thompson +// Suraiya Hameed // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -95,31 +96,21 @@ export interface TediousTypes { BigInt: TediousType; Binary: TediousType; Bit: TediousType; - BitN: TediousType; Char: TediousType; Date: TediousType; - DateN: TediousType; DateTime2: TediousType; - DateTime2N: TediousType; DateTime: TediousType; - DateTimeN: TediousType; DateTimeOffset: TediousType; - DateTimeOffsetN: TediousType; Decimal: TediousType; - DecimalN: TediousType; Float: TediousType; - FloatN: TediousType; Image: TediousType; Int: TediousType; - IntN: TediousType; Money: TediousType; - MoneyN: TediousType; NChar: TediousType; NText: TediousType; NVarChar: TediousType; Null: TediousType; Numeric: TediousType; - NumericN: TediousType; Real: TediousType; SmallDateTime: TediousType; SmallInt : TediousType; @@ -127,11 +118,9 @@ export interface TediousTypes { TVP: TediousType; Text: TediousType; Time: TediousType; - TimeN: TediousType; TinyInt: TediousType; UDT: TediousType; UniqueIdentifier: TediousType; - UniqueIdentifierN: TediousType; VarBinary: TediousType; VarChar: TediousType; Xml: TediousType; @@ -158,7 +147,7 @@ export interface ConnectionOptions { database?: string; /** - * By default, if the database requestion by options.database cannot be accessed, + * By default, if the database requested by options.database cannot be accessed, * the connection will fail with an error. However, if options.fallbackToDefaultDb is set to true, * then the user's default database will be * used instead (Default: false). */ @@ -197,7 +186,7 @@ export interface ConnectionOptions { abortTransactionOnError?: boolean; /** - * A string indicating which network interface (ip addres) to use when connecting to SQL Server. + * A string indicating which network interface (ip address) to use when connecting to SQL Server. */ localAddress?: string; @@ -226,7 +215,7 @@ export interface ConnectionOptions { debug?: DebugOptions; /** - * The default isolation level that transactions will be run with. (default: READ_COMMITED). + * The default isolation level that transactions will be run with. (default: READ_COMMITTED). */ isolationLevel?: ISOLATION_LEVEL; @@ -267,6 +256,96 @@ export interface ConnectionOptions { * Take this from tedious.TDS_VERSION.7_4 . */ tdsVersion?: number; + + /** + * Application name used for identifying a specific application in profiling, logging or tracing tools of SQL Server. (default: Tedious) + */ + appName?: string; + + /** + * Number of milliseconds before retrying to establish connection, in case of transient failure. (default: 500) + */ + connectionRetryInterval?: number; + + /** + * Number that sets to the first day of the week, it can be a number from 1 through 7.(default: 7, i.e, first day of the week is Sunday) + */ + datefirst?: number; + + /** + * A string representing position of month, day and year in temporal datatypes. (default: mdy) + */ + dateFormat?: string; + + /** + * A boolean, controls the way null values should be used during comparison operation. (default: true) + */ + enableAnsiNull?: boolean; + + /** + * If true, SET ANSI_NULL_DFLT_ON ON will be set in the initial sql. This means new columns will be nullable by default. See the T-SQL documentation for more details. (Default: true). + */ + enableAnsiNullDefault?: boolean; + + /** + * A boolean, controls if padding should be applied for values shorter than the size of defined column. (default: true) + */ + enableAnsiPadding?: boolean; + + /** + * If true, SQL Server will follow ISO standard behavior during various error conditions. For details, see documentation. (default: true) + */ + enableAnsiWarnings?: boolean; + + /** + * A boolean, determines if query execution should be terminated during overflow or divide-by-zero error. (default: false) + */ + enableArithAbort?: boolean; + + /** + * A boolean, determines if concatenation with NULL should result in NULL or empty string value, more details in documentation. (default: true) + */ + enableConcatNullYieldsNull?: boolean; + + /** + * A boolean, controls whether cursor should be closed, if the transaction opening it gets committed or rolled back. (default: false) + */ + enableCursorCloseOnCommit?: boolean; + + /** + * A boolean, sets the connection to either implicit or autocommit transaction mode. (default: false) + */ + enableImplicitTransactions?: boolean; + + /** + * If false, error is not generated during loss of precession. (default: false) + */ + enableNumericRoundabort?: boolean; + + /** + * If true, characters enclosed in single quotes are treated as literals and those enclosed double quotes are treated as identifiers. (default: true) + */ + enableQuotedIdentifier?: boolean; + + /** + * A string, sets the language of the session (default: us_english) + */ + language?: string; + + /** + * Number of retries on transient error (default: 3) + */ + maxRetriesOnTransientErrors?: number; + + /** + * Size of data to be returned by SELECT statement for varchar(max), nvarchar(max), varbinary(max), text, ntext, and image type. (default: 2147483647) + */ + textsize?: number; + + /** + * A boolean, that verifies whether server's identity matches it's certificate's names (default: true) + */ + trustServerCertificate?: boolean; } export interface ConnectionConfig { @@ -313,16 +392,66 @@ export interface ColumnValue { value: any; } +export interface Request { + /** + * This event, describing result set columns, will be emitted before row events are emitted. This event may be emited multiple times when more than one recordset is produced by the statement. + */ + on(event: 'columnMetadata', listener: (columns: ColumnMetaData[]) => void ):this; + + /** + * The request has been prepared and can be used in subsequent calls to execute and unprepare. + */ + on(event: 'prepared', listener: () => void):this; + + /** + * The request encountered an error and has not been prepared. + */ + on(event: 'error', listener: (err: Error) => void):this; + + /** + * This is the final event emitted by a request. This is emitted after the callback passed in a request is called. + */ + on(event: 'requestCompleted', listener: () => void):this; + + /** + * A row resulting from execution of the SQL statement + */ + on(event: 'row', listener: (columns: ColumnValue[]) => void):this; + + /** + * All rows from a result set have been provided (through row events). This token is used to indicate the completion of a SQL statement. As multiple SQL statements can be sent to the server in a single SQL batch, multiple done events can be generated. An done event is emited for each SQL statement in the SQL batch except variable declarations. For execution of SQL statements within stored procedures, doneProc and doneInProc events are used in place of done events. + */ + on(event: 'done', listener: (error: Error, more: boolean, rows: any[]) => void):this; + + /** + * Indicates the completion status of a SQL statement within a stored procedure. All rows from a statement in a stored procedure have been provided (through row events). + */ + on(event: 'doneInProc', listener: (error: Error, more: boolean, returnStatus: any, rows: any[]) => void):this; + + /** + * Indicates the completion status of a stored procedure. This is also generated for stored procedures executed through SQL statements. + */ + on(event: 'doneProc', listener: (error: Error, more: boolean, rows: any[]) => void):this; + + /** + * A value for an output parameter (that was added to the request with addOutputParameter(...)). See also Using Parameters. + */ + on(event: 'returnValue', listener: (parameterName: string, value: any, metadata: ColumnMetaData ) => void):this; +} + /** * A Request instance represents a request that can be executed on a connection * @event 'columnMetadata' This event, describing result set columns, will be emitted before row events are emitted. This event may be emited multiple times when more than one recordset is produced by the statement. + * @event 'prepared' The request has been prepared and can be used in subsequent calls to execute and unprepare. + * @event 'error' The request encountered an error and has not been prepared. + * @event 'requestCompleted' This is the final event emitted by a request. This is emitted after the callback passed in a request is called. * @event 'row' A row resulting from execution of the SQL statement * @event 'done' All rows from a result set have been provided (through row events). This token is used to indicate the completion of a SQL statement. As multiple SQL statements can be sent to the server in a single SQL batch, multiple done events can be generated. An done event is emited for each SQL statement in the SQL batch except variable declarations. For execution of SQL statements within stored procedures, doneProc and doneInProc events are used in place of done events. * @event 'doneInProc' Indicates the completion status of a SQL statement within a stored procedure. All rows from a statement in a stored procedure have been provided (through row events). * @event 'doneProc' Indicates the completion status of a stored procedure. This is also generated for stored procedures executed through SQL statements. * @event 'returnValue' A value for an output parameter (that was added to the request with addOutputParameter(...)). See also Using Parameters. */ -export declare class Request extends events.EventEmitter { +export class Request extends events.EventEmitter { /** * Constructor @@ -351,10 +480,20 @@ export declare class Request extends events.EventEmitter { * @param options Additional type options. Optional. */ addOutputParameter(name: string, type: TediousType, value?: any, options?: ParameterOptions): void; + + /** + * Temporarily suspends the flow of data from the database. No more 'row' events will be emitted until request.resume() is called. + */ + pause():void; + + /** + * Resumes the flow of data from the database. + */ + resume():void; } export interface BulkLoadColumnOpts extends ParameterOptions { - // indicates whether the column accepts NULL values. + // Indicates whether the column accepts NULL values. nullable: boolean; // If the name of the column is different from the name of the property found on rowObj arguments passed to , then you can use this option to specify the property name. objName?: string; @@ -422,6 +561,53 @@ export interface InfoObject { lineNumber: number; } +export interface Connection { + /** + * The attempt to connect and validate has completed. + */ + on(event: 'connect', listener: (err: Error) => void ):this; + + /** + * The connection has ended. This may be as a result of the client calling close(), the server closing the connection, or a network error. + */ + on(event: 'end', listener: () => void ):this; + + /** + * Internal error occurs. + */ + on(event: 'error', listener: (err: Error) => void ):this; + + /** + * A debug message is available. It may be logged or ignored. + */ + on(event: 'debug', listener: (messageText: string) => void ):this; + + /** + * The server has issued an information message. + */ + on(event: 'infoMessage', listener: (info: InfoObject) => void ):this; + + /** + * The server has issued an error message. + */ + on(event: 'errorMessage', listener: (err: Error) => void ):this; + + /** + * The server has reported that the active database has changed. This may be as a result of a successful login, or a use statement. + */ + on(event: 'databaseChange', listener: (databaseName: string) => void ):this; + + /** + * The server has reported that the language has changed. + */ + on(event: 'languageChange', listener: (languageName: string) => void ):this; + + /** + * The server has reported that the charset has changed. + */ + on(event: 'charsetChange', listener: (charset: string) => void ):this; +} + /** * Connection * @event 'connect' The attempt to connect and validate has completed. @@ -435,7 +621,7 @@ export interface InfoObject { * @event 'charsetChange' The server has reported that the charset has changed. * @event 'secure' A secure connection has been established. */ -export declare class Connection extends events.EventEmitter { +export class Connection extends events.EventEmitter { constructor(config: ConnectionConfig); diff --git a/types/test-listen/index.d.ts b/types/test-listen/index.d.ts new file mode 100644 index 0000000000..741ffa0695 --- /dev/null +++ b/types/test-listen/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for test-listen 1.1 +// Project: https://github.com/zeit/test-listen +// Definitions by: Stephen Mathieson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +import { Server } from "net"; + +declare function testListen(srv: Server, hostname?: string): Promise; + +export = testListen; diff --git a/types/test-listen/test-listen-tests.ts b/types/test-listen/test-listen-tests.ts new file mode 100644 index 0000000000..c5bc189ee8 --- /dev/null +++ b/types/test-listen/test-listen-tests.ts @@ -0,0 +1,25 @@ +import * as http from 'http'; +import testListen = require('test-listen'); + +const test = async (): Promise => { + const server = http.createServer((req: http.IncomingMessage, res: http.ServerResponse): void => { + res.write('hello'); + res.end(); + }); + + const addr = await testListen(server); + console.log(addr); +}; + +const testWithHostname = async (): Promise => { + const server = http.createServer((req: http.IncomingMessage, res: http.ServerResponse): void => { + res.write('hello'); + res.end(); + }); + + const addr = await testListen(server, '127.0.0.1'); + console.log(addr); +}; + +test(); +testWithHostname(); diff --git a/types/test-listen/tsconfig.json b/types/test-listen/tsconfig.json new file mode 100644 index 0000000000..2a2d45987e --- /dev/null +++ b/types/test-listen/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", + "test-listen-tests.ts" + ] +} diff --git a/types/test-listen/tslint.json b/types/test-listen/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/test-listen/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/tether/index.d.ts b/types/tether/index.d.ts index 20de5d7bf0..69cc2b0ef9 100644 --- a/types/tether/index.d.ts +++ b/types/tether/index.d.ts @@ -24,7 +24,7 @@ declare namespace Tether { interface ITetherOptions { attachment: string; bodyElement?: HTMLElement; - classes?: {[className: string]: boolean}; + classes?: {[className: string]: boolean | string}; classPrefix?: string; constraints?: ITetherConstraint[]; element?: HTMLElement | string | any /* JQuery */; diff --git a/types/tether/tether-tests.ts b/types/tether/tether-tests.ts index 5f78bb3b99..0675ed9594 100644 --- a/types/tether/tether-tests.ts +++ b/types/tether/tether-tests.ts @@ -9,7 +9,11 @@ new Tether({ targetAttachment: "top middle", targetModifier: "visible", offset: "-15px 0", - targetOffset: "0 0" + targetOffset: "0 0", + classes: { + 'element': false, + 'target': 'someClassName' + } }); new Tether({ @@ -50,4 +54,3 @@ new Tether({ } ] }); - diff --git a/types/three/index.d.ts b/types/three/index.d.ts index 0e10f9caea..8a83de8cae 100644 --- a/types/three/index.d.ts +++ b/types/three/index.d.ts @@ -34,6 +34,7 @@ export * from "./three-examples"; export * from "./three-fbxloader"; export * from "./three-FirstPersonControls"; export * from "./three-gltfexporter"; +export * from "./three-lensflare"; export * from "./three-maskpass"; export * from "./three-mtlloader"; export * from "./three-objloader"; diff --git a/types/three/test/canvas/canvas_materials.ts b/types/three/test/canvas/canvas_materials.ts index 9af83aff5d..dd0ebbf601 100644 --- a/types/three/test/canvas/canvas_materials.ts +++ b/types/three/test/canvas/canvas_materials.ts @@ -45,7 +45,9 @@ var geometry2 = new THREE.SphereGeometry(100, 14, 7); - var materials: THREE.Material[] = [ + type MeshMaterial = THREE.MeshBasicMaterial | THREE.MeshFaceMaterial | THREE.MeshLambertMaterial | THREE.MeshDepthMaterial | THREE.MeshNormalMaterial; + + var materials: MeshMaterial[] = [ new THREE.MeshBasicMaterial({ color: 0x00ffff, wireframe: true, side: THREE.DoubleSide }), new THREE.MeshBasicMaterial({ color: 0xff0000, blending: THREE.AdditiveBlending }), @@ -199,4 +201,4 @@ } -} \ No newline at end of file +} diff --git a/types/three/test/webgl/webgl_lensflares.ts b/types/three/test/webgl/webgl_lensflares.ts index 1d42762571..e07329e539 100644 --- a/types/three/test/webgl/webgl_lensflares.ts +++ b/types/three/test/webgl/webgl_lensflares.ts @@ -99,18 +99,11 @@ var flareColor = new THREE.Color(0xffffff); flareColor.setHSL(h, s, l + 0.5); - var lensFlare = new THREE.LensFlare(textureFlare0, 700, 0.0, THREE.AdditiveBlending, flareColor); + var lensFlare = new THREE.LensFlare(); - lensFlare.add(textureFlare2, 512, 0.0, THREE.AdditiveBlending); - lensFlare.add(textureFlare2, 512, 0.0, THREE.AdditiveBlending); - lensFlare.add(textureFlare2, 512, 0.0, THREE.AdditiveBlending); + lensFlare.addElement(new THREE.LensFlareElement(textureFlare2, 512, 0.0)); + lensFlare.addElement(new THREE.LensFlareElement(textureFlare3, 512, 0.0)); - lensFlare.add(textureFlare3, 60, 0.6, THREE.AdditiveBlending); - lensFlare.add(textureFlare3, 70, 0.7, THREE.AdditiveBlending); - lensFlare.add(textureFlare3, 120, 0.9, THREE.AdditiveBlending); - lensFlare.add(textureFlare3, 70, 1.0, THREE.AdditiveBlending); - - lensFlare.customUpdateCallback = lensFlareUpdateCallback; lensFlare.position.copy(light.position); scene.add(lensFlare); @@ -143,32 +136,6 @@ // - function lensFlareUpdateCallback(object: THREE.LensFlare) { - - var f: number, fl = object.lensFlares.length; - var flare: THREE.LensFlareProperty; - var vecX = -object.positionScreen.x * 2; - var vecY = -object.positionScreen.y * 2; - - - for (f = 0; f < fl; f++) { - - flare = object.lensFlares[f]; - - flare.x = object.positionScreen.x + vecX * flare.distance; - flare.y = object.positionScreen.y + vecY * flare.distance; - - flare.rotation = 0; - - } - - object.lensFlares[2].y += 0.025; - object.lensFlares[3].rotation = object.positionScreen.x * 0.5 + THREE.Math.degToRad(45); - - } - - // - function onWindowResize(event: Event) { renderer.setSize(window.innerWidth, window.innerHeight); diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index 4188efcf71..1f8b742e72 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -451,13 +451,21 @@ export class Camera extends Object3D { */ projectionMatrix: Matrix4; + isCamera: true; + + copy(source: this, recursive?: boolean): this; + getWorldDirection(target: Vector3): Vector3; + updateMatrixWorld(force: boolean): void; + } export class CubeCamera extends Object3D { constructor(near?: number, far?: number, cubeResolution?: number); + type: "CubeCamera"; + renderTarget: WebGLRenderTargetCube; /** @@ -465,7 +473,7 @@ export class CubeCamera extends Object3D { */ updateCubeMap(renderer: Renderer, scene: Scene): void; - update(renderer: Renderer, scene: Scene): void; + update(renderer: WebGLRenderer, scene: Scene): void; } /** @@ -488,8 +496,12 @@ export class OrthographicCamera extends Camera { */ constructor(left: number, right: number, top: number, bottom: number, near?: number, far?: number); + type: "OrthographicCamera"; + + isOrthographicCamera: true; + zoom: number; - view: { + view: null | { enabled: boolean, fullWidth: number, fullHeight: number, @@ -556,6 +568,10 @@ export class PerspectiveCamera extends Camera { */ constructor(fov?: number, aspect?: number, near?: number, far?: number); + type: "PerspectiveCamera"; + + isPerspectiveCamera: true; + zoom: number; /** @@ -579,7 +595,7 @@ export class PerspectiveCamera extends Camera { far: number; focus: number; - view: { + view: null | { enabled: boolean, fullWidth: number, fullHeight: number, @@ -596,6 +612,7 @@ export class PerspectiveCamera extends Camera { getEffectiveFOV(): number; getFilmWidth(): number; getFilmHeight(): number; + /** * Sets an offset in a larger frustum. This is useful for multi-window or multi-monitor/multi-machine setups. * For example, if you have 3x2 monitors and each monitor is 1920x1080 and the monitors are in grid like this: @@ -651,6 +668,8 @@ export class PerspectiveCamera extends Camera { export class StereoCamera extends Camera { constructor(); + type: "StereoCamera"; + aspect: number; eyeSep: number; cameraL: PerspectiveCamera; @@ -1072,6 +1091,7 @@ export class DirectGeometry extends EventDispatcher { * @source src/core/EventDispatcher.js */ export class EventDispatcher { + /** * Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object. */ @@ -1554,7 +1574,7 @@ export class Object3D extends EventDispatcher { /** * Object's parent in the scene graph. */ - parent: Object3D; + parent: Object3D | null; /** * Array with object's children. @@ -1636,13 +1656,13 @@ export class Object3D extends EventDispatcher { /** * An object that can be used to store custom data about the Object3d. It should not hold references to functions as these will not be cloned. */ - userData: any; + userData: {[key: string]: any}; /** * Used to check whether this or derived classes are Object3Ds. Default is true. * You should not change this, as it is used internally for optimisation. */ - isObject3D: boolean; + isObject3D: true; /** * Calls before rendering object @@ -1656,9 +1676,7 @@ export class Object3D extends EventDispatcher { onAfterRender: (renderer: WebGLRenderer, scene: Scene, camera: Camera, geometry: Geometry | BufferGeometry, material: Material, group: Group) => void; - /** - * - */ + static DefaultUp: Vector3; static DefaultMatrixAutoUpdate: boolean; @@ -1667,6 +1685,8 @@ export class Object3D extends EventDispatcher { */ applyMatrix(matrix: Matrix4): void; + applyQuaternion(quaternion: Quaternion): this; + /** * */ @@ -1692,56 +1712,56 @@ export class Object3D extends EventDispatcher { * @param axis A normalized vector in object space. * @param angle The angle in radians. */ - rotateOnAxis(axis: Vector3, angle: number): Object3D; + rotateOnAxis(axis: Vector3, angle: number): this; /** * Rotate an object along an axis in world space. The axis is assumed to be normalized. Method Assumes no rotated parent. * @param axis A normalized vector in object space. * @param angle The angle in radians. */ - rotateOnWorldAxis(axis: Vector3, angle: number): Object3D; + rotateOnWorldAxis(axis: Vector3, angle: number): this; /** * * @param angle */ - rotateX(angle: number): Object3D; + rotateX(angle: number): this; /** * * @param angle */ - rotateY(angle: number): Object3D; + rotateY(angle: number): this; /** * * @param angle */ - rotateZ(angle: number): Object3D; + rotateZ(angle: number): this; /** * @param axis A normalized vector in object space. * @param distance The distance to translate. */ - translateOnAxis(axis: Vector3, distance: number): Object3D; + translateOnAxis(axis: Vector3, distance: number): this; /** * Translates object along x axis by distance. * @param distance Distance. */ - translateX(distance: number): Object3D; + translateX(distance: number): this; /** * Translates object along y axis by distance. * @param distance Distance. */ - translateY(distance: number): Object3D; + translateY(distance: number): this; /** * Translates object along z axis by distance. * @param distance Distance. */ - translateZ(distance: number): Object3D; + translateZ(distance: number): this; /** * Updates the vector from local space to world space. @@ -1759,39 +1779,38 @@ export class Object3D extends EventDispatcher { * Rotates object to face point in space. * @param vector A world vector to look at. */ - lookAt(vector: Vector3): void; - lookAt(x: number, y: number, z: number): void; + lookAt(vector: Vector3 | number, y?: number, z?: number): void; /** * Adds object as child of this object. */ - add(...object: Object3D[]): void; + add(...object: Object3D[]): this; /** * Removes object as child of this object. */ - remove(...object: Object3D[]): void; + remove(...object: Object3D[]): this; /** - * Searches through the object's children and returns the first with a matching id, optionally recursive. + * Searches through the object's children and returns the first with a matching id. * @param id Unique number of the object instance */ - getObjectById(id: number): Object3D; + getObjectById(id: number): Object3D | undefined; /** - * Searches through the object's children and returns the first with a matching name, optionally recursive. + * Searches through the object's children and returns the first with a matching name. * @param name String to match to the children's Object3d.name property. */ - getObjectByName(name: string): Object3D; + getObjectByName(name: string): Object3D | undefined; - getObjectByProperty( name: string, value: string ): Object3D; + getObjectByProperty( name: string, value: string ): Object3D | undefined; getWorldPosition(target: Vector3): Vector3; getWorldQuaternion(target: Quaternion): Quaternion; getWorldScale(target: Vector3): Vector3; getWorldDirection(target: Vector3): Vector3; - raycast(raycaster: Raycaster, intersects: any): void; + raycast(raycaster: Raycaster, intersects: Intersection[]): void; traverse(callback: (object: Object3D) => any): void; @@ -1823,11 +1842,11 @@ export class Object3D extends EventDispatcher { export interface Intersection { distance: number; - distanceToRay: number; + distanceToRay?: number; point: Vector3; - index: number; - face: Face3; - faceIndex: number; + index?: number; + face?: Face3 | null; + faceIndex?: number; object: Object3D; } @@ -5150,20 +5169,26 @@ export class QuaternionLinearInterpolant extends Interpolant { export class Bone extends Object3D { constructor(); + isBone: true; + type: "Bone"; } export class Group extends Object3D { constructor(); + type: "Group"; + isGroup: true; } export class LOD extends Object3D { constructor(); - levels: any[]; + type: "LOD"; + + levels: {distance: number, object: Object3D}[]; addLevel(object: Object3D, distance?: number): void; getObjectForDistance(distance: number): Object3D; - raycast(raycaster: Raycaster, intersects: any): void; + raycast(raycaster: Raycaster, intersects: Intersection[]): void; update(camera: Camera): void; toJSON(meta: any): any; @@ -5173,32 +5198,6 @@ export class LOD extends Object3D { objects: any[]; } -export interface LensFlareProperty { - texture: Texture; // Texture - size: number; // size in pixels (-1 = use texture.width) - distance: number; // distance (0-1) from light source (0=at light source) - x: number; - y: number; - z: number; // screen position (-1 => 1) z = 0 is ontop z = 1 is back - scale: number; // scale - rotation: number; // rotation - opacity: number; // opacity - color: Color; // color - blending: Blending; -} - -export class LensFlare extends Object3D { - constructor(texture?: Texture, size?: number, distance?: number, blending?: Blending, color?: Color); - - lensFlares: LensFlareProperty[]; - positionScreen: Vector3; - customUpdateCallback: (object: LensFlare) => void; - - add(object: Object3D): void; - add(texture: Texture, size?: number, distance?: number, blending?: Blending, color?: Color): void; - updateLensFlares(): void; -} - export class Line extends Object3D { constructor( geometry?: Geometry | BufferGeometry, @@ -5207,10 +5206,13 @@ export class Line extends Object3D { ); geometry: Geometry|BufferGeometry; - material: Material; // LineDashedMaterial or LineBasicMaterial or ShaderMaterial + material: LineBasicMaterial | LineDashedMaterial | ShaderMaterial; + + type: "Line"; + isLine: true; computeLineDistances(): this; - raycast(raycaster: Raycaster, intersects: any): void; + raycast(raycaster: Raycaster, intersects: Intersection[]): void; } /** @@ -5230,20 +5232,23 @@ export class LineSegments extends Line { ); } +type MeshMaterial = MeshBasicMaterial | MeshLambertMaterial | MeshPhongMaterial | MeshDepthMaterial | MeshStandardMaterial | MeshPhysicalMaterial | MeshNormalMaterial | MeshFaceMaterial | ShaderMaterial; + export class Mesh extends Object3D { - constructor(geometry?: Geometry | BufferGeometry, material?: Material | Material[]); + constructor(geometry?: Geometry | BufferGeometry, material?: MeshMaterial | MeshMaterial[]); geometry: Geometry|BufferGeometry; - material: Material | Material[]; + material: MeshMaterial | MeshMaterial[]; drawMode: TrianglesDrawModes; morphTargetInfluences?: number[]; morphTargetDictionary?: { [key: string]: number; }; - isMesh: boolean; + isMesh: true; + type: string; setDrawMode(drawMode: TrianglesDrawModes): void; updateMorphTargets(): void; - getMorphTargetIndexByName(name: string): number; - raycast(raycaster: Raycaster, intersects: any): void; + raycast(raycaster: Raycaster, intersects: Intersection[]): void; + copy(source: this, recursive?: boolean): this; } /** @@ -5259,9 +5264,12 @@ export class Points extends Object3D { */ constructor( geometry?: Geometry | BufferGeometry, - material?: Material + material?: PointsMaterial | ShaderMaterial ); + type: "Points"; + isPoints: true; + /** * An instance of Geometry or BufferGeometry, where each vertex designates the position of a particle in the system. */ @@ -5270,9 +5278,9 @@ export class Points extends Object3D { /** * An instance of Material, defining the object's appearance. Default is a PointsMaterial with randomised colour. */ - material: Material; + material: PointsMaterial | ShaderMaterial; - raycast(raycaster: Raycaster, intersects: any): void; + raycast(raycaster: Raycaster, intersects: Intersection[]): void; } /** @@ -5328,10 +5336,14 @@ export class SkinnedMesh extends Mesh { export class Sprite extends Object3D { constructor(material?: Material); - geometry: BufferGeometry; - material: SpriteMaterial; + type: "Sprite"; + isSprite: true; - raycast(raycaster: Raycaster, intersects: any): void; + material: SpriteMaterial; + center: Vector2; + + raycast(raycaster: Raycaster, intersects: Intersection[]): void; + copy(source: this, recursive?: boolean): this; } /** @@ -6364,13 +6376,6 @@ export class WebGLStencilBuffer { reset(): void; } -// Renderers / WebGL / Plugins ///////////////////////////////////////////////////////////////////// -export class LensFlarePlugin { - constructor(renderer: WebGLRenderer, flares: any[]); - - render(scene: Scene, camera: Camera, viewportWidth: number, viewportHeight: number): void; -} - export class SpritePlugin { constructor(renderer: WebGLRenderer, sprites: any[]); @@ -6385,6 +6390,8 @@ export class SpritePlugin { export class Scene extends Object3D { constructor(); + type: "Scene"; + /** * A fog instance defining the type of fog that affects everything rendered in the scene. Default is null. */ @@ -6395,8 +6402,9 @@ export class Scene extends Object3D { */ overrideMaterial: Material | null; autoUpdate: boolean; - background: any; + background: null | Color | Texture; + copy(source: this, recursive?: boolean): this; toJSON(meta?: any): any; } @@ -6645,38 +6653,42 @@ export namespace ShapeUtils { export class Audio extends Object3D { constructor(listener: AudioListener); + type: "Audio"; - type: string; context: AudioContext; - source: AudioBufferSourceNode; gain: GainNode; autoplay: boolean; + buffer: null | Audio; + loop: boolean; startTime: number; + offset: number; playbackRate: number; - hasPlaybackControl: boolean; isPlaying: boolean; + hasPlaybackControl: boolean; sourceType: string; + source: AudioBufferSourceNode; filters: any[]; getOutput(): GainNode; - setNodeSource(audioNode: AudioBufferSourceNode): Audio; - setBuffer(audioBuffer: AudioBuffer): Audio; - play(): Audio; - pause(): Audio; - stop(): Audio; - connect(): Audio; - disconnect(): Audio; - getFilters(): any[]; - setFilter(value: any[]): Audio; - getFilter(): any; - setFilter(filter: any): Audio; - setPlaybackRate(value: number): Audio; - getPlaybackRate(): number; + setNodeSource(audioNode: AudioBufferSourceNode): this; + setMediaElementSource(mediaElement: MediaElementAudioSourceNode): this; + setBuffer(audioBuffer: AudioBuffer): this; + play(): this; onEnded(): void; + pause(): this; + stop(): this; + connect(): this; + disconnect(): this; + getFilters(): any[]; + setFilter(value: any[]): this; + getFilter(): any; + setFilter(filter: any): this; + setPlaybackRate(value: number): this; + getPlaybackRate(): number; getLoop(): boolean; setLoop(value: boolean): void; getVolume(): number; - setVolume(value: number): Audio; + setVolume(value: number): this; /** * @deprecated Use {@link AudioLoader} instead. */ @@ -6729,9 +6741,10 @@ export class PositionalAudio extends Audio { export class AudioListener extends Object3D { constructor(); - type: string; + type: "AudioListener"; context: AudioContext; gain: GainNode; + filter: null | any; getInput(): GainNode; removeFilter(): void; @@ -6739,6 +6752,7 @@ export class AudioListener extends Object3D { getFilter(): any; setMasterVolume(value: number): void; getMasterVolume(): number; + updateMatrixWorld(force?: boolean): void; } // Extras / Core ///////////////////////////////////////////////////////////////////// @@ -7500,7 +7514,7 @@ export class ArrowHelper extends Object3D { setDirection(dir: Vector3): void; setLength(length: number, headLength?: number, headWidth?: number): void; - setColor(hex: number): void; + setColor(color: Color): void; } export class AxesHelper extends LineSegments { @@ -7535,11 +7549,14 @@ export class CameraHelper extends LineSegments { } export class DirectionalLightHelper extends Object3D { - constructor(light: Light, size?: number, color?: Color | string | number); + constructor(light: DirectionalLight, size?: number, color?: Color | string | number); - light: Light; + light: DirectionalLight; lightPlane: Line; - color: Color | string | number; + targetPlane: Line; + color: Color | string | number | undefined; + matrix: Matrix4; + matrixAutoUpdate: boolean; dispose(): void; update(): void; @@ -7570,22 +7587,26 @@ export class GridHelper extends LineSegments { } export class HemisphereLightHelper extends Object3D { - constructor(light: Light, sphereSize: number); + constructor(light: HemisphereLight, size: number, color?: Color | number | string); - light: Light; - colors: Color[]; - lightSphere: Mesh; + light: HemisphereLight; + matrix: Matrix4; + matrixAutoUpdate: boolean; + material: MeshBasicMaterial; + + color: Color | string | number | undefined; dispose(): void; update(): void; } export class PointLightHelper extends Object3D { - constructor(light: Light, sphereSize?: number, color?: Color | string | number); + constructor(light: PointLight, sphereSize?: number, color?: Color | string | number); - light: Light; - sphereSize: number; - color: Color | string | number; + light: PointLight; + color: Color | string | number | undefined; + matrix: Matrix4; + matrixAutoUpdate: boolean; dispose(): void; update(): void; @@ -7605,7 +7626,9 @@ export class SpotLightHelper extends Object3D { constructor(light: Light, color?: Color | string | number); light: Light; - color: Color | string | number; + matrix: Matrix4; + matrixAutoUpdate: boolean; + color: Color | string | number | undefined; dispose(): void; update(): void; diff --git a/types/three/three-lensflare.d.ts b/types/three/three-lensflare.d.ts new file mode 100644 index 0000000000..f9a0967099 --- /dev/null +++ b/types/three/three-lensflare.d.ts @@ -0,0 +1,27 @@ +import {Mesh, Camera, Scene, WebGLRenderer, Blending, Vector3, Color, Shader, Texture, BufferGeometry} from "./three-core"; + +export class LensFlare extends Mesh { + + constructor(); + + type: 'LensFlare'; + frustumCulled: false; + renderOrder: number; + + addElement(element: LensFlareElement): this; + onBeforeRender: (renderer: WebGLRenderer, scene: Scene, camera: Camera) => void; + dispose(): void; + + isLensflare: true; + +} + +export class LensFlareElement { + constructor(texture: Texture, size?: number, distance?: number, color?: Color); + texture: Texture; + size: number; + distance: number; + color: Color; + static Shader: Shader; + static Geometry: BufferGeometry +} diff --git a/types/throttle-debounce/index.d.ts b/types/throttle-debounce/index.d.ts index ded0507caf..34bfbbdb5b 100644 --- a/types/throttle-debounce/index.d.ts +++ b/types/throttle-debounce/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for throttle-debounce 1.0 +// Type definitions for throttle-debounce 1.1 // Project: https://github.com/niksy/throttle-debounce -// Definitions by: Marek Buchar +// Definitions by: Marek Buchar , Frank Li // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** @@ -30,7 +30,7 @@ * @return * A new, throttled, function. */ -export function throttle( +export function throttle any>( delay: number, noTrailing: boolean, callback: T, @@ -57,7 +57,7 @@ export function throttle( * @return * A new, throttled, function. */ -export function throttle( +export function throttle any>( delay: number, callback: T, debounceMode?: boolean, @@ -87,7 +87,7 @@ export function throttle( * @return * A new, debounced function. */ -export function debounce(delay: number, atBegin: boolean, callback: T): T; +export function debounce any>(delay: number, atBegin: boolean, callback: T): T; /** * Debounce execution of a function. Debouncing, unlike throttling, @@ -106,4 +106,4 @@ export function debounce(delay: number, atBegin: boolean, callback: T): T; * @return * A new, debounced function. */ -export function debounce(delay: number, callback: T): T; +export function debounce any>(delay: number, callback: T): T; diff --git a/types/tinajs__tina/index.d.ts b/types/tinajs__tina/index.d.ts new file mode 100644 index 0000000000..b29ad6bff9 --- /dev/null +++ b/types/tinajs__tina/index.d.ts @@ -0,0 +1,62 @@ +// Type definitions for @tinajs/tina 1.4 +// Project: https://github.com/tinajs/tina +// Definitions by: Jiayu Liu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/tinajs__tina +// TypeScript Version: 2.2 + +export function use(plugin: any): void; + +export interface ComponentProperties { + [key: string]: any; +} + +export interface ComponentLifecycles { + created: () => void; + attached: () => void; + ready: () => void; + moved: () => void; + detached: () => void; +} + +export interface ComponentDefinitions extends ComponentLifecycles { + properties: ComponentProperties; + data: { [key: string]: any }; + compute: (data: { [key: string]: any }) => { [key: string]: any }; + methods: { [name: string]: (this: Component) => any }; + mixins: Array>; +} + +export class Component { + static define(definitions: Partial): void; + static mixin(definitions: Partial): void; + setData(data: { [key: string]: any }): void; + data: { [key: string]: any }; +} + +export interface PageHooks { + beforeLoad: (this: Page) => void; + onLoad: (this: Page) => void; + onReady: (this: Page) => void; + onShow: (this: Page) => void; + onHide: (this: Page) => void; + onUnload: (this: Page) => void; +} + +export interface PageEvents { + onPullDownRefresh: (event: Page) => void; + onReachBottom: (event: Page) => void; + onShareAppMessage: (event: Page) => void; + onPageScroll: (event: Page) => void; +} + +export interface PageDefinitions + extends ComponentDefinitions, + PageEvents, + PageHooks { + mixins: Array>; +} + +export class Page extends Component { + static define(definitions: Partial): void; + static mixin(definitions: Partial): void; +} diff --git a/types/tinajs__tina/tinajs__tina-tests.ts b/types/tinajs__tina/tinajs__tina-tests.ts new file mode 100644 index 0000000000..3f3fad874f --- /dev/null +++ b/types/tinajs__tina/tinajs__tina-tests.ts @@ -0,0 +1,57 @@ +import { Page, Component } from "@tinajs/tina"; + +function sayHi() { + return "hi"; +} + +Page.mixin({ + onLoad: sayHi, + created: sayHi +}); + +Component.mixin({ + created: sayHi +}); + +Page.define({ + properties: { + content: String + } +}); + +Page.define({ + mixins: [ + { + methods: { + lol() { + return; + } + } + }, + { + methods: { + tiktok() { + return; + } + } + } + ], + data: { + count: 0 + }, + compute({ count }) { + return { countPlus1: count + 1 }; + }, + onLoad() { + this.data.count; + }, + methods: { + handleTapButton() { + this.data.count; + } + } +}); + +Component.define({ + data: {} +}); diff --git a/types/tinajs__tina/tsconfig.json b/types/tinajs__tina/tsconfig.json new file mode 100644 index 0000000000..8c2f008caa --- /dev/null +++ b/types/tinajs__tina/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "@tinajs/tina": ["tinajs__tina"] + } + }, + "files": ["index.d.ts", "tinajs__tina-tests.ts"] +} diff --git a/types/tinajs__tina/tslint.json b/types/tinajs__tina/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/tinajs__tina/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/triplesec/index.d.ts b/types/triplesec/index.d.ts new file mode 100644 index 0000000000..00208a8d0a --- /dev/null +++ b/types/triplesec/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for triplesec 3.0 +// Project: https://github.com/keybase/triplesec +// Definitions by: Ben Speakman +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export interface WordArray { + sigBytes: number; + words: number[]; + to_hex: () => string; +} + +export interface Arguments { + data: Buffer; + key: Buffer; + progress_hook?: (progress: Progress) => void; +} + +export interface Progress { + what: string; + i: number; + total: number; +} + +export function encrypt(arg: Arguments, cb: (err: Error | null, buff: Buffer | null) => void): void; +export function decrypt(arg: Arguments, cb: (err: Error | null, buff: Buffer | null) => void): void; + +export namespace prng { + function generate(n: number, cb: (words: WordArray) => void): void; +} diff --git a/types/triplesec/triplesec-tests.ts b/types/triplesec/triplesec-tests.ts new file mode 100644 index 0000000000..adba7a131d --- /dev/null +++ b/types/triplesec/triplesec-tests.ts @@ -0,0 +1,37 @@ +import * as triplesec from 'triplesec'; + +const progressHook = (progress: triplesec.Progress) => { + progress.what; // $ExpectType string + progress.i; // $ExpectType number + progress.total; // $ExpectType number +}; + +triplesec.encrypt({ + data: new Buffer('data'), + key: new Buffer('key'), + progress_hook: progressHook, +}, (err, buff) => { + if (err === null) { + buff; // $ExpectType Buffer | null + } else { + err; // $ExpectType Error + } +}); + +triplesec.decrypt({ + data: new Buffer('data'), + key: new Buffer('key'), + progress_hook: progressHook, +}, (err, buff) => { + if (err === null) { + buff; // $ExpectType Buffer | null + } else { + err; // $ExpectType Error + } +}); + +triplesec.prng.generate(24, words => { + words.sigBytes; // $ExpectType number + words.words; // $ExpectType number[] + words.to_hex(); // $ExpectType string +}); diff --git a/types/triplesec/tsconfig.json b/types/triplesec/tsconfig.json new file mode 100644 index 0000000000..cf233cc7e0 --- /dev/null +++ b/types/triplesec/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", + "triplesec-tests.ts" + ] +} diff --git a/types/triplesec/tslint.json b/types/triplesec/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/triplesec/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/twig/index.d.ts b/types/twig/index.d.ts index 29f0e0be56..d09e713e44 100644 --- a/types/twig/index.d.ts +++ b/types/twig/index.d.ts @@ -17,7 +17,7 @@ export interface Parameters { method?: any; options?: any; data?: any; - async?: any; + async?: any; } export interface Template { diff --git a/types/uglify-js/index.d.ts b/types/uglify-js/index.d.ts index 8778975020..7589ba8e86 100644 --- a/types/uglify-js/index.d.ts +++ b/types/uglify-js/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for UglifyJS 3.0 // Project: https://github.com/mishoo/UglifyJS2 -// Definitions by: Alan Agius , Tanguy Krotoff +// Definitions by: Alan Agius +// Tanguy Krotoff +// John Reilly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 diff --git a/types/umzug/index.d.ts b/types/umzug/index.d.ts index b60028c566..f74c5933be 100644 --- a/types/umzug/index.d.ts +++ b/types/umzug/index.d.ts @@ -4,7 +4,7 @@ // Margus Lamp // Troy McKinnon // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import { EventEmitter } from 'events'; import Sequelize = require("sequelize"); diff --git a/types/url-parse/index.d.ts b/types/url-parse/index.d.ts index ce8f3647c2..6aed768de9 100644 --- a/types/url-parse/index.d.ts +++ b/types/url-parse/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for url-parse 1.1 // Project: https://github.com/unshiftio/url-parse // Definitions by: Pavlo Chernenko +// Hari Sivaramakrishnan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -8,28 +9,30 @@ import URLSearchParams = require("url-search-params"); type UrlQueryParamsParser = (url: string) => string; -declare class URL { - readonly auth: string; - readonly hash: string; - readonly host: string; - readonly hostname: string; - readonly href: string; - readonly origin: string; - readonly password: string; - readonly pathname: string; - readonly port: string; - readonly protocol: string; - query: { [key: string]: string | undefined }; - readonly search: string; - set(property: string, value: string | object | number | undefined): URL; - readonly slashes: boolean; - readonly username: string; - readonly searchParams: URLSearchParams; - toString(): string; +declare namespace parse { + interface URL { + readonly auth: string; + readonly hash: string; + readonly host: string; + readonly hostname: string; + readonly href: string; + readonly origin: string; + readonly password: string; + readonly pathname: string; + readonly port: string; + readonly protocol: string; + query: { [key: string]: string | undefined }; + readonly search: string; + set(property: string, value: string | object | number | undefined): URL; + readonly slashes: boolean; + readonly username: string; + readonly searchParams: URLSearchParams; + toString(): string; + } } -type ParseFunctionNodeType = (url: string, parseQueryString?: boolean, slashesDenoteHost?: boolean) => URL; -type ParseFunctionType = (url: string, baseURL?: object | string, parser?: boolean | UrlQueryParamsParser) => URL; +type ParseFunctionNodeType = (url: string, parseQueryString?: boolean, slashesDenoteHost?: boolean) => parse.URL; +type ParseFunctionType = (url: string, baseURL?: object | string, parser?: boolean | UrlQueryParamsParser) => parse.URL; interface Protocol { slashes: boolean; diff --git a/types/url-parse/url-parse-tests.ts b/types/url-parse/url-parse-tests.ts index 48b2fa016d..61dc650ee1 100644 --- a/types/url-parse/url-parse-tests.ts +++ b/types/url-parse/url-parse-tests.ts @@ -1,10 +1,10 @@ import parse = require("url-parse"); const url1 = new URL("foo/bar", "https://github.com/"); -const url2 = parse("https://github.com/foo/bar?baz=true"); -const url3 = parse("https://github.com/foo/bar", true, true); -const url4 = parse("foo/bar", "https://github.com/"); -const url5 = parse("foo/bar", "https://github.com/", () => "queryParserOverride"); +const url2: parse.URL = parse("https://github.com/foo/bar?baz=true"); +const url3: parse.URL = parse("https://github.com/foo/bar", true, true); +const url4: parse.URL = parse("foo/bar", "https://github.com/"); +const url5: parse.URL = parse("foo/bar", "https://github.com/", () => "queryParserOverride"); url2.hash; url2.hostname; diff --git a/types/url-search-params/index.d.ts b/types/url-search-params/index.d.ts index 42cca9ca21..c58357a909 100644 --- a/types/url-search-params/index.d.ts +++ b/types/url-search-params/index.d.ts @@ -9,7 +9,7 @@ declare class URLSearchParams { append(name: string, value: any): void; delete(name: string): void; entries(): Iterator; - get(name: string): string; + get(name: string): string | null; getAll(name: string): string[]; has(name: string): boolean; keys(): Iterator; diff --git a/types/url-search-params/url-search-params-tests.ts b/types/url-search-params/url-search-params-tests.ts index 94664f5a5c..c468c692d0 100644 --- a/types/url-search-params/url-search-params-tests.ts +++ b/types/url-search-params/url-search-params-tests.ts @@ -11,6 +11,8 @@ params.entries(); params.get("b"); +params.get("d"); + params.getAll("b"); params.has("b"); diff --git a/types/usb/index.d.ts b/types/usb/index.d.ts index 7d3a5d8c89..6a4ea4d329 100644 --- a/types/usb/index.d.ts +++ b/types/usb/index.d.ts @@ -62,7 +62,7 @@ export class ConfigDescriptor { } export class Interface { - interface: number; + interfaceNumber: number; altSetting: number; descriptor: InterfaceDescriptor; endpoints: Endpoint[]; diff --git a/types/usb/usb-tests.ts b/types/usb/usb-tests.ts index 44701c655b..1fa6bf7cca 100644 --- a/types/usb/usb-tests.ts +++ b/types/usb/usb-tests.ts @@ -57,7 +57,7 @@ device.allConfigDescriptors = [configDesc]; const iface = new usb.Interface(device, 1); -iface.interface = 1; +iface.interfaceNumber = 1; iface.altSetting = 0; iface.claim(); iface.release((error: string) => null); diff --git a/types/vexdb/index.d.ts b/types/vexdb/index.d.ts new file mode 100644 index 0000000000..974b203fd8 --- /dev/null +++ b/types/vexdb/index.d.ts @@ -0,0 +1,595 @@ +// Type definitions for vexdb 1.7 +// Project: https://github.com/MayorMonty/vexdb#readme +// Definitions by: Brendan McGuire +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import { EventEmitter } from "events"; + +export type Endpoint = + | "events" + | "teams" + | "matches" + | "rankings" + | "season_rankings" + | "awards" + | "skills"; + +/** + * Parameter Objects + */ +export type StringRequest = + | string + | string[] + | RegExp + | StringRequestValidatorFunction; +export type StringRequestValidatorFunction = ( + itemValue: string, + item: ResponseObject +) => Promise | boolean; + +export type NumberRequest = number | number[] | NumberRequestValidatorFunction; +export type NumberRequestValidatorFunction = ( + itemValue: number, + item: ResponseObject +) => Promise | boolean; + +/** + * Request Objects + */ + +export type RequestObject = + | TeamsRequestObject + | EventsRequestObject + | MatchesRequestObject + | RankingsRequestObject + | SeasonRankingsRequestObject + | AwardsRequestObject + | SkillsRequestObject; + +export interface TeamsRequestObject { + team?: StringRequest; + number?: StringRequest; + team_name?: StringRequest; + robot_name?: StringRequest; + program?: StringRequest; + organisation?: StringRequest; + city?: StringRequest; + region?: StringRequest; + country?: StringRequest; + grade?: StringRequest; + is_registered?: NumberRequest; + sku?: StringRequest; + limit_number?: number; + limit_start?: number; +} + +export interface EventsRequestObject { + sku?: StringRequest; + program?: StringRequest; + date?: StringRequest; + season?: StringRequest; + city?: StringRequest; + region?: StringRequest; + country?: StringRequest; + status?: StringRequest; + limit_number?: number; + limit_start?: number; + + key?: StringRequest; + name?: StringRequest; + loc_venue?: StringRequest; + loc_address1?: StringRequest; + loc_address2?: StringRequest; + loc_city?: StringRequest; + loc_region?: StringRequest; + loc_postcode?: StringRequest; + loc_country?: StringRequest; + start?: StringRequest; + end?: StringRequest; +} + +export interface MatchesRequestObject { + sku?: StringRequest; + division?: StringRequest; + team?: StringRequest; + round?: NumberRequest; + instance?: NumberRequest; + matchnum?: NumberRequest; + scheduled?: NumberRequest; + field?: StringRequest; + scored?: NumberRequest; + season?: StringRequest; + limit_number?: number; + limit_start?: number; + + red1?: StringRequest; + red2?: StringRequest; + red3?: StringRequest; + redsit?: StringRequest; + blue1?: StringRequest; + blue2?: StringRequest; + blue3?: StringRequest; + bluesit?: StringRequest; + redscore?: NumberRequest; + bluescore?: NumberRequest; +} + +export interface RankingsRequestObject { + sku?: StringRequest; + division?: StringRequest; + team?: StringRequest; + rank?: StringRequest; + season?: StringRequest; + limit_number?: number; + limit_start?: number; + + wins?: NumberRequest; + losses?: NumberRequest; + ties?: NumberRequest; + wp?: NumberRequest; + ap?: NumberRequest; + sp?: NumberRequest; + trsp?: NumberRequest; + max_score?: NumberRequest; + opr?: NumberRequest; + dpr?: NumberRequest; + ccwm?: NumberRequest; +} + +export interface SeasonRankingsRequestObject { + program?: StringRequest; + season?: StringRequest; + team?: StringRequest; + vrating_rank?: NumberRequest; + limit_number?: number; + limit_start?: number; + + vrating?: NumberRequest; +} + +export interface AwardsRequestObject { + sku?: StringRequest; + name?: StringRequest; + team?: StringRequest; + season?: StringRequest; + limit_number?: number; + limit_start?: number; + + order?: NumberRequest; +} + +export interface SkillsRequestObject { + sku?: StringRequest; + program?: StringRequest; + type?: NumberRequest; + team?: StringRequest; + season?: StringRequest; + rank?: NumberRequest; + season_rank?: NumberRequest; + limit_number?: number; + limit_start?: number; + + attempts?: NumberRequest; + score?: NumberRequest; +} + +/** + * Response Objects + */ + +export type ResponseObject = + | TeamsResponseObject + | EventsResponseObject + | MatchesResponseObject + | RankingsResponseObject + | SeasonRankingsResponseObject + | AwardsResponseObject + | SkillsResponseObject; + +export interface TeamsResponseObject { + number: string; + program: string; + team_name: string; + robot_name: string; + organisation: string; + city: string; + region: string; + country: string; + grade: string; + is_registered: 0 | 1; +} + +export interface EventsResponseObject { + sku: string; + key: string; + program: string; + name: string; + loc_venue: string; + loc_address1: string; + loc_address2: string; + loc_city: string; + loc_region: string; + loc_postcode: string; + loc_country: string; + season: string; + start: string; + end: string; + divisions: string[]; +} + +export interface MatchesResponseObject { + sku: string; + division: string; + round: 1 | 2 | 3 | 4 | 5 | 6 | 16; + instance: number; + matchnum: number; + field: string; + red1: string; + red2: string; + red3: string; + redsit: string; + blue1: string; + blue2: string; + blue3: string; + bluesit: string; + redscore: number; + bluescore: number; + scored: 0 | 1; + scheduled: string; +} + +export interface RankingsResponseObject { + sku: string; + division: string; + rank: number; + team: string; + wins: number; + losses: number; + ties: number; + wp: number; + ap: number; + sp: number; + trsp: number; + max_score: number; + opr: number; + dpr: number; + ccwm: number; +} + +export interface SeasonRankingsResponseObject { + team: string; + season: string; + program: string; + vrating_rank: number; + vrating: number; +} + +export interface AwardsResponseObject { + sku: string; + name: string; + team: string; + qualifies: string[]; + order: number; +} + +export interface SkillsResponseObject { + sku: string; + type: number; + rank: number; + team: string; + program: string; + attempts: number; + score: number; +} + +/** + * GET + */ +export function get( + endpoint: "teams", + params: TeamsRequestObject +): Promise; + +export function get( + endpoint: "events", + params: EventsRequestObject +): Promise; + +export function get( + endpoint: "matches", + params: MatchesRequestObject +): Promise; + +export function get( + endpoint: "rankings", + params: RankingsRequestObject +): Promise; + +export function get( + endpoint: "season_rankings", + params: SeasonRankingsRequestObject +): Promise; + +export function get( + endpoint: "awards", + params: AwardsRequestObject +): Promise; + +export function get( + endpoint: "skills", + params: SkillsRequestObject +): Promise; + +/** + * SIZE + */ +export function size( + endpoint: "teams", + params: TeamsRequestObject +): Promise; + +export function size( + endpoint: "events", + params: EventsRequestObject +): Promise; + +export function size( + endpoint: "matches", + params: MatchesRequestObject +): Promise; + +export function size( + endpoint: "rankings", + params: RankingsRequestObject +): Promise; + +export function size( + endpoint: "season_rankings", + params: SeasonRankingsRequestObject +): Promise; + +export function size( + endpoint: "awards", + params: AwardsRequestObject +): Promise; + +export function size( + endpoint: "skills", + params: SkillsRequestObject +): Promise; + +/** + * LIVE + */ +export interface LiveEventEmitter extends EventEmitter { + close(): void; + params(updateParameters: Q): Q; + current(): R[]; + + // Update Events + on(event: "item", callback: (item: R) => void): this; + on(event: "fetch", callback: (newItems: R[]) => void): this; + on(event: "prefetch", callback: (results: R[]) => void): this; +} + +export type LiveRequestObject = T & { prefetch?: boolean }; + +export function live( + endpoint: "teams", + params: LiveRequestObject +): LiveEventEmitter; + +export function live( + endpoint: "events", + params: LiveRequestObject +): LiveEventEmitter; + +export function live( + endpoint: "matches", + params: LiveRequestObject +): LiveEventEmitter; + +export function live( + endpoint: "rankings", + params: LiveRequestObject +): LiveEventEmitter; + +export function live( + endpoint: "season_rankings", + params: LiveRequestObject +): LiveEventEmitter; + +export function live( + endpoint: "awards", + params: LiveRequestObject +): LiveEventEmitter; + +export function live( + endpoint: "skills", + params: LiveRequestObject +): LiveEventEmitter; + +export function live( + endpoint: Endpoint, + params: LiveRequestObject +): LiveEventEmitter; + +/** + * CACHE + */ +export interface CacheEntry { + expiry: number; + value: { + status: 0 | 1; + size: number; + result: T[]; + }; +} + +export function cache( + endpoint: "teams", + params: TeamsRequestObject, + value: TeamsResponseObject[] +): Promise>; + +export function cache( + endpoint: "events", + params: EventsRequestObject, + value: EventsResponseObject[] +): Promise>; + +export function cache( + endpoint: "matches", + params: MatchesRequestObject, + value: MatchesResponseObject[] +): Promise>; + +export function cache( + endpoint: "rankings", + params: RankingsRequestObject, + value: RankingsResponseObject[] +): Promise>; + +export function cache( + endpoint: "season_rankings", + params: SeasonRankingsRequestObject, + value: SeasonRankingsResponseObject[] +): Promise>; + +export function cache( + endpoint: "awards", + params: AwardsRequestObject, + value: AwardsResponseObject[] +): Promise>; + +export function cache( + endpoint: "skills", + params: SkillsRequestObject, + value: SkillsResponseObject[] +): Promise>; + +export function cache( + endpoint: Endpoint, + params: RequestObject, + value: ResponseObject[] +): Promise>; + +export namespace cache { + const ttl: number; + + function clear(): void; + + function has(endpoint: "teams", params: TeamsRequestObject): Promise; + + function has( + endpoint: "events", + params: EventsRequestObject + ): Promise; + + function has( + endpoint: "matches", + params: MatchesRequestObject + ): Promise; + + function has( + endpoint: "rankings", + params: RankingsRequestObject + ): Promise; + + function has( + endpoint: "season_rankings", + params: SeasonRankingsRequestObject + ): Promise; + + function has( + endpoint: "awards", + params: AwardsRequestObject + ): Promise; + + function has( + endpoint: "skills", + params: SkillsRequestObject + ): Promise; + + function resolve( + endpoint: "teams", + params: TeamsRequestObject + ): Promise>; + + function resolve( + endpoint: "events", + params: EventsRequestObject + ): Promise>; + + function resolve( + endpoint: "matches", + params: MatchesRequestObject + ): Promise>; + + function resolve( + endpoint: "rankings", + params: RankingsRequestObject + ): Promise>; + + function resolve( + endpoint: "season_rankings", + params: SeasonRankingsRequestObject + ): Promise>; + + function resolve( + endpoint: "awards", + params: AwardsRequestObject + ): Promise>; + + function resolve( + endpoint: "skills", + params: SkillsRequestObject + ): Promise>; + + function sanitize(endpoint: Endpoint, params: object): object; + + function serialize(url: any, params: object): object; + + function setTTL(ttl: number): object; +} + +/** + * CONSTANT + */ +export namespace constant { + const endpoints: string[]; + + const settings: { + baseURL: string; + cache: { + ttl: number; + }; + headers: {}; + live: { + pollTime: number; + }; + params: {}; + }; + + const uniques: { + events: string; + teams: string; + }; + + const validParams: { + awards: string[]; + events: string[]; + matches: string[]; + rankings: string[]; + season_rankings: string[]; + skills: string[]; + teams: string[]; + }; + + function header(headers: object): void; + + function isBrowser(): boolean; + + function param(params: RequestObject): void; +} diff --git a/types/vexdb/tsconfig.json b/types/vexdb/tsconfig.json new file mode 100644 index 0000000000..b71d12c433 --- /dev/null +++ b/types/vexdb/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", "vexdb-tests.ts"] +} diff --git a/types/vexdb/tslint.json b/types/vexdb/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/vexdb/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/vexdb/vexdb-tests.ts b/types/vexdb/vexdb-tests.ts new file mode 100644 index 0000000000..28e2dceb8e --- /dev/null +++ b/types/vexdb/vexdb-tests.ts @@ -0,0 +1,99 @@ +/** + * Requests + */ +import { + get, + live, + TeamsRequestObject, + AwardsRequestObject, + EventsRequestObject, + RankingsRequestObject, + SeasonRankingsRequestObject, + SkillsRequestObject, + MatchesRequestObject, + TeamsResponseObject, + AwardsResponseObject, + EventsResponseObject, + RankingsResponseObject, + SeasonRankingsResponseObject, + SkillsResponseObject, + MatchesResponseObject, + size +} from "vexdb"; + +get("teams", { number: "3796B" }); +get("awards", { order: 1 }); +get("events", { loc_venue: "J.L. Mann High School" }); +get("matches", { redscore: 23 }); +get("rankings", { wp: 23 }); +get("season_rankings", { vrating: 1 }); +get("skills", { attempts: 1 }); + +size("teams", { number: "3796B" }); +size("awards", { order: 1 }); +size("events", { loc_venue: "J.L. Mann High School" }); +size("matches", { redscore: 23 }); +size("rankings", { wp: 23 }); +size("season_rankings", { vrating: 1 }); +size("skills", { attempts: 1 }); + +const teams = live("teams", { number: "3796B" }); +const teams_params: TeamsRequestObject = {}; +const teams_current: TeamsResponseObject[] = teams.current(); +teams.params(teams_params); +teams.on("fetch", (item: TeamsResponseObject[]) => {}); +teams.on("prefetch", (results: TeamsResponseObject[]) => {}); +teams.on("item", (item: TeamsResponseObject) => {}); +teams.close(); + +const awards = live("awards", { order: 1 }); +const awards_params: AwardsRequestObject = {}; +const awards_current: AwardsResponseObject[] = awards.current(); +awards.params(awards_params); +awards.on("fetch", (item: AwardsResponseObject[]) => {}); +awards.on("prefetch", (results: AwardsResponseObject[]) => {}); +awards.on("item", (item: AwardsResponseObject) => {}); +awards.close(); + +const events = live("events", { loc_venue: "J.L. Mann High School" }); +const events_params: EventsRequestObject = {}; +const events_current: EventsResponseObject[] = events.current(); +events.params(events_params); +events.on("fetch", (item: EventsResponseObject[]) => {}); +events.close(); + +const matches = live("matches", { team: "3796B" }); +const matches_params: MatchesRequestObject = {}; +const matches_current: MatchesResponseObject[] = matches.current(); +matches.params(matches_params); +matches.on("fetch", (item: MatchesResponseObject[]) => {}); +matches.on("prefetch", (results: MatchesResponseObject[]) => {}); +matches.on("item", (item: MatchesResponseObject) => {}); +matches.close(); + +const skills = live("skills", { rank: 23 }); +const skills_params: SkillsRequestObject = {}; +const skills_current: SkillsResponseObject[] = skills.current(); +skills.params(skills_params); +skills.on("fetch", (item: SkillsResponseObject[]) => {}); +skills.on("prefetch", (results: SkillsResponseObject[]) => {}); +skills.on("item", (item: SkillsResponseObject) => {}); +skills.close(); + +const rankings = live("rankings", { team: "3796N" }); +const rankings_params: RankingsRequestObject = {}; +const rankings_current: RankingsResponseObject[] = rankings.current(); +rankings.params(rankings_params); +rankings.on("fetch", (item: RankingsResponseObject[]) => {}); +rankings.on("prefetch", (results: RankingsResponseObject[]) => {}); +rankings.on("item", (item: RankingsResponseObject) => {}); +rankings.close(); + +const season_rankings = live("season_rankings", { team: "3796N" }); +const season_rankings_params: SeasonRankingsRequestObject = {}; +const season_rankings_current: SeasonRankingsResponseObject[] = season_rankings.current(); +season_rankings.params(season_rankings_params); +season_rankings.on("fetch", (item: SeasonRankingsResponseObject[]) => {}); +season_rankings.on("prefetch", (results: SeasonRankingsResponseObject[]) => {}); +season_rankings.on("item", (item: SeasonRankingsResponseObject) => {}); +season_rankings.close(); diff --git a/types/victory/index.d.ts b/types/victory/index.d.ts index 1ce04d2436..31740217e7 100644 --- a/types/victory/index.d.ts +++ b/types/victory/index.d.ts @@ -1,1683 +1,1942 @@ -// Type definitions for Victory 0.9.2 +// Type definitions for Victory 0.9.3 // Project: https://github.com/FormidableLabs/victory // Definitions by: Alexey Svetliakov // snerks // Krzysztof Cebula +// Vitaliy Polyanskiy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 /// declare module "victory" { - import * as React from "react"; + import * as React from "react"; + + /** + * Single animation object to interpolate + */ + export type AnimationStyle = { [key: string ]: string | number }; + + /** + * Animation styles to interpolate + */ + + export type AnimationData = AnimationStyle | AnimationStyle[]; + + export type AnimationEasing = + "back" | "backIn" | "backOut" | "backInOut" | "bounce" | "bounceIn" | "bounceOut" | + "bounceInOut" | "circle" | "circleIn" | "circleOut" | "circleInOut" | "linear" | + "linearIn" | "linearOut" | "linearInOut" | "cubic" | "cubicIn" | "cubicOut" | + "cubicInOut" | "elastic" | "elasticIn" | "elasticOut" | "elasticInOut" | "exp" | + "expIn" | "expOut" | "expInOut" | "poly" | "polyIn" | "polyOut" | "polyInOut" | + "quad" | "quadIn" | "quadOut" | "quadInOut" | "sin" | "sinIn" | "sinOut" | "sinInOut"; + + // Many victory components accept string or number or callback which returns string or number + type StringOrNumberOrCallback = string | number | { (): string | number }; + + /** + * Style interface used in components/themeing + */ + export interface VictoryStyleInterface { + parent?: React.CSSProperties; + data?: React.CSSProperties; + labels?: React.CSSProperties; + tickLabels?: React.CSSProperties; + } + + export interface VictoryAnimationProps { /** - * Single animation object to interpolate + * The child of should be a function that takes an object of tweened values and returns a component to render. + * @param style */ - export type AnimationStyle = { [key: string ]: string | number }; + children?: (style: AnimationStyle) => React.ReactElement; /** - * Animation styles to interpolate + * The number of milliseconds the animation should take to complete. + * @default 1000 */ - export type AnimationData = AnimationStyle | AnimationStyle[]; - export type AnimationEasing = - "back" | "backIn" | "backOut" | "backInOut" | "bounce" | "bounceIn" | "bounceOut" | - "bounceInOut" | "circle" | "circleIn" | "circleOut" | "circleInOut" | "linear" | - "linearIn" | "linearOut" | "linearInOut" | "cubic" | "cubicIn" | "cubicOut" | - "cubicInOut" | "elastic" | "elasticIn" | "elasticOut" | "elasticInOut" | "exp" | - "expIn" | "expOut" | "expInOut" | "poly" | "polyIn" | "polyOut" | "polyInOut" | - "quad" | "quadIn" | "quadOut" | "quadInOut" | "sin" | "sinIn" | "sinOut" | "sinInOut"; - - // Many victory components accept string or number or callback which returns string or number - type StringOrNumberOrCallback = string | number | { (): string | number }; - + duration?: number; /** - * Style interface used in components/themeing + * The easing prop specifies an easing function name to use for tweening. + * @default "quadInOut" */ - export interface VictoryStyleInterface { - parent?: React.CSSProperties; - data?: React.CSSProperties; - labels?: React.CSSProperties; - tickLabels?: React.CSSProperties; - } - - export interface VictoryAnimationProps { - /** - * The child of should be a function that takes an object of tweened values and returns a component to render. - * @param style - */ - children?: (style: AnimationStyle) => React.ReactElement; - /** - * The number of milliseconds the animation should take to complete. - * @default 1000 - */ - duration?: number; - /** - * The easing prop specifies an easing function name to use for tweening. - * @default "quadInOut" - */ - easing?: AnimationEasing; - /** - * The delay prop specifies a delay in milliseconds before the animation begins. - * If multiple values are in the animation queue, it is the delay between each animation. - * @default 0 - */ - delay?: number; - /** - * The onEnd prop specifies a function to run when the animation ends. If multiple animations are in the queue, it is called after the last animation. - */ - onEnd?: () => void; - /** - * The data prop specifies the latest set of values to tween to. - * When this prop changes, VictoryAnimation will begin animating from the current value to the new value. - * When given an array of values, VictoryAnimation will use it as an animation queue. - * @default {} - */ - data?: AnimationData; - } - + easing?: AnimationEasing; /** - * VictoryAnimation animates prop changes for any React component. - * Just use a child function inside VictoryAnimation that accepts an object of tweened values and returns a component to render. + * The delay prop specifies a delay in milliseconds before the animation begins. + * If multiple values are in the animation queue, it is the delay between each animation. + * @default 0 */ - export class VictoryAnimation extends React.Component {} - + delay?: number; /** - * Text anchor type + * The onEnd prop specifies a function to run when the animation ends. If multiple animations are in the queue, it is called after the last animation. */ - type TextAnchorType = "start" | "middle" | "end" | "inherit"; + onEnd?: () => void; /** - * Vertical anchor type + * The data prop specifies the latest set of values to tween to. + * When this prop changes, VictoryAnimation will begin animating from the current value to the new value. + * When given an array of values, VictoryAnimation will use it as an animation queue. + * @default {} */ - type VerticalAnchorType = "start" | "middle" | "end"; + data?: AnimationData; + } - export interface VictoryLabelProps { - /** - * Specifies the angle to rotate the text by. - */ - angle?: string | number; - /** - * The capHeight prop defines a text metric for the font being used: the expected height of capital letters. - * This is necessary because of SVG, which (a) positions the *bottom* of the text at `y`, and (b) has no notion of line height. - * The value should ideally use the same units as `lineHeight` and `dy`, preferably ems. If given a unitless number, it is assumed to be ems. - * @default "0.71em" - */ - capHeight?: StringOrNumberOrCallback; - /** - * Victory components can pass a datum prop to their label component. This can be used to calculate functional styles, and determine child text - */ - datum?: {}; - /** - * Labels that apply to an entire data series will recieve the entire series as `data` instead of an individual datum prop. - */ - data?: any[]; - /** - * The events prop attaches arbitrary event handlers to the label component. - * Event handlers are currently only called with their corresponding events. - */ - events?: React.DOMAttributes; - /** - * All Victory components will pass a text prop to their label component. - * This defines the content of the label when child nodes are absent. It will be ignored if children are provided. - */ - text?: StringOrNumberOrCallback; - /** - * The children of this component define the content of the label. - * This makes using the component similar to normal HTML spans or labels. strings, numbers, and functions of data / value are supported. - */ - children?: StringOrNumberOrCallback; - /** - * The lineHeight prop defines how much space a single line of text should take up. - * Note that SVG has no notion of line-height, so the positioning may differ slightly from what you would expect with CSS, - * but the result is similar: a roughly equal amount of extra space is distributed above and below the line of text. - * The value should ideally use the same units as `capHeight` and `dy`, preferably ems. - * If given a unitless number, it is assumed to be ems. - * @default 1 - */ - lineHeight?: StringOrNumberOrCallback; - /** - * The style prop applies CSS properties to the rendered `` element. - */ - style?: React.CSSProperties; - /** - * The textAnchor prop defines how the text is horizontally positioned relative to the given `x` and `y` coordinates. - */ - textAnchor?: TextAnchorType | { (): TextAnchorType }; - /** - * The verticalAnchor prop defines how the text is vertically positioned relative to the given `x` and `y` coordinates. - */ - verticalAnchor?: VerticalAnchorType | { (): VerticalAnchorType }; - /** - * The transform prop applies a transform to the rendered `` element. - * In addition to being a string, it can be an object containing transform definitions for easier authoring. - */ - transform?: string | {} | { (): string | {} }; - /** - * The x prop defines the x coordinate to use as a basis for horizontal positioning. - */ - x?: number; - /** - * The y prop defines the y coordinate to use as a basis for vertical positioning. - */ - y?: number; - /** - * The dx prop defines a horizontal shift from the `x` coordinate. - */ - dx?: StringOrNumberOrCallback; - /** - * The dy prop defines a vertical shift from the `y` coordinate. - * Since this component already accounts for `capHeight`, `lineHeight`, and `verticalAnchor`, this will usually not be necessary. - */ - dy?: StringOrNumberOrCallback; - } + /** + * VictoryAnimation animates prop changes for any React component. + * Just use a child function inside VictoryAnimation that accepts an object of tweened values and returns a component to render. + */ + export class VictoryAnimation extends React.Component {} + /** + * Text anchor type + */ + type TextAnchorType = "start" | "middle" | "end" | "inherit"; + + /** + * Vertical anchor type + */ + type VerticalAnchorType = "start" | "middle" | "end"; + + export interface VictoryLabelProps { /** - * VictoryLabel is a text component that provides several enhancements over SVG’s element. + * Specifies the angle to rotate the text by. */ - export class VictoryLabel extends React.Component {} - - export interface VictoryContainerProps { - /** - * The style prop specifies styles for your VictoryContainer. Any valid inline style properties - * will be applied. Height and width should be specified via the height - * and width props, as they are used to calculate the alignment of - * components within the container. Styles from the child component will - * also be passed, if any exist. - * @examples {border: 1px solid red} - */ - style?: React.CSSProperties; - /** - * The height props specifies the height the svg viewBox of the container. - * This value should be given as a number of pixels. If no height prop - * is given, the height prop from the child component passed will be used. - */ - height?: number; - /** - * The width props specifies the width of the svg viewBox of the container - * This value should be given as a number of pixels. If no width prop - * is given, the width prop from the child component passed will be used. - */ - width?: number; - /** - * The events prop attaches arbitrary event handlers to the container component. - * Event handlers passed from other Victory components are called with their - * corresponding events as well as scale, style, width, height, and data when - * applicable. Use the invert method to convert event coordinate information to - * data. `scale.x.invert(evt.offsetX)`. - * @examples {{ onClick: (evt) => alert(`x: ${evt.clientX}, y: ${evt.clientY}`)}} - */ - events?: React.DOMAttributes; - /** - * The title prop specifies the title to be applied to the SVG to assist - * accessibility for screen readers. The more descriptive this title is, the more - * useful it will be. If no title prop is passed, it will default to Victory Chart. - * @example "Popularity of Dog Breeds by Percentage" - * @default "Victory Chart" - */ - title?: string; - /** - * The desc prop specifies the description of the chart/SVG to assist with - * accessibility for screen readers. The more info about the chart provided in - * the description, the more usable it will be for people using screen readers. - * This prop defaults to an empty string. - * @example "Golden retreivers make up 30%, Labs make up 25%, and other dog breeds are - * not represented above 5% each." - * @default "" - */ - desc?: string; - } - export class VictoryContainer extends React.Component {} - - // Note: Many SVG attributes are missed in CSSProperties interface - export interface VictoryThemeDefinition { - area?: VictoryStyleInterface; - axis?: { - axis: React.CSSProperties; - axisLabel: React.CSSProperties; - grid: React.CSSProperties; - ticks: React.CSSProperties; - tickLabels: React.CSSProperties; - }; - bar?: VictoryStyleInterface; - candlestick?: VictoryStyleInterface & { - props: { - width: number; - height: number; - candleColors: { - positive: string; - negative: string; - }; - }; - }; - line?: VictoryStyleInterface; - pie?: { - props: { - width: number; - height: number; - colorScale: string[]; - }; - style: VictoryStyleInterface; - }; - scatter?: VictoryStyleInterface; - props?: { - width: number; - height: number; - colorScale: string[]; - }; - } - - interface VictoryThemeInterface { - /** - * Default theme - */ - material: VictoryThemeDefinition; - } + angle?: string | number; /** - * Available themes + * The capHeight prop defines a text metric for the font being used: the expected height of capital letters. + * This is necessary because of SVG, which (a) positions the *bottom* of the text at `y`, and (b) has no notion of line height. + * The value should ideally use the same units as `lineHeight` and `dy`, preferably ems. If given a unitless number, it is assumed to be ems. + * @default "0.71em" */ - export const VictoryTheme: VictoryThemeInterface; - + capHeight?: StringOrNumberOrCallback; /** - * Animate object used in components + * Victory components can pass a datum prop to their label component. This can be used to calculate functional styles, and determine child text */ - export interface AnimatePropTypeInterface { - /** - * Animation duration - */ - duration: number; - /** - * Animation end callback - */ - onEnd?: () => void; - /** - * Animation exit transition configuration - */ - onExit?: { - duration?: number; - before?: (datum: any) => AnimationStyle; - }; - /** - * Animation enter transition configuration - */ - onEnter?: { - duration?: number; - before?: (datum: any) => AnimationStyle; - after?: (datum: any) => AnimationStyle; - }; - /** - * Animation load transition configuration - */ - onLoad?: { - duration?: number; - before?: (datum: any) => AnimationStyle; - after?: (datum: any) => AnimationStyle; - }; - /** - * The easing prop specifies an easing function name to use for tweening. - * @default "quadInOut" - */ - easing?: AnimationEasing; - } - + datum?: {}; /** - * Return value for eventHandlers values + * Labels that apply to an entire data series will recieve the entire series as `data` instead of an individual datum prop. */ - interface EventCallbackInterface { - /** - * Use only in: - * - VictoryChart - * - VictoryStack - */ - childName?: string; - target?: TTarget; - eventKey?: TEventKey; - /** - * Will be called with the calculated props for the individual selected element and result will override - * props of selected element via object assignment - * @param props - */ - mutation: (props: any) => any; - } - - export interface EventPropTypeInterface { - /** - * Use only in: - * - VictoryChart - * - VictoryStack - */ - childName?: string; - /** - * Targets may be any valid style namespace for a given component - */ - target: TTarget; - /** - * - */ - eventKey?: TEventKey; - /** - * Event handlers map. Keys are standard event names (such as onClick) and values are event callbacks - */ - eventHandlers: { - [key: string]: { - (event: React.SyntheticEvent): EventCallbackInterface } | - { (event: React.SyntheticEvent): EventCallbackInterface[] - } - }; - } - + data?: any[]; /** - * Data domain type + * The events prop attaches arbitrary event handlers to the label component. + * Event handlers are currently only called with their corresponding events. */ - type DomainTuple = [number, number] | [Date, Date]; - type DomainPropType = DomainTuple | { x?: DomainTuple; y: DomainTuple; } | { x: DomainTuple; y?: DomainTuple; }; + events?: React.DOMAttributes; /** - * Domain padding + * All Victory components will pass a text prop to their label component. + * This defines the content of the label when child nodes are absent. It will be ignored if children are provided. */ - type DomainPaddingPropType = number | { - x?: number; - y?: number; + text?: StringOrNumberOrCallback; + /** + * The children of this component define the content of the label. + * This makes using the component similar to normal HTML spans or labels. strings, numbers, and functions of data / value are supported. + */ + children?: StringOrNumberOrCallback; + /** + * The lineHeight prop defines how much space a single line of text should take up. + * Note that SVG has no notion of line-height, so the positioning may differ slightly from what you would expect with CSS, + * but the result is similar: a roughly equal amount of extra space is distributed above and below the line of text. + * The value should ideally use the same units as `capHeight` and `dy`, preferably ems. + * If given a unitless number, it is assumed to be ems. + * @default 1 + */ + lineHeight?: StringOrNumberOrCallback; + /** + * The style prop applies CSS properties to the rendered `` element. + */ + style?: React.CSSProperties; + /** + * The textAnchor prop defines how the text is horizontally positioned relative to the given `x` and `y` coordinates. + */ + textAnchor?: TextAnchorType | { (): TextAnchorType }; + /** + * The verticalAnchor prop defines how the text is vertically positioned relative to the given `x` and `y` coordinates. + */ + verticalAnchor?: VerticalAnchorType | { (): VerticalAnchorType }; + /** + * The transform prop applies a transform to the rendered `` element. + * In addition to being a string, it can be an object containing transform definitions for easier authoring. + */ + transform?: string | {} | { (): string | {} }; + /** + * The x prop defines the x coordinate to use as a basis for horizontal positioning. + */ + x?: number; + /** + * The y prop defines the y coordinate to use as a basis for vertical positioning. + */ + y?: number; + /** + * The dx prop defines a horizontal shift from the `x` coordinate. + */ + dx?: StringOrNumberOrCallback; + /** + * The dy prop defines a vertical shift from the `y` coordinate. + * Since this component already accounts for `capHeight`, `lineHeight`, and `verticalAnchor`, this will usually not be necessary. + */ + dy?: StringOrNumberOrCallback; + } + + /** + * VictoryLabel is a text component that provides several enhancements over SVG’s element. + */ + export class VictoryLabel extends React.Component {} + + export interface VictoryContainerProps { + /** + * The responsive prop specifies whether the rendered container should be a responsive container + * with a viewBox attribute, or a static container with absolute width and height. + * @default true + */ + responsive?: boolean + /** + * The style prop specifies styles for your VictoryContainer. Any valid inline style properties + * will be applied. Height and width should be specified via the height + * and width props, as they are used to calculate the alignment of + * components within the container. Styles from the child component will + * also be passed, if any exist. + * @examples {border: 1px solid red} + */ + style?: React.CSSProperties; + /** + * The height props specifies the height the svg viewBox of the container. + * This value should be given as a number of pixels. If no height prop + * is given, the height prop from the child component passed will be used. + */ + height?: number; + /** + * The width props specifies the width of the svg viewBox of the container + * This value should be given as a number of pixels. If no width prop + * is given, the width prop from the child component passed will be used. + */ + width?: number; + /** + * The events prop attaches arbitrary event handlers to the container component. + * Event handlers passed from other Victory components are called with their + * corresponding events as well as scale, style, width, height, and data when + * applicable. Use the invert method to convert event coordinate information to + * data. `scale.x.invert(evt.offsetX)`. + * @examples {{ onClick: (evt) => alert(`x: ${evt.clientX}, y: ${evt.clientY}`)}} + */ + events?: React.DOMAttributes; + /** + * The title prop specifies the title to be applied to the SVG to assist + * accessibility for screen readers. The more descriptive this title is, the more + * useful it will be. If no title prop is passed, it will default to Victory Chart. + * @example "Popularity of Dog Breeds by Percentage" + * @default "Victory Chart" + */ + title?: string; + /** + * The desc prop specifies the description of the chart/SVG to assist with + * accessibility for screen readers. The more info about the chart provided in + * the description, the more usable it will be for people using screen readers. + * This prop defaults to an empty string. + * @example "Golden retreivers make up 30%, Labs make up 25%, and other dog breeds are + * not represented above 5% each." + * @default "" + */ + desc?: string; + } + + export class VictoryContainer extends React.Component {} + + type CursorData = { + x: number; + y: number; + } + + export interface VictoryCursorContainerProps extends VictoryContainerProps { + /** + * The cursorComponent prop takes a component instance which will be used to render a cursor element. + * The new element created will be supplied with x1, y1, x2 and y2 positioning props. + * If a cursorComponent is not supplied, a new Line component will be rendered. + * @default cursorComponent={} + */ + cursorComponent?: React.ReactElement; + /** + * When the cursorDimension prop is set, the cursor will be a line to inspect the given dimension (either "x" or "y"). + * When this prop is not specified, the cursor will be a 2-dimensional crosshair. + * For example, if you would like to inspect the time of time-series data, set dimension={"x"}; + * the cursor will then be a vertical line that will inspect the time value of the current mouse position. + * @example cursorDimension="x" + */ + cursorDimension?: 'x' | 'y'; + /** + * The cursorLabel prop defines the label that will appear next to the cursor. + * A label will only appear if cursorLabel is set. This prop should be given as a + * function of a point (an Object with x and y properties). + * @example cursorLabel={(point) => point.x} + */ + cursorLabel?: (point: CursorData) => void; + /** + * The cursorLabelComponent prop takes a component instance which will be + * used to render a label for the cursor. The new element created from the passed + * cursorLabelComponent will be supplied with the following props: x, y, + * active, text. If cursorLabelComponent is omitted, a new VictoryLabel will be created with the props described above. + * @default cursorLabelComponent={} + */ + cursorLabelComponent?: React.ReactElement; + /** + * The cursorLabelOffset prop determines the pixel offset of the cursor label + * from the cursor point. This prop should be an Object with x and y properties, or a + * number to be used for both dimensions. + * @default "{ x: 5, y: -10 }" + */ + cursorLabelOffset?: number | CursorData; + /** + * Whenever the mouse is not over the chart, the cursor will not be displayed. + * If instead you would like to keep it displayed, use the defaultCursorValue prop to set the default value. + * The prop should be a point (an Object with x and y properties) for 2-dimensional cursors, or a number for 1-dimensional cursors. + * @example defaultCursorValue={{x: 1, y: 1}}, defaultCursorValue={0}} + */ + defaultCursorValue?: number | CursorData; + /** + * When the disable prop is set to true, VictoryCursorContainer events will not fire. + */ + disable?: boolean + /** + * When the cursorDimension prop is set, the cursor will be a line to inspect the given dimension (either "x" or "y"). + * When this prop is not specified, the cursor will be a 2-dimensional crosshair. + * For example, if you would like to inspect the time of time-series data, set dimension={"x"}; + * the cursor will then be a vertical line that will inspect the time value of the current mouse position. + * @example onChange={(value, props) => this.setState({cursorValue: value})} + */ + onCursorChange?: (value: CursorData, props: VictoryCursorContainerProps) => void + } + + export class VictoryCursorContainer extends React.Component {} + + export interface VictoryBrushContainerProps extends VictoryContainerProps { + /** + * The optional allowDrag prop accepts a boolean that enables dragging behavior + * for the highlighted brush area. Resizing will still be enabled when the allowDrag + * prop is set to false. + * @default true + */ + allowDrag?: boolean; + /** + * The optional allowResize prop accepts a boolean that enables resizing the + * highlighted brush area. Dragging will still be enabled when the allowResize + * prop is set to false, but the dimensions of the brush area will be fixed. + * @default true + */ + allowResize?: boolean; + /** + * The brushComponent prop specifies the component to be rendered for the + * highlighted area. This component will be supplied with the following props: x, y, + * width, height, and style. When this prop is not specified, a will be rendered. + * @default brushComponent={} + */ + brushComponent?: React.ReactElement; + /** + * When the brushDimension prop is set, brushing will only be specific to the to + * the given dimension (either "x" or "y"), and the entire domain of the other + * dimension will be highlighted. When this prop is not specified, highlighting will + * occur along both dimensions. + * @example brushDimension="x" + */ + brushDimension?: 'x' | 'y'; + /** + * The optional brushDomain prop describes the highlighted state. This prop is an + * object that specifies separate arrays for x and y. Each array is a tuple that + * describes the minimum and maximum values to render. If this prop is not provided + * initially, the chart will render with the entire domain highlighted. When this prop + * changes, the chart will render with a new highlighted domain. + * @example brushDomain={{ x: [50, 100], y: [0, 100] }} + */ + brushDomain?: DomainPropType; + /** + * The brushStyle adds custom styles to the brushComponent. This prop + * should be given as an object of SVG style attributes. + * @default "brushStyle={{ stroke: "transparent", fill: "black", fillOpacity: 0.1 }}" + */ + brushStyle?: React.CSSProperties; + /** + * The defaultBrushArea prop specifies how the container will behave when a + * region outside the active brush is clicked without selecting a new area. When the + * prop is set to "all", the entire domain will be selected. When the prop is set to "none", + * no new region will be selected, and any existing active brush will be cleared. When + * the prop is set to "disable" the new selected region will default to the current active brush. + */ + defaultBrushArea?: 'all' | 'none' | 'disable'; + /** + * When the disable prop is set to true, VictoryBrushContainer events will not fire. + */ + disable?: boolean; + /** + * The handleComponent prop specifies the component to be rendered for each + * handle for the highlighted area. This component will be supplied with the following + * props: x, y, width, height, cursor, and style. When this prop is not + * specified, a will be rendered. + * @default handleComponent={} + */ + handleComponent?: React.ReactElement; + /** + * The handleStyle adds custom styles to the handleComponents. This prop should be given as an object of SVG style attributes. + * + * Handles refer to the region on each highlighted area where the area may be + * expanded. Only handles relevant to the given dimension will be rendered. For + * example, when brushDimension="x" only "left" and "right" handles will be + * rendered. Handles are automatically styled with cursors appropriate to their orientation. + * @default "handleStyle={{ stroke: 'transparent', fill: 'transparent' }}" + */ + handleStyle?: React.CSSProperties; + /** + * The optional onBrushDomainChange prop accepts an function to be called on + * each update to the highlighted domain. The function accepts the parameters of + * domain (the updated domain), and props (the props used by VictoryBrushContainer). + * @example onBrushDomainChange={(domain, props) => handleDomainChange(domain, props)} + */ + onBrushDomainChange?: (domain: DomainPropType, props: VictoryBrushContainerProps) => void; + } + + export class VictoryBrushContainer extends React.Component {} + + export interface VictoryZoomContainerProps extends VictoryContainerProps { + /** + * The optional allowPan prop accepts a boolean that enables the panning + * functionality. Zooming will still be enabled when the allowPan prop is set to false. + * @default true + */ + allowPan?: boolean; + /** + * The optional allowZoom prop accepts a boolean that enables the zoom + * functionality. Panning will still be enabled when the allowZoom prop is set to false. + * @default true + */ + allowZoom?: boolean; + /** + * VictoryZoomContainer works by clipping data outside of a given domain. + * VictoryZoomContainer uses VictoryClipContainer by default. + * This prop should not be replaced with a custom component, but you may want to set + * props on VictoryClipContainer, such as clipPadding. + * @example clipContainerComponent={} + */ + clipContainerComponent?: React.ReactElement; + /** + * When the zoomDimension prop is set, panning and zooming will be restricted to + * the given dimension (either x or y), and the domain of the other dimension will + * remain static. When this prop is not specified, both x and y dimensions will pan and zoom. + * @example zoomDimension="x" + */ + zoomDimension?: 'x' | 'y'; + /** + * The zoomDomain prop describes the zoomed state. This prop is an object that + * specifies separate arrays for x and y. Each array is a tuple that describes the + * minimum and maximum values to render. If this prop is not provided initially, the + * chart will render without an initial zoom, displaying the entire dataset. Updates to + * zoomDomain will trigger a re-render of the chart with the new domain. + * @example zoomDomain={{x: [0, 100]}} + */ + zoomDomain?: DomainPropType; + /** + * The brushStyle adds custom styles to the brushComponent. This prop + * should be given as an object of SVG style attributes. + * @default "brushStyle={{ stroke: 'transparent', fill: 'black', fillOpacity: 0.1 }}" + */ + brushStyle?: React.CSSProperties; + /** + * The defaultBrushArea prop specifies how the container will behave when a + * region outside the active brush is clicked without selecting a new area. When the + * prop is set to "all", the entire domain will be selected. When the prop is set to "none", + * no new region will be selected, and any existing active brush will be cleared. When + * the prop is set to "disable" the new selected region will default to the current active brush. + */ + defaultBrushArea?: 'all' | 'none' | 'disable'; + /** + * When the disable prop is set to true, VictoryBrushContainer events will not fire. + */ + disable?: boolean; + /** + * When the disable prop is set to true, VictoryZoomContainer events will not fire. + */ + downsample?: number | boolean; + /** + * The minimumZoom prop sets a minimum domain extent for the zoomed chart. + * When the difference between the maximum and minimum of a zoomed domain is equal to the minimumZoom + * in either dimension, the component will stop responding to events that would normally trigger zooming in. + * Zooming out and panning will still be enabled. When this prop is not specified, the default minimum + * zoom will cover 1 / 1000th of the original domain. This prop should be given as an object + * with numeric values for x and y. + * @example minimumZoom={{x: 1, y: 0.01}} + */ + minimumZoom?: CursorData; + /** + * The optional onZoomDomainChange prop accepts an function to be called on each update to the visible domain. + * The function accepts the parameters domain (the updated domain) and props (the props used by VictoryZoomContainer). + * @example onZoomDomainChange={(domain, props) => handleDomainChange(domain, props)} + */ + onZoomDomainChange?: (domain: DomainPropType, props: VictoryZoomContainerProps) => void; + } + + export class VictoryZoomContainer extends React.Component {} + + // Note: Many SVG attributes are missed in CSSProperties interface + export interface VictoryThemeDefinition { + area?: VictoryStyleInterface; + axis?: { + axis: React.CSSProperties; + axisLabel: React.CSSProperties; + grid: React.CSSProperties; + ticks: React.CSSProperties; + tickLabels: React.CSSProperties; }; - - /** - * D3 scale function shape. Don't want to introduce typing dependency to d3 - */ - interface D3Scale { - domain: () => any; - range: () => any; - copy: () => any; - } - /** - * Acceptable scale types - */ - type ScalePropType = "linear" | "time" | "log" | "sqrt"; - - /** - * Category prop type - */ - type CategoryPropType = string[] | { - x: string[] - y: string[] + bar?: VictoryStyleInterface; + candlestick?: VictoryStyleInterface & { + props: { + width: number; + height: number; + candleColors: { + positive: string; + negative: string; + }; + }; }; + line?: VictoryStyleInterface; + pie?: { + props: { + width: number; + height: number; + colorScale: string[]; + }; + style: VictoryStyleInterface; + }; + scatter?: VictoryStyleInterface; + props?: { + width: number; + height: number; + colorScale: string[]; + }; + } + interface VictoryThemeInterface { /** - * Data getter property type + * Default theme */ - type DataGetterPropType = number | string | string[] | { (data: any): number | string | string[] }; + material: VictoryThemeDefinition; + } - type InterpolationPropType = "basis" | "basisClosed" | "basisOpen" | "bundle" | - "cardinal" | "cardinalClosed" | "cardinalOpen" | - "catmullRom" | "catmullRomClosed" | "catmullRomOpen" | - "linear" | "linearClosed" | "monotoneX" | "monotoneY" | - "natural" | "radial" | "step" | "stepAfter" | "stepBefore"; + /** + * Available themes + */ + export const VictoryTheme: VictoryThemeInterface; - type ColorScalePropType = "greyscale" | "qualitative" | "heatmap" | "warm" | "cool" | "red" | "green" | "blue" | string[]; + /** + * Animate object used in components + */ + export interface AnimatePropTypeInterface { /** - * Common properties + * Animation duration */ - interface VictoryCommonProps { - /** - * The animate prop specifies props for VictoryAnimation to use. - * The animate prop should also be used to specify enter and exit - * transition configurations with the `onExit` and `onEnter` namespaces respectively. - * @example - * {duration: 500, onExit: () => {}, onEnter: {duration: 500, before: () => ({y: 0})})} - */ - animate?: AnimatePropTypeInterface; - /** - * The name prop is used to reference a component instance when defining shared events. - */ - name?: string; - /** - * The height props specifies the height the svg viewBox of the chart container. - * This value should be given as a number of pixels - */ - height?: number; - /** - * The padding props specifies the amount of padding in number of pixels between - * the edge of the chart and any rendered child components. This prop can be given - * as a number or as an object with padding specified for top, bottom, left - * and right. - * @default 50 - */ - padding?: number | { - top?: number; - bottom?: number; - left?: number; - right?: number; - }; - /** - * The scale prop determines which scales your chart should use. This prop can be - * given as a string specifying a supported scale ("linear", "time", "log", "sqrt"), - * as a d3 scale function, or as an object with scales specified for x and y - * @example d3Scale.time(), {x: "linear", y: "log"} - * @default "linear" - */ - scale?: ScalePropType | D3Scale | { - x?: ScalePropType | D3Scale; - y?: ScalePropType | D3Scale; - }; - /** - * The standalone prop determines whether the component will render a standalone svg - * or a tag that will be included in an external svg. Set standalone to false to - * compose VictoryAxis with other components within an enclosing tag. - * @default true - */ - standalone?: boolean; - /** - * The width props specifies the width of the svg viewBox of the chart container - * This value should be given as a number of pixels - */ - width?: number; - /** - * The containerComponent prop takes an entire component which will be used to - * create a container element for standalone charts. - * The new element created from the passed containerComponent wil be provided with - * these props from VictoryArea: height, width, children - * (the chart itself) and style. Props that are not provided by the - * child chart component include title and desc, both of which - * are intended to add accessibility to Victory components. The more descriptive these props - * are, the more accessible your data will be for people using screen readers. - * Any of these props may be overridden by passing in props to the supplied component, - * or modified or ignored within the custom component itself. If a dataComponent is - * not provided, VictoryArea will use the default VictoryContainer component. - * @example - * @default - */ - containerComponent?: React.ReactElement; - /** - * The theme prop takes a style object with nested data, labels, and parent objects. - * You can create this object yourself, or you can use a theme provided by Victory. - * When using VictoryArea as a solo component, implement the theme directly on - * VictoryArea. If you are wrapping VictoryArea in VictoryChart, VictoryStack, or - * VictoryGroup, please call the theme on the outermost wrapper component instead. - * @example theme={VictoryTheme.material} - * http://www.github.com/FormidableLabs/victory-core/tree/master/src/victory-theme/material.js - */ - theme?: VictoryThemeDefinition; - /** - * The groupComponent prop takes an entire component which will be used to - * create group elements for use within container elements. This prop defaults - * to a tag on web, and a react-native-svg tag on mobile - * @default - */ - groupComponent?: React.ReactElement; - } - + duration: number; /** - * Common properties for all data components + * Animation end callback */ - interface VictoryDatableProps { - /** - * The categories prop specifies how categorical data for a chart should be ordered. - * This prop should be given as an array of string values, or an object with - * these arrays of values specified for x and y. If this prop is not set, - * categorical data will be plotted in the order it was given in the data array - * @example ["dogs", "cats", "mice"] - */ - categories?: CategoryPropType; - /** - * The data prop specifies the data to be plotted. Data should be in the form of an array - * of data points, or an array of arrays of data points for multiple datasets. - * Each data point may be any format you wish (depending on the `x` and `y` accessor props), - * but by default, an object with x and y properties is expected. - * @example [{x: 1, y: 2}, {x: 2, y: 3}], [[1, 2], [2, 3]], - * [[{x: "a", y: 1}, {x: "b", y: 2}], [{x: "a", y: 2}, {x: "b", y: 3}]] - */ - data?: any[]; - /** - * The dataComponent prop takes an entire component which will be used to create an area. - * The new element created from the passed dataComponent will be provided with the - * following properties calculated by VictoryArea: a scale, style, events, interpolation, - * and an array of modified data objects (including x, y, and calculated y0 and y1). - * Any of these props may be overridden by passing in props to the supplied component, - * or modified or ignored within the custom component itself. If a dataComponent is - * not provided, VictoryArea will use its default Area component. - * @default - */ - dataComponent?: React.ReactElement; - /** - * The domain prop describes the range of values your chart will cover. This prop can be - * given as a array of the minimum and maximum expected values for your bar chart, - * or as an object that specifies separate arrays for x and y. - * If this prop is not provided, a domain will be calculated from data, or other - * available information. - * @example [-1, 1], {x: [0, 100], y: [0, 1]} - */ - domain?: DomainPropType; - /** - * The x prop specifies how to access the X value of each data point. - * If given as a function, it will be run on each data point, and returned value will be used. - * If given as an integer, it will be used as an array index for array-type data points. - * If given as a string, it will be used as a property key for object-type data points. - * If given as an array of strings, or a string containing dots or brackets, - * it will be used as a nested object property path (for details see Lodash docs for _.get). - * If `null` or `undefined`, the data value will be used as is (identity function/pass-through). - * @example 0, 'x', 'x.value.nested.1.thing', 'x[2].also.nested', null, d => Math.sin(d) - * @default "x" - */ - x?: DataGetterPropType; - /** - * The y prop specifies how to access the Y value of each data point. - * If given as a function, it will be run on each data point, and returned value will be used. - * If given as an integer, it will be used as an array index for array-type data points. - * If given as a string, it will be used as a property key for object-type data points. - * If given as an array of strings, or a string containing dots or brackets, - * it will be used as a nested object property path (for details see Lodash docs for _.get). - * If `null` or `undefined`, the data value will be used as is (identity function/pass-through). - * @example 0, 'y', 'y.value.nested.1.thing', 'y[2].also.nested', null, d => Math.sin(d) - * @default "y" - */ - y?: DataGetterPropType; - } - - // Common labable interface - interface VictoryLabableProps { - /** - * The labelComponent prop takes in an entire label component which will be used - * to create a label for the area. The new element created from the passed labelComponent - * will be supplied with the following properties: x, y, index, data, verticalAnchor, - * textAnchor, angle, style, text, and events. any of these props may be overridden - * by passing in props to the supplied component, or modified or ignored within - * the custom component itself. If labelComponent is omitted, a new VictoryLabel - * will be created with props described above. This labelComponent prop should be used to - * provide a series label for VictoryArea. If individual labels are required for each - * data point, they should be created by composing VictoryArea with VictoryScatter - * @default - */ - labelComponent?: React.ReactElement; - } - - interface VictoryMultiLabeableProps extends VictoryLabableProps { - /** - * The labels prop defines labels that will appear above each bar in your chart. - * This prop should be given as an array of values or as a function of data. - * If given as an array, the number of elements in the array should be equal to - * the length of the data array. Labels may also be added directly to the data object - * like data={[{x: 1, y: 1, label: "first"}]}. - * @example ["spring", "summer", "fall", "winter"], (datum) => datum.title - */ - labels?: string[] | { (data: any): string }; - } - - interface VictorySingleLabableProps extends VictoryLabableProps { - /** - * The label prop defines the label that will appear at the edge of the area. - * This prop should be given a string or as a function of data. If individual - * labels are required for each data point, they should be created by composing - * VictoryArea with VictoryScatter - * @example: "Series 1", (data) => `${data.length} points` - */ - label?: string | { (data: any): string }; - } - - export interface VictoryAreaProps extends VictoryCommonProps, VictoryDatableProps, VictorySingleLabableProps { - /** - * The event prop take an array of event objects. Event objects are composed of - * a target, an eventKey, and eventHandlers. Targets may be any valid style namespace - * for a given component, so "data" and "labels" are all valid targets for VictoryArea events. - * Since VictoryArea only renders a single element, the eventKey property is not used. - * The eventHandlers object should be given as an object whose keys are standard - * event names (i.e. onClick) and whose values are event callbacks. The return value - * of an event handler is used to modify elemnts. The return value should be given - * as an object or an array of objects with optional target and eventKey keys, - * and a mutation key whose value is a function. The target and eventKey keys - * will default to those corresponding to the element the event handler was attached to. - * The mutation function will be called with the calculated props for the individual selected - * element (i.e. an area), and the object returned from the mutation function - * will override the props of the selected element via object assignment. - * @example - * events={[ - * { - * target: "data", - * eventHandlers: { - * onClick: () => { - * return [ - * { - * mutation: (props) => { - * return {style: merge({}, props.style, {fill: "orange"})}; - * } - * }, { - * target: "labels", - * mutation: () => { - * return {text: "hey"}; - * } - * } - * ]; - * } - * } - * } - * ]} - *}} - */ - events?: EventPropTypeInterface<"data" | "labels" | "parent", "all">[]; - /** - * The interpolation prop determines how data points should be connected when plotting a line - * @default "linear" - */ - interpolation?: InterpolationPropType; - /** - * The samples prop specifies how many individual points to plot when plotting - * y as a function of x. Samples is ignored if x props are provided instead. - * @default 50 - */ - samples?: number; - /** - * The style prop specifies styles for your VictoryArea. Any valid inline style properties - * will be applied. Height, width, and padding should be specified via the height, - * width, and padding props, as they are used to calculate the alignment of - * components within chart. - * @example {data: {fill: "red"}, labels: {fontSize: 12}} - */ - style?: VictoryStyleInterface; - } + onEnd?: () => void; /** - * Draw area charts with React. VictoryArea is a composable component, so it doesn't include axes. - * Add VictoryArea as a child of VictoryChart for a complete chart. + * Animation exit transition configuration */ - export class VictoryArea extends React.Component {} - - export interface VictoryAxisProps extends VictoryCommonProps { - /** - * The axisComponent prop takes in an entire component which will be used - * to create the axis line. The new element created from the passed axisComponent - * will be supplied with the following properties: x1, y1, x2, y2, style and events. - * Any of these props may be overridden by passing in props to the supplied component, - * or modified or ignored within the custom component itself. If an axisComponent - * is not supplied, VictoryAxis will render its default AxisLine component. - * @default - */ - axisComponent?: React.ReactElement; - /** - * The axisLabelComponent prop takes in an entire component which will be used - * to create the axis label. The new element created from the passed axisLabelComponent - * will be supplied with the following properties: x, y, verticalAnchor, textAnchor, - * angle, transform, style and events. Any of these props may be overridden by - * passing in props to the supplied component, or modified or ignored within - * the custom component itself. If an axisLabelComponent is not supplied, a new - * VictoryLabel will be created with props described above - * @default - */ - axisLabelComponent?: React.ReactElement; - /** - * This prop specifies whether a given axis is intended to cross another axis. - */ - crossAxis?: boolean; - /** - * The dependentAxis prop specifies whether the axis corresponds to the - * dependent variable (usually y). This prop is useful when composing axis - * with other components to form a chart. - */ - dependentAxis?: boolean; - /** - * The domain prop describes the range of values your axis will include. This prop should be - * given as a array of the minimum and maximum expected values for your axis. - * If this value is not given it will be calculated based on the scale or tickValues. - * @examples [-1, 1] - */ - domain?: DomainPropType; - /** - * The event prop take an array of event objects. Event objects are composed of - * a target, an eventKey, and eventHandlers. Targets may be any valid style namespace - * for a given component, so "axis", "axisLabel", "ticks", "tickLabels", and "grid" are - * all valid targets for VictoryAxis events. The eventKey may optionally be used to select a - * single element by index rather than an entire set. The eventHandlers object - * should be given as an object whose keys are standard event names (i.e. onClick) - * and whose values are event callbacks. The return value of an event handler - * be used to modify other elemnts. The return value should be given as an object or - * an array of objects with optional target and eventKey keys, and a mutation - * key whose value is a function. The target and eventKey keys will default to those - * corresponding to the element the event handler was attached to. The mutation - * function will be called with the calculated props for the individual selected - * element (i.e. a single tick), and the object returned from the mutation function - * will override the props of the selected element via object assignment. - * @examples - * events={[ - * { - * target: "grid", - * eventKey: 2, - * eventHandlers: { - * onClick: () => { - * return [ - * { - * mutation: (props) => { - * return {style: merge({}, props.style, {stroke: "orange"})}; - * } - * }, { - * target: "tickLabels", - * mutation: () => { - * return {text: "hey"}; - * } - * } - * ]; - * } - * } - * } - * ]} - *}} - */ - events?: EventPropTypeInterface<"axis" | "axisLabel" | "grid" | "ticks" | "tickLabels" | "parent", number | string>[]; - /** - * The gridComponent prop takes in an entire component which will be used - * to create grid lines. The new element created from the passed gridComponent - * will be supplied with the following properties: x1, y1, x2, y2, tick, style and events. - * Any of these props may be overridden by passing in props to the supplied component, - * or modified or ignored within the custom component itself. If a gridComponent - * is not supplied, VictoryAxis will render its default GridLine component. - * @default - */ - gridComponent?: React.ReactElement; - /** - * If true, this value will flip the domain of a given axis. - */ - invertAxis?: boolean; - /** - * The label prop defines the label that will appear along the axis. This - * prop should be given as a value or an entire, HTML-complete label - * component. If a label component is given, it will be cloned. The new - * element's properties x, y, textAnchor, verticalAnchor, and transform - * will have defaults provided by the axis; styles filled out with - * defaults provided by the axis, and overrides from the label component. - * If a value is given, a new VictoryLabel will be created with props and - * styles from the axis. - */ - label?: any; - /** - * This value describes how far from the "edge" of its permitted area each axis - * will be set back in the x-direction. If this prop is not given, - * the offset is calculated based on font size, axis orientation, and label padding. - */ - offsetX?: number; - /** - * This value describes how far from the "edge" of its permitted area each axis - * will be set back in the y-direction. If this prop is not given, - * the offset is calculated based on font size, axis orientation, and label padding. - */ - offsetY?: number; - /** - * The orientation prop specifies the position and orientation of your axis. - */ - orientation?: "top" | "bottom" | "left" | "right"; - /** - * The style prop specifies styles for your VictoryAxis. Any valid inline style properties - * will be applied. Height, width, and padding should be specified via the height, - * width, and padding props, as they are used to calculate the alignment of - * components within chart. - * @example {axis: {stroke: "#756f6a"}, grid: {stroke: "grey"}, ticks: {stroke: "grey"}, - * tickLabels: {fontSize: 10, padding: 5}, axisLabel: {fontSize: 16, padding: 20}} - */ - style?: { - parent?: React.CSSProperties; - axis?: React.CSSProperties; - axisLabel?: React.CSSProperties; - grid?: React.CSSProperties; - ticks?: React.CSSProperties; - tickLabels?: React.CSSProperties; - }; - /** - * The tickComponent prop takes in an entire component which will be used - * to create tick lines. The new element created from the passed tickComponent - * will be supplied with the following properties: x1, y1, x2, y2, tick, style and events. - * Any of these props may be overridden by passing in props to the supplied component, - * or modified or ignored within the custom component itself. If a tickComponent - * is not supplied, VictoryAxis will render its default Tick component. - * @default - */ - tickComponent?: React.ReactElement; - /** - * The tickCount prop specifies approximately how many ticks should be drawn on the axis if - * tickValues are not explicitly provided. This value is calculated by d3 scale and - * prioritizes returning "nice" values and evenly spaced ticks over an exact number of ticks. - * If you need an exact number of ticks, please specify them via the tickValues prop. - * This prop must have a value greater than zero. - * @default 5 - */ - tickCount?: number; - /** - * The tickLabelComponent prop takes in an entire component which will be used - * to create the tick labels. The new element created from the passed tickLabelComponent - * will be supplied with the following properties: x, y, verticalAnchor, textAnchor, - * angle, tick, style and events. Any of these props may be overridden by - * passing in props to the supplied component, or modified or ignored within - * the custom component itself. If an tickLabelComponent is not supplied, a new - * VictoryLabel will be created with props described above - * @default - */ - tickLabelComponent?: React.ReactElement; - /** - * The tickFormat prop specifies how tick values should be expressed visually. - * tickFormat can be given as a function to be applied to every tickValue, or as - * an array of display values for each tickValue. - * @example d3.time.format("%Y"), (x) => x.toPrecision(2), ["first", "second", "third"] - */ - tickFormat?: any[] | { (data: any): string | number }; - /** - * The tickValues prop explicitly specifies which tick values to draw on the axis. - * @example ["apples", "bananas", "oranges"], [2, 4, 6, 8] - */ - tickValues?: any[] - } - + onExit?: { + duration?: number; + before?: (datum: any) => AnimationStyle; + }; /** - * VictoryAxis draws an SVG chart axis with React. - * Styles and data can be customized by passing in your own values as properties to the component. - * Data changes are animated with VictoryAnimation. + * Animation enter transition configuration */ - export class VictoryAxis extends React.Component {} - - export interface VictoryBarProps extends VictoryCommonProps, VictoryDatableProps, VictoryMultiLabeableProps { - /** - * The event prop take an array of event objects. Event objects are composed of - * a target, an eventKey, and eventHandlers. Targets may be any valid style namespace - * for a given component, so "data" and "labels" are all valid targets for VictoryBar events. - * The eventKey may optionally be used to select a single element by index rather than an entire - * set. The eventHandlers object should be given as an object whose keys are standard - * event names (i.e. onClick) and whose values are event callbacks. The return value - * of an event handler is used to modify elemnts. The return value should be given - * as an object or an array of objects with optional target and eventKey keys, - * and a mutation key whose value is a function. The target and eventKey keys - * will default to those corresponding to the element the event handler was attached to. - * The mutation function will be called with the calculated props for the individual selected - * element (i.e. a single bar), and the object returned from the mutation function - * will override the props of the selected element via object assignment. - * @example - * events={[ - * { - * target: "data", - * eventKey: "thisOne", - * eventHandlers: { - * onClick: () => { - * return [ - * { - * eventKey: "theOtherOne", - * mutation: (props) => { - * return {style: merge({}, props.style, {fill: "orange"})}; - * } - * }, { - * eventKey: "theOtherOne", - * target: "labels", - * mutation: () => { - * return {text: "hey"}; - * } - * } - * ]; - * } - * } - * } - * ]} - *}} - */ - events?: EventPropTypeInterface<"data" | "labels" | "parent", number | string>[]; - /** - * Similar to data accessor props `x` and `y`, this prop may be used to functionally - * assign eventKeys to data - */ - eventKey?: StringOrNumberOrCallback; - /** - * The horizontal prop determines whether the bars will be laid vertically or - * horizontally. The bars will be vertical if this prop is false or unspecified, - * or horizontal if the prop is set to true. - */ - horizontal?: boolean; - /** - * The style prop specifies styles for your VictoryBar. Any valid inline style properties - * will be applied. Height, width, and padding should be specified via the height, - * width, and padding props, as they are used to calculate the alignment of - * components within chart. In addition to normal style properties, angle and verticalAnchor - * may also be specified via the labels object, and they will be passed as props to - * VictoryLabel, or any custom labelComponent. - * @example {data: {fill: "red", width: 8}, labels: {fontSize: 12}} - */ - style?: VictoryStyleInterface; - } + onEnter?: { + duration?: number; + before?: (datum: any) => AnimationStyle; + after?: (datum: any) => AnimationStyle; + }; /** - * Draw SVG bar charts with React. VictoryBar is a composable component, so it doesn't include axes - * Check out VictoryChart for complete bar charts and more. + * Animation load transition configuration */ - export class VictoryBar extends React.Component {} - - export interface VictoryChartProps extends VictoryCommonProps { - /** - * The domain prop describes the range of values your chart will include. This prop can be - * given as a array of the minimum and maximum expected values for your chart, - * or as an object that specifies separate arrays for x and y. - * If this prop is not provided, a domain will be calculated from data, or other - * available information. - * @example: [-1, 1], {x: [0, 100], y: [0, 1]} - */ - domain?: DomainPropType; - /** - * The domainPadding prop specifies a number of pixels of padding to add to the - * beginning and end of a domain. This prop is useful for explicitly spacing ticks farther - * from the origin to prevent crowding. This prop should be given as an object with - * numbers specified for x and y. - */ - domainPadding?: DomainPaddingPropType; - /** - * The event prop take an array of event objects. Event objects are composed of - * a childName, target, eventKey, and eventHandlers. Targets may be any valid style namespace - * for a given component, (i.e. "data" and "labels"). The childName will refer to an - * individual child of VictoryChart, either by its name prop, or by index. The eventKey - * may optionally be used to select a single element by index or eventKey rather than - * an entire set. The eventHandlers object should be given as an object whose keys are standard - * event names (i.e. onClick) and whose values are event callbacks. The return value - * of an event handler is used to modify elemnts. The return value should be given - * as an object or an array of objects with optional target and eventKey and childName keys, - * and a mutation key whose value is a function. The target and eventKey and childName keys - * will default to those corresponding to the element the event handler was attached to. - * The mutation function will be called with the calculated props for the individual selected - * element (i.e. a single bar), and the object returned from the mutation function - * will override the props of the selected element via object assignment. - * @examples - * events={[ - * { - * target: "data", - * childName: "firstBar", - * eventHandlers: { - * onClick: () => { - * return [ - * { - * childName: "secondBar", - * mutation: (props) => { - * return {style: merge({}, props.style, {fill: "orange"})}; - * } - * }, { - * childName: "secondBar", - * target: "labels", - * mutation: () => { - * return {text: "hey"}; - * } - * } - * ]; - * } - * } - * } - * ]} - *}} - */ - events?: EventPropTypeInterface[]; - /** - * Similar to data accessor props `x` and `y`, this prop may be used to functionally - * assign eventKeys to data - */ - eventKey?: StringOrNumberOrCallback; - /** - * The style prop specifies styles for your chart. Any valid inline style properties - * will be applied. Height, width, and padding should be specified via the height, - * width, and padding props, as they are used to calculate the alignment of - * components within chart. - * @example {border: "1px solid #ccc", margin: "2%", maxWidth: "40%"} - */ - style?: React.CSSProperties; - } + onLoad?: { + duration?: number; + before?: (datum: any) => AnimationStyle; + after?: (datum: any) => AnimationStyle; + }; /** - * A flexible charting component for React. - * VictoryChart composes other Victory components into reusable charts. - * Acting as a coordinator rather than a stand-alone component, VictoryChart reconciles props such as domain and scale for child components, - * and provides a set of sensible defaults. This component works with: - * - VictoryAxis - * - VictoryLine - * - VictoryScatter - * - VictoryBar + * The easing prop specifies an easing function name to use for tweening. + * @default "quadInOut" */ - export class VictoryChart extends React.Component {} + easing?: AnimationEasing; + } - export interface VictoryGroupProps extends VictoryCommonProps, VictoryMultiLabeableProps { - /** - * The categories prop specifies how categorical data for a chart should be ordered. - * This prop should be given as an array of string values, or an object with - * these values for x and y. When categories are not given as an object - * When this prop is set on a wrapper component, it will dictate the categories of - * its the children. If this prop is not set, any categories on child component - * or categorical data, will be merged to create a shared set of categories. - * @example ["dogs", "cats", "mice"] - */ - categories?: CategoryPropType; - /** - * The colorScale prop is an optional prop that defines the color scale the chart's bars - * will be created on. This prop should be given as an array of CSS colors, or as a string - * corresponding to one of the built in color scales. VictoryBar will automatically assign - * values from this color scale to the bars unless colors are explicitly provided in the - * `dataAttributes` prop. - */ - colorScale?: ColorScalePropType; - /** - * The domain prop describes the range of values your chart will include. This prop can be - * given as a array of the minimum and maximum expected values for your chart, - * or as an object that specifies separate arrays for x and y. - * If this prop is not provided, a domain will be calculated from data, or other - * available information. - * @examples: [-1, 1], {x: [0, 100], y: [0, 1]} - */ - domain?: DomainPropType; - /** - * The domainPadding prop specifies a number of pixels of padding to add to the - * beginning and end of a domain. This prop is useful for explicitly spacing ticks farther - * from the origin to prevent crowding. This prop should be given as an object with - * numbers specified for x and y. - */ - domainPadding?: DomainPaddingPropType; - /** - * The event prop take an array of event objects. Event objects are composed of - * a childName, target, eventKey, and eventHandlers. Targets may be any valid style namespace - * for a given component, (i.e. "data" and "labels"). The childName will refer to an - * individual child of VictoryGroup, either by its name prop, or by index. The eventKey - * may optionally be used to select a single element by index or eventKey rather than - * an entire set. The eventHandlers object should be given as an object whose keys are standard - * event names (i.e. onClick) and whose values are event callbacks. The return value - * of an event handler is used to modify elemnts. The return value should be given - * as an object or an array of objects with optional target and eventKey and childName keys, - * and a mutation key whose value is a function. The target and eventKey and childName keys - * will default to those corresponding to the element the event handler was attached to. - * The mutation function will be called with the calculated props for the individual selected - * element (i.e. a single bar), and the object returned from the mutation function - * will override the props of the selected element via object assignment. - * @examples - * events={[ - * { - * target: "data", - * childName: "firstBar", - * eventHandlers: { - * onClick: () => { - * return [ - * { - * childName: "secondBar", - * mutation: (props) => { - * return {style: merge({}, props.style, {fill: "orange"})}; - * } - * }, { - * childName: "secondBar", - * target: "labels", - * mutation: () => { - * return {text: "hey"}; - * } - * } - * ]; - * } - * } - * } - * ]} - *}} - */ - events?: EventPropTypeInterface<"data" | "labels" | "parent", StringOrNumberOrCallback>[]; - /** - * Similar to data accessor props `x` and `y`, this prop may be used to functionally - * assign eventKeys to data - */ - eventKey?: StringOrNumberOrCallback; - /** - * The horizontal prop determines whether the bars will be laid vertically or - * horizontally. The bars will be vertical if this prop is false or unspecified, - * or horizontal if the prop is set to true. - */ - horizontal?: boolean; - /** - * The style prop specifies styles for your grouped chart. These styles will be - * applied to all grouped children - */ - style?: VictoryStyleInterface; - } - export class VictoryGroup extends React.Component {} - - export interface VictoryLineProps extends VictoryCommonProps, VictoryDatableProps, VictorySingleLabableProps { - /** - * The event prop take an array of event objects. Event objects are composed of - * a target, an eventKey, and eventHandlers. Targets may be any valid style namespace - * for a given component, so "data" and "labels" are all valid targets for VictoryLine events. - * Since VictoryLine only renders a single element, the eventKey property is not used. - * The eventHandlers object should be given as an object whose keys are standard - * event names (i.e. onClick) and whose values are event callbacks. The return value - * of an event handler is used to modify elemnts. The return value should be given - * as an object or an array of objects with optional target and eventKey keys, - * and a mutation key whose value is a function. The target and eventKey keys - * will default to those corresponding to the element the event handler was attached to. - * The mutation function will be called with the calculated props for the individual selected - * element (i.e. a line), and the object returned from the mutation function - * will override the props of the selected element via object assignment. - * @examples - * events={[ - * { - * target: "data", - * eventHandlers: { - * onClick: () => { - * return [ - * { - * mutation: (props) => { - * return {style: merge({}, props.style, {stroke: "orange"})}; - * } - * }, { - * target: "labels", - * mutation: () => { - * return {text: "hey"}; - * } - * } - * ]; - * } - * } - * } - * ]} - *}} - */ - events?: EventPropTypeInterface<"data" | "labels" | "parent", number | string>[]; - /** - * The interpolation prop determines how data points should be connected - * when plotting a line - */ - interpolation?: InterpolationPropType; - /** - * The samples prop specifies how many individual points to plot when plotting - * y as a function of x. Samples is ignored if x props are provided instead. - */ - samples?: number; - /** - * The labels prop defines the labels that will appear above each point. - * This prop should be given as an array or as a function of data. - */ - labels?: string[]|number[]|Function; - /** - * Use the sortKey prop to indicate how data should be sorted. This prop - * is given directly to the lodash sortBy function to be executed on the - * final dataset. - */ - sortKey?: string|string[]|Function; - /** - * The style prop specifies styles for your VictoryLine. Any valid inline style properties - * will be applied. Height, width, and padding should be specified via the height, - * width, and padding props, as they are used to calculate the alignment of - * components within chart. in addition to normal style properties, angle and verticalAnchor - * may also be specified via the labels object, and they will be passed as props to - * VictoryLabel, or any custom labelComponent. - * @examples{data: {stroke: "red"}, labels: {fontSize: 12}} - */ - style?: VictoryStyleInterface; - } + /** + * Return value for eventHandlers values + */ + interface EventCallbackInterface { /** - * VictoryLine creates a line based on data. VictoryLine is a composable component, so it does not include an axis. - * Check out VictoryChart for easy to use line charts and more. + * Use only in: + * - VictoryChart + * - VictoryStack */ - export class VictoryLine extends React.Component {} - - export interface VictoryLegendProps extends VictoryCommonProps, VictoryDatableProps, VictorySingleLabableProps { - /** - * The colorScale prop defines a color scale to be applied to each data - * symbol in VictoryLegend. This prop should be given as an array of CSS - * colors, or as a string corresponding to one of the built in color - * scales: "grayscale", "qualitative", "heatmap", "warm", "cool", "red", - * "green", "blue". VictoryLegend will assign a color to each symbol by - * index, unless they are explicitly specified in the data object. - * Colors will repeat when there are more symbols than colors in the - * provided colorScale. - */ - colorScale?: ColorScalePropType; - /** - * The style prop defines the style of the VictoryLegend component. - * The style prop should be given as an object with styles defined for data, labels and - * parent. Any valid svg styles are supported, but width, height, and - * padding should be specified via props as they determine relative - * layout for components in VictoryLegend. - */ - style?: VictoryStyleInterface; - /** - * The containerComponent prop takes a component instance which will be - * used to create a container element for standalone legends. The new - * element created from the passed containerComponent will be provided - * with the following props: height, width, children (the legend itself) - * and style. If a containerComponent is not provided, the default - * VictoryContainer component will be used. VictoryContainer supports - * title and desc props, which are intended to add accessibility to - * Victory components. The more descriptive these props are, the more - * accessible your data will be for people using screen readers. These - * props may be set by passing them directly to the supplied component. - * By default, VictoryContainer renders a responsive svg using the - * viewBox attribute. To render a static container, set - * responsive={false} directly on the instance of VictoryContainer - * supplied via the containerComponent prop. VictoryContainer also - * renders a Portal element that may be used in conjunction with - * VictoryPortal to force components to render above other children. - * @default - */ - containerComponent?: React.ReactElement; - /** - * Specify data via the data prop. VictoryLegend expects data as an - * array of objects with name (required), symbol, and labels properties. - * The data prop must be given as an array. - */ - data?: Array<{ - name?: string; - symbol?: { - fill?: string; - type?: string; - }; - }>; - /** - * The itemsPerRow prop determines how many items to render in each row - * of a horizontal legend, or in each column of a vertical legend. This - * prop should be given as an integer. When this prop is not given, - * legend items will be rendered in a single row or column. - */ - itemsPerRow?: number; - /** - * The dataComponent prop takes a component instance which will be - * responsible for rendering a data element used to associate a symbol - * or color with each data series. The new element created from the - * passed dataComponent will be provided with the following properties - * calculated by VictoryLegend: x, y, size, style, and symbol. Any of - * these props may be overridden by passing in props to the supplied - * component, or modified or ignored within the custom component itself. - * If a dataComponent is not provided, VictoryLegend will use its - * default Point component. - */ - dataComponent?: React.ReactElement; - /** - * The groupComponent prop takes an entire component which will be used to - * create group elements for use within container elements. This prop defaults - * to a tag on web, and a react-native-svg tag on mobile - * @default - */ - groupComponent?: React.ReactElement; - /** - * The gutter prop defines the number of pixels between legend rows or - * columns, depending on orientation. When orientation is horizontal, - * gutters are between columns. When orientation is vertical, gutters - * are the space between rows. - */ - gutter?: number; - /** - * The labelComponent prop takes a component instance which will be used - * to render each legend label. The new element created from the passed - * labelComponent will be supplied with the following properties: x, y, - * style, and text. Any of these props may be overridden by passing in - * props to the supplied component, or modified or ignored within the - * custom component itself. If labelComponent is omitted, a new - * VictoryLabel will be created with the props described above. - */ - labelComponent?: React.ReactElement; - /** - * The orientation prop takes a string that defines whether legend data - * are displayed in a row or column. When orientation is "horizontal", - * legend items will be displayed in a single row. When orientation is - * "vertical", legend items will be displayed in a single column. Line - * and text-wrapping is not currently supported, so "vertical" - * orientation is both the default setting and recommended for - * displaying many series of data. - * @default 'vertical' - */ - orientation?: 'horizontal'|'vertical'; - /** - * The padding prop specifies the amount of padding in pixels between - * the edge of the legend and any rendered child components. This prop - * can be given as a number or as an object with padding specified for - * top, bottom, left and right. As with width and height, the absolute - * padding will depend on whether the component is rendered in a - * responsive container. When a component is nested within - * VictoryLegend, setting padding on the child component will have no - * effect. - */ - padding?: number | { - top?: number; - bottom?: number; - left?: number; - right?: number; - }; - /** - * The standalone props specifies whether the component should be - * rendered in an independent element or in a tag. This prop - * defaults to true, and renders an svg. - */ - standalone?: boolean; - /** - * The symbolSpacer prop defines the number of pixels between data - * components and label components. - */ - symbolSpacer?: number; - /** - * The width and height props define the width and height of the legend. - * These props may be given as positive numbers or functions of data. If - * these props are not set, width and height will be determined based on - * an approximate text size calculated from the text and style props - * provided to VictoryLegend. - */ - width?: number; - height?: number; - /** - * The x and y props define the base position of the legend element. - */ - x?: number; - y?: number; - } + childName?: string; + target?: TTarget; + eventKey?: TEventKey; /** - * VictoryLegend renders a chart legend component. + * Will be called with the calculated props for the individual selected element and result will override + * props of selected element via object assignment + * @param props */ - export class VictoryLegend extends React.Component {} + mutation: (props: any) => any; + } - type ScatterSymbolType = "circle" | "diamond" | "plus" | "square" | "star" | "triangleDown" | "triangleUp"; - export interface VictoryScatterProps extends VictoryCommonProps, VictoryDatableProps, VictoryMultiLabeableProps { - /** - * The bubbleProperty prop indicates which property of the data object should be used - * to scale data points in a bubble chart - */ - bubbleProperty?: string; - /** - * The event prop take an array of event objects. Event objects are composed of - * a target, an eventKey, and eventHandlers. Targets may be any valid style namespace - * for a given component, so "data" and "labels" are all valid targets for VictoryScatter - * events. The eventKey may optionally be used to select a single element by index rather than - * an entire set. The eventHandlers object should be given as an object whose keys are standard - * event names (i.e. onClick) and whose values are event callbacks. The return value - * of an event handler is used to modify elemnts. The return value should be given - * as an object or an array of objects with optional target and eventKey keys, - * and a mutation key whose value is a function. The target and eventKey keys - * will default to those corresponding to the element the event handler was attached to. - * The mutation function will be called with the calculated props for the individual selected - * element (i.e. a single bar), and the object returned from the mutation function - * will override the props of the selected element via object assignment. - * @examples - * events={[ - * { - * target: "data", - * eventKey: "thisOne", - * eventHandlers: { - * onClick: () => { - * return [ - * { - * eventKey: "theOtherOne", - * mutation: (props) => { - * return {style: merge({}, props.style, {fill: "orange"})}; - * } - * }, { - * eventKey: "theOtherOne", - * target: "labels", - * mutation: () => { - * return {text: "hey"}; - * } - * } - * ]; - * } - * } - * } - * ]} - *}} - */ - events?: EventPropTypeInterface<"data" | "labels" | "parent", StringOrNumberOrCallback>[]; - /** - * Similar to data accessor props `x` and `y`, this prop may be used to functionally - * assign eventKeys to data - */ - eventKey?: StringOrNumberOrCallback; - /** - * The maxBubbleSize prop sets an upper limit for scaling data points in a bubble chart - */ - maxBubbleSize?: number; - /** - * The samples prop specifies how many individual points to plot when plotting - * y as a function of x. Samples is ignored if x props are provided instead. - */ - samples?: number; - /** - * The size prop determines how to scale each data point - */ - size?: number | { (data: any): number }; - /** - * The style prop specifies styles for your VictoryScatter. Any valid inline style properties - * will be applied. Height, width, and padding should be specified via the height, - * width, and padding props, as they are used to calculate the alignment of - * components within chart. In addition to normal style properties, angle and verticalAnchor - * may also be specified via the labels object, and they will be passed as props to - * VictoryLabel, or any custom labelComponent. - * @example {data: {fill: "red"}, labels: {fontSize: 12}} - */ - style?: VictoryStyleInterface; - /** - * The symbol prop determines which symbol should be drawn to represent data points. - */ - symbol?: ScatterSymbolType | { (data: any): ScatterSymbolType }; - } + export interface EventPropTypeInterface { /** - * VictoryScatter creates a scatter of points from data. VictoryScatter is a composable component, so it does not include an axis. - * Check out VictoryChart for easy to use scatter plots and more. + * Use only in: + * - VictoryChart + * - VictoryStack */ - export class VictoryScatter extends React.Component {} - - export interface VictoryStackProps extends VictoryCommonProps, VictoryMultiLabeableProps { - /** - * The categories prop specifies how categorical data for a chart should be ordered. - * This prop should be given as an array of string values, or an object with - * these values for x and y. When categories are not given as an object - * When this prop is set on a wrapper component, it will dictate the categories of - * its the children. If this prop is not set, any categories on child component - * or catigorical data, will be merged to create a shared set of categories. - * @example ["dogs", "cats", "mice"] - */ - categories?: CategoryPropType; - /** - * The colorScale prop is an optional prop that defines the color scale the chart's bars - * will be created on. This prop should be given as an array of CSS colors, or as a string - * corresponding to one of the built in color scales. VictoryBar will automatically assign - * values from this color scale to the bars unless colors are explicitly provided in the - * `dataAttributes` prop. - */ - colorScale?: ColorScalePropType; - /** - * The domain prop describes the range of values your chart will include. This prop can be - * given as a array of the minimum and maximum expected values for your chart, - * or as an object that specifies separate arrays for x and y. - * If this prop is not provided, a domain will be calculated from data, or other - * available information. - * @example: [-1, 1], {x: [0, 100], y: [0, 1]} - */ - domain?: DomainPropType; - /** - * The domainPadding prop specifies a number of pixels of padding to add to the - * beginning and end of a domain. This prop is useful for explicitly spacing ticks farther - * from the origin to prevent crowding. This prop should be given as an object with - * numbers specified for x and y. - */ - domainPadding?: DomainPaddingPropType; - /** - * The event prop take an array of event objects. Event objects are composed of - * a childName, target, eventKey, and eventHandlers. Targets may be any valid style namespace - * for a given component, (i.e. "data" and "labels"). The childName will refer to an - * individual child of VictoryStack, either by its name prop, or by index. The eventKey - * may optionally be used to select a single element by index or eventKey rather than - * an entire set. The eventHandlers object should be given as an object whose keys are standard - * event names (i.e. onClick) and whose values are event callbacks. The return value - * of an event handler is used to modify elemnts. The return value should be given - * as an object or an array of objects with optional target and eventKey and childName keys, - * and a mutation key whose value is a function. The target and eventKey and childName keys - * will default to those corresponding to the element the event handler was attached to. - * The mutation function will be called with the calculated props for the individual selected - * element (i.e. a single bar), and the object returned from the mutation function - * will override the props of the selected element via object assignment. - * @examples - * events={[ - * { - * target: "data", - * childName: "firstBar", - * eventHandlers: { - * onClick: () => { - * return [ - * { - * childName: "secondBar", - * mutation: (props) => { - * return {style: merge({}, props.style, {fill: "orange"})}; - * } - * }, { - * childName: "secondBar", - * target: "labels", - * mutation: () => { - * return {text: "hey"}; - * } - * } - * ]; - * } - * } - * } - * ]} - *}} - */ - events?: EventPropTypeInterface<"data" | "labels" | "parent", StringOrNumberOrCallback>[]; - /** - * Similar to data accessor props `x` and `y`, this prop may be used to functionally - * assign eventKeys to data - */ - eventKey?: StringOrNumberOrCallback; - /** - * The horizontal prop determines whether the bars will be laid vertically or - * horizontally. The bars will be vertical if this prop is false or unspecified, - * or horizontal if the prop is set to true. - */ - horizontal?: boolean; - /** - * The style prop specifies styles for your grouped chart. These styles will be - * applied to all grouped children - */ - style?: VictoryStyleInterface; - /** - * The xOffset prop is used for grouping stacks of bars. This prop will be set - * by the VictoryGroup component wrapper, or can be set manually. - */ - xOffset?: number; - } - export class VictoryStack extends React.Component {} - - export interface VictoryPieProps extends VictoryCommonProps, VictoryMultiLabeableProps { - /** - * The colorScale prop is an optional prop that defines the color scale the pie - * will be created on. This prop should be given as an array of CSS colors, or as a string - * corresponding to one of the built in color scales. VictoryPie will automatically assign - * values from this color scale to the pie slices unless colors are explicitly provided in the - * data object - */ - colorScale?: ColorScalePropType; - /** - * The data prop specifies the data to be plotted, - * where data X-value is the slice label (string or number), - * and Y-value is the corresponding number value represented by the slice - * Data should be in the form of an array of data points. - * Each data point may be any format you wish (depending on the `x` and `y` accessor props), - * but by default, an object with x and y properties is expected. - * @example [{x: 1, y: 2}, {x: 2, y: 3}], [[1, 2], [2, 3]], - * [[{x: "a", y: 1}, {x: "b", y: 2}], [{x: "a", y: 2}, {x: "b", y: 3}]] - */ - data?: any[]; - /** - * The dataComponent prop takes an entire, HTML-complete data component which will be used to - * create slices for each datum in the pie chart. The new element created from the passed - * dataComponent will have the property datum set by the pie chart for the point it renders; - * properties style and pathFunction calculated by VictoryPie; an index property set - * corresponding to the location of the datum in the data provided to the pie; events bound to - * the VictoryPie; and the d3 compatible slice object. - * If a dataComponent is not provided, VictoryPie's Slice component will be used. - */ - dataComponent?: React.ReactElement; - /** - * The labelRadius prop defines the radius of the arc that will be used for positioning each slice label. - * If this prop is not set, the label radius will default to the radius of the pie + label padding. - */ - labelRadius?: number; - /** - * The overall end angle of the pie in degrees. This prop is used in conjunction with - * startAngle to create a pie that spans only a segment of a circle. - */ - endAngle?: number; - /** - * The event prop takes an array of event objects. Event objects are composed of - * a target, an eventKey, and eventHandlers. Targets may be any valid style namespace - * for a given component, so "data" and "labels" are all valid targets for VictoryPie - * events. The eventKey may optionally be used to select a single element by index rather than - * an entire set. The eventHandlers object should be given as an object whose keys are standard - * event names (i.e. onClick) and whose values are event callbacks. The return value - * of an event handler is used to modify elemnts. The return value should be given - * as an object or an array of objects with optional target and eventKey keys, - * and a mutation key whose value is a function. The target and eventKey keys - * will default to those corresponding to the element the event handler was attached to. - * The mutation function will be called with the calculated props for the individual selected - * element (i.e. a single bar), and the object returned from the mutation function - * will override the props of the selected element via object assignment. - * @examples - * events={[ - * { - * target: "data", - * eventKey: 1, - * eventHandlers: { - * onClick: () => { - * return [ - * { - * eventKey: 2, - * mutation: (props) => { - * return {style: merge({}, props.style, {fill: "orange"})}; - * } - * }, { - * eventKey: 2, - * target: "labels", - * mutation: () => { - * return {text: "hey"}; - * } - * } - * ]; - * } - * } - * } - * ]} - *}} - */ - events?: EventPropTypeInterface<"data" | "labels" | "parent", StringOrNumberOrCallback | string[] | number[]>[]; - /** - * Similar to data accessor props `x` and `y`, this prop may be used to functionally - * assign eventKeys to data - */ - eventKey?: StringOrNumberOrCallback; - /** - * When creating a donut chart, this prop determines the number of pixels between - * the center of the chart and the inner edge of a donut. When this prop is set to zero - * a regular pie chart is rendered. - */ - innerRadius?: number; - /** - * Set the cornerRadius for every dataComponent (Slice by default) within VictoryPie - */ - cornerRadius?: number; - /** - * The padAngle prop determines the amount of separation between adjacent data slices - * in number of degrees - */ - padAngle?: number; - /** - * The overall start angle of the pie in degrees. This prop is used in conjunction with - * endAngle to create a pie that spans only a segment of a circle. - */ - startAngle?: number; - /** - * The style prop specifies styles for your pie. VictoryPie relies on Radium, - * so valid Radium style objects should work for this prop. Height, width, and - * padding should be specified via the height, width, and padding props. - * @example {data: {stroke: "black"}, label: {fontSize: 10}} - */ - style?: VictoryStyleInterface; - /** - * The x prop specifies how to access the X value of each data point. - * If given as a function, it will be run on each data point, and returned value will be used. - * If given as an integer, it will be used as an array index for array-type data points. - * If given as a string, it will be used as a property key for object-type data points. - * If given as an array of strings, or a string containing dots or brackets, - * it will be used as a nested object property path (for details see Lodash docs for _.get). - * If `null` or `undefined`, the data value will be used as is (identity function/pass-through). - * @example 0, 'x', 'x.value.nested.1.thing', 'x[2].also.nested', null, d => Math.sin(d) - */ - x?: DataGetterPropType; - /** - * The y prop specifies how to access the Y value of each data point. - * If given as a function, it will be run on each data point, and returned value will be used. - * If given as an integer, it will be used as an array index for array-type data points. - * If given as a string, it will be used as a property key for object-type data points. - * If given as an array of strings, or a string containing dots or brackets, - * it will be used as a nested object property path (for details see Lodash docs for _.get). - * If `null` or `undefined`, the data value will be used as is (identity function/pass-through). - * @example 0, 'y', 'y.value.nested.1.thing', 'y[2].also.nested', null, d => Math.sin(d) - */ - y?: DataGetterPropType; - } + childName?: string; /** - * victory-pie draws an SVG pie or donut chart with React. - * Styles and data can be customized by passing in your own values as properties to the component. - * Data changes are animated with VictoryAnimation. + * Targets may be any valid style namespace for a given component */ - export class VictoryPie extends React.Component {} + target: TTarget; + /** + * + */ + eventKey?: TEventKey; + /** + * Event handlers map. Keys are standard event names (such as onClick) and values are event callbacks + */ + eventHandlers: { + [key: string]: { + (event: React.SyntheticEvent): EventCallbackInterface } | + { (event: React.SyntheticEvent): EventCallbackInterface[] + } + }; + } + + /** + * Data domain type + */ + type DomainTuple = [number, number] | [Date, Date]; + + type DomainPropType = DomainTuple | { x?: DomainTuple; y: DomainTuple; } | { x: DomainTuple; y?: DomainTuple; }; + + /** + * Domain padding + */ + type DomainPaddingPropType = number | { + x?: number | [ number, number]; + y?: number | [ number, number]; + }; + + /** + * D3 scale function shape. Don't want to introduce typing dependency to d3 + */ + interface D3Scale { + domain: () => any; + range: () => any; + copy: () => any; + } + + /** + * Acceptable scale types + */ + type ScalePropType = "linear" | "time" | "log" | "sqrt"; + + /** + * Category prop type + */ + type CategoryPropType = string[] | { + x: string[] + y: string[] + }; + + /** + * Data getter property type + */ + type DataGetterPropType = number | string | string[] | { (data: any): number | string | string[] }; + + type InterpolationPropType = "basis" | "basisClosed" | "basisOpen" | "bundle" | + "cardinal" | "cardinalClosed" | "cardinalOpen" | + "catmullRom" | "catmullRomClosed" | "catmullRomOpen" | + "linear" | "linearClosed" | "monotoneX" | "monotoneY" | + "natural" | "radial" | "step" | "stepAfter" | "stepBefore"; + + type ColorScalePropType = "greyscale" | "qualitative" | "heatmap" | "warm" | "cool" | "red" | "green" | "blue" | string[]; + + /** + * Common properties + */ + interface VictoryCommonProps { + /** + * The animate prop specifies props for VictoryAnimation to use. + * The animate prop should also be used to specify enter and exit + * transition configurations with the `onExit` and `onEnter` namespaces respectively. + * @example + * {duration: 500, onExit: () => {}, onEnter: {duration: 500, before: () => ({y: 0})})} + */ + animate?: AnimatePropTypeInterface; + /** + * The name prop is used to reference a component instance when defining shared events. + */ + name?: string; + /** + * The height props specifies the height the svg viewBox of the chart container. + * This value should be given as a number of pixels + */ + height?: number; + /** + * The padding props specifies the amount of padding in number of pixels between + * the edge of the chart and any rendered child components. This prop can be given + * as a number or as an object with padding specified for top, bottom, left + * and right. + * @default 50 + */ + padding?: number | { + top?: number; + bottom?: number; + left?: number; + right?: number; + }; + /** + * The scale prop determines which scales your chart should use. This prop can be + * given as a string specifying a supported scale ("linear", "time", "log", "sqrt"), + * as a d3 scale function, or as an object with scales specified for x and y + * @example d3Scale.time(), {x: "linear", y: "log"} + * @default "linear" + */ + scale?: ScalePropType | D3Scale | { + x?: ScalePropType | D3Scale; + y?: ScalePropType | D3Scale; + }; + /** + * The standalone prop determines whether the component will render a standalone svg + * or a tag that will be included in an external svg. Set standalone to false to + * compose VictoryAxis with other components within an enclosing tag. + * @default true + */ + standalone?: boolean; + /** + * The width props specifies the width of the svg viewBox of the chart container + * This value should be given as a number of pixels + */ + width?: number; + /** + * The containerComponent prop takes an entire component which will be used to + * create a container element for standalone charts. + * The new element created from the passed containerComponent wil be provided with + * these props from VictoryArea: height, width, children + * (the chart itself) and style. Props that are not provided by the + * child chart component include title and desc, both of which + * are intended to add accessibility to Victory components. The more descriptive these props + * are, the more accessible your data will be for people using screen readers. + * Any of these props may be overridden by passing in props to the supplied component, + * or modified or ignored within the custom component itself. If a dataComponent is + * not provided, VictoryArea will use the default VictoryContainer component. + * @example + * @default + */ + containerComponent?: React.ReactElement; + /** + * The theme prop takes a style object with nested data, labels, and parent objects. + * You can create this object yourself, or you can use a theme provided by Victory. + * When using VictoryArea as a solo component, implement the theme directly on + * VictoryArea. If you are wrapping VictoryArea in VictoryChart, VictoryStack, or + * VictoryGroup, please call the theme on the outermost wrapper component instead. + * @example theme={VictoryTheme.material} + * http://www.github.com/FormidableLabs/victory-core/tree/master/src/victory-theme/material.js + */ + theme?: VictoryThemeDefinition; + /** + * The groupComponent prop takes an entire component which will be used to + * create group elements for use within container elements. This prop defaults + * to a tag on web, and a react-native-svg tag on mobile + * @default + */ + groupComponent?: React.ReactElement; + } + + /** + * Common properties for all data components + */ + interface VictoryDatableProps { + /** + * The categories prop specifies how categorical data for a chart should be ordered. + * This prop should be given as an array of string values, or an object with + * these arrays of values specified for x and y. If this prop is not set, + * categorical data will be plotted in the order it was given in the data array + * @example ["dogs", "cats", "mice"] + */ + categories?: CategoryPropType; + /** + * The data prop specifies the data to be plotted. Data should be in the form of an array + * of data points, or an array of arrays of data points for multiple datasets. + * Each data point may be any format you wish (depending on the `x` and `y` accessor props), + * but by default, an object with x and y properties is expected. + * @example [{x: 1, y: 2}, {x: 2, y: 3}], [[1, 2], [2, 3]], + * [[{x: "a", y: 1}, {x: "b", y: 2}], [{x: "a", y: 2}, {x: "b", y: 3}]] + */ + data?: any[]; + /** + * The dataComponent prop takes an entire component which will be used to create an area. + * The new element created from the passed dataComponent will be provided with the + * following properties calculated by VictoryArea: a scale, style, events, interpolation, + * and an array of modified data objects (including x, y, and calculated y0 and y1). + * Any of these props may be overridden by passing in props to the supplied component, + * or modified or ignored within the custom component itself. If a dataComponent is + * not provided, VictoryArea will use its default Area component. + * @default + */ + dataComponent?: React.ReactElement; + /** + * The domain prop describes the range of values your chart will cover. This prop can be + * given as a array of the minimum and maximum expected values for your bar chart, + * or as an object that specifies separate arrays for x and y. + * If this prop is not provided, a domain will be calculated from data, or other + * available information. + * @example [-1, 1], {x: [0, 100], y: [0, 1]} + */ + domain?: DomainPropType; + /** + * The x prop specifies how to access the X value of each data point. + * If given as a function, it will be run on each data point, and returned value will be used. + * If given as an integer, it will be used as an array index for array-type data points. + * If given as a string, it will be used as a property key for object-type data points. + * If given as an array of strings, or a string containing dots or brackets, + * it will be used as a nested object property path (for details see Lodash docs for _.get). + * If `null` or `undefined`, the data value will be used as is (identity function/pass-through). + * @example 0, 'x', 'x.value.nested.1.thing', 'x[2].also.nested', null, d => Math.sin(d) + * @default "x" + */ + x?: DataGetterPropType; + /** + * The y prop specifies how to access the Y value of each data point. + * If given as a function, it will be run on each data point, and returned value will be used. + * If given as an integer, it will be used as an array index for array-type data points. + * If given as a string, it will be used as a property key for object-type data points. + * If given as an array of strings, or a string containing dots or brackets, + * it will be used as a nested object property path (for details see Lodash docs for _.get). + * If `null` or `undefined`, the data value will be used as is (identity function/pass-through). + * @example 0, 'y', 'y.value.nested.1.thing', 'y[2].also.nested', null, d => Math.sin(d) + * @default "y" + */ + y?: DataGetterPropType; + } + + // Common labable interface + interface VictoryLabableProps { + /** + * The labelComponent prop takes in an entire label component which will be used + * to create a label for the area. The new element created from the passed labelComponent + * will be supplied with the following properties: x, y, index, data, verticalAnchor, + * textAnchor, angle, style, text, and events. any of these props may be overridden + * by passing in props to the supplied component, or modified or ignored within + * the custom component itself. If labelComponent is omitted, a new VictoryLabel + * will be created with props described above. This labelComponent prop should be used to + * provide a series label for VictoryArea. If individual labels are required for each + * data point, they should be created by composing VictoryArea with VictoryScatter + * @default + */ + labelComponent?: React.ReactElement; + } + + interface VictoryMultiLabeableProps extends VictoryLabableProps { + /** + * The labels prop defines labels that will appear above each bar in your chart. + * This prop should be given as an array of values or as a function of data. + * If given as an array, the number of elements in the array should be equal to + * the length of the data array. Labels may also be added directly to the data object + * like data={[{x: 1, y: 1, label: "first"}]}. + * @example ["spring", "summer", "fall", "winter"], (datum) => datum.title + */ + labels?: string[] | { (data: any): string }; + } + + interface VictorySingleLabableProps extends VictoryLabableProps { + /** + * The label prop defines the label that will appear at the edge of the area. + * This prop should be given a string or as a function of data. If individual + * labels are required for each data point, they should be created by composing + * VictoryArea with VictoryScatter + * @example: "Series 1", (data) => `${data.length} points` + */ + label?: string | { (data: any): string }; + } + + export interface VictoryAreaProps extends VictoryCommonProps, VictoryDatableProps, VictorySingleLabableProps { + /** + * The event prop take an array of event objects. Event objects are composed of + * a target, an eventKey, and eventHandlers. Targets may be any valid style namespace + * for a given component, so "data" and "labels" are all valid targets for VictoryArea events. + * Since VictoryArea only renders a single element, the eventKey property is not used. + * The eventHandlers object should be given as an object whose keys are standard + * event names (i.e. onClick) and whose values are event callbacks. The return value + * of an event handler is used to modify elemnts. The return value should be given + * as an object or an array of objects with optional target and eventKey keys, + * and a mutation key whose value is a function. The target and eventKey keys + * will default to those corresponding to the element the event handler was attached to. + * The mutation function will be called with the calculated props for the individual selected + * element (i.e. an area), and the object returned from the mutation function + * will override the props of the selected element via object assignment. + * @example + * events={[ + * { + * target: "data", + * eventHandlers: { + * onClick: () => { + * return [ + * { + * mutation: (props) => { + * return {style: merge({}, props.style, {fill: "orange"})}; + * } + * }, { + * target: "labels", + * mutation: () => { + * return {text: "hey"}; + * } + * } + * ]; + * } + * } + * } + * ]} + *}} + */ + events?: EventPropTypeInterface<"data" | "labels" | "parent", "all">[]; + /** + * The interpolation prop determines how data points should be connected when plotting a line + * @default "linear" + */ + interpolation?: InterpolationPropType; + /** + * The samples prop specifies how many individual points to plot when plotting + * y as a function of x. Samples is ignored if x props are provided instead. + * @default 50 + */ + samples?: number; + /** + * The style prop specifies styles for your VictoryArea. Any valid inline style properties + * will be applied. Height, width, and padding should be specified via the height, + * width, and padding props, as they are used to calculate the alignment of + * components within chart. + * @example {data: {fill: "red"}, labels: {fontSize: 12}} + */ + style?: VictoryStyleInterface; + } + + /** + * Draw area charts with React. VictoryArea is a composable component, so it doesn't include axes. + * Add VictoryArea as a child of VictoryChart for a complete chart. + */ + export class VictoryArea extends React.Component {} + + export interface VictoryAxisProps extends VictoryCommonProps { + /** + * The axisComponent prop takes in an entire component which will be used + * to create the axis line. The new element created from the passed axisComponent + * will be supplied with the following properties: x1, y1, x2, y2, style and events. + * Any of these props may be overridden by passing in props to the supplied component, + * or modified or ignored within the custom component itself. If an axisComponent + * is not supplied, VictoryAxis will render its default AxisLine component. + * @default + */ + axisComponent?: React.ReactElement; + /** + * The axisLabelComponent prop takes in an entire component which will be used + * to create the axis label. The new element created from the passed axisLabelComponent + * will be supplied with the following properties: x, y, verticalAnchor, textAnchor, + * angle, transform, style and events. Any of these props may be overridden by + * passing in props to the supplied component, or modified or ignored within + * the custom component itself. If an axisLabelComponent is not supplied, a new + * VictoryLabel will be created with props described above + * @default + */ + axisLabelComponent?: React.ReactElement; + /** + * This prop specifies whether a given axis is intended to cross another axis. + */ + crossAxis?: boolean; + /** + * The dependentAxis prop specifies whether the axis corresponds to the + * dependent variable (usually y). This prop is useful when composing axis + * with other components to form a chart. + */ + dependentAxis?: boolean; + /** + * The domain prop describes the range of values your axis will include. This prop should be + * given as a array of the minimum and maximum expected values for your axis. + * If this value is not given it will be calculated based on the scale or tickValues. + * @examples [-1, 1] + */ + domain?: DomainPropType; + /** + * The event prop take an array of event objects. Event objects are composed of + * a target, an eventKey, and eventHandlers. Targets may be any valid style namespace + * for a given component, so "axis", "axisLabel", "ticks", "tickLabels", and "grid" are + * all valid targets for VictoryAxis events. The eventKey may optionally be used to select a + * single element by index rather than an entire set. The eventHandlers object + * should be given as an object whose keys are standard event names (i.e. onClick) + * and whose values are event callbacks. The return value of an event handler + * be used to modify other elemnts. The return value should be given as an object or + * an array of objects with optional target and eventKey keys, and a mutation + * key whose value is a function. The target and eventKey keys will default to those + * corresponding to the element the event handler was attached to. The mutation + * function will be called with the calculated props for the individual selected + * element (i.e. a single tick), and the object returned from the mutation function + * will override the props of the selected element via object assignment. + * @examples + * events={[ + * { + * target: "grid", + * eventKey: 2, + * eventHandlers: { + * onClick: () => { + * return [ + * { + * mutation: (props) => { + * return {style: merge({}, props.style, {stroke: "orange"})}; + * } + * }, { + * target: "tickLabels", + * mutation: () => { + * return {text: "hey"}; + * } + * } + * ]; + * } + * } + * } + * ]} + *}} + */ + events?: EventPropTypeInterface<"axis" | "axisLabel" | "grid" | "ticks" | "tickLabels" | "parent", number | string>[]; + /** + * The gridComponent prop takes in an entire component which will be used + * to create grid lines. The new element created from the passed gridComponent + * will be supplied with the following properties: x1, y1, x2, y2, tick, style and events. + * Any of these props may be overridden by passing in props to the supplied component, + * or modified or ignored within the custom component itself. If a gridComponent + * is not supplied, VictoryAxis will render its default GridLine component. + * @default + */ + gridComponent?: React.ReactElement; + /** + * If true, this value will flip the domain of a given axis. + */ + invertAxis?: boolean; + /** + * The label prop defines the label that will appear along the axis. This + * prop should be given as a value or an entire, HTML-complete label + * component. If a label component is given, it will be cloned. The new + * element's properties x, y, textAnchor, verticalAnchor, and transform + * will have defaults provided by the axis; styles filled out with + * defaults provided by the axis, and overrides from the label component. + * If a value is given, a new VictoryLabel will be created with props and + * styles from the axis. + */ + label?: any; + /** + * This value describes how far from the "edge" of its permitted area each axis + * will be set back in the x-direction. If this prop is not given, + * the offset is calculated based on font size, axis orientation, and label padding. + */ + offsetX?: number; + /** + * This value describes how far from the "edge" of its permitted area each axis + * will be set back in the y-direction. If this prop is not given, + * the offset is calculated based on font size, axis orientation, and label padding. + */ + offsetY?: number; + /** + * The orientation prop specifies the position and orientation of your axis. + */ + orientation?: "top" | "bottom" | "left" | "right"; + /** + * The style prop specifies styles for your VictoryAxis. Any valid inline style properties + * will be applied. Height, width, and padding should be specified via the height, + * width, and padding props, as they are used to calculate the alignment of + * components within chart. + * @example {axis: {stroke: "#756f6a"}, grid: {stroke: "grey"}, ticks: {stroke: "grey"}, + * tickLabels: {fontSize: 10, padding: 5}, axisLabel: {fontSize: 16, padding: 20}} + */ + style?: { + parent?: React.CSSProperties; + axis?: React.CSSProperties; + axisLabel?: React.CSSProperties; + grid?: React.CSSProperties; + ticks?: React.CSSProperties; + tickLabels?: React.CSSProperties; + }; + /** + * The tickComponent prop takes in an entire component which will be used + * to create tick lines. The new element created from the passed tickComponent + * will be supplied with the following properties: x1, y1, x2, y2, tick, style and events. + * Any of these props may be overridden by passing in props to the supplied component, + * or modified or ignored within the custom component itself. If a tickComponent + * is not supplied, VictoryAxis will render its default Tick component. + * @default + */ + tickComponent?: React.ReactElement; + /** + * The tickCount prop specifies approximately how many ticks should be drawn on the axis if + * tickValues are not explicitly provided. This value is calculated by d3 scale and + * prioritizes returning "nice" values and evenly spaced ticks over an exact number of ticks. + * If you need an exact number of ticks, please specify them via the tickValues prop. + * This prop must have a value greater than zero. + * @default 5 + */ + tickCount?: number; + /** + * The tickLabelComponent prop takes in an entire component which will be used + * to create the tick labels. The new element created from the passed tickLabelComponent + * will be supplied with the following properties: x, y, verticalAnchor, textAnchor, + * angle, tick, style and events. Any of these props may be overridden by + * passing in props to the supplied component, or modified or ignored within + * the custom component itself. If an tickLabelComponent is not supplied, a new + * VictoryLabel will be created with props described above + * @default + */ + tickLabelComponent?: React.ReactElement; + /** + * The tickFormat prop specifies how tick values should be expressed visually. + * tickFormat can be given as a function to be applied to every tickValue, or as + * an array of display values for each tickValue. + * @example d3.time.format("%Y"), (x) => x.toPrecision(2), ["first", "second", "third"] + */ + tickFormat?: any[] | { (data: any): string | number }; + /** + * The tickValues prop explicitly specifies which tick values to draw on the axis. + * @example ["apples", "bananas", "oranges"], [2, 4, 6, 8] + */ + tickValues?: any[] + } + + /** + * VictoryAxis draws an SVG chart axis with React. + * Styles and data can be customized by passing in your own values as properties to the component. + * Data changes are animated with VictoryAnimation. + */ + export class VictoryAxis extends React.Component {} + + export interface VictoryBarProps extends VictoryCommonProps, VictoryDatableProps, VictoryMultiLabeableProps { + /** + * The event prop take an array of event objects. Event objects are composed of + * a target, an eventKey, and eventHandlers. Targets may be any valid style namespace + * for a given component, so "data" and "labels" are all valid targets for VictoryBar events. + * The eventKey may optionally be used to select a single element by index rather than an entire + * set. The eventHandlers object should be given as an object whose keys are standard + * event names (i.e. onClick) and whose values are event callbacks. The return value + * of an event handler is used to modify elemnts. The return value should be given + * as an object or an array of objects with optional target and eventKey keys, + * and a mutation key whose value is a function. The target and eventKey keys + * will default to those corresponding to the element the event handler was attached to. + * The mutation function will be called with the calculated props for the individual selected + * element (i.e. a single bar), and the object returned from the mutation function + * will override the props of the selected element via object assignment. + * @example + * events={[ + * { + * target: "data", + * eventKey: "thisOne", + * eventHandlers: { + * onClick: () => { + * return [ + * { + * eventKey: "theOtherOne", + * mutation: (props) => { + * return {style: merge({}, props.style, {fill: "orange"})}; + * } + * }, { + * eventKey: "theOtherOne", + * target: "labels", + * mutation: () => { + * return {text: "hey"}; + * } + * } + * ]; + * } + * } + * } + * ]} + *}} + */ + events?: EventPropTypeInterface<"data" | "labels" | "parent", number | string>[]; + /** + * Similar to data accessor props `x` and `y`, this prop may be used to functionally + * assign eventKeys to data + */ + eventKey?: StringOrNumberOrCallback; + /** + * The horizontal prop determines whether the bars will be laid vertically or + * horizontally. The bars will be vertical if this prop is false or unspecified, + * or horizontal if the prop is set to true. + */ + horizontal?: boolean; + /** + * The style prop specifies styles for your VictoryBar. Any valid inline style properties + * will be applied. Height, width, and padding should be specified via the height, + * width, and padding props, as they are used to calculate the alignment of + * components within chart. In addition to normal style properties, angle and verticalAnchor + * may also be specified via the labels object, and they will be passed as props to + * VictoryLabel, or any custom labelComponent. + * @example {data: {fill: "red", width: 8}, labels: {fontSize: 12}} + */ + style?: VictoryStyleInterface; + } + + /** + * Draw SVG bar charts with React. VictoryBar is a composable component, so it doesn't include axes + * Check out VictoryChart for complete bar charts and more. + */ + export class VictoryBar extends React.Component {} + + export interface VictoryChartProps extends VictoryCommonProps { + /** + * The domain prop describes the range of values your chart will include. This prop can be + * given as a array of the minimum and maximum expected values for your chart, + * or as an object that specifies separate arrays for x and y. + * If this prop is not provided, a domain will be calculated from data, or other + * available information. + * @example: [-1, 1], {x: [0, 100], y: [0, 1]} + */ + domain?: DomainPropType; + /** + * The domainPadding prop specifies a number of pixels of padding to add to the + * beginning and end of a domain. This prop is useful for explicitly spacing ticks farther + * from the origin to prevent crowding. This prop should be given as an object with + * numbers specified for x and y. + */ + domainPadding?: DomainPaddingPropType; + /** + * The event prop take an array of event objects. Event objects are composed of + * a childName, target, eventKey, and eventHandlers. Targets may be any valid style namespace + * for a given component, (i.e. "data" and "labels"). The childName will refer to an + * individual child of VictoryChart, either by its name prop, or by index. The eventKey + * may optionally be used to select a single element by index or eventKey rather than + * an entire set. The eventHandlers object should be given as an object whose keys are standard + * event names (i.e. onClick) and whose values are event callbacks. The return value + * of an event handler is used to modify elemnts. The return value should be given + * as an object or an array of objects with optional target and eventKey and childName keys, + * and a mutation key whose value is a function. The target and eventKey and childName keys + * will default to those corresponding to the element the event handler was attached to. + * The mutation function will be called with the calculated props for the individual selected + * element (i.e. a single bar), and the object returned from the mutation function + * will override the props of the selected element via object assignment. + * @examples + * events={[ + * { + * target: "data", + * childName: "firstBar", + * eventHandlers: { + * onClick: () => { + * return [ + * { + * childName: "secondBar", + * mutation: (props) => { + * return {style: merge({}, props.style, {fill: "orange"})}; + * } + * }, { + * childName: "secondBar", + * target: "labels", + * mutation: () => { + * return {text: "hey"}; + * } + * } + * ]; + * } + * } + * } + * ]} + *}} + */ + events?: EventPropTypeInterface[]; + /** + * Similar to data accessor props `x` and `y`, this prop may be used to functionally + * assign eventKeys to data + */ + eventKey?: StringOrNumberOrCallback; + /** + * The style prop specifies styles for your chart. Any valid inline style properties + * will be applied. Height, width, and padding should be specified via the height, + * width, and padding props, as they are used to calculate the alignment of + * components within chart. + * @example {border: "1px solid #ccc", margin: "2%", maxWidth: "40%"} + */ + style?: React.CSSProperties; + } + + /** + * A flexible charting component for React. + * VictoryChart composes other Victory components into reusable charts. + * Acting as a coordinator rather than a stand-alone component, VictoryChart reconciles props such as domain and scale for child components, + * and provides a set of sensible defaults. This component works with: + * - VictoryAxis + * - VictoryLine + * - VictoryScatter + * - VictoryBar + */ + export class VictoryChart extends React.Component {} + + export interface VictoryGroupProps extends VictoryCommonProps, VictoryMultiLabeableProps { + /** + * The categories prop specifies how categorical data for a chart should be ordered. + * This prop should be given as an array of string values, or an object with + * these values for x and y. When categories are not given as an object + * When this prop is set on a wrapper component, it will dictate the categories of + * its the children. If this prop is not set, any categories on child component + * or categorical data, will be merged to create a shared set of categories. + * @example ["dogs", "cats", "mice"] + */ + categories?: CategoryPropType; + /** + * The colorScale prop is an optional prop that defines the color scale the chart's bars + * will be created on. This prop should be given as an array of CSS colors, or as a string + * corresponding to one of the built in color scales. VictoryBar will automatically assign + * values from this color scale to the bars unless colors are explicitly provided in the + * `dataAttributes` prop. + */ + colorScale?: ColorScalePropType; + /** + * The domain prop describes the range of values your chart will include. This prop can be + * given as a array of the minimum and maximum expected values for your chart, + * or as an object that specifies separate arrays for x and y. + * If this prop is not provided, a domain will be calculated from data, or other + * available information. + * @examples: [-1, 1], {x: [0, 100], y: [0, 1]} + */ + domain?: DomainPropType; + /** + * The domainPadding prop specifies a number of pixels of padding to add to the + * beginning and end of a domain. This prop is useful for explicitly spacing ticks farther + * from the origin to prevent crowding. This prop should be given as an object with + * numbers specified for x and y. + */ + domainPadding?: DomainPaddingPropType; + /** + * The event prop take an array of event objects. Event objects are composed of + * a childName, target, eventKey, and eventHandlers. Targets may be any valid style namespace + * for a given component, (i.e. "data" and "labels"). The childName will refer to an + * individual child of VictoryGroup, either by its name prop, or by index. The eventKey + * may optionally be used to select a single element by index or eventKey rather than + * an entire set. The eventHandlers object should be given as an object whose keys are standard + * event names (i.e. onClick) and whose values are event callbacks. The return value + * of an event handler is used to modify elemnts. The return value should be given + * as an object or an array of objects with optional target and eventKey and childName keys, + * and a mutation key whose value is a function. The target and eventKey and childName keys + * will default to those corresponding to the element the event handler was attached to. + * The mutation function will be called with the calculated props for the individual selected + * element (i.e. a single bar), and the object returned from the mutation function + * will override the props of the selected element via object assignment. + * @examples + * events={[ + * { + * target: "data", + * childName: "firstBar", + * eventHandlers: { + * onClick: () => { + * return [ + * { + * childName: "secondBar", + * mutation: (props) => { + * return {style: merge({}, props.style, {fill: "orange"})}; + * } + * }, { + * childName: "secondBar", + * target: "labels", + * mutation: () => { + * return {text: "hey"}; + * } + * } + * ]; + * } + * } + * } + * ]} + *}} + */ + events?: EventPropTypeInterface<"data" | "labels" | "parent", StringOrNumberOrCallback>[]; + /** + * Similar to data accessor props `x` and `y`, this prop may be used to functionally + * assign eventKeys to data + */ + eventKey?: StringOrNumberOrCallback; + /** + * The horizontal prop determines whether the bars will be laid vertically or + * horizontally. The bars will be vertical if this prop is false or unspecified, + * or horizontal if the prop is set to true. + */ + horizontal?: boolean; + /** + * The style prop specifies styles for your grouped chart. These styles will be + * applied to all grouped children + */ + style?: VictoryStyleInterface; + } + + export class VictoryGroup extends React.Component {} + + export interface VictoryLineProps extends VictoryCommonProps, VictoryDatableProps, VictorySingleLabableProps { + /** + * The event prop take an array of event objects. Event objects are composed of + * a target, an eventKey, and eventHandlers. Targets may be any valid style namespace + * for a given component, so "data" and "labels" are all valid targets for VictoryLine events. + * Since VictoryLine only renders a single element, the eventKey property is not used. + * The eventHandlers object should be given as an object whose keys are standard + * event names (i.e. onClick) and whose values are event callbacks. The return value + * of an event handler is used to modify elemnts. The return value should be given + * as an object or an array of objects with optional target and eventKey keys, + * and a mutation key whose value is a function. The target and eventKey keys + * will default to those corresponding to the element the event handler was attached to. + * The mutation function will be called with the calculated props for the individual selected + * element (i.e. a line), and the object returned from the mutation function + * will override the props of the selected element via object assignment. + * @examples + * events={[ + * { + * target: "data", + * eventHandlers: { + * onClick: () => { + * return [ + * { + * mutation: (props) => { + * return {style: merge({}, props.style, {stroke: "orange"})}; + * } + * }, { + * target: "labels", + * mutation: () => { + * return {text: "hey"}; + * } + * } + * ]; + * } + * } + * } + * ]} + *}} + */ + events?: EventPropTypeInterface<"data" | "labels" | "parent", number | string>[]; + /** + * The interpolation prop determines how data points should be connected + * when plotting a line + */ + interpolation?: InterpolationPropType; + /** + * The samples prop specifies how many individual points to plot when plotting + * y as a function of x. Samples is ignored if x props are provided instead. + */ + samples?: number; + /** + * The labels prop defines the labels that will appear above each point. + * This prop should be given as an array or as a function of data. + */ + labels?: string[]|number[]|Function; + /** + * Use the sortKey prop to indicate how data should be sorted. This prop + * is given directly to the lodash sortBy function to be executed on the + * final dataset. + */ + sortKey?: string|string[]|Function; + /** + * The style prop specifies styles for your VictoryLine. Any valid inline style properties + * will be applied. Height, width, and padding should be specified via the height, + * width, and padding props, as they are used to calculate the alignment of + * components within chart. in addition to normal style properties, angle and verticalAnchor + * may also be specified via the labels object, and they will be passed as props to + * VictoryLabel, or any custom labelComponent. + * @examples{data: {stroke: "red"}, labels: {fontSize: 12}} + */ + style?: VictoryStyleInterface; + } + + /** + * VictoryLine creates a line based on data. VictoryLine is a composable component, so it does not include an axis. + * Check out VictoryChart for easy to use line charts and more. + */ + export class VictoryLine extends React.Component {} + + export interface VictoryLegendProps extends VictoryCommonProps, VictoryDatableProps, VictorySingleLabableProps { + /** + * The colorScale prop defines a color scale to be applied to each data + * symbol in VictoryLegend. This prop should be given as an array of CSS + * colors, or as a string corresponding to one of the built in color + * scales: "grayscale", "qualitative", "heatmap", "warm", "cool", "red", + * "green", "blue". VictoryLegend will assign a color to each symbol by + * index, unless they are explicitly specified in the data object. + * Colors will repeat when there are more symbols than colors in the + * provided colorScale. + */ + colorScale?: ColorScalePropType; + /** + * The style prop defines the style of the VictoryLegend component. + * The style prop should be given as an object with styles defined for data, labels and + * parent. Any valid svg styles are supported, but width, height, and + * padding should be specified via props as they determine relative + * layout for components in VictoryLegend. + */ + style?: VictoryStyleInterface; + /** + * The containerComponent prop takes a component instance which will be + * used to create a container element for standalone legends. The new + * element created from the passed containerComponent will be provided + * with the following props: height, width, children (the legend itself) + * and style. If a containerComponent is not provided, the default + * VictoryContainer component will be used. VictoryContainer supports + * title and desc props, which are intended to add accessibility to + * Victory components. The more descriptive these props are, the more + * accessible your data will be for people using screen readers. These + * props may be set by passing them directly to the supplied component. + * By default, VictoryContainer renders a responsive svg using the + * viewBox attribute. To render a static container, set + * responsive={false} directly on the instance of VictoryContainer + * supplied via the containerComponent prop. VictoryContainer also + * renders a Portal element that may be used in conjunction with + * VictoryPortal to force components to render above other children. + * @default + */ + containerComponent?: React.ReactElement; + /** + * Specify data via the data prop. VictoryLegend expects data as an + * array of objects with name (required), symbol, and labels properties. + * The data prop must be given as an array. + */ + data?: Array<{ + name?: string; + symbol?: { + fill?: string; + type?: string; + }; + }>; + /** + * The itemsPerRow prop determines how many items to render in each row + * of a horizontal legend, or in each column of a vertical legend. This + * prop should be given as an integer. When this prop is not given, + * legend items will be rendered in a single row or column. + */ + itemsPerRow?: number; + /** + * The dataComponent prop takes a component instance which will be + * responsible for rendering a data element used to associate a symbol + * or color with each data series. The new element created from the + * passed dataComponent will be provided with the following properties + * calculated by VictoryLegend: x, y, size, style, and symbol. Any of + * these props may be overridden by passing in props to the supplied + * component, or modified or ignored within the custom component itself. + * If a dataComponent is not provided, VictoryLegend will use its + * default Point component. + */ + dataComponent?: React.ReactElement; + /** + * The groupComponent prop takes an entire component which will be used to + * create group elements for use within container elements. This prop defaults + * to a tag on web, and a react-native-svg tag on mobile + * @default + */ + groupComponent?: React.ReactElement; + /** + * The gutter prop defines the number of pixels between legend rows or + * columns, depending on orientation. When orientation is horizontal, + * gutters are between columns. When orientation is vertical, gutters + * are the space between rows. + */ + gutter?: number; + /** + * The labelComponent prop takes a component instance which will be used + * to render each legend label. The new element created from the passed + * labelComponent will be supplied with the following properties: x, y, + * style, and text. Any of these props may be overridden by passing in + * props to the supplied component, or modified or ignored within the + * custom component itself. If labelComponent is omitted, a new + * VictoryLabel will be created with the props described above. + */ + labelComponent?: React.ReactElement; + /** + * The orientation prop takes a string that defines whether legend data + * are displayed in a row or column. When orientation is "horizontal", + * legend items will be displayed in a single row. When orientation is + * "vertical", legend items will be displayed in a single column. Line + * and text-wrapping is not currently supported, so "vertical" + * orientation is both the default setting and recommended for + * displaying many series of data. + * @default 'vertical' + */ + orientation?: 'horizontal'|'vertical'; + /** + * The padding prop specifies the amount of padding in pixels between + * the edge of the legend and any rendered child components. This prop + * can be given as a number or as an object with padding specified for + * top, bottom, left and right. As with width and height, the absolute + * padding will depend on whether the component is rendered in a + * responsive container. When a component is nested within + * VictoryLegend, setting padding on the child component will have no + * effect. + */ + padding?: number | { + top?: number; + bottom?: number; + left?: number; + right?: number; + }; + /** + * The standalone props specifies whether the component should be + * rendered in an independent element or in a tag. This prop + * defaults to true, and renders an svg. + */ + standalone?: boolean; + /** + * The symbolSpacer prop defines the number of pixels between data + * components and label components. + */ + symbolSpacer?: number; + /** + * The width and height props define the width and height of the legend. + * These props may be given as positive numbers or functions of data. If + * these props are not set, width and height will be determined based on + * an approximate text size calculated from the text and style props + * provided to VictoryLegend. + */ + width?: number; + height?: number; + /** + * The x and y props define the base position of the legend element. + */ + x?: number; + y?: number; + } + + /** + * VictoryLegend renders a chart legend component. + */ + export class VictoryLegend extends React.Component {} + + type ScatterSymbolType = "circle" | "diamond" | "plus" | "square" | "star" | "triangleDown" | "triangleUp"; + + export interface VictoryScatterProps extends VictoryCommonProps, VictoryDatableProps, VictoryMultiLabeableProps { + /** + * The bubbleProperty prop indicates which property of the data object should be used + * to scale data points in a bubble chart + */ + bubbleProperty?: string; + /** + * The event prop take an array of event objects. Event objects are composed of + * a target, an eventKey, and eventHandlers. Targets may be any valid style namespace + * for a given component, so "data" and "labels" are all valid targets for VictoryScatter + * events. The eventKey may optionally be used to select a single element by index rather than + * an entire set. The eventHandlers object should be given as an object whose keys are standard + * event names (i.e. onClick) and whose values are event callbacks. The return value + * of an event handler is used to modify elemnts. The return value should be given + * as an object or an array of objects with optional target and eventKey keys, + * and a mutation key whose value is a function. The target and eventKey keys + * will default to those corresponding to the element the event handler was attached to. + * The mutation function will be called with the calculated props for the individual selected + * element (i.e. a single bar), and the object returned from the mutation function + * will override the props of the selected element via object assignment. + * @examples + * events={[ + * { + * target: "data", + * eventKey: "thisOne", + * eventHandlers: { + * onClick: () => { + * return [ + * { + * eventKey: "theOtherOne", + * mutation: (props) => { + * return {style: merge({}, props.style, {fill: "orange"})}; + * } + * }, { + * eventKey: "theOtherOne", + * target: "labels", + * mutation: () => { + * return {text: "hey"}; + * } + * } + * ]; + * } + * } + * } + * ]} + *}} + */ + events?: EventPropTypeInterface<"data" | "labels" | "parent", StringOrNumberOrCallback>[]; + /** + * Similar to data accessor props `x` and `y`, this prop may be used to functionally + * assign eventKeys to data + */ + eventKey?: StringOrNumberOrCallback; + /** + * The maxBubbleSize prop sets an upper limit for scaling data points in a bubble chart + */ + maxBubbleSize?: number; + /** + * The samples prop specifies how many individual points to plot when plotting + * y as a function of x. Samples is ignored if x props are provided instead. + */ + samples?: number; + /** + * The size prop determines how to scale each data point + */ + size?: number | { (data: any): number }; + /** + * The style prop specifies styles for your VictoryScatter. Any valid inline style properties + * will be applied. Height, width, and padding should be specified via the height, + * width, and padding props, as they are used to calculate the alignment of + * components within chart. In addition to normal style properties, angle and verticalAnchor + * may also be specified via the labels object, and they will be passed as props to + * VictoryLabel, or any custom labelComponent. + * @example {data: {fill: "red"}, labels: {fontSize: 12}} + */ + style?: VictoryStyleInterface; + /** + * The symbol prop determines which symbol should be drawn to represent data points. + */ + symbol?: ScatterSymbolType | { (data: any): ScatterSymbolType }; + } + + /** + * VictoryScatter creates a scatter of points from data. VictoryScatter is a composable component, so it does not include an axis. + * Check out VictoryChart for easy to use scatter plots and more. + */ + export class VictoryScatter extends React.Component {} + + export interface VictoryStackProps extends VictoryCommonProps, VictoryMultiLabeableProps { + /** + * The categories prop specifies how categorical data for a chart should be ordered. + * This prop should be given as an array of string values, or an object with + * these values for x and y. When categories are not given as an object + * When this prop is set on a wrapper component, it will dictate the categories of + * its the children. If this prop is not set, any categories on child component + * or catigorical data, will be merged to create a shared set of categories. + * @example ["dogs", "cats", "mice"] + */ + categories?: CategoryPropType; + /** + * The colorScale prop is an optional prop that defines the color scale the chart's bars + * will be created on. This prop should be given as an array of CSS colors, or as a string + * corresponding to one of the built in color scales. VictoryBar will automatically assign + * values from this color scale to the bars unless colors are explicitly provided in the + * `dataAttributes` prop. + */ + colorScale?: ColorScalePropType; + /** + * The domain prop describes the range of values your chart will include. This prop can be + * given as a array of the minimum and maximum expected values for your chart, + * or as an object that specifies separate arrays for x and y. + * If this prop is not provided, a domain will be calculated from data, or other + * available information. + * @example: [-1, 1], {x: [0, 100], y: [0, 1]} + */ + domain?: DomainPropType; + /** + * The domainPadding prop specifies a number of pixels of padding to add to the + * beginning and end of a domain. This prop is useful for explicitly spacing ticks farther + * from the origin to prevent crowding. This prop should be given as an object with + * numbers specified for x and y. + */ + domainPadding?: DomainPaddingPropType; + /** + * The event prop take an array of event objects. Event objects are composed of + * a childName, target, eventKey, and eventHandlers. Targets may be any valid style namespace + * for a given component, (i.e. "data" and "labels"). The childName will refer to an + * individual child of VictoryStack, either by its name prop, or by index. The eventKey + * may optionally be used to select a single element by index or eventKey rather than + * an entire set. The eventHandlers object should be given as an object whose keys are standard + * event names (i.e. onClick) and whose values are event callbacks. The return value + * of an event handler is used to modify elemnts. The return value should be given + * as an object or an array of objects with optional target and eventKey and childName keys, + * and a mutation key whose value is a function. The target and eventKey and childName keys + * will default to those corresponding to the element the event handler was attached to. + * The mutation function will be called with the calculated props for the individual selected + * element (i.e. a single bar), and the object returned from the mutation function + * will override the props of the selected element via object assignment. + * @examples + * events={[ + * { + * target: "data", + * childName: "firstBar", + * eventHandlers: { + * onClick: () => { + * return [ + * { + * childName: "secondBar", + * mutation: (props) => { + * return {style: merge({}, props.style, {fill: "orange"})}; + * } + * }, { + * childName: "secondBar", + * target: "labels", + * mutation: () => { + * return {text: "hey"}; + * } + * } + * ]; + * } + * } + * } + * ]} + *}} + */ + events?: EventPropTypeInterface<"data" | "labels" | "parent", StringOrNumberOrCallback>[]; + /** + * Similar to data accessor props `x` and `y`, this prop may be used to functionally + * assign eventKeys to data + */ + eventKey?: StringOrNumberOrCallback; + /** + * The horizontal prop determines whether the bars will be laid vertically or + * horizontally. The bars will be vertical if this prop is false or unspecified, + * or horizontal if the prop is set to true. + */ + horizontal?: boolean; + /** + * The style prop specifies styles for your grouped chart. These styles will be + * applied to all grouped children + */ + style?: VictoryStyleInterface; + /** + * The xOffset prop is used for grouping stacks of bars. This prop will be set + * by the VictoryGroup component wrapper, or can be set manually. + */ + xOffset?: number; + } + + export class VictoryStack extends React.Component {} + + export interface VictoryPieProps extends VictoryCommonProps, VictoryMultiLabeableProps { + /** + * The colorScale prop is an optional prop that defines the color scale the pie + * will be created on. This prop should be given as an array of CSS colors, or as a string + * corresponding to one of the built in color scales. VictoryPie will automatically assign + * values from this color scale to the pie slices unless colors are explicitly provided in the + * data object + */ + colorScale?: ColorScalePropType; + /** + * The data prop specifies the data to be plotted, + * where data X-value is the slice label (string or number), + * and Y-value is the corresponding number value represented by the slice + * Data should be in the form of an array of data points. + * Each data point may be any format you wish (depending on the `x` and `y` accessor props), + * but by default, an object with x and y properties is expected. + * @example [{x: 1, y: 2}, {x: 2, y: 3}], [[1, 2], [2, 3]], + * [[{x: "a", y: 1}, {x: "b", y: 2}], [{x: "a", y: 2}, {x: "b", y: 3}]] + */ + data?: any[]; + /** + * The dataComponent prop takes an entire, HTML-complete data component which will be used to + * create slices for each datum in the pie chart. The new element created from the passed + * dataComponent will have the property datum set by the pie chart for the point it renders; + * properties style and pathFunction calculated by VictoryPie; an index property set + * corresponding to the location of the datum in the data provided to the pie; events bound to + * the VictoryPie; and the d3 compatible slice object. + * If a dataComponent is not provided, VictoryPie's Slice component will be used. + */ + dataComponent?: React.ReactElement; + /** + * The labelRadius prop defines the radius of the arc that will be used for positioning each slice label. + * If this prop is not set, the label radius will default to the radius of the pie + label padding. + */ + labelRadius?: number; + /** + * The overall end angle of the pie in degrees. This prop is used in conjunction with + * startAngle to create a pie that spans only a segment of a circle. + */ + endAngle?: number; + /** + * The event prop takes an array of event objects. Event objects are composed of + * a target, an eventKey, and eventHandlers. Targets may be any valid style namespace + * for a given component, so "data" and "labels" are all valid targets for VictoryPie + * events. The eventKey may optionally be used to select a single element by index rather than + * an entire set. The eventHandlers object should be given as an object whose keys are standard + * event names (i.e. onClick) and whose values are event callbacks. The return value + * of an event handler is used to modify elemnts. The return value should be given + * as an object or an array of objects with optional target and eventKey keys, + * and a mutation key whose value is a function. The target and eventKey keys + * will default to those corresponding to the element the event handler was attached to. + * The mutation function will be called with the calculated props for the individual selected + * element (i.e. a single bar), and the object returned from the mutation function + * will override the props of the selected element via object assignment. + * @examples + * events={[ + * { + * target: "data", + * eventKey: 1, + * eventHandlers: { + * onClick: () => { + * return [ + * { + * eventKey: 2, + * mutation: (props) => { + * return {style: merge({}, props.style, {fill: "orange"})}; + * } + * }, { + * eventKey: 2, + * target: "labels", + * mutation: () => { + * return {text: "hey"}; + * } + * } + * ]; + * } + * } + * } + * ]} + *}} + */ + events?: EventPropTypeInterface<"data" | "labels" | "parent", StringOrNumberOrCallback | string[] | number[]>[]; + /** + * Similar to data accessor props `x` and `y`, this prop may be used to functionally + * assign eventKeys to data + */ + eventKey?: StringOrNumberOrCallback; + /** + * When creating a donut chart, this prop determines the number of pixels between + * the center of the chart and the inner edge of a donut. When this prop is set to zero + * a regular pie chart is rendered. + */ + innerRadius?: number; + /** + * Set the cornerRadius for every dataComponent (Slice by default) within VictoryPie + */ + cornerRadius?: number; + /** + * The padAngle prop determines the amount of separation between adjacent data slices + * in number of degrees + */ + padAngle?: number; + /** + * The overall start angle of the pie in degrees. This prop is used in conjunction with + * endAngle to create a pie that spans only a segment of a circle. + */ + startAngle?: number; + /** + * The style prop specifies styles for your pie. VictoryPie relies on Radium, + * so valid Radium style objects should work for this prop. Height, width, and + * padding should be specified via the height, width, and padding props. + * @example {data: {stroke: "black"}, label: {fontSize: 10}} + */ + style?: VictoryStyleInterface; + /** + * The x prop specifies how to access the X value of each data point. + * If given as a function, it will be run on each data point, and returned value will be used. + * If given as an integer, it will be used as an array index for array-type data points. + * If given as a string, it will be used as a property key for object-type data points. + * If given as an array of strings, or a string containing dots or brackets, + * it will be used as a nested object property path (for details see Lodash docs for _.get). + * If `null` or `undefined`, the data value will be used as is (identity function/pass-through). + * @example 0, 'x', 'x.value.nested.1.thing', 'x[2].also.nested', null, d => Math.sin(d) + */ + x?: DataGetterPropType; + /** + * The y prop specifies how to access the Y value of each data point. + * If given as a function, it will be run on each data point, and returned value will be used. + * If given as an integer, it will be used as an array index for array-type data points. + * If given as a string, it will be used as a property key for object-type data points. + * If given as an array of strings, or a string containing dots or brackets, + * it will be used as a nested object property path (for details see Lodash docs for _.get). + * If `null` or `undefined`, the data value will be used as is (identity function/pass-through). + * @example 0, 'y', 'y.value.nested.1.thing', 'y[2].also.nested', null, d => Math.sin(d) + */ + y?: DataGetterPropType; + } + + /** + * victory-pie draws an SVG pie or donut chart with React. + * Styles and data can be customized by passing in your own values as properties to the component. + * Data changes are animated with VictoryAnimation. + */ + export class VictoryPie extends React.Component {} } diff --git a/types/video.js/index.d.ts b/types/video.js/index.d.ts index 5ba14c022d..de0c2ad543 100644 --- a/types/video.js/index.d.ts +++ b/types/video.js/index.d.ts @@ -6,6 +6,7 @@ // Christoph Wagner // Gio Freitas // Grzegorz Błaszczyk +// Stéphane Roucheray // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // The Video.js API allows you to interact with the video through @@ -19,6 +20,7 @@ export as namespace videojs; declare namespace videojs { const getComponent: typeof Component.getComponent; const registerComponent: typeof Component.registerComponent; + const getPlugin: typeof Plugin.getPlugin; interface PlayerOptions { techOrder?: string[]; @@ -53,15 +55,27 @@ declare namespace videojs { height: number; } - class Component { + class EventTarget { + addEventListener(type: string | string[], callback: (eventObject: Event) => void): void; + dispatchEvent(event: string | Event | { [key: string]: any }): void; + off(type?: string | string[], callback?: (eventObject: Event) => void): void; + on(type: string | string[], callback: (eventObject: Event) => void): void; + one(type: string | string[], callback: (eventObject: Event) => void): void; + removeEventListener(type?: string | string[], callback?: (eventObject: Event) => void): void; + trigger(event: string | Event | { [key: string]: any }): void; + } + + class Component extends EventTarget { constructor(player: Player, options: any); - static getComponent(name: 'Player'|'player'): typeof Player; - static getComponent(name: 'Component'|'component' | string): typeof Component; - static registerComponent(name: string, ComponentToRegister: typeof Component): typeof Component; + static getComponent(name: 'Player' | 'player'): Player; + static getComponent(name: 'Button' | 'button'): Button; + static getComponent(name: 'Component' | 'component' | string): Component; + static registerComponent(name: string, ComponentToRegister: Component): Component; - $(selector: string, context?: string|Element): Element; - $$(selector: string, context?: string|Element): NodeList; + $(selector: string, context?: string | Element): Element; + $$(selector: string, context?: string | Element): NodeList; + addChild(child: string | Component, optionsopt?: any, indexopt?: number): Component; addClass(classToAdd: string): void; blur(): void; cancelAnimationFrame(id: number): number; @@ -70,31 +84,28 @@ declare namespace videojs { clearTimeout(timeoutId: number): number; contentEl(): Element; createEl(tagNameopt?: string, properties?: any, attributes?: any): Element; - currentDimension(widthOrHeight: 'width'|'height'): number; + currentDimension(widthOrHeight: 'width' | 'height'): number; currentDimensions(): Dimensions; currentHeight(): number; currentWidth(): number; - dimension(widthOrHeight: 'width'|'height'): number; - dimension(widthOrHeight: 'width'|'height', num: string|number, skipListenersopt?: boolean): void; - dimensions(width: string|number, height: string|number): void; + dimension(widthOrHeight: 'width' | 'height'): number; + dimension(widthOrHeight: 'width' | 'height', num: string | number, skipListenersopt?: boolean): void; + dimensions(width: string | number, height: string | number): void; dispose(): void; el(): Element; enableTouchActivity(): void; focus(): void; - getAttribute(attribute: string): string|null; - getChild(name: string): Component|undefined; - getChildById(id: string): Component|undefined; + getAttribute(attribute: string): string | null; + getChild(name: string): Component | undefined; + getChildById(id: string): Component | undefined; hasClass(classToCheck: string): boolean; - height(): number|string; - height(num: number|string, skipListeners?: boolean): void; + height(): number | string; + height(num: number | string, skipListeners?: boolean): void; hide(): void; id(): string; initChildren(): void; localize(key: string, tokens?: string[], defaultValue?: string): string; name(): string; - off(eventName?: string, callback?: (eventObject: Event) => void): void; - on(eventName: string, callback: (eventObject: Event) => void): void; - one(eventName: string, callback: (eventObject: Event) => void): void; options(obj: any): any; player(): Player; ready(callback: (this: this) => void): this; @@ -112,6 +123,11 @@ declare namespace videojs { width(num: number, skipListeners?: number): void; } + class Button extends Component { + controlText(textopt?: string, elopt?: Element): string; + createControlTextEl(elopt: Element): Element; + } + class Player extends Component { autoplay(value?: boolean): string; addRemoteTextTrack(options: {}, manualCleanup?: boolean): HTMLTrackElement; @@ -144,6 +160,18 @@ declare namespace videojs { width(num: number): void; } + class Plugin { + static deregisterPlugin(name: string): void; + static getPlugin(name: string): Plugin; + static getPlugins(namesopt?: string[]): { [key: string]: Plugin }; + static getPluginVersion(name: string): string; + static isBasic(plugin: Plugin | (() => void)): boolean; + static registerPlugin(name: string, plugin: Plugin | (() => void)): void; + dispose(): void; + getEventHash(hashopt: any): any; + version(): string; + } + namespace dom { function appendContent(element: Element, content: any): Element; } diff --git a/types/video.js/video.js-tests.ts b/types/video.js/video.js-tests.ts index 287b804e14..68a138f433 100644 --- a/types/video.js/video.js-tests.ts +++ b/types/video.js/video.js-tests.ts @@ -14,9 +14,9 @@ videojs("example_video_1").ready(function() { this.src({ type: "video/mp4", src: "http://www.example.com/path/to/video.mp4" }); this.src([ - { type: "video/mp4", src: "http://www.example.com/path/to/video.mp4" }, - { type: "video/webm", src: "http://www.example.com/path/to/video.webm" }, - { type: "video/ogg", src: "http://www.example.com/path/to/video.ogv" } + { type: "video/mp4", src: "http://www.example.com/path/to/video.mp4" }, + { type: "video/webm", src: "http://www.example.com/path/to/video.webm" }, + { type: "video/ogg", src: "http://www.example.com/path/to/video.ogv" } ]); const whereYouAt: number = this.currentTime(); @@ -79,3 +79,20 @@ function testEvents(myPlayer: videojs.Player) { // Removes all listeners. myPlayer.off(); } + +function testComponents() { + let component = videojs.getComponent('Component'); + component = videojs.Component.getComponent('Component'); + + const button = videojs.getComponent('Button'); + button.controlText('Button Text'); + const player = videojs.getComponent('Player'); + player.play(); +} + +function testPlugin() { + let plugin = videojs.getPlugin('plugin_name'); + plugin = videojs.getPlugin('plugin_name'); + + plugin.dispose(); +} diff --git a/types/viewporter/viewporter-tests.ts b/types/viewporter/viewporter-tests.ts index 94df0749fa..59fa5cd20f 100644 --- a/types/viewporter/viewporter-tests.ts +++ b/types/viewporter/viewporter-tests.ts @@ -109,7 +109,7 @@ function test_swipey() { var canvas = $('canvas')[0]; var context = canvas.getContext('2d'); var iOS = (/iphone|ipad/i).test(navigator.userAgent); - var pointers = new Map(); + var pointers = new Map(); // handle resizing / rotating of the viewport var width, height; $(window).bind(viewporter.ACTIVE ? 'viewportchange' : 'resize', function () { diff --git a/types/virtual-dom/index.d.ts b/types/virtual-dom/index.d.ts index 813928efeb..2f0d9c6fdc 100644 --- a/types/virtual-dom/index.d.ts +++ b/types/virtual-dom/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for virtual-dom 2.0.1 +// Type definitions for virtual-dom 2.1.1 // Project: https://github.com/Matt-Esch/virtual-dom // Definitions by: Christopher Brown // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -42,13 +42,20 @@ declare namespace VirtualDOM { type: string; // 'VirtualNode' } + interface VNodeConstructor { + new (tagName: string, properties: VProperties, children: VTree[], key?: string, namespace?: string): VNode; + } + interface VText { text: string; - new(text: any): VText; version: string; type: string; // 'VirtualText' } + interface VTextConstructor { + new (text: string): VText; + } + interface Widget { type: string; // 'Widget' init(): Element; @@ -78,7 +85,6 @@ declare namespace VirtualDOM { interface VPatch { vNode: VNode; patch: any; - new(type: number, vNode: VNode, patch: any): VPatch; version: string; /** type is set to 'VirtualPatch' on the prototype, but overridden in the @@ -87,6 +93,12 @@ declare namespace VirtualDOM { type: number; } + type PatchFn = (rootNode: T, patches: VPatch[], renderOptions: VPatchOptions) => T; + + interface VPatchOptions { + patch?: PatchFn; + } + interface createProperties extends VProperties { key?: string; namespace?: string; @@ -107,7 +119,12 @@ declare namespace VirtualDOM { patch() usually just returns rootNode after doing stuff to it, so we want to preserve that type (though it will usually be just Element). */ - function patch(rootNode: T, patches: VPatch[], renderOptions?: any): T; + function patch(rootNode: T, patches: VPatch[], renderOptions?: VPatchOptions): T; + + function isVNode(vTree: VTree): vTree is VNode; + function isVText(vTree: VTree): vTree is VText; + function isWidget(vTree: VTree): vTree is Widget; + function isThunk(vTree: VTree): vTree is Thunk; } declare module "virtual-dom/h" { @@ -130,3 +147,29 @@ declare module "virtual-dom/patch" { declare module "virtual-dom" { export = VirtualDOM; } +declare module "virtual-dom/vnode/vnode" { + import VNodeConstructor = VirtualDOM.VNodeConstructor; + const VNode: VNodeConstructor; + export = VNode; +} +declare module "virtual-dom/vnode/vtext" { + import VTextConstructor = VirtualDOM.VTextConstructor; + const VText: VTextConstructor; + export = VText; +} +declare module "virtual-dom/vnode/is-vnode" { + import isVNode = VirtualDOM.isVNode; + export = isVNode; +} +declare module "virtual-dom/vnode/is-vtext" { + import isVText = VirtualDOM.isVText; + export = isVText; +} +declare module "virtual-dom/vnode/is-widget" { + import isWidget = VirtualDOM.isWidget; + export = isWidget; +} +declare module "virtual-dom/vnode/is-thunk" { + import isThunk = VirtualDOM.isThunk; + export = isThunk; +} diff --git a/types/virtual-dom/virtual-dom-tests.ts b/types/virtual-dom/virtual-dom-tests.ts index f11c7f343f..37fd28fa8f 100644 --- a/types/virtual-dom/virtual-dom-tests.ts +++ b/types/virtual-dom/virtual-dom-tests.ts @@ -1,9 +1,13 @@ - import virtual_dom = require("virtual-dom"); -import VNode = virtual_dom.VNode; +import VNode = require("virtual-dom/vnode/vnode"); +import VText = require("virtual-dom/vnode/vtext"); import h = virtual_dom.h; +import isVNode = virtual_dom.isVNode; +import isVText = virtual_dom.isVText; +import isWidget = virtual_dom.isWidget; +import isThunk = virtual_dom.isThunk; -function renderAny(object: any): VNode { +function renderAny(object: any): virtual_dom.VNode { if (object === undefined) { return h('i.undefined', 'undefined'); } @@ -31,3 +35,25 @@ function renderAny(object: any): VNode { } return h('span.string', object.toString()); } + +const newNode = new VNode("tag", {}, []); +const newText = new VText("text"); +newText.text = "new-text"; +const tree: any = newNode; + +if (isVNode(tree)) { + tree.children = []; +} else if (isVText(tree)) { + tree.text = "hello"; +} else if (isWidget(tree)) { + tree.init(); +} else if (isThunk(tree)) { + tree.vnode = newNode; +} + +virtual_dom.patch(document.createElement("div"), []); +virtual_dom.patch(document.createElement("div"), [], { + patch: (rootNode: HTMLDivElement, patches: virtual_dom.VPatch[]) => { + return rootNode; + } +}); diff --git a/types/vue2-datepicker/index.d.ts b/types/vue2-datepicker/index.d.ts new file mode 100644 index 0000000000..6dd67352fa --- /dev/null +++ b/types/vue2-datepicker/index.d.ts @@ -0,0 +1,57 @@ +// Type definitions for vue2-datepicker 2.0 +// Project: https://github.com/mengxiong10/vue2-datepicker +// Definitions by: ChristianStornowski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Component } from "vue/types/options"; + +declare namespace Datepicker { + interface Shortcuts { + text: string; + start: Date; + end: Date; + } + + interface TimePickerOptions { + start: string; + step: string; + end: string; + } + + interface Lang { + days: string[]; + months: string[]; + pickers: string[]; + placeholder: { + date: string; + dateRange: string; + }; + } +} + +declare const Datepicker: Component Date[]); + shortcuts?: boolean | Datepicker.Shortcuts[] + timePickerOptions?: Datepicker.TimePickerOptions[] | (() => Datepicker.TimePickerOptions[]); + minuteStep?: number; + firstDayOfWeek?: number; + inputClass?: string; + inputName?: string; + confirmText?: string; + rangeSeparator?: string; +}>; + +export default Datepicker; diff --git a/types/vue2-datepicker/package.json b/types/vue2-datepicker/package.json new file mode 100644 index 0000000000..faefc1b2f7 --- /dev/null +++ b/types/vue2-datepicker/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "vue": ">=2.0.0" + } +} diff --git a/types/vue2-datepicker/tsconfig.json b/types/vue2-datepicker/tsconfig.json new file mode 100644 index 0000000000..56e16426be --- /dev/null +++ b/types/vue2-datepicker/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", + "vue2-datepicker-tests.ts" + ] +} diff --git a/types/vue2-datepicker/tslint.json b/types/vue2-datepicker/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/vue2-datepicker/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/vue2-datepicker/vue2-datepicker-tests.ts b/types/vue2-datepicker/vue2-datepicker-tests.ts new file mode 100644 index 0000000000..5b1546f8a2 --- /dev/null +++ b/types/vue2-datepicker/vue2-datepicker-tests.ts @@ -0,0 +1,23 @@ +import Vue from 'vue'; +import DatePicker from "vue2-datepicker"; + +new Vue({ + el: '#app', + components: { + DatePicker + }, + template: ` + + + + + `, + data() { + return { dateOfBirth: new Date() }; + } +}); diff --git a/types/vuex-i18n/index.d.ts b/types/vuex-i18n/index.d.ts index 2332ef4436..e1f607ef39 100644 --- a/types/vuex-i18n/index.d.ts +++ b/types/vuex-i18n/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for vuex-i18n 1.7 // Project: https://github.com/dkfbasel/vuex-i18n // Definitions by: Cedric Kemp +// Noam Kfir // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -17,13 +18,16 @@ declare module "vue/types/vue" { } export interface Translations { - [key: string]: string; + [key: string]: string | Translations; } export interface Ii18n { /** get the current locale */ locale(): string; + /** get all the registered locales */ + locales(): string[]; + /** set the current locale (i.e. 'de', 'en') */ set(locale: string): void; @@ -64,12 +68,12 @@ export interface Ii18n { /** * get localized string from store in a given language if available. */ - translateIn(locale: string, key: string, options: any, pluralization?: number): string | undefined; + translateIn(locale: string, key: string, options?: any, pluralization?: number): string | undefined; /** * get localized string from store in a given language if available. */ - translateIn(locale: string, key: string, defaultValue: string, options: any, pluralization?: number): string | undefined; + translateIn(locale: string, key: string, defaultValue: string, options?: any, pluralization?: number): string | undefined; /** * check if the given locale translations are present in the store diff --git a/types/vuex-i18n/vuex-i18n-tests.ts b/types/vuex-i18n/vuex-i18n-tests.ts index 218bd12ccf..82d9d864d9 100644 --- a/types/vuex-i18n/vuex-i18n-tests.ts +++ b/types/vuex-i18n/vuex-i18n-tests.ts @@ -23,7 +23,10 @@ Vue.use(vuexI18n.plugin, store); // structured as object trees and will automatically be flattened by the the // plugin const translationsEn = { - content: "This is some {type} content" + content: "This is some {type} content", + tree: { + nested: "This is nested content" + } }; // translations can be kept in separate files for each language @@ -39,3 +42,5 @@ Vue.i18n.add("de", translationsDe); // set the start locale to use Vue.i18n.set("en"); + +Vue.i18n.translateIn("en", "tree.nested"); diff --git a/types/waterline/index.d.ts b/types/waterline/index.d.ts index a3aa7c04ee..b0a23d8e5a 100644 --- a/types/waterline/index.d.ts +++ b/types/waterline/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/balderdashy/waterline // Definitions by: Alexandro Libertino // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/webpack-dev-middleware/index.d.ts b/types/webpack-dev-middleware/index.d.ts index 6a7d1bc4b3..73175d2eab 100644 --- a/types/webpack-dev-middleware/index.d.ts +++ b/types/webpack-dev-middleware/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/webpack/webpack-dev-middleware // Definitions by: Benjamin Lim // reduckted +// Chris Abrams // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -23,7 +24,7 @@ declare namespace WebpackDevMiddleware { lazy?: boolean; watchOptions?: webpack.Options.WatchOptions; publicPath: string; - index?: string; + index?: string | boolean; headers?: { [name: string]: string; }; @@ -32,6 +33,7 @@ declare namespace WebpackDevMiddleware { serverSideRender?: boolean; logger?: Logger; filename?: string; + writeToDisk?: boolean | ((filename: string) => boolean); } interface ReporterOptions { diff --git a/types/webpack-dev-middleware/webpack-dev-middleware-tests.ts b/types/webpack-dev-middleware/webpack-dev-middleware-tests.ts index beb3c1abe6..9881ab3b9c 100644 --- a/types/webpack-dev-middleware/webpack-dev-middleware-tests.ts +++ b/types/webpack-dev-middleware/webpack-dev-middleware-tests.ts @@ -23,6 +23,7 @@ webpackDevMiddlewareInstance = webpackDevMiddleware(compiler, { }, reporter: null, serverSideRender: false, + writeToDisk: false, }); const app = express(); diff --git a/types/webpack-dev-server/index.d.ts b/types/webpack-dev-server/index.d.ts index 4dc419bd3a..dab8ae5467 100644 --- a/types/webpack-dev-server/index.d.ts +++ b/types/webpack-dev-server/index.d.ts @@ -4,76 +4,169 @@ // Dave Parslow // Zheyang Song // Alan Agius +// Artur Androsovych // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 import * as webpack from 'webpack'; -import * as core from 'express-serve-static-core'; -import * as serveStatic from 'serve-static'; -import * as http from 'http'; -import * as spdy from 'spdy'; import * as httpProxyMiddleware from 'http-proxy-middleware'; +import * as express from 'express'; +import * as serveStatic from 'serve-static'; +import * as https from 'https'; +import * as http from 'http'; declare namespace WebpackDevServer { interface ListeningApp { address(): { port?: number }; } - interface proxyConfigMap { + interface ProxyConfigMap { [url: string]: string | httpProxyMiddleware.Config; } - type proxyConfigArrayItem = { + type ProxyConfigArrayItem = { path?: string | string[]; context?: string | string[] } & httpProxyMiddleware.Config; - type proxyConfigArray = proxyConfigArrayItem[]; + type ProxyConfigArray = ProxyConfigArrayItem[]; - type expressAppHook = (app: core.Express) => void; + interface Rewrite { + from: RegExp; + to: string; + } + + interface HistoryApiFallbackConfig { + disableDotRule?: boolean; + rewrites?: Rewrite[]; + } interface Configuration { - after?: expressAppHook; + /** Provides the ability to execute custom middleware after all other middleware internally within the server. */ + after?: (app: express.Application) => void; + /** This option allows you to whitelist services that are allowed to access the dev server. */ allowedHosts?: string[]; - before?: expressAppHook; + /** Provides the ability to execute custom middleware prior to all other middleware internally within the server. */ + before?: (app: express.Application) => void; + /** This option broadcasts the server via ZeroConf networking on start. */ bonjour?: boolean; - clientLogLevel?: string; + /** + * When using inline mode, the console in your DevTools will show you messages e.g. before reloading, + * before an error or when Hot Module Replacement is enabled. This may be too verbose. + */ + clientLogLevel?: 'none' | 'error' | 'warning' | 'info'; + /** Enable gzip compression for everything served. */ compress?: boolean; - contentBase?: string; + /** + * Tell the server where to serve content from. This is only necessary if you want to serve static files. + * devServer.publicPath will be used to determine where the bundles should be served from, and takes precedence. + */ + contentBase?: boolean | string | string[]; + /** + * When set to true this option bypasses host checking. + * THIS IS NOT RECOMMENDED as apps that do not check the host are vulnerable to DNS rebinding attacks. + */ disableHostCheck?: boolean; + /** + * This option lets you reduce the compilations in lazy mode. + * By default in lazy mode, every request results in a new compilation. + * With filename, it's possible to only compile when a certain file is requested. + */ filename?: string; - headers?: {}; - historyApiFallback?: boolean | {}; - host?: string; - hot?: boolean; - hotOnly?: boolean; - https?: boolean | spdy.ServerOptions; - inline?: boolean; - lazy?: boolean; - noInfo?: boolean; - open?: boolean; - openPage?: string; - overlay?: boolean | { - warnings: boolean; - errors: boolean; + /** Adds headers to all responses. */ + headers?: { + [key: string]: string; }; + /** When using the HTML5 History API, the index.html page will likely have to be served in place of any 404 responses. */ + historyApiFallback?: boolean | HistoryApiFallbackConfig; + /** Specify a host to use. By default this is localhost. */ + host?: string; + /** Enable webpack's Hot Module Replacement feature. */ + hot?: boolean; + /** Enables Hot Module Replacement (see devServer.hot) without page refresh as fallback in case of build failures. */ + hotOnly?: boolean; + /** By default dev-server will be served over HTTP. It can optionally be served over HTTP/2 with HTTPS. */ + https?: boolean | https.ServerOptions; + /** The filename that is considered the index file. */ + index?: string; + /** + * Toggle between the dev-server's two different modes. + * By default the application will be served with inline mode enabled. + * This means that a script will be inserted in your bundle to take care of live reloading, + * and build messages will appear in the browser console. + */ + inline?: boolean; + /** + * When lazy is enabled, the dev-server will only compile the bundle when it gets requested. + * This means that webpack will not watch any file changes. + */ + lazy?: boolean; + /** + * With noInfo enabled, messages like the webpack bundle information that is shown + * when starting up and after each save,will be hidden. + * Errors and warnings will still be shown. + */ + noInfo?: boolean; + /** When open is enabled, the dev server will open the browser. */ + open?: boolean; + /** Specify a page to navigate to when opening the browser. */ + openPage?: string; + /** Shows a full-screen overlay in the browser when there are compiler errors or warnings. Disabled by default. */ + overlay?: boolean | { + warnings?: boolean; + errors?: boolean; + }; + /** When used via the CLI, a path to an SSL .pfx file. If used in options, it should be the bytestream of the .pfx file. */ pfx?: string; + /** The passphrase to a SSL PFX file. */ pfxPassphrase?: string; + /** Specify a port number to listen for requests on. */ port?: number; - proxy?: proxyConfigMap | proxyConfigArray; + /** + * Proxying some URLs can be useful when you have a separate API backend development server + * and you want to send API requests on the same domain. + */ + proxy?: ProxyConfigMap | ProxyConfigArray; + /** + * When using inline mode and you're proxying dev-server, + * the inline client script does not always know where to connect to. + * It will try to guess the URL of the server based on window.location, but if that fails you'll need to use this. + */ public?: string; + /** The bundled files will be available in the browser under this path. */ publicPath?: string; + /** + * With quiet enabled, nothing except the initial startup information will be written to the console. + * This also means that errors or warnings from webpack are not visible. + */ quiet?: boolean; - setup?: expressAppHook; // will be depreacted in v3.0.0 and replaced by before + /** @deprecated Here you can access the Express app object and add your own custom middleware to it. */ + setup?: (app: express.Application) => void; + /** The Unix socket to listen to (instead of a host). */ socket?: string; + /** It is possible to configure advanced options for serving static files from contentBase. */ staticOptions?: serveStatic.ServeStaticOptions; - stats?: webpack.compiler.StatsOptions | webpack.compiler.StatsToStringOptions; + /** + * This option lets you precisely control what bundle information gets displayed. + * This can be a nice middle ground if you want some bundle information, but not all of it. + */ + stats?: string | webpack.Stats; + /** This option lets the browser open with your local IP. */ useLocalIp?: boolean; + /** Tell the server to watch the files served by the devServer.contentBase option. File changes will trigger a full page reload. */ watchContentBase?: boolean; + /** Control options related to watching the files. */ watchOptions?: webpack.WatchOptions; } } +declare module 'webpack' { + interface Configuration { + /** Can be used to configure the behaviour of webpack-dev-server when the webpack config is passed to webpack-dev-server CLI. */ + devServer?: WebpackDevServer.Configuration; + } +} + declare class WebpackDevServer { constructor( webpack: webpack.Compiler | webpack.MultiCompiler, diff --git a/types/webpack-dev-server/webpack-dev-server-tests.ts b/types/webpack-dev-server/webpack-dev-server-tests.ts index 5a23a60ad7..a73037e74c 100644 --- a/types/webpack-dev-server/webpack-dev-server-tests.ts +++ b/types/webpack-dev-server/webpack-dev-server-tests.ts @@ -1,6 +1,6 @@ import webpack = require('webpack'); import WebpackDevServer = require('webpack-dev-server'); -import * as core from 'express-serve-static-core'; +import { Application } from 'express'; const compiler = webpack({}); const multipleCompiler = webpack([]); @@ -46,7 +46,7 @@ const config: WebpackDevServer.Configuration = { "**": "http://localhost:9090" }, - setup: (app: core.Express) => { + setup: (app: Application) => { // Here you can access the Express app object and add your own custom middleware to it. // For example, to define custom handlers for some paths: app.get('/some/path', (req, res) => { @@ -69,8 +69,7 @@ const config: WebpackDevServer.Configuration = { }, // It's a required option. publicPath: "/assets/", - headers: { "X-Custom-Header": "yes" }, - stats: { colors: true } + headers: { "X-Custom-Header": "yes" } }; // API example @@ -87,13 +86,23 @@ server.listen(8080, "localhost", () => { }); server.close(); -WebpackDevServer.addDevServerEntrypoints(config, { +const webpackConfig: webpack.Configuration = { + context: __dirname, + + mode: 'development', + + target: 'node', + + devServer: config +}; + +WebpackDevServer.addDevServerEntrypoints(webpackConfig, { publicPath: "/assets/", https: true }); WebpackDevServer.addDevServerEntrypoints( - [config], + [webpackConfig], { publicPath: "/assets/", https: true diff --git a/types/webpack-hot-middleware/index.d.ts b/types/webpack-hot-middleware/index.d.ts index ca0abd7d69..d9cfe9cb60 100644 --- a/types/webpack-hot-middleware/index.d.ts +++ b/types/webpack-hot-middleware/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for webpack-hot-middleware 2.16 // Project: https://github.com/glenjamin/webpack-hot-middleware#readme -// Definitions by: Benjamin Lim , Ron Martinez +// Definitions by: Benjamin Lim +// Ron Martinez +// Chris Abrams // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -19,6 +21,7 @@ declare namespace WebpackHotMiddleware { log?: false | Logger; path?: string; heartbeat?: number; + reload?: boolean; } type Logger = (message?: any, ...optionalParams: any[]) => void; diff --git a/types/webpack-hot-middleware/webpack-hot-middleware-tests.ts b/types/webpack-hot-middleware/webpack-hot-middleware-tests.ts index b87b379379..b28f86362f 100644 --- a/types/webpack-hot-middleware/webpack-hot-middleware-tests.ts +++ b/types/webpack-hot-middleware/webpack-hot-middleware-tests.ts @@ -10,6 +10,7 @@ webpackHotMiddlewareInstance = webpackHotMiddleware(compiler, { log: console.log.bind(console), path: '/__what', heartbeat: 2000, + reload: false, }); const app = express(); diff --git a/types/webpack-serve/index.d.ts b/types/webpack-serve/index.d.ts index cc83147ad2..48fdfcbf38 100644 --- a/types/webpack-serve/index.d.ts +++ b/types/webpack-serve/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for webpack-serve 1.0 +// Type definitions for webpack-serve 2.0 // Project: https://github.com/webpack-contrib/webpack-serve // Definitions by: Ryan Clark // Jokcy @@ -13,81 +13,107 @@ import * as webpack from 'webpack'; import * as webpackDevMiddleware from 'webpack-dev-middleware'; import * as webpackHotClient from 'webpack-hot-client'; import * as https from 'https'; - -export = WebpackServe; +import * as net from 'net'; declare module 'webpack' { - interface Configuration { - serve?: WebpackServe.Options; - } + interface Configuration { + serve?: WebpackServe.Options; + } } -declare function WebpackServe(options: WebpackServe.Options): Promise; +declare function WebpackServe(argv: object, options: WebpackServe.Options): Promise; declare namespace WebpackServe { - interface WebpackServeOpen { - /** Name of the browser to open */ - app?: string; - /** Path on the server to open */ - path?: string; - } + interface Result { + /** An instance of a Koa application, extended with a server property, and stop method, which is used to programatically stop the server */ + app: InitializedKoa; - interface WebpackServeMiddleware { - /** Function to call to add koa-static */ - content: () => koa.Middleware; - /** Function to call to add the webpack-dev-middleware */ - webpack: () => webpackDevMiddleware.WebpackDevMiddleware; - } + /** A function which binds a serve event-name to a function */ + on(type: K, callback: (args: EventMap[K]) => void): void; - interface Instance { - /** Subscriber function for events */ - on(event: 'build-started', listener: (args: { compiler: webpack.Compiler }) => void): this; - on(event: 'build-finished', listener: (args: { compiler: webpack.Compiler, stats: webpack.Stats }) => void): this; - on(event: 'compiler-error' | 'compiler-warning', listener: (args: { compiler: webpack.Compiler, stats: any }) => void): this; - on(event: 'listening', listener: (args: { server: koa, options: Options }) => void): this; + /** Access to a frozen copy of the internal options object used by the module. */ + options: InitializedOptions; + } - /** Close webpack-serve */ - close: () => void; - } + interface Options { + /** Addon to webpack-serve that allows access to the Koa server instance */ + add?: (app: InitializedKoa, middleware: Middleware, options: Options) => void; - interface ListenersObject { - 'build-started': (args: { compiler: webpack.Compiler }) => void; - 'build-finished': (args: { compiler: webpack.Compiler, stats: webpack.Stats }) => void; - 'compiler-error': (args: { compiler: webpack.Compiler, stats: any }) => void; - 'compiler-warning': (args: { compiler: webpack.Compiler, stats: any }) => void; - 'listening': (args: { server: koa, options: Options }) => void; - } + /** Custom instance of a webpack compiler */ + compiler?: webpack.Compiler; - interface Options { - /** Addon to webpack-serve that allows access to the Koa server instance */ - add?: (app: koa, middleware: WebpackServeMiddleware, options: Options) => void; - /** Copy the server URL to the clipboard when the server is started */ - clipboard?: boolean; - /** Custom instance of a webpack compiler */ - compiler?: webpack.Compiler; - /** Webpack configuration for creating a new webpack compiler instance */ - config?: webpack.Configuration; - /** A path or array of paths where content will be served from */ - content?: string | string[]; - /** Options for webpack-dev-middleware */ - dev?: webpackDevMiddleware.Options; - /** The host the server will listen on */ - host?: string; - /** Options for webpack-hot-client */ - hot?: webpackHotClient.Options | boolean; - /** Enable HTTP2 support */ - http2?: boolean; - /** Configuration object for the server to use HTTPS */ - https?: https.ServerOptions; - /** Level of information for webpack-serve to output */ - logLevel?: 'trace' | 'debug' | 'info' | 'warn' | 'error'; - /** Prepend timestamp to each log line */ - logTime?: boolean; - /** Object of subscribers to webpack-serve bus events */ - on?: ListenersObject; - /** Open the browser when started */ - open?: WebpackServeOpen | boolean; - /** Port that the server listens on */ - port?: number; - } + /** Webpack configuration for creating a new webpack compiler instance */ + config?: webpack.Configuration; + + /** A path or array of paths where content will be served from */ + content?: string | string[]; + + /** Copy the server URL to the clipboard when the server is started */ + clipboard?: boolean; + + /** Options for webpack-dev-middleware */ + devMiddleware?: webpackDevMiddleware.Options; + + /** The host the server will listen on */ + host?: string; + + /** Options for webpack-hot-client */ + hotClient?: webpackHotClient.Options | boolean; + + /** Enable HTTP2 support */ + http2?: boolean; + + /** Configuration object for the server to use HTTPS */ + https?: https.ServerOptions; + + /** Level of information for webpack-serve to output */ + logLevel?: 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'silent'; + + /** Prepend timestamp to each log line */ + logTime?: boolean; + + /** Object of subscribers to webpack-serve bus events */ + on?: OnOptions; + + /** Open the browser when started */ + open?: OpenOptions | boolean; + + /** Port that the server listens on */ + port?: number; + } + + interface OpenOptions { + /** Name of the browser to open */ + app?: string; + /** Path on the server to open */ + path?: string; + } + + type OnOptions = { [K in keyof EventMap]?: (args: EventMap[K]) => void }; + + interface InitializedKoa extends koa { + server: net.Server; + stop: () => void; + } + + interface InitializedOptions extends Options { + protocol: 'http' | 'https'; + } + + interface Middleware { + /** Function to call to add koa-static */ + content: () => void; + /** Function to call to add the webpack-dev-middleware */ + webpack: () => void; + } + + interface EventMap { + 'build-started': { compiler: webpack.Compiler }; + 'build-finished': { compiler: webpack.Compiler; stats: webpack.Stats }; + 'compiler-error': { compiler: webpack.Compiler; stats: any }; + 'compiler-warning': { compiler: webpack.Compiler; stats: any }; + listening: { server: net.Server; options: InitializedOptions }; + } } + +export = WebpackServe; diff --git a/types/webpack-serve/tsconfig.json b/types/webpack-serve/tsconfig.json index 11c218b9c9..696f2d44f5 100644 --- a/types/webpack-serve/tsconfig.json +++ b/types/webpack-serve/tsconfig.json @@ -1,23 +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", - "webpack-serve-tests.ts" - ] + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "webpack-serve-tests.ts" + ] } diff --git a/types/webpack-serve/v1/index.d.ts b/types/webpack-serve/v1/index.d.ts new file mode 100644 index 0000000000..19983e6303 --- /dev/null +++ b/types/webpack-serve/v1/index.d.ts @@ -0,0 +1,97 @@ +// Type definitions for webpack-serve 1.0 +// Project: https://github.com/webpack-contrib/webpack-serve +// Definitions by: Ryan Clark +// Jokcy +// ZSkycat +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +import * as koa from 'koa'; +import * as webpack from 'webpack'; +import * as webpackDevMiddleware from 'webpack-dev-middleware'; +import * as webpackHotClient from 'webpack-hot-client'; +import * as https from 'https'; + +export = WebpackServe; + +declare module 'webpack' { + interface Configuration { + serve?: WebpackServe.Options; + } +} + +declare function WebpackServe(options: WebpackServe.Options): Promise; + +declare namespace WebpackServe { + interface WebpackServeOpen { + /** Name of the browser to open */ + app?: string; + /** Path on the server to open */ + path?: string; + } + + interface WebpackServeMiddleware { + /** Function to call to add koa-static */ + content: () => koa.Middleware; + /** Function to call to add the webpack-dev-middleware */ + webpack: () => webpackDevMiddleware.WebpackDevMiddleware; + } + + interface Instance { + /** Subscriber function for events */ + on(event: 'build-started', listener: (args: { compiler: webpack.Compiler }) => void): this; + on(event: 'build-finished', listener: (args: { compiler: webpack.Compiler, stats: webpack.Stats }) => void): this; + on(event: 'compiler-error' | 'compiler-warning', listener: (args: { compiler: webpack.Compiler, stats: any }) => void): this; + on(event: 'listening', listener: (args: { server: koa, options: NormalisedOptions }) => void): this; + + /** Close webpack-serve */ + close: () => void; + } + + interface ListenersObject { + 'build-started': (args: { compiler: webpack.Compiler }) => void; + 'build-finished': (args: { compiler: webpack.Compiler, stats: webpack.Stats }) => void; + 'compiler-error': (args: { compiler: webpack.Compiler, stats: any }) => void; + 'compiler-warning': (args: { compiler: webpack.Compiler, stats: any }) => void; + 'listening': (args: { server: koa, options: NormalisedOptions }) => void; + } + + interface Options { + /** Addon to webpack-serve that allows access to the Koa server instance */ + add?: (app: koa, middleware: WebpackServeMiddleware, options: Options) => void; + /** Copy the server URL to the clipboard when the server is started */ + clipboard?: boolean; + /** Custom instance of a webpack compiler */ + compiler?: webpack.Compiler; + /** Webpack configuration for creating a new webpack compiler instance */ + config?: webpack.Configuration; + /** A path or array of paths where content will be served from */ + content?: string | string[]; + /** Options for webpack-dev-middleware */ + dev?: webpackDevMiddleware.Options; + /** The host the server will listen on */ + host?: string; + /** Options for webpack-hot-client */ + hot?: webpackHotClient.Options | boolean; + /** Enable HTTP2 support */ + http2?: boolean; + /** Configuration object for the server to use HTTPS */ + https?: https.ServerOptions; + /** Level of information for webpack-serve to output */ + logLevel?: 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'silent'; + /** Prepend timestamp to each log line */ + logTime?: boolean; + /** Object of subscribers to webpack-serve bus events */ + on?: ListenersObject; + /** Open the browser when started */ + open?: WebpackServeOpen | boolean; + /** Port that the server listens on */ + port?: number; + } + + interface NormalisedOptions extends Options { + protocol: 'http' | 'https'; + } +} diff --git a/types/webpack-serve/v1/tsconfig.json b/types/webpack-serve/v1/tsconfig.json new file mode 100644 index 0000000000..1a76820546 --- /dev/null +++ b/types/webpack-serve/v1/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "webpack-serve": ["webpack-serve/v1"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "webpack-serve-tests.ts" + ] +} diff --git a/types/webpack-serve/v1/tslint.json b/types/webpack-serve/v1/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/webpack-serve/v1/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/webpack-serve/v1/webpack-serve-tests.ts b/types/webpack-serve/v1/webpack-serve-tests.ts new file mode 100644 index 0000000000..c2e2cf04af --- /dev/null +++ b/types/webpack-serve/v1/webpack-serve-tests.ts @@ -0,0 +1,64 @@ +import webpack = require('webpack'); +import serve = require('webpack-serve'); + +const config: webpack.Configuration = { + mode: 'development', + entry: ['index.js'], // when use compiler entry must be array or object +}; + +const serveConfig = { + http2: true, + dev: { + publicPath: '/', + logLevel: 'info' + }, + host: 'localhost' +}; + +const compiler = webpack(config); + +const server = serve({ + compiler, + ...serveConfig +}); + +server + .then((server) => { + server.on('listening', () => { + server.close(); + }); + }); + +const config2: webpack.Configuration = { + ...config, + serve: { + ...serveConfig, + port: 8888, + hot: { + port: 8889 + } + }, +}; + +const server2 = serve({ + config: config2 +}); + +server2 + .then((server) => { + server.on('listening', () => { + server.close(); + }); + }); + +const server3 = serve({ + logLevel: 'silent', + config: config2 +}); + +server3 + .then((server) => { + server.on('listening', () => { + server.close(); + }); + }); diff --git a/types/webpack-serve/webpack-serve-tests.ts b/types/webpack-serve/webpack-serve-tests.ts index d22c1adfea..796d977450 100644 --- a/types/webpack-serve/webpack-serve-tests.ts +++ b/types/webpack-serve/webpack-serve-tests.ts @@ -1,52 +1,49 @@ import webpack = require('webpack'); import serve = require('webpack-serve'); -const config: webpack.Configuration = { - mode: 'development', - entry: ['index.js'], // when use compiler entry must be array or object +const webpackConfig: webpack.Configuration = { + entry: { index: './index.js' }, }; -const serveConfig = { - http2: true, - dev: { - publicPath: '/', - logLevel: 'info' - }, - host: 'localhost' +const webpackCompiler = webpack(webpackConfig); + +const serveConfig: serve.Options = { + add: (app, middleware, options) => { + middleware.content(); + middleware.webpack(); + }, + compiler: webpackCompiler, + config: webpackConfig, + content: './webroot', + clipboard: true, + devMiddleware: { + logLevel: 'warn', + publicPath: '/', + }, + host: 'localhost', + hotClient: { + logLevel: 'warn', + allEntries: true, + }, + http2: true, + https: {}, + logLevel: 'info', + logTime: false, + on: { + 'build-finished': args => { + console.log(args.stats.toString()); + }, + }, + open: { + path: '/index.html', + }, + port: 65080, }; -const compiler = webpack(config); +const promise = serve({}, serveConfig); -const server = serve({ - compiler, - ...serveConfig -}); - -server - .then((server) => { - server.on('listening', () => { - server.close(); +promise.then(result => { + result.on('compiler-error', args => { + console.log(args.stats); }); - }); - -const config2: webpack.Configuration = { - ...config, - serve: { - ...serveConfig, - port: 8888, - hot: { - port: 8889 - } - }, -}; - -const server2 = serve({ - config: config2 }); - -server2 - .then((server) => { - server.on('listening', () => { - server.close(); - }); - }); diff --git a/types/webpack-sources/index.d.ts b/types/webpack-sources/index.d.ts index 7eecb45c60..49ee96f8c7 100644 --- a/types/webpack-sources/index.d.ts +++ b/types/webpack-sources/index.d.ts @@ -154,7 +154,7 @@ export class ReplaceSource extends Source implements SourceAndMapMixin { _name: string; replacements: any[][]; - constructor(source: Source, name: string); + constructor(source: Source, name?: string); replace(start: number, end: number, newValue: string): void; diff --git a/types/webpack/index.d.ts b/types/webpack/index.d.ts index 597c86fa52..5831d996dd 100644 --- a/types/webpack/index.d.ts +++ b/types/webpack/index.d.ts @@ -6,13 +6,13 @@ // Tommy Troy Lin // Mohsen Azimi // Jonathan Creamer -// Ahmed T. Ali // Alan Agius // Spencer Elliott // Jason Cheatham // Dennis George // Christophe Hurpeau // ZSkycat +// John Reilly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -90,8 +90,6 @@ declare namespace webpack { watchOptions?: Options.WatchOptions; /** Switch loaders to debug mode. */ debug?: boolean; - /** Can be used to configure the behaviour of webpack-dev-server when the webpack config is passed to webpack-dev-server CLI. */ - devServer?: any; // TODO: Type this /** Include polyfills or mocks for various node stuff */ node?: Node | false; /** Set the value of require.amd and define.amd. */ @@ -949,6 +947,8 @@ declare namespace webpack { childrenCounters: any; usedChunkIds: any; usedModuleIds: any; + fileTimestamps: Map; + contextTimestamps: Map; getStats(): Stats; addModule(module: CompilationModule, cacheGroup: any): any; // tslint:disable-next-line:ban-types @@ -1019,6 +1019,26 @@ declare namespace webpack { invalidate(): void; } + interface InputFileSystem { + purge(): void; + readFile(path: string, callback: (err: Error, contents: Buffer) => void): void; + readFileSync(path: string): Buffer; + readlink(path: string, callback: (err: Error, linkString: string) => void): void; + readlinkSync(path: string): string; + stat(path: string, callback: (err: Error, stats: any) => void): void; + statSync(path: string): any; + } + + interface OutputFileSystem { + join(...paths: string[]): string; + mkdir(path: string, callback: (err: Error) => void): void; + mkdirp(path: string, callback: (err: Error) => void): void; + purge(): void; + rmdir(path: string, callback: (err: Error) => void): void; + unlink(path: string, callback: (err: Error) => void): void; + writeFile(path: string, data: any, callback: (err: Error) => void): void; + } + class Compiler extends Tapable implements ICompiler { constructor(); @@ -1027,7 +1047,10 @@ declare namespace webpack { name: string; options: Configuration; - outputFileSystem: any; + inputFileSystem: InputFileSystem; + outputFileSystem: OutputFileSystem; + fileTimestamps: Map; + contextTimestamps: Map; run(handler: Compiler.Handler): void; watch(watchOptions: Compiler.WatchOptions, handler: Compiler.Handler): Compiler.Watching; } @@ -1424,6 +1447,33 @@ declare namespace webpack { } } + class AggressiveSplittingPlugin extends Plugin { + constructor(options?: AggressiveSplittingPlugin.Options); + } + + namespace AggressiveSplittingPlugin { + interface Options { + /** + * Size in byte. + * Only chunks bigger than the specified minSize are stored in records. + * This ensures the chunks fill up as your application grows, + * instead of creating too many chunks for every change. + * + * Default: 30720 + */ + minSize: 30000; + /** + * Size in byte. + * maximum size prefered for each chunk. + * + * Default: 51200 + */ + maxSize: 50000; + chunkOverhead: 0; + entryChunkMultiplicator: 1; + } + } + /** @deprecated */ class DedupePlugin extends Plugin { constructor(); diff --git a/types/webpack/v3/index.d.ts b/types/webpack/v3/index.d.ts index c76ec6fb85..a149e285f6 100644 --- a/types/webpack/v3/index.d.ts +++ b/types/webpack/v3/index.d.ts @@ -6,7 +6,6 @@ // Tommy Troy Lin // Mohsen Azimi // Jonathan Creamer -// Ahmed T. Ali // Alan Agius // Spencer Elliott // Jason Cheatham @@ -86,8 +85,6 @@ declare namespace webpack { watchOptions?: Options.WatchOptions; /** Switch loaders to debug mode. */ debug?: boolean; - /** Can be used to configure the behaviour of webpack-dev-server when the webpack config is passed to webpack-dev-server CLI. */ - devServer?: any; // TODO: Type this /** Include polyfills or mocks for various node stuff */ node?: Node | false; /** Set the value of require.amd and define.amd. */ diff --git a/types/webpack/webpack-tests.ts b/types/webpack/webpack-tests.ts index 5a41905b8d..1e1a95fe97 100644 --- a/types/webpack/webpack-tests.ts +++ b/types/webpack/webpack-tests.ts @@ -158,11 +158,26 @@ declare const require: any; declare const path: any; configuration = { plugins: [ - function(this: webpack.Compiler) { - this.plugin("done", stats => { - require("fs").writeFileSync( + function apply(this: webpack.Compiler) { + const prevTimestamps = new Map(); + const startTime = Date.now(); + + this.hooks.emit.tap("SomePlugin", (compilation: webpack.compilation.Compilation) => { + for (const filepath in compilation.fileTimestamps.keys()) { + const prevTimestamp = prevTimestamps.get(filepath) || startTime; + const newTimestamp = compilation.fileTimestamps.get(filepath) || Infinity; + if (prevTimestamp < newTimestamp) { + this.inputFileSystem.readFileSync(filepath).toString('utf-8'); + } + } + }); + + this.hooks.afterEmit.tapAsync("afterEmit", (stats, callback) => { + this.outputFileSystem.writeFile( path.join(__dirname, "...", "stats.json"), - JSON.stringify(stats.toJson())); + JSON.stringify(stats.getStats().toJson()), + callback + ); }); } ] diff --git a/types/websocket-async/index.d.ts b/types/websocket-async/index.d.ts new file mode 100644 index 0000000000..36bb12e08e --- /dev/null +++ b/types/websocket-async/index.d.ts @@ -0,0 +1,87 @@ +// Type definitions for websocket-async 1.3 +// Project: https://github.com/jcao219/websocket-async +// Definitions by: Ben O'Sullivan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Typescript Version: 2.7 + +/** + * An asynchronous WebSocket client. + * @example + * // Set up connection. + * const webSocketClient = new WebSocketClient; + * // Connect. + * await webSocketClient.connect('ws://www.example.com/'); + * // Send is synchronous. + * webSocketClient.send('Hello!'); + * // Receive is asynchronous. + * console.log(await webSocketClient.receive()); + * // See if there are any more messages received. + * if (webSocketClient.dataAvailable !== 0) { + * console.log(await webSocketClient.receive()); + * } + * // Close the connection. + * await webSocketClient.disconnect(); + */ +declare class WebSocketClient { + _socket: WebSocket; + + _closeEvent: CloseEvent | null; + + _receiveCallbacksQueue: Array<{ resolve: (data: any) => void, reject: (reason: any) => void }>; + + _receiveDataQueue: any[]; + + constructor(); + + /** + * Whether a connection is currently open. + * @returns true if the connection is open. + */ + connected(): boolean; + + /** + * The number of messages available to receive. + * @returns The number of queued messages that can be retrieved with {@link #receive} + */ + dataAvailable(): number; + + /** + * Sets up a WebSocket connection to specified url. Resolves when the + * connection is established. Can be called again to reconnect to any url. + */ + connect(url: string, protocols?: string): Promise; + + /** + * Send data through the websocket. + * Must be connected. See {@link #connected}. + */ + send(data: any): void; + + /** + * Asynchronously receive data from the websocket. + * Resolves immediately if there is buffered, unreceived data. + * Otherwise, resolves with the next rececived message, + * or rejects if disconnected. + * @returns A promise that resolves with the data received. + */ + receive(): Promise; + + /** + * Initiates the close handshake if there is an active connection. + * Returns a promise that will never reject. + * The promise resolves once the WebSocket connection is closed. + */ + disconnect(code?: number, reason?: string): Promise; + + /** + * Sets up the event listeners, which do the bulk of the work. + */ + private _setupListenersOnConnect(): Promise; + + /** + * Resets the receive arrays and close events, called in the constructor + */ + private _reset(): void; +} + +export default WebSocketClient; diff --git a/types/websocket-async/tsconfig.json b/types/websocket-async/tsconfig.json new file mode 100644 index 0000000000..78b5de7ea6 --- /dev/null +++ b/types/websocket-async/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5", + "es2015.promise", + "webworker" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "websocket-async-tests.ts" + ] +} diff --git a/types/websocket-async/tslint.json b/types/websocket-async/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/websocket-async/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/websocket-async/websocket-async-tests.ts b/types/websocket-async/websocket-async-tests.ts new file mode 100644 index 0000000000..f32192be95 --- /dev/null +++ b/types/websocket-async/websocket-async-tests.ts @@ -0,0 +1,4 @@ +import WebSocketClient from 'websocket-async'; + +const connection = new WebSocketClient(); +connection.connect(''); diff --git a/types/wepy/app.d.ts b/types/wepy/app.d.ts index 9389b0400f..17274c83b1 100644 --- a/types/wepy/app.d.ts +++ b/types/wepy/app.d.ts @@ -1,3 +1,5 @@ +import { PageConfig } from "./page"; + export interface AppConfig { appEvents?: string[]; pageEvents?: string[]; @@ -11,16 +13,9 @@ export interface AppConstructor { /* the supported add-ons */ export type AddOn = "requestfix" | "promisify"; -export interface WindowConfig { - backgroundTextStyle: string; - navigationBarBackgroundColor: string; - navigationBarTitleText: string; - navigationBarTextStyle: string; -} - export default class app { config: { - window: WindowConfig; + window: PageConfig; pages: string[]; }; $init(wepy: any, config: AppConfig): void; diff --git a/types/wepy/page.d.ts b/types/wepy/page.d.ts index 7655621106..d369802715 100644 --- a/types/wepy/page.d.ts +++ b/types/wepy/page.d.ts @@ -8,8 +8,20 @@ export interface PageConstructor { new (): page; } +export interface PageConfig { + navigationBarBackgroundColor?: string; + navigationBarTextStyle?: string; + navigationBarTitleText?: string; + backgroundColor?: string; + backgroundTextStyle?: string; + enablePullDownRefresh?: boolean; + disableScroll?: boolean; + onReachBottomDistance?: number; +} + export default class page extends component { - $preloadData: { [key: string]: any }; + config?: PageConfig; + $preloadData?: { [key: string]: any }; $init(wxpage: any, $parent: any): any; $route( type: "redirectTo" | "navigateTo", diff --git a/types/wepy/wepy-tests.ts b/types/wepy/wepy-tests.ts index d9794f6e8b..c0fb4b3d89 100644 --- a/types/wepy/wepy-tests.ts +++ b/types/wepy/wepy-tests.ts @@ -17,10 +17,21 @@ export class MyComponent extends wepy.component { titleClassName: "" }; + config = {}; + methods = {}; - onLoad() { + async onLoad() { super.onLoad(); + await wepy.request("http://www.weixin.com"); + const a = await wepy.request({ + url: "www.weixin.com", + data: { a: 1, b: 2 }, + header: { + "content-type": "application/json" + }, + method: "POST" + }); } } diff --git a/types/wepy/wx_enhanced.d.ts b/types/wepy/wx_enhanced.d.ts index d5e66dea34..5769c4f718 100644 --- a/types/wepy/wx_enhanced.d.ts +++ b/types/wepy/wx_enhanced.d.ts @@ -114,6 +114,22 @@ export interface UrlParam { url: string; } +export interface RequestParam extends UrlParam { + data?: object | string | ArrayBuffer; + header?: object; + method?: + | "GET" + | "OPTIONS" + | "HEAD" + | "POST" + | "PUT" + | "DELETE" + | "TRACE" + | "CONNECT"; + dataType?: "json" | "text"; + responseType?: "text" | "arraybuffer"; +} + export interface FilePathParam { filePath: string; } @@ -332,7 +348,7 @@ export interface WxEnhances { removeStorage(params: { key: string }): Promise; - request(params: UrlParam): Promise; + request(params: RequestParam | string): Promise; requestPayment(params: { timeStamp: string; diff --git a/types/winston-dynamodb/package.json b/types/winston-dynamodb/package.json new file mode 100644 index 0000000000..33e1a4f018 --- /dev/null +++ b/types/winston-dynamodb/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "@types/winston": "^2.3.9" + } +} diff --git a/types/winston-mail/index.d.ts b/types/winston-mail/index.d.ts new file mode 100644 index 0000000000..3faaffee29 --- /dev/null +++ b/types/winston-mail/index.d.ts @@ -0,0 +1,53 @@ +// Type definitions for winston-mail 1.5 +// Project: https://github.com/wavded/winston-mail#readme +// Definitions by: Sorin Sandru +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as winston from "winston"; + +export as namespace winstonMail; + +export class Mail extends winston.Transport + implements winston.TransportInstance { + constructor(options: MailTransportOptions); + name: string; + to: string; + from: string; + level: string; + unique: boolean; + silent: boolean; + filter: ((obj: { level: string; message: string; meta: any }) => boolean); + subject: string; + html: boolean; + log(level: any, msg: any, meta: any, callback: any): any; +} + +export interface MailTransportOptions { + name?: string; + to: string; + from?: string; + level?: string; + silent?: boolean; + handleExceptions?: boolean; + host?: string; + port?: number; + username?: string; + password?: string; + subject?: string; + ssl?: boolean | { key: string; ca: string; cert: string }; + tls?: boolean | { ciphers: string }; + unique?: boolean; + filter?: ((obj: { level: string; message: string; meta: any }) => boolean); + html?: boolean; + timeout?: number; + authentication?: string[]; + formatter?: (( + obj: { level: string; message: string; meta: any } + ) => string); +} + +declare module "winston" { + interface Transports { + Mail: winstonMail.Mail; + } +} diff --git a/types/winston-mail/package.json b/types/winston-mail/package.json new file mode 100644 index 0000000000..33e1a4f018 --- /dev/null +++ b/types/winston-mail/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "@types/winston": "^2.3.9" + } +} diff --git a/types/winston-mail/tsconfig.json b/types/winston-mail/tsconfig.json new file mode 100644 index 0000000000..89b4c0a16e --- /dev/null +++ b/types/winston-mail/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "strictFunctionTypes": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "winston-mail-tests.ts"] +} diff --git a/types/winston-mail/tslint.json b/types/winston-mail/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/winston-mail/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/winston-mail/winston-mail-tests.ts b/types/winston-mail/winston-mail-tests.ts new file mode 100644 index 0000000000..0a647378df --- /dev/null +++ b/types/winston-mail/winston-mail-tests.ts @@ -0,0 +1,53 @@ +import winstonMail = require("winston-mail"); +import winston = require("winston"); +import { Transform } from "stream"; + +let mail: winstonMail.Mail = new winstonMail.Mail({ to: "test" }); + +winston.add(mail); + +// $ExpectError +mail = new winstonMail.Mail({}); + +let mailOptions: winstonMail.MailTransportOptions = { + name: "test", + to: "test", + from: "test", + level: "test", + silent: true, + handleExceptions: true, + host: "test", + port: 10202, + username: "test", + password: "test", + subject: "test", + ssl: false, + tls: false, + unique: false, + filter: (obj: { level: string; message: string; meta: any }): boolean => { + return false; + }, + html: true, + timeout: 5000, + authentication: ["test"], + formatter: (obj: { level: string; message: string; meta: any }): string => { + return "test"; + } +}; + +mailOptions = { + to: "test", + ssl: { key: "test", ca: "test", cert: "test" }, + tls: { ciphers: "test" } +}; + +mail = new winstonMail.Mail(mailOptions); + +mailOptions = { + test: "test" // $ExpectError +}; + +let transport: winston.TransportInstance = new winstonMail.Mail({ to: "test" }); +transport = winston.transports.Console; + +mail.log("test", "test", "test", "test"); diff --git a/types/winston-syslog/package.json b/types/winston-syslog/package.json new file mode 100644 index 0000000000..33e1a4f018 --- /dev/null +++ b/types/winston-syslog/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "@types/winston": "^2.3.9" + } +} diff --git a/types/winston/index.d.ts b/types/winston/index.d.ts deleted file mode 100644 index dd6ab0e1aa..0000000000 --- a/types/winston/index.d.ts +++ /dev/null @@ -1,506 +0,0 @@ -// Type definitions for winston 2.3 -// Project: https://github.com/flatiron/winston -// Definitions by: bonnici , Peter Harris , DABH -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// Imported from: https://github.com/soywiz/typescript-node-definitions/winston.d.ts - -/// - -import { Agent } from 'http'; - -declare namespace winston { - interface AbstractConfigSetLevels { - [key: string]: number; - } - - interface AbstractConfigSetColors { - [key: string]: string | string[]; - } - - interface AbstractConfigSet { - levels: AbstractConfigSetLevels; - colors: AbstractConfigSetColors; - } - - interface CliConfigSetLevels extends AbstractConfigSetLevels { - error: number; - warn: number; - help: number; - data: number; - info: number; - debug: number; - prompt: number; - verbose: number; - input: number; - silly: number; - } - - interface CliConfigSetColors extends AbstractConfigSetColors { - error: string | string[]; - warn: string | string[]; - help: string | string[]; - data: string | string[]; - info: string | string[]; - debug: string | string[]; - prompt: string | string[]; - verbose: string | string[]; - input: string | string[]; - silly: string | string[]; - } - interface NpmConfigSetLevels extends AbstractConfigSetLevels { - error: number; - warn: number; - info: number; - verbose: number; - debug: number; - silly: number; - } - interface NpmConfigSetColors extends AbstractConfigSetColors { - error: string | string[]; - warn: string | string[]; - info: string | string[]; - verbose: string | string[]; - debug: string | string[]; - silly: string | string[]; - } - interface SyslogConfigSetLevels extends AbstractConfigSetLevels { - emerg: number; - alert: number; - crit: number; - error: number; - warning: number; - notice: number; - info: number; - debug: number; - } - interface SyslogConfigSetColors extends AbstractConfigSetColors { - emerg: string | string[]; - alert: string | string[]; - crit: string | string[]; - error: string | string[]; - warning: string | string[]; - notice: string | string[]; - info: string | string[]; - debug: string | string[]; - } - - interface Winston { - config: Config; - transports: Transports; - Transport: TransportStatic; - Logger: LoggerStatic; - Container: ContainerStatic; - loggers: ContainerInstance; - default: LoggerInstance; - - exception: Exception; - - exitOnError: boolean; - level: string; - - log: LogMethod; - - silly: LeveledLogMethod; - debug: LeveledLogMethod; - verbose: LeveledLogMethod; - info: LeveledLogMethod; - warn: LeveledLogMethod; - error: LeveledLogMethod; - - query(options: QueryOptions, callback?: (err: Error, results: any) => void): any; - query(callback: (err: Error, results: any) => void): any; - stream(options?: any): NodeJS.ReadableStream; - handleExceptions(...transports: TransportInstance[]): void; - unhandleExceptions(...transports: TransportInstance[]): void; - add(transport: TransportInstance, options?: TransportOptions, created?: boolean): LoggerInstance; - clear(): void; - remove(transport: string | TransportInstance): LoggerInstance; - startTimer(): ProfileHandler; - profile(id: string, msg?: string, meta?: any, callback?: (err: Error, level: string, msg: string, meta: any) => void): LoggerInstance; - addColors(target: AbstractConfigSetColors): any; - setLevels(target: AbstractConfigSetLevels): any; - cli(): LoggerInstance; - close(): void; - configure(options: LoggerOptions): void; - } - - type CLILoggingLevel = 'error' | 'warn' | 'help' | 'data' | 'info' | 'debug' | 'prompt' | 'verbose' | 'input' | 'silly'; - type NPMLoggingLevel = 'error' | 'warn' | 'info' | 'verbose' | 'debug' | 'silly'; - type SyslogLoggingLevel = 'emerg' | 'alert' | 'crit' | 'error' | 'warning' | 'notice' | 'info' | 'debug'; - - interface Config { - allColors: AbstractConfigSetColors; - cli: {levels: CliConfigSetLevels, colors: CliConfigSetColors}; - npm: {levels: NpmConfigSetLevels, colors: NpmConfigSetColors}; - syslog: {levels: SyslogConfigSetLevels, colors: SyslogConfigSetColors}; - - addColors(colors: AbstractConfigSetColors): void; - colorize(level: number, message?: string): string; - } - - interface ExceptionProcessInfo { - pid: number; - uid?: number; - gid?: number; - cwd: string; - execPath: string; - version: string; - argv: string; - memoryUsage: NodeJS.MemoryUsage; - } - - interface ExceptionOsInfo { - loadavg: [number, number, number]; - uptime: number; - } - - interface ExceptionTrace { - column: number; - file: string; - "function": string; - line: number; - method: string; - native: boolean; - } - - interface ExceptionAllInfo { - date: Date; - process: ExceptionProcessInfo; - os: ExceptionOsInfo; - trace: ExceptionTrace[]; - stack: string[]; - } - - interface Exception { - getAllInfo(err: Error): ExceptionAllInfo; - getProcessInfo(): ExceptionProcessInfo; - getOsInfo(): ExceptionOsInfo; - getTrace(err: Error): ExceptionTrace[]; - } - - type MetadataRewriter = (level: string, msg: string, meta: any) => any; - - type MetadataFilter = (level: string, msg: string, meta: any) => string | { msg: any; meta: any; }; - - interface LoggerStatic { - new (options?: LoggerOptions): LoggerInstance; - } - - interface LoggerInstance extends NodeJS.EventEmitter { - rewriters: MetadataRewriter[]; - filters: MetadataFilter[]; - transports: {[key: string]: TransportInstance}; - - extend(target: any): LoggerInstance; - - log: LogMethod; - - // for cli levels - error: LeveledLogMethod; - warn: LeveledLogMethod; - help: LeveledLogMethod; - data: LeveledLogMethod; - info: LeveledLogMethod; - debug: LeveledLogMethod; - prompt: LeveledLogMethod; - verbose: LeveledLogMethod; - input: LeveledLogMethod; - silly: LeveledLogMethod; - - // for syslog levels only - emerg: LeveledLogMethod; - alert: LeveledLogMethod; - crit: LeveledLogMethod; - warning: LeveledLogMethod; - notice: LeveledLogMethod; - - query(options: QueryOptions, callback?: (err: Error, results: any) => void): any; - query(callback: (err: Error, results: any) => void): any; - stream(options?: any): NodeJS.ReadableStream; - close(): void; - handleExceptions(...transports: TransportInstance[]): void; - unhandleExceptions(...transports: TransportInstance[]): void; - add(transport: TransportInstance, options?: TransportOptions, created?: boolean): LoggerInstance; - clear(): void; - remove(transport: string | TransportInstance): LoggerInstance; - startTimer(): ProfileHandler; - profile(id: string, msg?: string, meta?: any, callback?: (err: Error, level: string, msg: string, meta: any) => void): LoggerInstance; - configure(options: LoggerOptions): void; - setLevels(target: AbstractConfigSetLevels): any; - cli(): LoggerInstance; - - level: string; - } - - interface LoggerOptions { - transports?: TransportInstance[]; - rewriters?: MetadataRewriter[]; - filters?: MetadataFilter[]; - exceptionHandlers?: TransportInstance[]; - handleExceptions?: boolean; - level?: string; - levels?: AbstractConfigSetLevels; - - exitOnError?: boolean | ((err: Error) => void); - - // TODO: Need to make instances specific, - // and need to get options for each instance. - // Unfortunately, the documentation is unhelpful. - [optionName: string]: any; - } - - interface TransportStatic { - new(options?: TransportOptions): TransportInstance; - } - - interface TransportInstance extends TransportStatic, NodeJS.EventEmitter { - silent: boolean; - raw: boolean; - name: string; - level?: string; - handleExceptions: boolean; - exceptionsLevel: string; - humanReadableUnhandledException: boolean; - - formatQuery(query: (string | Object)): (string | Object); - formatter?(options?: any): string; - normalizeQuery(options: QueryOptions): QueryOptions; - formatResults(results: (Object | any[]), options?: Object): (Object | any[]); - logException(msg: string, meta: Object, callback: () => void): void; - } - - interface ConsoleTransportInstance extends TransportInstance { - json: boolean; - colorize: boolean | 'all' | 'level' | 'message'; - prettyPrint: boolean; - timestamp: boolean | (() => string | boolean); - showLevel: boolean; - label: string|null; - logstash: boolean; - depth: string|null; - align: boolean; - stderrLevels: { [key: string]: LeveledLogMethod; }; - eol: string; - - new(options?: ConsoleTransportOptions): ConsoleTransportInstance; - stringify?(obj: Object): string; - } - - interface DailyRotateFileTransportInstance extends TransportInstance { - new(options?: DailyRotateFileTransportOptions): DailyRotateFileTransportInstance; - } - - interface FileTransportInstance extends TransportInstance { - json: boolean; - logstash: boolean; - colorize: boolean | 'all' | 'level' | 'message'; - maxsize: number|null; - rotationFormat: boolean; - zippedArchive: boolean; - maxFiles: number|null; - prettyPrint: boolean; - label: string|null; - timestamp: boolean | (() => string | boolean); - eol: string; - tailable: boolean; - depth: string|null; - showLevel: boolean; - maxRetries: number; - - close(): void; - new(options?: FileTransportOptions): FileTransportInstance; - stringify?(obj: Object): string; - } - - interface HttpTransportInstance extends TransportInstance { - name: string; - ssl: boolean; - host: string; - port: number; - auth?: {username: string, password: string}; - path: string; - agent?: Agent|null; - - new(options?: HttpTransportOptions): HttpTransportInstance; - } - - interface MemoryTransportInstance extends TransportInstance { - errorOutput: GenericTextTransportOptions[]; - writeOutput: GenericTextTransportOptions[]; - - json: boolean; - colorize: boolean | 'all' | 'level' | 'message'; - prettyPrint: boolean; - timestamp: boolean | (() => string | boolean); - showLevel: boolean; - label: string|null; - depth: string|null; - - new(options?: MemoryTransportOptions): MemoryTransportInstance; - stringify?(obj: Object): string; - } - - interface WebhookTransportInstance extends TransportInstance { - new(options?: WebhookTransportOptions): WebhookTransportInstance; - } - - interface WinstonModuleTrasportInstance extends TransportInstance { - new(options?: WinstonModuleTransportOptions): WinstonModuleTrasportInstance; - } - - interface ContainerStatic { - new(options: LoggerOptions): ContainerInstance; - } - - interface ContainerInstance extends ContainerStatic { - get(id: string, options?: LoggerOptions): LoggerInstance; - add(id: string, options: LoggerOptions): LoggerInstance; - has(id: string): boolean; - close(id: string): void; - options: LoggerOptions; - loggers: {[key: string]: LoggerInstance}; - default: LoggerOptions; - } - - interface Transports { - File: FileTransportInstance; - Console: ConsoleTransportInstance; - Loggly: WinstonModuleTrasportInstance; - DailyRotateFile: DailyRotateFileTransportInstance; - Http: HttpTransportInstance; - Memory: MemoryTransportInstance; - Webhook: WebhookTransportInstance; - } - - type TransportOptions = ConsoleTransportOptions | DailyRotateFileTransportOptions | FileTransportOptions - | HttpTransportOptions | MemoryTransportOptions | WebhookTransportOptions | WinstonModuleTransportOptions; - - interface GenericTransportOptions { - level?: string; - silent?: boolean; - raw?: boolean; - name?: string; - handleExceptions?: boolean; - exceptionsLevel?: string; - humanReadableUnhandledException?: boolean; - - formatter?(options?: any): string; - } - - interface GenericTextTransportOptions { - json?: boolean; - colorize?: boolean | 'all' | 'level' | 'message'; - colors?: any; - prettyPrint?: boolean; - showLevel?: boolean; - label?: string; - depth?: number; - - timestamp?: boolean | (() => string | boolean); - stringify?(obj: any): string; - } - - interface GenericNetworkTransportOptions { - host?: string; - port?: number; - auth?: { - username: string; - password: string; - }; - path?: string; - } - - interface ConsoleTransportOptions extends GenericTransportOptions, GenericTextTransportOptions { - logstash?: boolean; - debugStdout?: boolean; - } - - interface DailyRotateFileTransportOptions extends GenericTransportOptions, GenericTextTransportOptions { - logstash?: boolean; - maxsize?: number; - maxFiles?: number; - eol?: string; - maxRetries?: number; - datePattern?: string; - filename?: string; - dirname?: string; - options?: { - flags?: string; - highWaterMark?: number; - }; - stream?: NodeJS.WritableStream; - } - - interface FileTransportOptions extends GenericTransportOptions, GenericTextTransportOptions { - logstash?: boolean; - maxsize?: number; - rotationFormat?: boolean; - zippedArchive?: boolean; - maxFiles?: number; - eol?: string; - tailable?: boolean; - maxRetries?: number; - filename?: string; - dirname?: string; - options?: { - flags?: string; - highWaterMark?: number; - }; - stream?: NodeJS.WritableStream; - } - - interface HttpTransportOptions extends GenericTransportOptions, GenericNetworkTransportOptions { - ssl?: boolean; - } - - interface MemoryTransportOptions extends GenericTransportOptions, GenericTextTransportOptions { - } - - interface WebhookTransportOptions extends GenericTransportOptions, GenericNetworkTransportOptions { - method?: string; - ssl?: { - key?: any; - cert?: any; - ca: any; - }; - } - - interface WinstonModuleTransportOptions extends GenericTransportOptions { - [optionName: string]: any; - } - - interface QueryOptions { - rows?: number; - limit?: number; - start?: number; - from?: Date; - until?: Date; - order?: "asc" | "desc"; - fields: any; - } - - interface ProfileHandler { - logger: LoggerInstance; - start: Date; - - done(msg: string): LoggerInstance; - } - - interface LogMethod { - (level: string, msg: string, callback: LogCallback): LoggerInstance; - (level: string, msg: string, meta: any, callback: LogCallback): LoggerInstance; - (level: string, msg: string, ...meta: any[]): LoggerInstance; - } - - interface LeveledLogMethod { - (msg: string, callback: LogCallback): LoggerInstance; - (msg: string, meta: any, callback: LogCallback): LoggerInstance; - (msg: string, ...meta: any[]): LoggerInstance; - } - - type LogCallback = (error?: any, level?: string, msg?: string, meta?: any) => void; -} - -declare const winston: winston.Winston; -export = winston; diff --git a/types/winston/tslint.json b/types/winston/tslint.json deleted file mode 100644 index 38c1ea8606..0000000000 --- a/types/winston/tslint.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "ban-types": false, - "no-misused-new": false - } -} diff --git a/types/winston/winston-tests.ts b/types/winston/winston-tests.ts deleted file mode 100644 index c9c8fcd0da..0000000000 --- a/types/winston/winston-tests.ts +++ /dev/null @@ -1,292 +0,0 @@ -import winston = require('winston'); - -declare const str: string; -let bool: boolean; -declare const num: number; -declare const metadata: any; -const obj: any = {}; -declare const stamp: boolean | (() => string | boolean); - -winston.level = 'debug'; - -let queryOptions: winston.QueryOptions; -declare const transportOptions: winston.TransportOptions; -const loggerOptions: winston.LoggerOptions = { - transports: [new (winston.Transport)()], - rewriters: [ - (level: string, msg: string, meta: any): any => { - return meta; - } - ], - exceptionHandlers: [new (winston.Transport)()], - handleExceptions: false -}; - -declare const options: any; -let value: any; -let transport: winston.TransportInstance; -let logger: winston.LoggerInstance; -let profiler: winston.ProfileHandler; - -declare const writeableStream: NodeJS.WritableStream; -let readableStream: NodeJS.ReadableStream; - -const transportStatic: winston.TransportStatic = winston.Transport; - -let transportInstance: winston.TransportInstance = new (winston.Transport)(transportOptions); -transportInstance = new (winston.Transport)(); - -const containerInstance: winston.ContainerInstance = new (winston.Container)(loggerOptions); -winston.loggers.options.transports = [ - new (winston.Transport)() -]; -winston.loggers.add('category1', { - console: { - level: 'silly', - colorize: 'true', - label: 'category one' - }, - file: { - filename: '/path/to/some/file' - }, - transports: [ - new (winston.Transport)() - ] -}); -logger = winston.loggers.get('category1'); - -bool = containerInstance.has(str); -logger = containerInstance.get(str, loggerOptions); -containerInstance.close(str); - -transport = winston.transports.Console; -transport = winston.transports.DailyRotateFile; -transport = winston.transports.File; -transport = winston.transports.Http; -transport = winston.transports.Loggly; -transport = winston.transports.Memory; -transport = winston.transports.Webhook; - -value = transport.formatQuery({}); -queryOptions = transport.normalizeQuery(queryOptions); -value = transport.formatResults([], {}); -transport.logException(str, metadata, () => { }); - -winston.exitOnError = bool; - -winston.log(str, str); -winston.log(str, str, metadata); -winston.log(str, str, metadata, metadata, metadata); -winston.silly(str, str); -winston.silly(str, str, metadata); -winston.silly(str, str, metadata, metadata, metadata); -winston.debug(str); -winston.debug(str, metadata); -winston.debug(str, metadata, metadata, metadata); -winston.verbose(str, str); -winston.verbose(str, str, metadata); -winston.verbose(str, str, metadata, metadata, metadata); -winston.info(str); -winston.info(str, metadata); -winston.info(str, metadata, metadata, metadata); -winston.warn(str); -winston.warn(str, metadata); -winston.warn(str, metadata, metadata, metadata); -winston.error(str); -winston.error(str, metadata); -winston.error(str, metadata, metadata, metadata); - -winston.query(queryOptions, (err: Error, results: any): void => { -}); -winston.query((err: Error, results: any): void => { -}); - -logger = winston.add(transport, transportOptions); -logger = winston.remove(transport); -logger = winston.add(transport, {filename: 'path/to/file.log'}); - -winston.clear(); -logger = winston.profile(str, str, metadata, (err: Error, level: string, msg: string, meta: any): void => { -}); -logger = winston.profile(str); -profiler = winston.startTimer(); -winston.setLevels({}); -logger = winston.cli(); - -winston.handleExceptions(transport); -winston.unhandleExceptions(transport); - -readableStream = winston.stream(options); - -readableStream.on('log', (log: any): void => { - console.log(log); -}); - -logger = logger.extend(obj); -logger.log(str, str); -logger.log(str, str, metadata); -logger.log(str, str, metadata, metadata, metadata); -logger.debug(str); -logger.debug(str, metadata); -logger.debug(str, metadata, metadata, metadata); -logger.info(str); -logger.info(str, metadata); -logger.info(str, metadata, metadata, metadata); -logger.warn(str); -logger.warn(str, metadata); -logger.warn(str, metadata, metadata, metadata); -logger.error(str); -logger.error(str, metadata); -logger.error(str, metadata, metadata, metadata); - -logger.query(queryOptions, (err: Error, results: any): void => { -}); -logger.query((err: Error, results: any): void => { -}); - -readableStream = winston.stream(options); -logger.close(); -logger.handleExceptions(transport); -logger.unhandleExceptions(transport); -logger = logger.add(transport, transportOptions, bool); -logger = logger.add(transport); -logger = logger.add(transport, {filename: 'path/to/file.log'}); - -logger.clear(); -logger = logger.remove(transport); -profiler = logger.startTimer(); -logger = logger.profile(str, str, metadata, (err: Error, level: string, msg: string, meta: any): void => { -}); -value = logger.setLevels(value); -logger = logger.cli(); - -logger = profiler.done(str); -logger = profiler.logger; -profiler.start = new Date(); - -const testRewriter: winston.MetadataRewriter = (level: string, msg: string, meta: any): any => { - return meta; -}; - -logger.rewriters.push(testRewriter); -/** - * New Logger instances with transports tests: - */ - -logger = new (winston.Logger)({ - transports: [ - new (winston.transports.Console)({ - level: str, - silent: bool, - json: bool, - colorize: bool, - timestamp: stamp, - showLevel: bool, - label: str, - logstash: bool, - debugStdout: bool, - depth: num, - }), - new (winston.transports.DailyRotateFile)({ - level: str, - silent: bool, - json: bool, - colorize: bool, - maxsize: num, - maxFiles: num, - maxRetries: num, - prettyPrint: bool, - timestamp: stamp, - filename: str, - dirname: str, - datePattern: str, - eol: str, - stream: writeableStream, - }), - new (winston.transports.File)({ - level: str, - silent: bool, - json: bool, - colorize: bool, - prettyPrint: bool, - timestamp: stamp, - showLevel: bool, - logstash: bool, - rotationFormat: bool, - depth: num, - zippedArchive: bool, - eol: str, - tailable: bool, - maxRetries: num, - filename: str, - maxsize: num, - maxFiles: num, - stream: writeableStream, - }), - new (winston.transports.Http)({ - level: str, - host: str, - port: num, - path: str, - auth: { username: str, password: str }, - ssl: bool, - }), - new (winston.transports.Loggly)({ - level: str, - subdomain: str, - auth: {}, - inputName: str, - json: bool, - }), - new (winston.transports.Memory)({ - level: str, - json: bool, - colorize: bool, - showLevel: bool, - depth: num, - timestamp: stamp, - label: str, - }), - new (winston.transports.Webhook)({ - level: str, - name: str, - host: str, - port: num, - method: str, - path: str, - auth: { username: str, password: str }, - ssl: {ca: {}}, - }), - ] -}); - -/* Remove transport by name */ -logger = logger.remove('nooo'); - -/* Reconfigure logger */ -logger.configure({ level: 'silly' }); - -winston.default.warn("Don't export reserved words in JavaScript!"); - -winston.default.setLevels(winston.config.syslog.levels); -winston.addColors(winston.config.syslog.colors); -winston.default.emerg('syslog!'); - -winston.config.addColors(winston.config.syslog.colors); -winston.config.colorize(winston.config.syslog.levels['info'], "Hello world!"); - -// module augment for custom level log -// https://github.com/winstonjs/winston#using-custom-logging-levels -// https://github.com/Microsoft/TypeScript/issues/7545 -declare module 'winston' { - interface LoggerInstance { - yay: LeveledLogMethod; - } -} -const customLevelLogger = new winston.Logger({ - levels: {yay: 0, haha: 1, hoho: 2}, - transports: [ - new (winston.transports.Console)() - ] -}); -customLevelLogger.yay('yay!'); diff --git a/types/x-ray/index.d.ts b/types/x-ray/index.d.ts index 271155ef94..345059a8eb 100644 --- a/types/x-ray/index.d.ts +++ b/types/x-ray/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/lapwinglabs/x-ray#readme // Definitions by: Matt Traynham // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/yargs-interactive/index.d.ts b/types/yargs-interactive/index.d.ts new file mode 100644 index 0000000000..0f0d3461de --- /dev/null +++ b/types/yargs-interactive/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for yargs-interactive 2.0 +// Project: https://github.com/nanovazquez/yargs-interactive#readme +// Definitions by: Steven Zeck +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function yargsInteractive(): yargsInteractive.Interactive; + +declare namespace yargsInteractive { + interface OptionData { + type: string; + describe: string; + default?: string | number | boolean; + prompt?: string; + options?: string[]; + } + interface Option { + [key: string]: OptionData | { default: boolean }; + } + interface Interactive { + usage(usage: string): Interactive; + interactive(options: Option): Interactive; + then(callback: (result: any) => any): Interactive; + } +} + +export = yargsInteractive; diff --git a/types/yargs-interactive/tsconfig.json b/types/yargs-interactive/tsconfig.json new file mode 100644 index 0000000000..5b8ffeee31 --- /dev/null +++ b/types/yargs-interactive/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", + "yargs-interactive-tests.ts" + ] +} diff --git a/types/yargs-interactive/tslint.json b/types/yargs-interactive/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/yargs-interactive/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/yargs-interactive/yargs-interactive-tests.ts b/types/yargs-interactive/yargs-interactive-tests.ts new file mode 100644 index 0000000000..cff1ca16c2 --- /dev/null +++ b/types/yargs-interactive/yargs-interactive-tests.ts @@ -0,0 +1,19 @@ +/// + +import yargsInteractive = require("yargs-interactive"); + +const options: yargsInteractive.Option = { + color: { + describe: "What is your favorite color?", + prompt: "always", + type: "input", + default: "Blue", + } +}; + +yargsInteractive() + .usage("$0 [args]") + .interactive(options) + .then((result: any) => { + console.log(result); + }); diff --git a/types/yargs/index.d.ts b/types/yargs/index.d.ts index 882e8e9999..50901570a4 100644 --- a/types/yargs/index.d.ts +++ b/types/yargs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for yargs 11.0 +// Type definitions for yargs 11.1 // Project: https://github.com/chevex/yargs // Definitions by: Martin Poelstra // Mizunashi Mana @@ -116,6 +116,8 @@ declare namespace yargs { group(key: string | string[], groupName: string): Argv; + hide(key: string): Argv; + help(): Argv; help(enableExplicit: boolean): Argv; help(option: string, enableExplicit: boolean): Argv; @@ -185,6 +187,9 @@ declare namespace yargs { showCompletionScript(): Argv; + showhidden(option?: string | boolean): Argv; + showhidden(option: string, description?: string): Argv; + showHelp(consoleLevel?: string): Argv; showHelpOnFail(enable: boolean, message?: string): Argv; diff --git a/types/yargs/yargs-tests.ts b/types/yargs/yargs-tests.ts index 43779309bf..f98120d1c4 100644 --- a/types/yargs/yargs-tests.ts +++ b/types/yargs/yargs-tests.ts @@ -648,3 +648,16 @@ function Argv$check() { .check((argv, aliases) => void 0) .check((argv, aliases) => void 0, false); } + +function Argv$hide() { + const ya = yargs + .hide('a'); +} + +function Argv$showhidden() { + const ya = yargs + .showhidden() + .showhidden(true) + .showhidden('show-hidden') + .showhidden('show-hidden', 'Show hidden options'); +} diff --git a/types/yesql/index.d.ts b/types/yesql/index.d.ts new file mode 100644 index 0000000000..0fd68065ea --- /dev/null +++ b/types/yesql/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for yesql 3.2 +// Project: https://github.com/pihvi/yesql#readme +// Definitions by: Lluís Ulzurrun de Asanza Sáez +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +declare function readSqlFiles( + dir: string, + options?: { + pg?: boolean, + type?: 'pg' | 'mysql' + } +): string; + +declare namespace readSqlFiles { + function pg(query: string): (data: object) => {text: string, values: any[]}; + function mysql(query: string): (data: object) => {sql: string, values: any[]}; +} + +export = readSqlFiles; diff --git a/types/yesql/tsconfig.json b/types/yesql/tsconfig.json new file mode 100644 index 0000000000..cd44319d86 --- /dev/null +++ b/types/yesql/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", + "yesql-tests.ts" + ] +} diff --git a/types/yesql/tslint.json b/types/yesql/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/yesql/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/yesql/yesql-tests.ts b/types/yesql/yesql-tests.ts new file mode 100644 index 0000000000..7f1aa7b91a --- /dev/null +++ b/types/yesql/yesql-tests.ts @@ -0,0 +1,17 @@ +import * as yesql from "yesql"; + +yesql(''); // $ExpectType string +yesql('', {pg: true}); // $ExpectType string +yesql('', {type: 'mysql'}); // $ExpectType string + +yesql.pg(''); // $ExpectType (data: object) => { text: string; values: any[]; } +yesql.pg('')({}); // $ExpectType { text: string; values: any[]; } + +yesql.pg('')('demo'); // $ExpectError +yesql.pg('')(42); // $ExpectError + +yesql.mysql(''); // $ExpectType (data: object) => { sql: string; values: any[]; } +yesql.mysql('')({}); // $ExpectType { sql: string; values: any[]; } + +yesql.mysql('')('demo'); // $ExpectError +yesql.mysql('')(42); // $ExpectError diff --git a/types/zip-webpack-plugin/index.d.ts b/types/zip-webpack-plugin/index.d.ts new file mode 100644 index 0000000000..332e2936e2 --- /dev/null +++ b/types/zip-webpack-plugin/index.d.ts @@ -0,0 +1,99 @@ +// Type definitions for zip-webpack-plugin 3.0 +// Project: https://github.com/erikdesjardins/zip-webpack-plugin +// Definitions by: Blaise Kal +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as webpack from 'webpack'; + +export = ZipPlugin; + +/** + * Webpack plugin to zip emitted files. Compresses all assets into a zip file. + * See https://www.npmjs.com/package/zip-webpack-plugin#usage + */ +declare class ZipPlugin extends webpack.Plugin { + /** + * @param options Options for ZipPlugin. + */ + constructor(options?: ZipPlugin.Options); +} + +declare namespace ZipPlugin { + interface Options { + /** + * Output path. Can be relative (to the webpack output path) or absolute. + * Defaults to the Webpack output path. + */ + path?: string; + /** + * Output file name. + * Defaults to the Webpack output filename or basename of the path. + */ + filename?: string; + /** + * The file extension to use instead of "zip". + * Defaults to "zip". + */ + extension?: string; + /** + * The path prefix for files included in the zip file. + * Default to no prefix. + */ + pathPrefix?: string; + /** + * Function to map asset paths to new paths. + */ + pathMapper?: (assetPath: string) => string; + /** + * Include file paths or patterns. + * Defaults to including all files in the webpack output path. + */ + include?: string | RegExp | ReadonlyArray; + /** + * Exclude file paths or patterns. Takes precedence over include. Defaults to no excluding. + */ + exclude?: string | RegExp | ReadonlyArray; + /** + * File options passed to yazl `addFile`. + * See https://github.com/thejoshwolfe/yazl#addfilerealpath-metadatapath-options + */ + fileOptions?: fileOptions; + /** + * File options passed to yazl `end`. + * See https://github.com/thejoshwolfe/yazl#endoptions-finalsizecallback + */ + zipOptions?: zipOptions; + } + + interface fileOptions { + /** + * Overwrite the last modified time. + * Defaults to the current date and time. + */ + mtime?: Date; + /** + * UNIX permission bits and file type. + */ + mode?: number; + /** + * Whether to compress the out[ut zip file. + * When true, the file data will be deflated (compression method 8). + * When false, the file data will be stored (compression method 0). + */ + compress?: boolean; + /** + * Force ZIP64 format. ZIP64 format is enabled by default where necessary. + * See https://github.com/thejoshwolfe/yazl#regarding-zip64-support + */ + forceZip64Format?: boolean; + } + + interface zipOptions { + /** + * Force ZIP64 format. ZIP64 format is enabled by default where necessary. + * See https://github.com/thejoshwolfe/yazl#regarding-zip64-support + */ + forceZip64Format?: boolean; + } +} diff --git a/types/zip-webpack-plugin/tsconfig.json b/types/zip-webpack-plugin/tsconfig.json new file mode 100644 index 0000000000..8c18bf81a0 --- /dev/null +++ b/types/zip-webpack-plugin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "zip-webpack-plugin-tests.ts" + ] +} diff --git a/types/zip-webpack-plugin/tslint.json b/types/zip-webpack-plugin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/zip-webpack-plugin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/zip-webpack-plugin/zip-webpack-plugin-tests.ts b/types/zip-webpack-plugin/zip-webpack-plugin-tests.ts new file mode 100644 index 0000000000..f6396e5e7b --- /dev/null +++ b/types/zip-webpack-plugin/zip-webpack-plugin-tests.ts @@ -0,0 +1,28 @@ +import * as ZipPlugin from "zip-webpack-plugin"; + +new ZipPlugin(); + +const options: ZipPlugin.Options = { + include: "include.string", + exclude: "exclude.string", +}; +new ZipPlugin(options); + +new ZipPlugin({ + path: "path", + filename: "filename", + extension: "ext", + pathPrefix: "prefix", + pathMapper: (assetPath) => `pathMapper/${assetPath}`, + include: ["include.string", /include\.regexp/], + exclude: ["exclude.string", /exclude\.regexp/], + fileOptions: { + mtime: new Date(), + mode: parseInt("0100664", 8), + compress: false, + forceZip64Format: true, + }, + zipOptions: { + forceZip64Format: true, + } +});