diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index fb6f7ba030..8c7f823a07 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 @@ -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,23 @@ /types/timelinejs3/ @MikeMatusz /types/timer-machine/ @dolanmiu /types/timezone-js/ @bonnici +/types/tinajs__tina/ @Jimexist +/types/tinajs__tina-redux/ @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 +4335,7 @@ /types/trayballoon/ @korve /types/tress/ @sindilevich /types/trim/ @skysteve +/types/triplesec/ @threesquared /types/trunk8/ @niemyjski /types/tryer/ @bengry /types/tspromise/ @soywiz @@ -4174,7 +4347,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 +4365,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 +4390,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 +4408,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 +4429,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 +4450,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 +4468,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 +4480,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 +4509,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 +4523,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 @@ -4377,7 +4562,7 @@ /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 @@ -4394,8 +4579,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 @@ -4403,6 +4588,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 @@ -4424,7 +4611,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 @@ -4446,12 +4633,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 @@ -4463,13 +4653,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/README.ko.md b/README.ko.md new file mode 100644 index 0000000000..224967a9dc --- /dev/null +++ b/README.ko.md @@ -0,0 +1,338 @@ +# DefinitelyTyped [![Build Status](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped.svg?branch=master)](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped) + +[![깃터(https://gitter.im/borisyankov/DefinitelyTyped)에서 대화에 참여해보세요](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/borisyankov/DefinitelyTyped?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +> 이 저장소는 고품질의 타입스크립트(TypeScript) 자료형 정의(Type definition)를 위한 저장소입니다. + +이 문서가 가장 최신 내용을 담고있긴 하지만, [공식 사이트(definitelytyped.org)](http://definitelytyped.org)도 확인해보시면 좋습니다. + +## 선언 파일(Declaration file)이 뭔가요? + +[타입스크립트 안내서(TypeScript handbook)](http://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html)를 읽어보세요. + +## 선언 파일(Declaration file)을 어떻게 받을 수 있나요?? + +### npm 사용하기 + +아래 방법은 타입스크립트(TypeScript) 2.0+ 이상의 버전을 사용하는 사람들만 사용할 수 있는 방법이기는 합니다만, 이 방법을 사용하기를 장려합니다. + +```sh +npm install --save-dev @types/node +``` + +`node` 를 위한 자료형(Typing)이 컴파일 과정에 자동으로 포함될 겁니다. +더 자세한 내용은 [안내서(Handbook)](http://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html)에서 확인해보실 수 있습니다. + +NPM 의 "foo" 패키지에 대응되는 자료형 패키지는 "@types/foo" 입니다. +원하시는 패키지를 찾을 수 없는 경우, [타입서치(TypeSearch)](https://microsoft.github.io/TypeSearch/) 사이트에서 한 번 찾아보세요. + +타입서치(TypeSearch)에서도 찾을 수 없는 경우, 찾고 있는 패키지가 자료형(Typing)을 +[함께 제공](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html)하고 있지는 않은지 확인해보세요. +패키지에 포함된 자료형(Typing)은 주로 `package.json` 파일의 `"types"` 나 `"typings"` 필드(Field)를 통해 제공되지만, +`/// ` 같은 주석을 사용하여 패키지 안의 ".d.ts" 파일들을 직접 가져와야 할 수도 있습니다. + + +### 그 외의 방법들 + +타입스크립트(TypeScript) 1.0 버전에서 사용할 수 있는 방법은 다음과 같습니다. + +* [Typings](https://github.com/typings/typings) 을 사용하기 +* ~~[NuGet](http://nuget.org/packages?q=DefinitelyTyped) 을 사용하기~~ (다른 방법을 사용해주세요. NuGet 은 더 이상 DT 자료형(Typing)을 제공하지 않습니다.) +* 이 저장소의 `master` 브랜치를 직접 내려받기 + +위 방법을 사용할 경우 수동으로 [참조(Reference)](http://www.typescriptlang.org/docs/handbook/triple-slash-directives.html)를 추가해주어야 할 수 있습니다. + + +## 어떻게 이곳에 기여할 수 있나요? + +여러분과 같은 많은 기여자들의 도움 덕분에 이 저장소가 돌아가고 있습니다. 감사합니다. + +### 테스트 + +여러분이 만든 자료형 선언(Type declation)을 세상에 공유하기에 앞서, 여러분이 스스로 여러분의 자료형 선언(Type declation)을 사용하고 확인해주세요. + +#### 이미 존재하는 자료형 패키지를 임시로 수정하기 + +이미 존재하는 패키지의 자료형 선언(Type declaration)에 새로운 기능을 추가하려면 [모듈 증강(module augmentation)](http://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation)를 사용할 수 있습니다. +물론 `node_modules/@types/foo/index.d.ts` 를 직접 수정하실 수도 있으며, 이 파일을 복사한 다음 아래의 과정을 따라하실 수도 있습니다. + + +#### 새 자료형 패키지를 임시로 추가하기 + +사용하고 계신 `tsconfig.json` 에 다음 내용을 추가해주세요. + +```json +"baseUrl": "types", +"typeRoots": ["types"], +``` + +(`types` 대신 `src/types` 을 사용하실 수도 있습니다.) +그리고 "foo" 모듈(Module)에 대한 선언(Declaration)을 포함하는 `types/foo/index.d.ts` 파일을 만들어주세요. +이제 코드 안에서 여러분의 새 자료형 선언(Type declaration)을 사용하는 `"foo"` 모듈(Module)을 임포트(Import)하실 수 있을 겁니다. +코드를 컴파일하고 실행시켜서 여러분의 자료형(Typing)이 실행 중에 실제로 벌어지는 일과 잘 맞아떨어지는지 확인해주세요. +실제 코드를 통한 확인이 끝나면, [풀 리퀘스트(Pull request)](#풀-리퀘스트pull-request-만들기)를 만들어주세요. +[이미 존재하는 패키지를 수정](#이미-존재하는-패키지를-수정하기)하거나 [새 패키지를 만들기](#새-패키지-만들기)위한 과정들을 따라하시면 됩니다. + + +### 풀 리퀘스트(Pull request) 만들기 + +여러분의 자료형 선언이 잘 작동하는지 확인하셨다면, DefinitelyTyped 에 공유해주세요. + +우선, 이 저장소를 [포크(fork)](https://guides.github.com/activities/forking/)해 주시고, [node](https://nodejs.org/) 를 설치하신 뒤, `npm install` 명령을 실행해주세요. + + +#### 이미 존재하는 패키지를 수정하기 + +* `cd types/my-package-to-edit` 명령을 실행합니다. +* 자료형(Typing) 파일들을 수정합니다. 테스트를 추가하는 것도 잊지마세요! + 만약 브레이킹 체인지(Breaking change)를 만드셨다면, [메이저 버전(major version)](#i-want-to-update-a-package-to-a-new-major-version)을 꼭 올려주세요. +* 패키지 머릿주석의 "Definitions by" 부분에 여러분의 이름을 추가하실 수도 있습니다. + - 이름을 추가하시면 다른 사람들이 그 패키지에 대한 풀 리퀘스트(Pull request)나 이슈(Issue)를 만들 때 여러분에게 알람이 갑니다. + - `// Definitions by: Alice , Bob ` 와 같이 여러분의 이름을 줄의 맨 마지막에 추가할 수 있습니다. + - 사람이 너무 많을 경우엔, 다음과 같이 여러 줄로 쓰실 수도 있습니다. + ```typescript + // Definitions by: Alice + // Bob + // Steve + // John + ``` +* `tslint.json` 파일이 있는 경우에는, `npm run lint package-name` 명령을 실행시키고 결과를 확인해주세요. 그렇지 않은 경우에는, 해당 패키지가 있는 디렉토리 안에서 `tsc` 명령을 실행시키고 결과를 확인해주세요. + +이미 존재하는 패키지에 대한 풀 리퀘스트(Pull request)를 만들었을 경우에는, `dt-bot` 이 이전 저자들을 자동으로 호출하는지 확인해주세요. +그렇지 않은 경우에는, 여러분이 직접 풀 리퀘스트(Pull request)와 관계있는 사람들을 호출할 수도 있습니다. + + +#### 새 패키지를 만들기 + +만약 라이브러리를 만드는 중이고 라이브러리가 타입스크립트(TypeScript)로 쓰여있다면, DefinitelyTyped 에 선언(Declaration)을 올리는 대신 패키지에 [자동생성된 선언(Declaration) 파일을 포함](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html)시킬 수 있습니다. + +NPM 패키지를 위한 자료형(Typing) 패키지를 만드시려면, 패키지의 이름과 같은 이름의 디렉토리를 만들어주세요. +NPM 에 올라가 있지 않은 패키지를 위한 자료형(Typing) 패키지를 만드시려면, 그 패키지가 NPM 에 올라와 있는 패키지와 이름이 겹치지 않는지 확인해주세요. +(`npm info foo` 명령어를 사용하여 `foo` 패키지가 NPM 에 있는지 확인할 수 있습니다.) + +새 자료형 패키지는 다음과 같은 구조로 구성되어있어야만 합니다. + +| 파일 이름 | 용도 | +| --- | --- | +| index.d.ts | 패키지를 위한 자료형(Typing)을 포함하는 파일입니다. | +| foo-tests.ts | 자료형(Typing)의 테스트를 위한 파일입니다. 이 파일의 코드는 실행되지는 않지만, 자료형 검사(Type checking)를 통과해야 합니다. | +| tsconfig.json | `tsc` 명령을 돌릴 수 있게 해주는 파일입니다. | +| tslint.json | 린터(Linter)를 사용할 수 있게 해주는 파일입니다. | + +이 파일들은, npm ≥ 5.2.0 에서는 `npx dts-gen --dt --name my-package-name --template module` 명령으로, +그 이하 경우에는 `npm install -g dts-gen` 와 `dts-gen --dt --name my-package-name --template module` 명령으로 만들 수 있습니다. +`dts-gen` 의 모든 옵션(Option)을 보고싶으시면 [dts-gen](https://github.com/Microsoft/dts-gen) 저장소를 확인해주세요. + +자료형(Typing) 패키지에 새 파일을 추가하거나, `async` 키워드를 사용하기 위해 `"target"` 을 `"es6"` 로 설정하거나, `"lib"` 를 추가하거나, `jsx` 지원을 추가하기 위해서 `tsconfig.json` 파일을 변경해야 할 수도 있습니다. + +DefinitelyTyped 의 관리자들이 주기적으로 새로운 풀 리퀘스트(Pull request)들을 확인하기는 하지만, +다른 풀 리퀘스트(Pull request)가 많을 경우 확인이 느려질 수 있다는 걸 알아주세요. + +[base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/base64-js) 패키지는 좋은 예시 중 하나입니다. + + +#### 많이 저지르는 실수들 + +* 우선, [안내서(Handbook)](http://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html)에 나와있는 내용들을 따라주세요. +* 코드에서는 모든 곳에서 탭(Tab)을 사용하거나, 항상 4 개의 띄어쓰기를 사용해주세요. +* `function sum(nums: number[]): number`의 경우, 만약 함수가 인자를 변경하지 않는다면 `ReadonlyArray` 를 사용해주세요. +* `interface Foo { new(): Foo; }`의 경우, + 이런 선언은 이 형(Type)을 가진 객체(Object)에 `new` 를 사용할 수 있도록 만듭니다. 많은 경우 여러분은 `declare class Foo { constructor(); }` 를 사용하려는 것일 겁니다. +* `const Class: { new(): IClass; }`의 경우, + `new` 를 사용할 수 있는 상수를 만드는 대신, `class Class { constructor(); }` 와 같이 클래스 선언(Class declaration)을 사용하는 게 더 좋습니다. +* `getMeAT(): T`의 경우, + 만일 자료형 매개변수(Type parameter)가 함수의 매개변수에 등장하지 않는다면, 그런 제너릭(Generic) 함수를 사용할 필요가 없습니다. + 그 제너릭(Generic) 함수는 단순히 자료형 단언(Type assertion)을 위장시킨 것뿐입니다. 이 경우 `getMeAT() as number` 와 같이 진짜 자료형 단언(Type assertion) 을 사용하는 게 더 좋습니다. + 다음은 괜찮은 제너릭(Generic)의 예시입니다. `function id(value: T): T;`. + 다음은 문제가 있는 제너릭(Generic)의 예시입니다. `function parseJson(json: string): T;`. + 예외적으로, `new Map()` 와 같은 경우는 괜찮습니다. +* `Function` 이나 `Object` 와 같은 형(Type)을 사용하는 것은 대부분의 경우 문제를 일으킵니다. 99% 의 경우 더 구체적인 형(Type)을 사용하는게 가능합니다. [함수(Function)](http://www.typescriptlang.org/docs/handbook/functions.html#function-types) 를 위해서는 `(x: number) => number` 와 같은, 객체를 위해서는 `{ x: number, y: number }` 와 같은 형(Type)들을 사용할 수 있습니다. 형(Type)에 대한 정보가 전혀 없을 경우에는, `Object` 형(Type)이 아니라 [`any`](http://www.typescriptlang.org/docs/handbook/basic-types.html#any) 형(Type)을 사용해야 합니다. 만일 어떤 형(Type)이 객체라는 사실만 알고 있는 경우, `Object` 나 `{ [key: string]: any }` 가 아니라 [`object`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#object-type) 를 사용해주세요. +* `var foo: string | any`의 경우, + `any` 가 합 자료형(Union type)의 안에서 사용될 경우, 결과 형(Type)은 언제나 `any` 가 됩니다. 따라서 형(Type)의 `string` 부분이 유용해 보인다 하더라도, 사실은 자료형 검사(Type checking)의 측면에서 `any` 와 다른 것이 없습니다. + 대신, `any`, `string`, 나 `string | object` 중 하나를 필요에 맞게 골라서 사용해주세요. + + +#### 패키지 삭제하기 + +패키지가 스스로의 형(Type)을 [포함](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html)하게 되면, DefinitelyTyped 에 있는 자료형(Typing) 패키지를 삭제하는 것이 좋습니다. + +`npm run not-needed -- typingsPackageName asOfVersion sourceRepoURL [libraryName]` 명령어를 사용하여 자료형(Typing) 패키지를 삭제할 수 있습니다. +- `typingsPackageName` 는 삭제할 디렉토리의 이름입니다. +- `asOfVersion` 는 새 스텁(Stub) 용 `@types/foo` 를 퍼블리시(Publish)할 버전입니다. 이 버전은 현재 NPM 에 올라간 버전보다 더 높은 버전이어야 합니다. +- `sourceRepoURL` 는 자료형(Typing)을 포함하게 된 저장소의 주소입니다. +- `libraryName` 는 패키지의 이름을 읽기 쉽게 쓴 것입니다. 즉, "angular2" 대신에 "Angular 2" 와 같이 쓰는 것이 좋습니다. (생략했을 경우에는 "typingsPackageName" 와 같은 것으로 취급됩니다.) + +DefinitelyTyped 의 다른 패키지들이 삭제된 자료형(Typing) 패키지를 사용하고 있을 경우, 형(Type)을 포함하기 시작한 원래 패키지를 사용하도록 수정해야합니다. 삭제된 자료형(Typing) 패키지를 사용하는 각 DefinitelyTyped 패키지들의 `package.json` 파일에 `"dependencies": { "foo": "x.y.z" }` 를 추가해주시면 됩니다. + +DefinitelyTyped 에 한 번도 올라온 적 없는 패키지가 형(Type)을 포함하게 되었다면, `notNeededPackages.json` 파일에 추가할 필요도 없습니다. + + +#### 린트(Lint)하기 + +자료형(Typing) 패키지를 린트(Lint)하려면, 패키지 디렉토리에 `{ "extends": "dtslint/dt.json" }` 를 포함하고 있는 `tslint.json` 파일을 추가해주시면 됩니다. 모든 새 패키지는 해당 파일을 가지고 있어야 합니다. +고쳐야 하지만 아직 고쳐지지 않은 린트(Lint) 결과가 있을 때에만 `tslint.json` 에서 린트 규칙(Lint rule)을 사용하지 않도록 설정할 수 있습니다. 예를 들어, + +```js +{ + "extends": "dtslint/dt.json", + "rules": { + // 이 패키지는 Function 형을 사용하고 있으며, 고치는 게 쉽지 않다. + "ban-types": false + } +} +``` + +(린트 규칙(Lint rule)이 절대로 적용되서는 안되는 경우에는, `// tslint:disable rule-name` 나 `//tslint:disable-next-line rule-name` 를 사용하는 것이 좋습니다. 후자가 더 나은 방식입니다.) + +어떤 표현식(Expression)이 특정한 형(Type)을 가진다고 단언(Assert)하고 싶을 때에는 `$ExpectType` 를 사용하시면 됩니다. 어떤 표현식(Expression)이 컴파일에 실패해야하는 경우에는 `$ExpectError` 를 하시면 됩니다. + +```js +// $ExpectType void +f(1); + +// $ExpectError +f("one"); +``` + +[dtslint](https://github.com/Microsoft/dtslint#write-tests) 저장소의 README 파일에서 더 자세한 내용을 확인하실 수 있습니다. + +이런 테스트들은 `npm run lint package-name` 명령으로 실행해볼 수 있습니다. 이 때, `package-name` 은 테스트하고 싶은 패키지의 이름입니다. +테스트 스크립트는 [dtslint](https://github.com/Microsoft/dtslint) 를 사용하고 있습니다. + + +## 자주 하는 질문들 + +#### 이 저장소와 `@types` 패키지들이 대체 무슨 관계가 있는 건가요? + +`master` 브랜치(Branch)의 내용들이 [types-publisher](https://github.com/Microsoft/types-publisher) 를 사용해 자동으로 `@types` 퍼블리시(Publish)됩니다. + +#### 풀 리퀘스트(Pull request)를 제출했습니다. 이게 합쳐질 때까지 얼마나 걸리나요? + +상황에 따라 다르지만, 대부분의 풀 리퀘스트(Pull request)들은 일주일 안에 합쳐집니다. 머릿주석에 있는 저자 중 한명에 의해 승인된 풀 리퀘스트(Pull request)는 보통 더 빨리 합쳐집니다. 새로운 패키지에 대한 풀 리퀘스트(Pull request)는 관리자의 세세한 코드 리뷰를 필요로 하기 때문에 더 오래 걸리는 경우가 많습니다. 각 PR 들은 합쳐지기 전에 TypeScript or DefinitelyTyped 팀 구성원의 코드 리뷰를 받아야 하며, 이는 사람이 하는 일이기 때문에 느려질 수도 있으니 양해를 바랍니다. [풀 리퀘스트 번다운 보드(PR Burndown Board)](https://github.com/DefinitelyTyped/DefinitelyTyped/projects/3?card_filter_query=is%3Aopen)에서 열린 풀 리퀘스트에 대한 관리자들의 진행도를 확인하실 수 있습니다. + +#### 내 풀 리퀘스트(Pull request)는 합쳐졌습니다. 언제 NPM 에 `@types` 패키지가 갱신되나요? + +NPM 의 패키지들은 수시간 안에 갱신될 겁니다. 만약 24 시간이 지나도 갱신되지 않으면, 문제를 파악하기 위해 @RyanCavanaugh 나 @andy-ms 를 풀 리퀘스트(Pull request)에서 호출해주세요. + +#### 다른 자료형 정의(Type definition)에 의존하는 자료형 정의(Type definition)을 만들고 있습니다. `` 와 임포트(import) 중 무엇을 사용해야하나요? + +외부 모듈(`export` 를 사용하는 모듈)을 사용할 경우, 임포트(import)를 사용해주세요. +환경과 관련된 모듈(ambient module)(`declare module` 를 쓰거나 전역 변수들을 선언한 모듈)을 사용할 경우, `` 를 사용해주세요. + +#### `package.json` 파일이 가끔 보이던데? + +일반적으로는 `package.json` 파일을 사용할 필요가 없습니다. 패키지가 퍼블리시(Publish)될 때 패키지를 위한 `package.json` 파일은 자동으로 생성됩니다. +가끔 보이는 `package.json` 파일은 의존하는 것들을 표시하기 위해 사용됩니다. [예시](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/pikaday/package.json)를 한 번 보세요. +의존성을 제외한 다른 필드(Field)들, 그러니까 `"description"` 같은 것들은 사용해서는 안됩니다. +옛날 `@types` 패키지를 사용하고 싶으실 경우에도 `"dependencies": { "@types/foo": "x.y.z" }` 와 같은 내용을 `package.json` 파일에 넣으셔야 합니다. + +#### 어떤 패키지들에 `tslint.json` 이 없거나, `tsconfig.json` 에 `"noImplicitAny": true`, `"noImplicitThis": true`, 나 `"strictNullChecks": true` 가 없어요. + +그럼 그 패키지들이 잘못된 겁니다. 고쳐서 풀 리퀘스트(Pull request)를 제출해주시면 고맙겠습니다. + +#### 자료형 정의(Type definition)을 요청할 수 있나요? + +이미 요청된 자료형 정의(Type definition)들을 [여기서](https://github.com/DefinitelyTyped/DefinitelyTyped/labels/Definition%3ARequest) 보실 수 있습니다. + +#### DOM 을 위한 자료형 정의(Type definitions)는요? + +웹 표준(Web standard)과 관련이 있는 자료형(Typing)들은 [TSJS-lib-generator](https://github.com/Microsoft/TSJS-lib-generator) 저장소에 기여해서 고치실 수 있습니다. 고쳐진 자료형(Typing)은 `lib.dom.d.ts` 파일에 포함될 겁니다. + +#### 어떤 패키지가 `export =` 를 쓰고 있는데, 저는 디폴트 임포트(Default import)가 더 좋습니다. `export =` 를 `export default` 로 바꿔도 되나요? + +타입스크립트(TypeScript) 2.7 이상을 사용하고 계시면 프로젝트 안에서 `--esModuleInterop` 를 사용해주세요. +그 이하의 경우, 디폴트 임포트(Default import)가 동작하는 환경(Webpack, SystemJS, esm)에서 작업 중이시면 [`--allowSyntheticDefaultImports`](http://www.typescriptlang.org/docs/handbook/compiler-options.html) 를 사용하는 걸 고려해보세요. +자료형 정의(Type definition)가 맞는 경우에는 자료형 정의(Type definition)을 수정하지 마세요. +NPM 패키지의 경우, `node -p 'require("foo")'` 가 원하는 값이라면 `export =` 이 맞고, `node -p 'require("foo").default'` 이 원하는 값이라면 `export default` 이 맞습니다. + +#### 자료형 선언(Type declaration)에서 타입스크립트(TypeScript) 2.1 이상의 기능을 사용하고 싶습니다. + +정의(Definition) 머릿주석(`// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`) 뒤에 `// TypeScript Version: 2.1` 를 추가해주시면 됩니다. + +#### 타입스크립트(TypeScript)에 기본으로 포함되지 않은 DOM API 를 추가하고 싶어요. + +[TSJS-Lib-Generator](https://github.com/Microsoft/TSJS-lib-generator#readme) 저장소가 관련되어있을 가능성이 있습니다. 해당 저장소의 안내를 따라주세요. +해당 표준이 아직 초안인 상태라면, 이 저장소와 관련된 일입니다. +`dom-` 으로 시작하는 패키지를 만드신 뒤, "Project" 머릿주석 부분에 해당 표준의 링크를 써 주세요. +다만 표준이 초안을 벗어나면 DefinitelyTyped 에서 삭제되고 `@types` 패키지가 지원이 중단된(Deprecated) 것으로 표시될 수도 있습니다. + +#### 패키지를 새 메이저 버전(major version)에 맞게 갱신하고 싶어요. + +옛날 버전도 계속해서 수정할 예정이라면, 이전 버전에 해당하는 새 디렉토리(예를 들어 `2.` 버전을 위해서는 `v2`)를 만들고 현재 파일들을 그 디렉토리로 옮겨야 합니다. 새 디렉토리로 옮긴 뒤에는 + +1. `tsconfig.json` 와 `tslint.json` 에 포함된 상대경로들을 수정해주어야 합니다. +2. 경로 대응 규칙(Path mapping rule)을 추가하여 테스트가 올바른 버전을 검사하도록 해야합니다. + +예를 들어, [history 패키지의 2 버전의 `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/history/v2/tsconfig.json) 파일은 다음과 같이 생겼습니다. + +```json +{ + "compilerOptions": { + "baseUrl": "../../", + "typeRoots": ["../../"], + "paths": { + "history": [ "history/v2" ] + }, + }, + "files": [ + "index.d.ts", + "history-tests.ts" + ] +} +``` + +수정 중인 패키지에 의존하는 DefinitelyTyped 의 다른 패키지들이 새 버전과 호환되지 않을 경우, 그 패키지들에도 옛날 버전으로의 경로 대응 규칙(Path mapping rule)을 추가해주어야 합니다. 수정 중인 패키지에 의존하는 패키지에 의존하는 패키지들에도 똑같은 작업을 해 주셔야 합니다. + +예를 들어, `react-router` 패키지는 `history@2` 패키지에 의존하고 있기 때문에, [react-router 패키지의 `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router/tsconfig.json) 파일이 `"history": [ "history/v2" ]` 와 같은 경로 대응 규칙(Path mapping rule)을 가지고 있는 걸 볼 수 있습니다. +이어서 (`react-router` 패키지에 의존하는 패키지인) `react-router-bootstrap` 또한 [tsconfig.json](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router-bootstrap/tsconfig.json) 파일 안에 경로 대응 규칙(Path mapping rule)을 가지고 있는 것을 보실 수 있습니다. + +`/// ` 에서는 경로 대응 규칙(Path mapping rule)이 동작하지 않기 때문에, DefinitelyTyped 패키지로에 의존할 때에는 임포트(import) 를 사용해야 합니다. + +#### 전역적으로도 모듈로도 사용될 수 있는 패키지의 자료형 선언(Type declaration)은 어떻게 쓰나요? + +타입스크립트 안내서(TypeScript Handbook)은 [선언(Declaration)을 쓰는 방법에 대한 전반적인 정보](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html)와 [예시들](https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html)을 포함하고 있습니다. 이 내용에는 ES6 식의 모듈 문법을 사용할 수 있는 자료형 선언(Type declaration)을 만드는 방법과 객체를 전역에서 사용할 수 있도록 하는 방법이 포함되어 있습니다. [big.js 패키지의 자료형 선언(Type declaration)](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/big.js/index.d.ts)이 실례입니다. 이 패키지는 웹 페이지의 스크립트 태그를 사용해 불러올 수 있으며, 또한 ES6 식의 임포트(Import) 구문을 사용해서 불러올 수도 있습니다. + +여러분의 패키지가 임포트(Import) 구문을 사용했을 때와 전역적으로 불렀을 때를 테스트 해보고 싶다면, `test` 디렉토리를 추가하고 `YourLibraryName-global.test.ts` 그리고 `YourLibraryName-module.test.ts` 라는 이름으로 테스트 파일 두 개를 추가해주세요. **전역(Global)** 테스트 파일은 웹 페이지에서 전역적으로 사용될 때를 테스트하는 파일입니다. 이 파일에서는 임포트(Import) 구문을 사용하지 않아야 합니다. **모듈(Module)** 테스트 파일은 임포트(Import) 구문을 사용할 때를 테스트 하는 파일입니다. 만약 여러분의 `tsconfig.json` 파일이 `files` 필드(Field)를 가지고 있다면, 이 필드(Field)는 반드시 두 테스트 파일을 모두 포함해야 합니다. [이 방식을 사용하는 실례](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/big.js/test) 또한 big.js 패키지의 자료형 선언(Type declaration)에서 확인해보실 수 있습니다. + +각각의 테스트 파일에 모든 상황을 테스트할 필요는 없다는 걸 잊지마세요. 전역 테스트 파일에서는 전역적으로 사용될 때만 테스트하고, 모듈 테스트 파일에서 나머지 상황들을 모두 테스트 할 수 있으며, 그 반대의 경우도 괜찮습니다. + +#### 지역 패키지(Scoped package)의 경우는 어떻게 하죠? + +`@foo/bar` 패키지와 같은 지역 패키지(Scoped package)를 위한 자료형 패키지(Type package)는 `types/foo__bar` 디렉토리에 추가하면 됩니다. 밑줄 문자가 두 번 있는 것에 주의하세요. + +지역 패키지(Scoped package)를 위한 자료형 패키지(Type package)를 생성하기 위해 `dts-gen` 를 사용한 경우에는, +다음과 같이 생성된 `tsconfig.json` 안에 지역 패키지(Scoped package)를 위한 적절한 경로 대응 규칙(Path mapping rule)을 추가해주어야 합니다. + +```json +{ + "paths":{ + "@foo/bar": ["foo__bar"] + } +} +``` + + +#### 깃헙(GitHub)이 보여주는 파일 히스토리(History)가 불완전해요. + +깃헙은 이름이 바뀐 파일의 히스토리(History)를 [지원하지 않습니다](http://stackoverflow.com/questions/5646174/how-to-make-github-follow-directory-history-after-renames). 대신 [`git log --follow`](https://www.git-scm.com/docs/git-log) 명령을 사용하세요. + +#### ES6 에서 사용하는 임포트(Import)를 사용하기 위해 모듈을 익스포트(Export)하지 않는 패키지들에 빈 이름공간을 추가해야 하나요? + +[chai-http](https://github.com/chaijs/chai-http) 패키지와 같은 몇몇 패키지들은 함수를 익스포트(Export)합니다. + +이런 패키지들을 `import * as foo from "foo";` 와 같이 임포트(Import)하면 다음과 같은 오류가 발생합니다. + +> error TS2497: Module 'foo' resolves to a non-module entity and cannot be imported using this construct + +이 오류는 함수의 이름과 똑같은 빈 이름공간(Namespace)을 정의해서 없앨 수 있으나, 좋은 방법은 아닙니다. +[스택오버플로(Stack Overflow)의 이 질문의 답변](https://stackoverflow.com/questions/39415661/what-does-resolves-to-a-non-module-entity-and-cannot-be-imported-using-this)이 이 문제와 관련되어 자주 언급됩니다. + +`import foo = require("foo");` 를 사용하여 모듈을 임포트(Import)하거나, 환경에서 ES6 모듈 변환(Module interop)을 지원한다면 `--allowSyntheticDefaultImports` 와 함께 `import foo from "foo";` 같은 디폴트 임포트(Default import)를 사용하는 것이 더 나은 방법입니다. + +## 라이센스 + +이 프로젝트는 MIT license 가 적용되어 있습니다. + +각 자료형 정의(Type definition) 파일들의 저작권은 각 기여자들에게 있으며, 기여자들은 해당 자료형 정의(Type definition) 파일들의 맨 위에 나열되어 있습니다. + +[![Analytics](https://ga-beacon.appspot.com/UA-47495295-4/borisyankov/DefinitelyTyped)](https://github.com/igrigorik/ga-beacon) diff --git a/README.md b/README.md index 34eae06069..9a31d73da1 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Also see the [definitelytyped.org](http://definitelytyped.org) website, although information in this README is more up-to-date. -*[You can also read this README in Spanish!](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.es.md)* +*You can also read this README in [Spanish](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.es.md) and [Korean!](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.ko.md)* ## What are declaration files? diff --git a/notNeededPackages.json b/notNeededPackages.json index 46be03a056..f630c4e59e 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -570,6 +570,12 @@ "sourceRepoURL": "https://github.com/acdlite/flux-standard-action", "asOfVersion": "1.1.0" }, + { + "libraryName": "fork-ts-checker-webpack-plugin", + "typingsPackageName": "fork-ts-checker-webpack-plugin", + "sourceRepoURL": "https://github.com/Realytics/fork-ts-checker-webpack-plugin", + "asOfVersion": "0.4.5" + }, { "libraryName": "Foundation Sites", "typingsPackageName": "foundation-sites", @@ -678,6 +684,12 @@ "sourceRepoURL": "https://github.com/facebook/immutable-js", "asOfVersion": "3.8.7" }, + { + "libraryName": "interactjs", + "typingsPackageName": "interact.js", + "sourceRepoURL": "https://github.com/taye/interact.js", + "asOfVersion": "1.3.0" + }, { "libraryName": "inversify", "typingsPackageName": "inversify", @@ -1140,6 +1152,24 @@ "sourceRepoURL": "https://github.com/gpbl/react-day-picker", "asOfVersion": "5.3.0" }, + { + "libraryName": "react-dnd", + "typingsPackageName": "react-dnd", + "sourceRepoURL": "https://github.com/react-dnd/react-dnd", + "asOfVersion": "3.0.2" + }, + { + "libraryName": "react-dnd-html5-backend", + "typingsPackageName": "react-dnd-html5-backend", + "sourceRepoURL": "https://github.com/react-dnd/react-dnd", + "asOfVersion": "3.0.2" + }, + { + "libraryName": "react-dnd-test-backend", + "typingsPackageName": "react-dnd-test-backend", + "sourceRepoURL": "https://github.com/react-dnd/react-dnd", + "asOfVersion": "3.0.2" + }, { "libraryName": "react-flip-move", "typingsPackageName": "react-flip-move", @@ -1194,12 +1224,24 @@ "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", "sourceRepoURL": "https://github.com/tomkp/react-split-pane", "asOfVersion": "0.1.67" }, + { + "libraryName": "react-svg", + "typingsPackageName": "react-svg", + "sourceRepoURL": "https://github.com/tanem/react-svg", + "asOfVersion": "5.0.0" + }, { "libraryName": "realm", "typingsPackageName": "realm", @@ -1219,7 +1261,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" 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/activedirectory2/activedirectory2-tests.ts b/types/activedirectory2/activedirectory2-tests.ts new file mode 100644 index 0000000000..662109e746 --- /dev/null +++ b/types/activedirectory2/activedirectory2-tests.ts @@ -0,0 +1,14 @@ +import ActiveDirectory = require("activedirectory2"); + +const ad = new ActiveDirectory({ + url: 'ldap://192.168.199.10', + baseDN: 'OU=MyUsers,DC=mydomain,DC=com', + username: 'service-user@mydomain.com', + password: 'xxxxx000pw' +}); + +ad.authenticate("test@mydomain.com", "yyyy111pw", (err, authed) => { + console.log("hello"); + console.log(err); + console.log(authed); +}); diff --git a/types/activedirectory2/index.d.ts b/types/activedirectory2/index.d.ts new file mode 100644 index 0000000000..f963ae32ba --- /dev/null +++ b/types/activedirectory2/index.d.ts @@ -0,0 +1,151 @@ +// Type definitions for activedirectory2 1.2 +// Project: https://github.com/jsumners/node-activedirectory#readme +// Definitions by: pas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.5 + +import { Filter } from "ldapjs"; + +interface ADProperties { + url: string; + baseDN: string; + username: string; + password: string; + pageSize?: 1000; + entryParser?: (entry: object, raw: string, cb: (entry: object) => void) => void; + referrals?: { + enabled: false, + exclude: [ + 'ldaps?://ForestDnsZones\\..*/.*', + 'ldaps?://DomainDnsZones\\..*/.*', + 'ldaps?://.*/CN=Configuration,.*' + ] + }; + attributes?: { + user: [ + 'dn', 'distinguishedName', + 'userPrincipalName', 'sAMAccountName', 'mail', + 'lockoutTime', 'whenCreated', 'pwdLastSet', 'userAccountControl', + 'employeeID', 'sn', 'givenName', 'initials', 'cn', 'displayName', + 'comment', 'description' + ], + group: [ + 'dn', 'cn', 'description', 'distinguishedName', 'objectCategory' + ] + }; +} + +interface LDAPjsReqProps { + url: string; + tlsOptions: { + host?: string; + key?: string; + cert?: string; + ca?: string; + rejectUnauthorized: boolean; + }; + socketPath?: string; + log?: any; + timeout?: number; + idleTimeout?: number; + connectionTimeout?: number; + strictDN?: boolean; +} + +type MembershipType = 'all'|'user'|'group'; + +interface ReqProps extends LDAPjsReqProps { + baseDN?: string; + bindDN?: string; + bindCredentials?: string; + scope?: 'base' | 'one' | 'sub'; + filter: string | Filter; + attributes: AttributeSpec; + sizeLimit: 0; + timeLimit: 10; + includeMembership: MembershipType[]; +} + +interface AttributeSpec { + user: UserAttributes[]; + group: GroupAttributes[]; +} + +type GroupAttributes = + | 'distinguishedName' + | 'objectCategory' + | 'cn' + | 'description'; + +type UserAttributes = + | 'distinguishedName' + | 'userPrincipalName' + | 'sAMAccountName' + | 'mail' + | 'lockoutTime' + | 'whenCreated' + | 'pwdLastSet' + | 'userAccountControl' + | 'employeeID' + | 'sn' + | 'givenName' + | 'initials' + | 'cn' + | 'displayName' + | 'comment' + | 'description'; + +interface FindResult { + groups: object[]; + users: object[]; + other: object[]; +} + +declare class ActiveDirectory { + constructor(props: ADProperties); + authenticate( + username: string, + password: string, + callback: (err: string, authenticated: boolean) => void + ): void; + isUserMemberOf( + opts: ReqProps, + username: string, + groupName: string, + callback: (err: object, res: boolean) => void + ): void; + find( + opts: string | ReqProps, + callback: (err: object, results: FindResult) => void + ): void; + findDeletedObjects( + opts: string | ReqProps, + callback: (err: object, results: object[]) => void + ): void; + findUser( + opts: string | ReqProps, + username: string, + callback: (err: object, user: object) => void + ): void; + findUsers( + opts: string | ReqProps, + callback: (err: object, users: object[]) => void + ): void; + findGroup( + opts: string | ReqProps, + groupName: string, + callback: (err: object, group: object) => void + ): void; + findGroups( + opts: string | ReqProps, + groupName: string, + callback: (err: object, groups: object[]) => void + ): void; + getRootDSE( + url: string, + attributes: string[], + callback: (err: object, result: object) => void + ): void; +} + +export = ActiveDirectory; diff --git a/types/activedirectory2/tsconfig.json b/types/activedirectory2/tsconfig.json new file mode 100644 index 0000000000..57a68150ac --- /dev/null +++ b/types/activedirectory2/tsconfig.json @@ -0,0 +1,24 @@ +{ + "files": [ + "index.d.ts", + "activedirectory2-tests.ts" + ], + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "es2015.iterable" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/fork-ts-checker-webpack-plugin/tslint.json b/types/activedirectory2/tslint.json similarity index 100% rename from types/fork-ts-checker-webpack-plugin/tslint.json rename to types/activedirectory2/tslint.json diff --git a/types/activex-excel/activex-excel-tests.ts b/types/activex-excel/activex-excel-tests.ts index 4f6fab3aa1..505fcacfef 100644 --- a/types/activex-excel/activex-excel-tests.ts +++ b/types/activex-excel/activex-excel-tests.ts @@ -16,6 +16,17 @@ const inCollection = (collection: { Item(index: any): T }, index: strin return item; }; +{ + let app1: Excel.Application | null = new ActiveXObject('Excel.Application'); + app1.Visible = true; + const book1 = app1.Workbooks.Add(); + + app1.Quit(); + app1 = null; + + WScript.Quit(); +} + const app = new ActiveXObject('Excel.Application'); // create a workbook -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/create-a-workbook @@ -27,7 +38,7 @@ newBook.SaveAs('allsales.xls'); // create or replace a worksheet -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/create-or-replace-a-worksheet const newOrExistingWorksheet = () => { const mySheetName = 'Sheet4'; - let mySheet = inCollection(newBook.Worksheets, mySheetName) as Excel.Worksheet | undefined; + let mySheet = inCollection(newBook.Worksheets, mySheetName); if (!mySheet) { WScript.Echo(`The sheet named "${mySheetName} doesn't exist, but will be created.`); mySheet = app.Worksheets.Add() as Excel.Worksheet; @@ -37,7 +48,7 @@ const newOrExistingWorksheet = () => { const replaceWorksheet = () => { const mySheetName = 'Sheet4'; app.DisplayAlerts = false; - let mySheet = inCollection(app.Worksheets, mySheetName); + let mySheet = inCollection(app.Worksheets, mySheetName); if (mySheet) { mySheet.Delete(); } app.DisplayAlerts = true; mySheet = app.Worksheets.Add() as Excel.Worksheet; @@ -46,9 +57,7 @@ const replaceWorksheet = () => { }; // referencing multiple sheets -- https://msdn.microsoft.com/VBA/Excel-VBA/articles/sheets-object-excel -const moveMultipleSheets = () => { - app.Worksheets.Item(toSafeArray(1, 'Sheet2')).Move(4); -}; +const moveMultipleSheets = () => app.Worksheets(toSafeArray(1, 'Sheet2')).Move(4); // sort worksheets alphanumerically by name -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/sort-worksheets-alphanumerically-by-name const sortSheetsTabName = () => { @@ -56,9 +65,9 @@ const sortSheetsTabName = () => { const sheets = app.ActiveWorkbook.Sheets; const sheetCount = sheets.Count; for (let i = 0; i < sheetCount; i += 1) { - const sheetI = sheets.Item(i); + const sheetI = sheets(i); for (let j = i; j < sheetCount; j += 1) { - const sheetJ = sheets.Item(j); + const sheetJ = sheets(j); if (sheetJ.Name < sheetI.Name) { sheetJ.Move(sheetI); } } } @@ -68,7 +77,7 @@ const sortSheetsTabName = () => { // fill a value down into blank cells in a column -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/fill-a-value-down-into-blank-cells-in-a-column const fillCellsFromAbove = () => { app.ScreenUpdating = false; - const columnA = app.Columns.Item(1); + const columnA = app.Columns(1); try { columnA.SpecialCells(Excel.XlCellType.xlCellTypeBlanks).Formula = '=R[-1]C'; columnA.Value = columnA.Value; @@ -78,7 +87,7 @@ const fillCellsFromAbove = () => { // hide and unhide columns -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/hide-and-unhide-columns const setColumnVisibility = (visible: boolean) => { - const book = app.Workbooks.Item(1); + const book = app.Workbooks(1); const sheet = inCollection(book.Worksheets, 'Sheet1'); if (!sheet) { return; } @@ -97,7 +106,7 @@ const setColumnVisibility = (visible: boolean) => { }; // highlighting the active cell, row, or column -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/highlight-the-active-cell-row-or-column -(() => { +{ const wks = app.ActiveSheet as Excel.Worksheet; // highlight active cell @@ -120,10 +129,10 @@ const setColumnVisibility = (visible: boolean) => { prm.Target.EntireColumn.Interior.ColorIndex = 8; app.ScreenUpdating = true; }); -})(); +} // referencing cells -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/reference-cells-and-ranges -(() => { +{ const wks = app.ActiveSheet as Excel.Worksheet; // all the cells on a worksheet @@ -141,20 +150,19 @@ const setColumnVisibility = (visible: boolean) => { wks.Range('A:A,C:C,F:F').Font.Bold = true; // using index numbers - wks.Cells.Item(6, 1).Value2 = 10; - // Value is also a property with parameters - ActiveXObject.set(wks.Cells.Item(6, 1), 'Value', 10); + wks.Cells(6, 1).Value2 = 10; + wks.Cells(6, 1).Value = 10; // iterating through cells using index numbers for (let counter = 1; counter < 20; counter += 1) { - ActiveXObject.set(wks.Cells.Item(counter, 1), 'Value', 10); + wks.Cells(counter, 1).Value = 10; } // relative to other cells - wks.Cells.Item(1, 1).Font.Underline = Excel.XlUnderlineStyle.xlUnderlineStyleDouble; + wks.Cells(1, 1).Font.Underline = Excel.XlUnderlineStyle.xlUnderlineStyleDouble; // using a Range object - const rng = wks.Cells.Item('A1:D5'); + const rng = wks.Cells('A1:D5'); rng.Formula = '=RAND()'; rng.Font.Bold = true; @@ -166,23 +174,22 @@ const setColumnVisibility = (visible: boolean) => { // refer to multiple ranges using Areas WScript.Echo(union.Areas.Count); -})(); +} // looping through a range of cells -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/looping-through-a-range-of-cells -(() => { +{ const wks = app.ActiveSheet as Excel.Worksheet; // using for for (let x = 1; x < 20; x++) { - const currentCell = wks.Cells.Item(x, 1); - if (Math.abs(currentCell.Value()) < 0.01) { - // because Value is typed as a method on the Excel.Range class, we have to treat it as a setter with parameters - ActiveXObject.set(currentCell, 'Value', 0); + const currentCell = wks.Cells(x, 1); + if (Math.abs(currentCell.Value) < 0.01) { + currentCell.Value = 0; } } // using Enumerator - let enumerator = new Enumerator(wks.Cells.Item('A1:D10')); + let enumerator = new Enumerator(wks.Cells('A1:D10')); enumerator.moveFirst(); while (!enumerator.atEnd()) { const currentCell = enumerator.item(); @@ -202,11 +209,11 @@ const setColumnVisibility = (visible: boolean) => { } enumerator.moveNext(); } -})(); +} // using selection -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/selecting-and-activating-cells -(() => { - const wks = app.ActiveWorkbook.Worksheets.Item(1) as Excel.Worksheet; +{ + const wks = app.ActiveWorkbook.Worksheets(1); // make a worksheet the active worksheet; otherwise code which uses the selection will fail wks.Select(); @@ -219,24 +226,24 @@ const setColumnVisibility = (visible: boolean) => { wks.Range("B1").Activate(); // working with 3-D ranges -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/working-with-3-d-ranges - app.Sheets.Item(toSafeArray("Sheet2", "Sheet3", "Sheet4")).Select(); + app.Sheets(toSafeArray("Sheet2", "Sheet3", "Sheet4")).Select(); app.Range("A1:H1").Select(); - (app.Selection as Excel.Range).Borders.Item(Excel.XlBordersIndex.xlEdgeBottom).LineStyle = Excel.XlLineStyle.xlDouble; + (app.Selection as Excel.Range).Borders(Excel.XlBordersIndex.xlEdgeBottom).LineStyle = Excel.XlLineStyle.xlDouble; // alternatively, use FillAcrossSheets to fill formatting and data across sheets const book = app.ActiveWorkbook; - const wks2 = book.Sheets.Item("Sheet2") as Excel.Worksheet; + const wks2 = book.Worksheets("Sheet2"); const rng = wks2.Range("A1:H1"); - rng.Borders.Item(Excel.XlBordersIndex.xlEdgeBottom).LineStyle = Excel.XlLineStyle.xlDouble; + rng.Borders(Excel.XlBordersIndex.xlEdgeBottom).LineStyle = Excel.XlLineStyle.xlDouble; book.Sheets.FillAcrossSheets(rng); -})(); +} // prevent duplicate entry -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/prevent-duplicate-entries-in-a-range -(() => { - const book = app.Workbooks.Item(1); +{ + const book = app.Workbooks(1); ActiveXObject.on(book, 'SheetChange', ['Sh', 'Target'], function(this, prm) { - const EvalRange = this.ActiveSheet.Range("A1:B20"); + const EvalRange = (this.ActiveSheet as Excel.Worksheet).Range("A1:B20"); // If the cell where the value was entered is not in the defined range, if the value pasted is larger than a single cell, or if no value was entered in the cell, then exit the macro if ( @@ -253,10 +260,11 @@ const setColumnVisibility = (visible: boolean) => { return; } + // const enumerator = new Enumerator(book.Worksheets); const enumerator = new Enumerator(book.Worksheets); enumerator.moveFirst(); while (!enumerator.atEnd()) { - const wks = enumerator.item() as Excel.Worksheet; + const wks = enumerator.item(); if (wks.Name === prm.Target.Name) { continue; } // If the value entered already exists in the defined range on the current worksheet, undo the entry. @@ -267,14 +275,14 @@ const setColumnVisibility = (visible: boolean) => { app.EnableEvents = true; } }); -})(); +} // add a unique list of values to a combobox -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/add-a-unique-list-of-values-to-a-combo-box -(() => { - (() => { +{ + { // using the AdvancedFilter property const book = app.ThisWorkbook; - const sheet = book.Worksheets.Item("Sheet1") as Excel.Worksheet; + const sheet = book.Worksheets("Sheet1"); const dataRange = sheet.Range('A1', sheet.Range("A100").End(Excel.XlDirection.xlUp)); dataRange.AdvancedFilter(Excel.XlFilterAction.xlFilterCopy, undefined, sheet.Range('L1'), true); const data = sheet.Range("L2", sheet.Range('L100').End(Excel.XlDirection.xlUp)).Value() as SafeArray; @@ -284,15 +292,17 @@ const setColumnVisibility = (visible: boolean) => { combobox.Clear(); ActiveXObject.set(combobox, 'List', [], data); combobox.ListIndex = -1; - })(); + } - (() => { + { // using a Dictionary - const sheet = app.ThisWorkbook.Sheets.Item('Sheet2') as Excel.Worksheet; + const sheet = app.ThisWorkbook.Sheets('Sheet2') as Excel.Worksheet; const data = sheet.Range('A2', sheet.Range('A100').End(Excel.XlDirection.xlUp)).Value2 as SafeArray; const arr = new VBArray(data).toArray(); const dict = new ActiveXObject('Scripting.Dictionary'); - arr.forEach(x => ActiveXObject.set(dict, 'Item', [x], true)); + for (const x of arr) { + ActiveXObject.set(dict, 'Item', [x], true); + } const combobox = sheet.OLEObjects('ComboBox1').Object as MSForms.ComboBox; combobox.Clear(); @@ -307,21 +317,28 @@ const setColumnVisibility = (visible: boolean) => { // alternatively, make a JS array out of the keys, and iterate using forEach // new VBArray(dict.Keys()).toArray().forEach(x => combobox.AddItem(x)); - })(); -})(); - -// animating a sparkline -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/animate-a-sparkline -(() => { - const wks = app.ActiveSheet as Excel.Worksheet; - const oSparkGroup = wks.Cells.SparklineGroups.Item(1); - - // Set the data source to the first year of data - oSparkGroup.ModifySourceData('B2:M4'); - - // Loop through the data points for the subsequent two years - for (let i = 1; i <= 24; i++) { - // Move the reference for the sparkline group over one cell - oSparkGroup.ModifySourceData(wks.Range(oSparkGroup.SourceData).Offset(0, 1).Address()); - WScript.Sleep(1000); } -})(); + + // animating a sparkline -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/animate-a-sparkline + { + const wks = app.ActiveSheet as Excel.Worksheet; + const oSparkGroup = wks.Cells.SparklineGroups(1); + + // Set the data source to the first year of data + oSparkGroup.ModifySourceData('B2:M4'); + + // Loop through the data points for the subsequent two years + for (let i = 1; i <= 24; i++) { + // Move the reference for the sparkline group over one cell + oSparkGroup.ModifySourceData(wks.Range(oSparkGroup.SourceData).Offset(0, 1).Address()); + WScript.Sleep(1000); + } + } + + { + const formats = new VBArray(app.ClipboardFormats).toArray(); + for (const format of formats) { + WScript.Echo(format); + } + } +} diff --git a/types/activex-excel/index.d.ts b/types/activex-excel/index.d.ts index c55bfe1c42..6243d25e05 100644 --- a/types/activex-excel/index.d.ts +++ b/types/activex-excel/index.d.ts @@ -2,14 +2,52 @@ // Project: https://msdn.microsoft.com/en-us/library/fp179694.aspx // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// /// /// +/// +/// declare namespace Excel { - // tslint:disable-next-line:no-const-enum + type AddSheetResult = + T extends XlSheetType.xlDialogSheet ? DialogSheet : + T extends XlSheetType.xlChart ? Chart : + T extends XlSheetType ? Worksheet : + T extends undefined ? Sheet : + never; + + type InternationalResult = + T extends XlApplicationInternationalStrings ? string : + T extends XlApplicationInternationalNumbers ? number : + T extends XlApplicationInternationalBooleans ? boolean : + any; + + type LineStyle = XlLineStyle | Constants.xlGray25 | Constants.xlGray50 | Constants.xlGray75 | Constants.xlAutomatic; + + type HorizontalAlignments = Constants.xlCenter | Constants.xlDistributed | Constants.xlJustify | Constants.xlLeft | Constants.xlRight; + + type VerticalAlignments = Constants.xlBottom | Constants.xlCenter | Constants.xlDistributed | Constants.xlJustify | Constants.xlTop; + + type PivotTableWizardSourceData = + TSourceType extends XlPivotTableSourceType.xlExternal ? SafeArray : + TSourceType extends XlPivotTableSourceType ? Range | SafeArray | string : + TSourceType extends undefined ? undefined : + never; + + type PivotTableWizardAutoPage = + TSourceType extends XlPivotTableSourceType.xlConsolidation ? boolean : + undefined; + + type PrintToFileName = + T extends true ? string : + undefined; + + type Sheet = Worksheet | Chart | DialogSheet; + + type SheetView = WorksheetView | DialogSheetView; + const enum Constants { xl3DBar = -4099, xl3DEffects1 = 13, @@ -180,7 +218,48 @@ declare namespace Excel { xlWorksheetShort = 5, } - // tslint:disable-next-line:no-const-enum + const enum FunctionCategory { + Commands = 10, + Customizing = 11, + Database = 6, + DateAndTime = 2, + DDEAndExternal = 13, + Financial = 1, + Information = 9, + Logical = 8, + LookupAndReference = 5, + MacroControl = 12, + MathAndTrig = 3, + Statistical = 4, + Text = 7, + UserDefined = 14, + } + + const enum InputBoxReturnType { + Formula = 0, + Number = 1, + String = 2, + Boolean = 4, + Range = 8, + ErrorValue = 16, + SafeArray = 64, + } + + const enum PivotFieldSubtotal { + Automatic = 1, + Average = 4, + Count = 3, + CountNums = 8, + Max = 5, + Min = 6, + Product = 7, + StdDev = 9, + StdDevp = 10, + Sum = 2, + Var = 11, + Varp = 12 + } + const enum XlAboveBelow { xlAboveAverage = 0, xlAboveStdDev = 4, @@ -190,7 +269,6 @@ declare namespace Excel { xlEqualBelowAverage = 3, } - // tslint:disable-next-line:no-const-enum const enum XlActionType { xlActionTypeDrillthrough = 256, xlActionTypeReport = 128, @@ -198,80 +276,82 @@ declare namespace Excel { xlActionTypeUrl = 1, } - // tslint:disable-next-line:no-const-enum const enum XlAllocation { xlAutomaticAllocation = 2, xlManualAllocation = 1, } - // tslint:disable-next-line:no-const-enum const enum XlAllocationMethod { xlEqualAllocation = 1, xlWeightedAllocation = 2, } - // tslint:disable-next-line:no-const-enum const enum XlAllocationValue { xlAllocateIncrement = 2, xlAllocateValue = 1, } - // tslint:disable-next-line:no-const-enum - const enum XlApplicationInternational { - xl24HourClock = 33, - xl4DigitYears = 43, + const enum XlApplicationInternationalStrings { xlAlternateArraySeparator = 16, xlColumnSeparator = 14, - xlCountryCode = 1, - xlCountrySetting = 2, - xlCurrencyBefore = 37, xlCurrencyCode = 25, - xlCurrencyDigits = 27, - xlCurrencyLeadingZeros = 40, - xlCurrencyMinusSign = 38, - xlCurrencyNegative = 28, - xlCurrencySpaceBefore = 36, - xlCurrencyTrailingZeros = 39, - xlDateOrder = 32, - xlDateSeparator = 17, - xlDayCode = 21, - xlDayLeadingZero = 42, xlDecimalSeparator = 3, xlGeneralFormatName = 26, - xlHourCode = 22, xlLeftBrace = 12, xlLeftBracket = 10, xlListSeparator = 5, xlLowerCaseColumnLetter = 9, xlLowerCaseRowLetter = 8, - xlMDY = 44, - xlMetric = 35, - xlMinuteCode = 23, - xlMonthCode = 20, - xlMonthLeadingZero = 41, - xlMonthNameChars = 30, - xlNoncurrencyDigits = 29, - xlNonEnglishFunctions = 34, xlRightBrace = 13, xlRightBracket = 11, + xlUpperCaseColumnLetter = 7, + xlUpperCaseRowLetter = 6, + xlDateSeparator = 17, + xlDayCode = 21, + xlHourCode = 22, + xlMinuteCode = 23, + xlMonthCode = 20, xlRowSeparator = 15, xlSecondCode = 24, xlThousandsSeparator = 4, - xlTimeLeadingZero = 45, xlTimeSeparator = 18, - xlUpperCaseColumnLetter = 7, - xlUpperCaseRowLetter = 6, - xlWeekdayNameChars = 31, xlYearCode = 19, } - // tslint:disable-next-line:no-const-enum + const enum XlApplicationInternationalNumbers { + xlCountryCode = 1, + xlCountrySetting = 2, + xlCurrencyDigits = 27, + xlCurrencyNegative = 28, + xlNoncurrencyDigits = 29, + xlDateOrder = 32, + xlMonthNameChars = 30, + xlWeekdayNameChars = 31, + } + + const enum XlApplicationInternationalBooleans { + xl24HourClock = 33, + xl4DigitYears = 43, + xlCurrencyBefore = 37, + xlCurrencyLeadingZeros = 40, + xlCurrencyMinusSign = 38, + xlCurrencySpaceBefore = 36, + xlCurrencyTrailingZeros = 39, + xlDayLeadingZero = 42, + xlMDY = 44, + xlMetric = 35, + xlMonthLeadingZero = 41, + xlNonEnglishFunctions = 34, + xlTimeLeadingZero = 45, + } + + type XlApplicationInternational = XlApplicationInternationalStrings | XlApplicationInternationalNumbers | XlApplicationInternationalBooleans; + const enum XlApplyNamesOrder { xlColumnThenRow = 2, xlRowThenColumn = 1, } - // tslint:disable-next-line:no-const-enum const enum XlArabicModes { xlArabicBothStrict = 3, xlArabicNone = 0, @@ -279,7 +359,6 @@ declare namespace Excel { xlArabicStrictFinalYaa = 2, } - // tslint:disable-next-line:no-const-enum const enum XlArrangeStyle { xlArrangeStyleCascade = 7, xlArrangeStyleHorizontal = -4128, @@ -287,14 +366,12 @@ declare namespace Excel { xlArrangeStyleVertical = -4166, } - // tslint:disable-next-line:no-const-enum const enum XlArrowHeadLength { xlArrowHeadLengthLong = 3, xlArrowHeadLengthMedium = -4138, xlArrowHeadLengthShort = 1, } - // tslint:disable-next-line:no-const-enum const enum XlArrowHeadStyle { xlArrowHeadStyleClosed = 3, xlArrowHeadStyleDoubleClosed = 5, @@ -303,14 +380,12 @@ declare namespace Excel { xlArrowHeadStyleOpen = 2, } - // tslint:disable-next-line:no-const-enum const enum XlArrowHeadWidth { xlArrowHeadWidthMedium = -4138, xlArrowHeadWidthNarrow = 1, xlArrowHeadWidthWide = 3, } - // tslint:disable-next-line:no-const-enum const enum XlAutoFillType { xlFillCopy = 1, xlFillDays = 5, @@ -325,7 +400,6 @@ declare namespace Excel { xlLinearTrend = 9, } - // tslint:disable-next-line:no-const-enum const enum XlAutoFilterOperator { xlAnd = 1, xlBottom10Items = 4, @@ -343,7 +417,6 @@ declare namespace Excel { xlTop10Percent = 5, } - // tslint:disable-next-line:no-const-enum const enum XlAxisCrosses { xlAxisCrossesAutomatic = -4105, xlAxisCrossesCustom = -4114, @@ -351,27 +424,23 @@ declare namespace Excel { xlAxisCrossesMinimum = 4, } - // tslint:disable-next-line:no-const-enum const enum XlAxisGroup { xlPrimary = 1, xlSecondary = 2, } - // tslint:disable-next-line:no-const-enum const enum XlAxisType { xlCategory = 1, xlSeriesAxis = 3, xlValue = 2, } - // tslint:disable-next-line:no-const-enum const enum XlBackground { xlBackgroundAutomatic = -4105, xlBackgroundOpaque = 3, xlBackgroundTransparent = 2, } - // tslint:disable-next-line:no-const-enum const enum XlBarShape { xlBox = 0, xlConeToMax = 5, @@ -381,7 +450,6 @@ declare namespace Excel { xlPyramidToPoint = 1, } - // tslint:disable-next-line:no-const-enum const enum XlBordersIndex { xlDiagonalDown = 5, xlDiagonalUp = 6, @@ -393,7 +461,6 @@ declare namespace Excel { xlInsideVertical = 11, } - // tslint:disable-next-line:no-const-enum const enum XlBorderWeight { xlHairline = 1, xlMedium = -4138, @@ -401,7 +468,6 @@ declare namespace Excel { xlThin = 2, } - // tslint:disable-next-line:no-const-enum const enum XlBuiltInDialog { _xlDialogChartSourceData = 541, _xlDialogPhonetic = 538, @@ -664,62 +730,53 @@ declare namespace Excel { xlDialogZoom = 256, } - // tslint:disable-next-line:no-const-enum const enum XlCalcFor { xlAllValues = 0, xlColGroups = 2, xlRowGroups = 1, } - // tslint:disable-next-line:no-const-enum const enum XlCalculatedMemberType { xlCalculatedMember = 0, xlCalculatedSet = 1, } - // tslint:disable-next-line:no-const-enum const enum XlCalculation { xlCalculationAutomatic = -4105, xlCalculationManual = -4135, xlCalculationSemiautomatic = 2, } - // tslint:disable-next-line:no-const-enum const enum XlCalculationInterruptKey { xlAnyKey = 2, xlEscKey = 1, xlNoKey = 0, } - // tslint:disable-next-line:no-const-enum const enum XlCalculationState { xlCalculating = 1, xlDone = 0, xlPending = 2, } - // tslint:disable-next-line:no-const-enum const enum XlCategoryType { xlAutomaticScale = -4105, xlCategoryScale = 2, xlTimeScale = 3, } - // tslint:disable-next-line:no-const-enum const enum XlCellChangedState { xlCellChangeApplied = 3, xlCellChanged = 2, xlCellNotChanged = 1, } - // tslint:disable-next-line:no-const-enum const enum XlCellInsertionMode { xlInsertDeleteCells = 1, xlInsertEntireRows = 2, xlOverwriteCells = 0, } - // tslint:disable-next-line:no-const-enum const enum XlCellType { xlCellTypeAllFormatConditions = -4172, xlCellTypeAllValidation = -4174, @@ -733,20 +790,17 @@ declare namespace Excel { xlCellTypeVisible = 12, } - // tslint:disable-next-line:no-const-enum const enum XlChartElementPosition { xlChartElementPositionAutomatic = -4105, xlChartElementPositionCustom = -4114, } - // tslint:disable-next-line:no-const-enum const enum XlChartGallery { xlAnyGallery = 23, xlBuiltIn = 21, xlUserDefined = 22, } - // tslint:disable-next-line:no-const-enum const enum XlChartItem { xlAxis = 21, xlAxisTitle = 17, @@ -782,14 +836,12 @@ declare namespace Excel { xlYErrorBars = 11, } - // tslint:disable-next-line:no-const-enum const enum XlChartLocation { xlLocationAsNewSheet = 1, xlLocationAsObject = 2, xlLocationAutomatic = 3, } - // tslint:disable-next-line:no-const-enum const enum XlChartPicturePlacement { xlAllFaces = 7, xlEnd = 2, @@ -800,14 +852,12 @@ declare namespace Excel { xlSides = 1, } - // tslint:disable-next-line:no-const-enum const enum XlChartPictureType { xlStack = 2, xlStackScale = 3, xlStretch = 1, } - // tslint:disable-next-line:no-const-enum const enum XlChartSplitType { xlSplitByCustomSplit = 4, xlSplitByPercentValue = 3, @@ -815,7 +865,6 @@ declare namespace Excel { xlSplitByValue = 2, } - // tslint:disable-next-line:no-const-enum const enum XlChartType { xl3DArea = -4098, xl3DAreaStacked = 78, @@ -892,14 +941,12 @@ declare namespace Excel { xlXYScatterSmoothNoMarkers = 73, } - // tslint:disable-next-line:no-const-enum const enum XlCheckInVersionType { xlCheckInMajorVersion = 1, xlCheckInMinorVersion = 0, xlCheckInOverwriteVersion = 2, } - // tslint:disable-next-line:no-const-enum const enum XlClipboardFormat { xlClipboardFormatBIFF = 8, xlClipboardFormatBIFF12 = 63, @@ -937,7 +984,6 @@ declare namespace Excel { xlClipboardFormatWK1 = 10, } - // tslint:disable-next-line:no-const-enum const enum XlCmdType { xlCmdCube = 1, xlCmdDefault = 4, @@ -946,13 +992,11 @@ declare namespace Excel { xlCmdTable = 3, } - // tslint:disable-next-line:no-const-enum const enum XlColorIndex { xlColorIndexAutomatic = -4105, xlColorIndexNone = -4142, } - // tslint:disable-next-line:no-const-enum const enum XlColumnDataType { xlDMYFormat = 4, xlDYMFormat = 7, @@ -966,21 +1010,18 @@ declare namespace Excel { xlYMDFormat = 5, } - // tslint:disable-next-line:no-const-enum const enum XlCommandUnderlines { xlCommandUnderlinesAutomatic = -4105, xlCommandUnderlinesOff = -4146, xlCommandUnderlinesOn = 1, } - // tslint:disable-next-line:no-const-enum const enum XlCommentDisplayMode { xlCommentAndIndicator = 1, xlCommentIndicatorOnly = -1, xlNoIndicator = 0, } - // tslint:disable-next-line:no-const-enum const enum XlConditionValueTypes { xlConditionValueAutomaticMax = 7, xlConditionValueAutomaticMin = 6, @@ -993,7 +1034,6 @@ declare namespace Excel { xlConditionValuePercentile = 5, } - // tslint:disable-next-line:no-const-enum const enum XlConnectionType { xlConnectionTypeODBC = 2, xlConnectionTypeOLEDB = 1, @@ -1002,7 +1042,6 @@ declare namespace Excel { xlConnectionTypeXMLMAP = 3, } - // tslint:disable-next-line:no-const-enum const enum XlConsolidationFunction { xlAverage = -4106, xlCount = -4112, @@ -1018,7 +1057,6 @@ declare namespace Excel { xlVarP = -4165, } - // tslint:disable-next-line:no-const-enum const enum XlContainsOperator { xlBeginsWith = 2, xlContains = 0, @@ -1026,32 +1064,27 @@ declare namespace Excel { xlEndsWith = 3, } - // tslint:disable-next-line:no-const-enum const enum XlCopyPictureFormat { xlBitmap = 2, xlPicture = -4147, } - // tslint:disable-next-line:no-const-enum const enum XlCorruptLoad { xlExtractData = 2, xlNormalLoad = 0, xlRepairFile = 1, } - // tslint:disable-next-line:no-const-enum const enum XlCreator { xlCreatorCode = 1480803660, } - // tslint:disable-next-line:no-const-enum const enum XlCredentialsMethod { xlCredentialsMethodIntegrated = 0, xlCredentialsMethodNone = 1, xlCredentialsMethodStored = 2, } - // tslint:disable-next-line:no-const-enum const enum XlCubeFieldSubType { xlCubeAttribute = 4, xlCubeCalculatedMeasure = 5, @@ -1065,20 +1098,17 @@ declare namespace Excel { xlCubeSet = 3, } - // tslint:disable-next-line:no-const-enum const enum XlCubeFieldType { xlHierarchy = 1, xlMeasure = 2, xlSet = 3, } - // tslint:disable-next-line:no-const-enum const enum XlCutCopyMode { xlCopy = 1, xlCut = 2, } - // tslint:disable-next-line:no-const-enum const enum XlCVError { xlErrDiv0 = 2007, xlErrNA = 2042, @@ -1089,32 +1119,27 @@ declare namespace Excel { xlErrValue = 2015, } - // tslint:disable-next-line:no-const-enum const enum XlDataBarAxisPosition { xlDataBarAxisAutomatic = 0, xlDataBarAxisMidpoint = 1, xlDataBarAxisNone = 2, } - // tslint:disable-next-line:no-const-enum const enum XlDataBarBorderType { xlDataBarBorderNone = 0, xlDataBarBorderSolid = 1, } - // tslint:disable-next-line:no-const-enum const enum XlDataBarFillType { xlDataBarFillGradient = 1, xlDataBarFillSolid = 0, } - // tslint:disable-next-line:no-const-enum const enum XlDataBarNegativeColorType { xlDataBarColor = 0, xlDataBarSameAsPositive = 1, } - // tslint:disable-next-line:no-const-enum const enum XlDataLabelPosition { xlLabelPositionAbove = 0, xlLabelPositionBelow = 1, @@ -1129,12 +1154,10 @@ declare namespace Excel { xlLabelPositionRight = -4152, } - // tslint:disable-next-line:no-const-enum const enum XlDataLabelSeparator { xlDataLabelSeparatorDefault = 1, } - // tslint:disable-next-line:no-const-enum const enum XlDataLabelsType { xlDataLabelsShowBubbleSizes = 6, xlDataLabelsShowLabel = 4, @@ -1144,7 +1167,6 @@ declare namespace Excel { xlDataLabelsShowValue = 2, } - // tslint:disable-next-line:no-const-enum const enum XlDataSeriesDate { xlDay = 1, xlMonth = 3, @@ -1152,7 +1174,6 @@ declare namespace Excel { xlYear = 4, } - // tslint:disable-next-line:no-const-enum const enum XlDataSeriesType { xlAutoFill = 4, xlChronological = 3, @@ -1160,13 +1181,11 @@ declare namespace Excel { xlGrowth = 2, } - // tslint:disable-next-line:no-const-enum const enum XlDeleteShiftDirection { xlShiftToLeft = -4159, xlShiftUp = -4162, } - // tslint:disable-next-line:no-const-enum const enum XlDirection { xlDown = -4121, xlToLeft = -4159, @@ -1174,21 +1193,18 @@ declare namespace Excel { xlUp = -4162, } - // tslint:disable-next-line:no-const-enum const enum XlDisplayBlanksAs { xlInterpolated = 3, xlNotPlotted = 1, xlZero = 2, } - // tslint:disable-next-line:no-const-enum const enum XlDisplayDrawingObjects { xlDisplayShapes = -4104, xlHide = 3, xlPlaceholders = 2, } - // tslint:disable-next-line:no-const-enum const enum XlDisplayUnit { xlHundredMillions = -8, xlHundreds = -2, @@ -1201,20 +1217,17 @@ declare namespace Excel { xlThousands = -3, } - // tslint:disable-next-line:no-const-enum const enum XlDupeUnique { xlDuplicate = 1, xlUnique = 0, } - // tslint:disable-next-line:no-const-enum const enum XlDVAlertStyle { xlValidAlertInformation = 3, xlValidAlertStop = 1, xlValidAlertWarning = 2, } - // tslint:disable-next-line:no-const-enum const enum XlDVType { xlValidateCustom = 7, xlValidateDate = 4, @@ -1226,7 +1239,6 @@ declare namespace Excel { xlValidateWholeNumber = 1, } - // tslint:disable-next-line:no-const-enum const enum XlDynamicFilterCriteria { xlFilterAboveAverage = 33, xlFilterAllDatesInPeriodApril = 24, @@ -1264,7 +1276,6 @@ declare namespace Excel { xlFilterYesterday = 2, } - // tslint:disable-next-line:no-const-enum const enum XlEditionFormat { xlBIFF = 2, xlPICT = 1, @@ -1272,7 +1283,6 @@ declare namespace Excel { xlVALU = 8, } - // tslint:disable-next-line:no-const-enum const enum XlEditionOptionsOption { xlAutomaticUpdate = 4, xlCancel = 1, @@ -1284,39 +1294,33 @@ declare namespace Excel { xlUpdateSubscriber = 2, } - // tslint:disable-next-line:no-const-enum const enum XlEditionType { xlPublisher = 1, xlSubscriber = 2, } - // tslint:disable-next-line:no-const-enum const enum XlEnableCancelKey { xlDisabled = 0, xlErrorHandler = 2, xlInterrupt = 1, } - // tslint:disable-next-line:no-const-enum const enum XlEnableSelection { xlNoRestrictions = 0, xlNoSelection = -4142, xlUnlockedCells = 1, } - // tslint:disable-next-line:no-const-enum const enum XlEndStyleCap { xlCap = 1, xlNoCap = 2, } - // tslint:disable-next-line:no-const-enum const enum XlErrorBarDirection { xlX = -4168, xlY = 1, } - // tslint:disable-next-line:no-const-enum const enum XlErrorBarInclude { xlErrorBarIncludeBoth = 1, xlErrorBarIncludeMinusValues = 3, @@ -1324,7 +1328,6 @@ declare namespace Excel { xlErrorBarIncludePlusValues = 2, } - // tslint:disable-next-line:no-const-enum const enum XlErrorBarType { xlErrorBarTypeCustom = -4114, xlErrorBarTypeFixedValue = 1, @@ -1333,7 +1336,6 @@ declare namespace Excel { xlErrorBarTypeStError = 4, } - // tslint:disable-next-line:no-const-enum const enum XlErrorChecks { xlEmptyCellReferences = 7, xlEvaluateToError = 1, @@ -1346,13 +1348,11 @@ declare namespace Excel { xlUnlockedFormulaCells = 6, } - // tslint:disable-next-line:no-const-enum const enum XlFileAccess { xlReadOnly = 3, xlReadWrite = 2, } - // tslint:disable-next-line:no-const-enum const enum XlFileFormat { xlAddIn = 18, xlAddIn8 = 18, @@ -1410,27 +1410,23 @@ declare namespace Excel { xlXMLSpreadsheet = 46, } - // tslint:disable-next-line:no-const-enum const enum XlFileValidationPivotMode { xlFileValidationPivotDefault = 0, xlFileValidationPivotRun = 1, xlFileValidationPivotSkip = 2, } - // tslint:disable-next-line:no-const-enum const enum XlFillWith { xlFillWithAll = -4104, xlFillWithContents = 2, xlFillWithFormats = -4122, } - // tslint:disable-next-line:no-const-enum const enum XlFilterAction { xlFilterCopy = 2, xlFilterInPlace = 1, } - // tslint:disable-next-line:no-const-enum const enum XlFilterAllDatesInPeriod { xlFilterAllDatesInPeriodDay = 2, xlFilterAllDatesInPeriodHour = 3, @@ -1440,26 +1436,22 @@ declare namespace Excel { xlFilterAllDatesInPeriodYear = 0, } - // tslint:disable-next-line:no-const-enum const enum XlFindLookIn { xlComments = -4144, xlFormulas = -4123, xlValues = -4163, } - // tslint:disable-next-line:no-const-enum const enum XlFixedFormatQuality { xlQualityMinimum = 1, xlQualityStandard = 0, } - // tslint:disable-next-line:no-const-enum const enum XlFixedFormatType { xlTypePDF = 0, xlTypeXPS = 1, } - // tslint:disable-next-line:no-const-enum const enum XlFormatConditionOperator { xlBetween = 1, xlEqual = 3, @@ -1471,7 +1463,6 @@ declare namespace Excel { xlNotEqual = 4, } - // tslint:disable-next-line:no-const-enum const enum XlFormatConditionType { xlAboveAverageCondition = 12, xlBlanksCondition = 10, @@ -1489,7 +1480,6 @@ declare namespace Excel { xlUniqueValues = 8, } - // tslint:disable-next-line:no-const-enum const enum XlFormatFilterTypes { xlFilterBottom = 0, xlFilterBottomPercent = 2, @@ -1497,7 +1487,6 @@ declare namespace Excel { xlFilterTopPercent = 3, } - // tslint:disable-next-line:no-const-enum const enum XlFormControl { xlButtonControl = 0, xlCheckBox = 1, @@ -1511,7 +1500,6 @@ declare namespace Excel { xlSpinner = 9, } - // tslint:disable-next-line:no-const-enum const enum XlFormulaLabel { xlColumnLabels = 2, xlMixedLabels = 3, @@ -1519,19 +1507,16 @@ declare namespace Excel { xlRowLabels = 1, } - // tslint:disable-next-line:no-const-enum const enum XlGenerateTableRefs { xlGenerateTableRefA1 = 0, xlGenerateTableRefStruct = 1, } - // tslint:disable-next-line:no-const-enum const enum XlGradientFillType { xlGradientFillLinear = 0, xlGradientFillPath = 1, } - // tslint:disable-next-line:no-const-enum const enum XlHAlign { xlHAlignCenter = -4108, xlHAlignCenterAcrossSelection = 7, @@ -1543,7 +1528,6 @@ declare namespace Excel { xlHAlignRight = -4152, } - // tslint:disable-next-line:no-const-enum const enum XlHebrewModes { xlHebrewFullScript = 0, xlHebrewMixedAuthorizedScript = 3, @@ -1551,14 +1535,12 @@ declare namespace Excel { xlHebrewPartialScript = 1, } - // tslint:disable-next-line:no-const-enum const enum XlHighlightChangesTime { xlAllChanges = 2, xlNotYetReviewed = 3, xlSinceMyLastSave = 1, } - // tslint:disable-next-line:no-const-enum const enum XlHtmlType { xlHtmlCalc = 1, xlHtmlChart = 3, @@ -1566,7 +1548,6 @@ declare namespace Excel { xlHtmlStatic = 0, } - // tslint:disable-next-line:no-const-enum const enum XlIcon { xlIcon0Bars = 37, xlIcon0FilledBoxes = 52, @@ -1623,7 +1604,6 @@ declare namespace Excel { xlIconYellowUpInclineArrow = 25, } - // tslint:disable-next-line:no-const-enum const enum XlIconSet { xl3Arrows = 1, xl3ArrowsGray = 2, @@ -1648,7 +1628,6 @@ declare namespace Excel { xlCustomSet = -1, } - // tslint:disable-next-line:no-const-enum const enum XlIMEMode { xlIMEModeAlpha = 8, xlIMEModeAlphaFull = 7, @@ -1663,39 +1642,33 @@ declare namespace Excel { xlIMEModeOn = 1, } - // tslint:disable-next-line:no-const-enum const enum XlImportDataAs { xlPivotTableReport = 1, xlQueryTable = 0, xlTable = 2, } - // tslint:disable-next-line:no-const-enum const enum XlInsertFormatOrigin { xlFormatFromLeftOrAbove = 0, xlFormatFromRightOrBelow = 1, } - // tslint:disable-next-line:no-const-enum const enum XlInsertShiftDirection { xlShiftDown = -4121, xlShiftToRight = -4161, } - // tslint:disable-next-line:no-const-enum const enum XlLayoutFormType { xlOutline = 1, xlTabular = 0, } - // tslint:disable-next-line:no-const-enum const enum XlLayoutRowType { xlCompactRow = 0, xlOutlineRow = 2, xlTabularRow = 1, } - // tslint:disable-next-line:no-const-enum const enum XlLegendPosition { xlLegendPositionBottom = -4107, xlLegendPositionCorner = 2, @@ -1705,7 +1678,6 @@ declare namespace Excel { xlLegendPositionTop = -4160, } - // tslint:disable-next-line:no-const-enum const enum XlLineStyle { xlContinuous = 1, xlDash = -4115, @@ -1717,7 +1689,6 @@ declare namespace Excel { xlSlantDashDot = 13, } - // tslint:disable-next-line:no-const-enum const enum XlLink { xlExcelLinks = 1, xlOLELinks = 2, @@ -1725,21 +1696,18 @@ declare namespace Excel { xlSubscribers = 6, } - // tslint:disable-next-line:no-const-enum const enum XlLinkInfo { xlEditionDate = 2, xlLinkInfoStatus = 3, xlUpdateState = 1, } - // tslint:disable-next-line:no-const-enum const enum XlLinkInfoType { xlLinkInfoOLELinks = 2, xlLinkInfoPublishers = 5, xlLinkInfoSubscribers = 6, } - // tslint:disable-next-line:no-const-enum const enum XlLinkStatus { xlLinkStatusCopiedValues = 10, xlLinkStatusIndeterminate = 5, @@ -1754,13 +1722,11 @@ declare namespace Excel { xlLinkStatusSourceOpen = 9, } - // tslint:disable-next-line:no-const-enum const enum XlLinkType { xlLinkTypeExcelLinks = 1, xlLinkTypeOLELinks = 2, } - // tslint:disable-next-line:no-const-enum const enum XlListConflict { xlListConflictDialog = 0, xlListConflictDiscardAllConflicts = 2, @@ -1768,7 +1734,6 @@ declare namespace Excel { xlListConflictRetryAllConflicts = 1, } - // tslint:disable-next-line:no-const-enum const enum XlListDataType { xlListDataTypeCheckbox = 9, xlListDataTypeChoice = 6, @@ -1785,7 +1750,6 @@ declare namespace Excel { xlListDataTypeText = 1, } - // tslint:disable-next-line:no-const-enum const enum XlListObjectSourceType { xlSrcExternal = 0, xlSrcQuery = 3, @@ -1793,7 +1757,6 @@ declare namespace Excel { xlSrcXml = 2, } - // tslint:disable-next-line:no-const-enum const enum XlLocationInTable { xlColumnHeader = -4110, xlColumnItem = 5, @@ -1806,27 +1769,23 @@ declare namespace Excel { xlTableBody = 8, } - // tslint:disable-next-line:no-const-enum const enum XlLookAt { xlPart = 2, xlWhole = 1, } - // tslint:disable-next-line:no-const-enum const enum XlLookFor { xlLookForBlanks = 0, xlLookForErrors = 1, xlLookForFormulas = 2, } - // tslint:disable-next-line:no-const-enum const enum XlMailSystem { xlMAPI = 1, xlNoMailSystem = 0, xlPowerTalk = 2, } - // tslint:disable-next-line:no-const-enum const enum XlMarkerStyle { xlMarkerStyleAutomatic = -4105, xlMarkerStyleCircle = 8, @@ -1842,21 +1801,18 @@ declare namespace Excel { xlMarkerStyleX = -4168, } - // tslint:disable-next-line:no-const-enum const enum XlMeasurementUnits { xlCentimeters = 1, xlInches = 0, xlMillimeters = 2, } - // tslint:disable-next-line:no-const-enum const enum XlMouseButton { xlNoButton = 0, xlPrimaryButton = 1, xlSecondaryButton = 2, } - // tslint:disable-next-line:no-const-enum const enum XlMousePointer { xlDefault = -4143, xlIBeam = 3, @@ -1864,7 +1820,6 @@ declare namespace Excel { xlWait = 2, } - // tslint:disable-next-line:no-const-enum const enum XlMSApplication { xlMicrosoftAccess = 4, xlMicrosoftFoxPro = 5, @@ -1875,46 +1830,39 @@ declare namespace Excel { xlMicrosoftWord = 1, } - // tslint:disable-next-line:no-const-enum const enum XlOartHorizontalOverflow { xlOartHorizontalOverflowClip = 1, xlOartHorizontalOverflowOverflow = 0, } - // tslint:disable-next-line:no-const-enum const enum XlOartVerticalOverflow { xlOartVerticalOverflowClip = 1, xlOartVerticalOverflowEllipsis = 2, xlOartVerticalOverflowOverflow = 0, } - // tslint:disable-next-line:no-const-enum const enum XlObjectSize { xlFitToPage = 2, xlFullPage = 3, xlScreenSize = 1, } - // tslint:disable-next-line:no-const-enum const enum XlOLEType { xlOLEControl = 2, xlOLEEmbed = 1, xlOLELink = 0, } - // tslint:disable-next-line:no-const-enum const enum XlOLEVerb { xlVerbOpen = 2, xlVerbPrimary = 1, } - // tslint:disable-next-line:no-const-enum const enum XlOrder { xlDownThenOver = 1, xlOverThenDown = 2, } - // tslint:disable-next-line:no-const-enum const enum XlOrientation { xlDownward = -4170, xlHorizontal = -4128, @@ -1922,26 +1870,22 @@ declare namespace Excel { xlVertical = -4166, } - // tslint:disable-next-line:no-const-enum const enum XlPageBreak { xlPageBreakAutomatic = -4105, xlPageBreakManual = -4135, xlPageBreakNone = -4142, } - // tslint:disable-next-line:no-const-enum const enum XlPageBreakExtent { xlPageBreakFull = 1, xlPageBreakPartial = 2, } - // tslint:disable-next-line:no-const-enum const enum XlPageOrientation { xlLandscape = 2, xlPortrait = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPaperSize { xlPaper10x14 = 16, xlPaper11x17 = 17, @@ -1987,7 +1931,6 @@ declare namespace Excel { xlPaperUser = 256, } - // tslint:disable-next-line:no-const-enum const enum XlParameterDataType { xlParamTypeBigInt = -5, xlParamTypeBinary = -2, @@ -2012,14 +1955,12 @@ declare namespace Excel { xlParamTypeWChar = -8, } - // tslint:disable-next-line:no-const-enum const enum XlParameterType { xlConstant = 1, xlPrompt = 0, xlRange = 2, } - // tslint:disable-next-line:no-const-enum const enum XlPasteSpecialOperation { xlPasteSpecialOperationAdd = 2, xlPasteSpecialOperationDivide = 5, @@ -2028,7 +1969,6 @@ declare namespace Excel { xlPasteSpecialOperationSubtract = 3, } - // tslint:disable-next-line:no-const-enum const enum XlPasteType { xlPasteAll = -4104, xlPasteAllExceptBorders = 7, @@ -2044,7 +1984,6 @@ declare namespace Excel { xlPasteValuesAndNumberFormats = 12, } - // tslint:disable-next-line:no-const-enum const enum XlPattern { xlPatternAutomatic = -4105, xlPatternChecker = 9, @@ -2070,7 +2009,6 @@ declare namespace Excel { xlPatternVertical = -4166, } - // tslint:disable-next-line:no-const-enum const enum XlPhoneticAlignment { xlPhoneticAlignCenter = 2, xlPhoneticAlignDistributed = 3, @@ -2078,7 +2016,6 @@ declare namespace Excel { xlPhoneticAlignNoControl = 0, } - // tslint:disable-next-line:no-const-enum const enum XlPhoneticCharacterType { xlHiragana = 2, xlKatakana = 1, @@ -2086,13 +2023,11 @@ declare namespace Excel { xlNoConversion = 3, } - // tslint:disable-next-line:no-const-enum const enum XlPictureAppearance { xlPrinter = 2, xlScreen = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPictureConvertorType { xlBMP = 1, xlCGM = 7, @@ -2109,7 +2044,6 @@ declare namespace Excel { xlWPG = 3, } - // tslint:disable-next-line:no-const-enum const enum XlPieSliceIndex { xlCenterPoint = 5, xlInnerCenterPoint = 8, @@ -2122,13 +2056,11 @@ declare namespace Excel { xlOuterCounterClockwisePoint = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPieSliceLocation { xlHorizontalCoordinate = 1, xlVerticalCoordinate = 2, } - // tslint:disable-next-line:no-const-enum const enum XlPivotCellType { xlPivotCellBlankCell = 9, xlPivotCellCustomSubtotal = 7, @@ -2142,14 +2074,12 @@ declare namespace Excel { xlPivotCellValue = 0, } - // tslint:disable-next-line:no-const-enum const enum XlPivotConditionScope { xlDataFieldScope = 2, xlFieldsScope = 1, xlSelectionScope = 0, } - // tslint:disable-next-line:no-const-enum const enum XlPivotFieldCalculation { xlDifferenceFrom = 2, xlIndex = 9, @@ -2168,14 +2098,12 @@ declare namespace Excel { xlRunningTotal = 5, } - // tslint:disable-next-line:no-const-enum const enum XlPivotFieldDataType { xlDate = 2, xlNumber = -4145, xlText = -4158, } - // tslint:disable-next-line:no-const-enum const enum XlPivotFieldOrientation { xlColumnField = 2, xlDataField = 4, @@ -2184,13 +2112,11 @@ declare namespace Excel { xlRowField = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPivotFieldRepeatLabels { xlDoNotRepeatLabels = 1, xlRepeatLabels = 2, } - // tslint:disable-next-line:no-const-enum const enum XlPivotFilterType { xlAfter = 33, xlAfterOrEqualTo = 34, @@ -2262,7 +2188,6 @@ declare namespace Excel { xlYearToDate = 52, } - // tslint:disable-next-line:no-const-enum const enum XlPivotFormatType { xlPTClassic = 20, xlPTNone = 21, @@ -2288,7 +2213,6 @@ declare namespace Excel { xlTable9 = 18, } - // tslint:disable-next-line:no-const-enum const enum XlPivotLineType { xlPivotLineBlank = 3, xlPivotLineGrandTotal = 2, @@ -2296,7 +2220,6 @@ declare namespace Excel { xlPivotLineSubtotal = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPivotTableMissingItems { xlMissingItemsDefault = -1, xlMissingItemsMax = 32500, @@ -2304,7 +2227,6 @@ declare namespace Excel { xlMissingItemsNone = 0, } - // tslint:disable-next-line:no-const-enum const enum XlPivotTableSourceType { xlConsolidation = 3, xlDatabase = 1, @@ -2313,7 +2235,6 @@ declare namespace Excel { xlScenario = 4, } - // tslint:disable-next-line:no-const-enum const enum XlPivotTableVersionList { xlPivotTableVersion10 = 1, xlPivotTableVersion11 = 2, @@ -2323,28 +2244,24 @@ declare namespace Excel { xlPivotTableVersionCurrent = -1, } - // tslint:disable-next-line:no-const-enum const enum XlPlacement { xlFreeFloating = 3, xlMove = 2, xlMoveAndSize = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPlatform { xlMacintosh = 1, xlMSDOS = 3, xlWindows = 2, } - // tslint:disable-next-line:no-const-enum const enum XlPortugueseReform { xlPortugueseBoth = 3, xlPortuguesePostReform = 2, xlPortuguesePreReform = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPrintErrors { xlPrintErrorsBlank = 1, xlPrintErrorsDash = 2, @@ -2352,42 +2269,36 @@ declare namespace Excel { xlPrintErrorsNA = 3, } - // tslint:disable-next-line:no-const-enum const enum XlPrintLocation { xlPrintInPlace = 16, xlPrintNoComments = -4142, xlPrintSheetEnd = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPriority { xlPriorityHigh = -4127, xlPriorityLow = -4134, xlPriorityNormal = -4143, } - // tslint:disable-next-line:no-const-enum const enum XlPropertyDisplayedIn { xlDisplayPropertyInPivotTable = 1, xlDisplayPropertyInPivotTableAndTooltip = 3, xlDisplayPropertyInTooltip = 2, } - // tslint:disable-next-line:no-const-enum const enum XlProtectedViewCloseReason { xlProtectedViewCloseEdit = 1, xlProtectedViewCloseForced = 2, xlProtectedViewCloseNormal = 0, } - // tslint:disable-next-line:no-const-enum const enum XlProtectedViewWindowState { xlProtectedViewWindowMaximized = 2, xlProtectedViewWindowMinimized = 1, xlProtectedViewWindowNormal = 0, } - // tslint:disable-next-line:no-const-enum const enum XlPTSelectionMode { xlBlanks = 4, xlButton = 15, @@ -2398,7 +2309,6 @@ declare namespace Excel { xlOrigin = 3, } - // tslint:disable-next-line:no-const-enum const enum XlQueryType { xlADORecordset = 7, xlDAORecordset = 2, @@ -2408,7 +2318,6 @@ declare namespace Excel { xlWebQuery = 4, } - // tslint:disable-next-line:no-const-enum const enum XlRangeAutoFormat { xlRangeAutoFormat3DEffects1 = 13, xlRangeAutoFormat3DEffects2 = 14, @@ -2455,20 +2364,17 @@ declare namespace Excel { xlRangeAutoFormatTable9 = 40, } - // tslint:disable-next-line:no-const-enum const enum XlRangeValueDataType { xlRangeValueDefault = 10, xlRangeValueMSPersistXML = 12, xlRangeValueXMLSpreadsheet = 11, } - // tslint:disable-next-line:no-const-enum const enum XlReferenceStyle { xlA1 = 1, xlR1C1 = -4150, } - // tslint:disable-next-line:no-const-enum const enum XlReferenceType { xlAbsolute = 1, xlAbsRowRelColumn = 2, @@ -2476,7 +2382,6 @@ declare namespace Excel { xlRelRowAbsColumn = 3, } - // tslint:disable-next-line:no-const-enum const enum XlRemoveDocInfoType { xlRDIAll = 99, xlRDIComments = 1, @@ -2497,7 +2402,6 @@ declare namespace Excel { xlRDISendForReview = 7, } - // tslint:disable-next-line:no-const-enum const enum XlRgbColor { rgbAliceBlue = 16775408, rgbAntiqueWhite = 14150650, @@ -2645,33 +2549,28 @@ declare namespace Excel { rgbYellowGreen = 3329434, } - // tslint:disable-next-line:no-const-enum const enum XlRobustConnect { xlAlways = 1, xlAsRequired = 0, xlNever = 2, } - // tslint:disable-next-line:no-const-enum const enum XlRoutingSlipDelivery { xlAllAtOnce = 2, xlOneAfterAnother = 1, } - // tslint:disable-next-line:no-const-enum const enum XlRoutingSlipStatus { xlNotYetRouted = 0, xlRoutingComplete = 2, xlRoutingInProgress = 1, } - // tslint:disable-next-line:no-const-enum const enum XlRowCol { xlColumns = 2, xlRows = 1, } - // tslint:disable-next-line:no-const-enum const enum XlRunAutoMacro { xlAutoActivate = 3, xlAutoClose = 2, @@ -2679,51 +2578,43 @@ declare namespace Excel { xlAutoOpen = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSaveAction { xlDoNotSaveChanges = 2, xlSaveChanges = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSaveAsAccessMode { xlExclusive = 3, xlNoChange = 1, xlShared = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSaveConflictResolution { xlLocalSessionChanges = 2, xlOtherSessionChanges = 3, xlUserResolution = 1, } - // tslint:disable-next-line:no-const-enum const enum XlScaleType { xlScaleLinear = -4132, xlScaleLogarithmic = -4133, } - // tslint:disable-next-line:no-const-enum const enum XlSearchDirection { xlNext = 1, xlPrevious = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSearchOrder { xlByColumns = 2, xlByRows = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSearchWithin { xlWithinSheet = 1, xlWithinWorkbook = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSheetType { xlChart = -4109, xlDialogSheet = -4116, @@ -2732,34 +2623,29 @@ declare namespace Excel { xlWorksheet = -4167, } - // tslint:disable-next-line:no-const-enum const enum XlSheetVisibility { xlSheetHidden = 0, xlSheetVeryHidden = 2, xlSheetVisible = -1, } - // tslint:disable-next-line:no-const-enum const enum XlSizeRepresents { xlSizeIsArea = 1, xlSizeIsWidth = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSlicerCrossFilterType { xlSlicerCrossFilterShowItemsWithDataAtTop = 2, xlSlicerCrossFilterShowItemsWithNoData = 3, xlSlicerNoCrossFilter = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSlicerSort { xlSlicerSortAscending = 2, xlSlicerSortDataSourceOrder = 1, xlSlicerSortDescending = 3, } - // tslint:disable-next-line:no-const-enum const enum XlSmartTagControlType { xlSmartTagControlActiveX = 13, xlSmartTagControlButton = 6, @@ -2777,32 +2663,27 @@ declare namespace Excel { xlSmartTagControlTextbox = 10, } - // tslint:disable-next-line:no-const-enum const enum XlSmartTagDisplayMode { xlButtonOnly = 2, xlDisplayNone = 1, xlIndicatorAndButton = 0, } - // tslint:disable-next-line:no-const-enum const enum XlSortDataOption { xlSortNormal = 0, xlSortTextAsNumbers = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSortMethod { xlPinYin = 1, xlStroke = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSortMethodOld { xlCodePage = 2, xlSyllabary = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSortOn { xlSortOnCellColor = 1, xlSortOnFontColor = 2, @@ -2810,25 +2691,21 @@ declare namespace Excel { xlSortOnValues = 0, } - // tslint:disable-next-line:no-const-enum const enum XlSortOrder { xlAscending = 1, xlDescending = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSortOrientation { xlSortColumns = 1, xlSortRows = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSortType { xlSortLabels = 2, xlSortValues = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSourceType { xlSourceAutoFilter = 3, xlSourceChart = 5, @@ -2840,41 +2717,35 @@ declare namespace Excel { xlSourceWorkbook = 0, } - // tslint:disable-next-line:no-const-enum const enum XlSpanishModes { xlSpanishTuteoAndVoseo = 1, xlSpanishTuteoOnly = 0, xlSpanishVoseoOnly = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSparklineRowCol { xlSparklineColumnsSquare = 2, xlSparklineNonSquare = 0, xlSparklineRowsSquare = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSparkScale { xlSparkScaleCustom = 3, xlSparkScaleGroup = 1, xlSparkScaleSingle = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSparkType { xlSparkColumn = 2, xlSparkColumnStacked100 = 3, xlSparkLine = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSpeakDirection { xlSpeakByColumns = 1, xlSpeakByRows = 0, } - // tslint:disable-next-line:no-const-enum const enum XlSpecialCellsValue { xlErrors = 16, xlLogical = 4, @@ -2882,7 +2753,6 @@ declare namespace Excel { xlTextValues = 2, } - // tslint:disable-next-line:no-const-enum const enum XlStdColorScale { xlColorScaleBlackWhite = 3, xlColorScaleGYR = 2, @@ -2890,37 +2760,31 @@ declare namespace Excel { xlColorScaleWhiteBlack = 4, } - // tslint:disable-next-line:no-const-enum const enum XlSubscribeToFormat { xlSubscribeToPicture = -4147, xlSubscribeToText = -4158, } - // tslint:disable-next-line:no-const-enum const enum XlSubtototalLocationType { xlAtBottom = 2, xlAtTop = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSummaryColumn { xlSummaryOnLeft = -4131, xlSummaryOnRight = -4152, } - // tslint:disable-next-line:no-const-enum const enum XlSummaryReportType { xlStandardSummary = 1, xlSummaryPivotTable = -4148, } - // tslint:disable-next-line:no-const-enum const enum XlSummaryRow { xlSummaryAbove = 0, xlSummaryBelow = 1, } - // tslint:disable-next-line:no-const-enum const enum XlTableStyleElementType { xlBlankRow = 19, xlColumnStripe1 = 7, @@ -2962,32 +2826,27 @@ declare namespace Excel { xlWholeTable = 0, } - // tslint:disable-next-line:no-const-enum const enum XlTabPosition { xlTabPositionFirst = 0, xlTabPositionLast = 1, } - // tslint:disable-next-line:no-const-enum const enum XlTextParsingType { xlDelimited = 1, xlFixedWidth = 2, } - // tslint:disable-next-line:no-const-enum const enum XlTextQualifier { xlTextQualifierDoubleQuote = 1, xlTextQualifierNone = -4142, xlTextQualifierSingleQuote = 2, } - // tslint:disable-next-line:no-const-enum const enum XlTextVisualLayoutType { xlTextVisualLTR = 1, xlTextVisualRTL = 2, } - // tslint:disable-next-line:no-const-enum const enum XlThemeColor { xlThemeColorAccent1 = 5, xlThemeColorAccent2 = 6, @@ -3003,20 +2862,17 @@ declare namespace Excel { xlThemeColorLight2 = 4, } - // tslint:disable-next-line:no-const-enum const enum XlThemeFont { xlThemeFontMajor = 1, xlThemeFontMinor = 2, xlThemeFontNone = 0, } - // tslint:disable-next-line:no-const-enum const enum XlThreadMode { xlThreadModeAutomatic = 0, xlThreadModeManual = 1, } - // tslint:disable-next-line:no-const-enum const enum XlTickLabelOrientation { xlTickLabelOrientationAutomatic = -4105, xlTickLabelOrientationDownward = -4170, @@ -3025,7 +2881,6 @@ declare namespace Excel { xlTickLabelOrientationVertical = -4166, } - // tslint:disable-next-line:no-const-enum const enum XlTickLabelPosition { xlTickLabelPositionHigh = -4127, xlTickLabelPositionLow = -4134, @@ -3033,7 +2888,6 @@ declare namespace Excel { xlTickLabelPositionNone = -4142, } - // tslint:disable-next-line:no-const-enum const enum XlTickMark { xlTickMarkCross = 4, xlTickMarkInside = 2, @@ -3041,7 +2895,6 @@ declare namespace Excel { xlTickMarkOutside = 3, } - // tslint:disable-next-line:no-const-enum const enum XlTimePeriods { xlLast7Days = 2, xlLastMonth = 5, @@ -3055,14 +2908,12 @@ declare namespace Excel { xlYesterday = 1, } - // tslint:disable-next-line:no-const-enum const enum XlTimeUnit { xlDays = 0, xlMonths = 1, xlYears = 2, } - // tslint:disable-next-line:no-const-enum const enum XlToolbarProtection { xlNoButtonChanges = 1, xlNoChanges = 4, @@ -3071,13 +2922,11 @@ declare namespace Excel { xlToolbarProtectionNone = -4143, } - // tslint:disable-next-line:no-const-enum const enum XlTopBottom { xlTop10Bottom = 0, xlTop10Top = 1, } - // tslint:disable-next-line:no-const-enum const enum XlTotalsCalculation { xlTotalsCalculationAverage = 2, xlTotalsCalculationCount = 3, @@ -3091,7 +2940,6 @@ declare namespace Excel { xlTotalsCalculationVar = 8, } - // tslint:disable-next-line:no-const-enum const enum XlTrendlineType { xlExponential = 5, xlLinear = -4132, @@ -3101,7 +2949,6 @@ declare namespace Excel { xlPower = 4, } - // tslint:disable-next-line:no-const-enum const enum XlUnderlineStyle { xlUnderlineStyleDouble = -4119, xlUnderlineStyleDoubleAccounting = 5, @@ -3110,14 +2957,12 @@ declare namespace Excel { xlUnderlineStyleSingleAccounting = 4, } - // tslint:disable-next-line:no-const-enum const enum XlUpdateLinks { xlUpdateLinksAlways = 3, xlUpdateLinksNever = 2, xlUpdateLinksUserSetting = 1, } - // tslint:disable-next-line:no-const-enum const enum XlVAlign { xlVAlignBottom = -4107, xlVAlignCenter = -4108, @@ -3126,7 +2971,6 @@ declare namespace Excel { xlVAlignTop = -4160, } - // tslint:disable-next-line:no-const-enum const enum XlWBATemplate { xlWBATChart = -4109, xlWBATExcel4IntlMacroSheet = 4, @@ -3134,28 +2978,24 @@ declare namespace Excel { xlWBATWorksheet = -4167, } - // tslint:disable-next-line:no-const-enum const enum XlWebFormatting { xlWebFormattingAll = 1, xlWebFormattingNone = 3, xlWebFormattingRTF = 2, } - // tslint:disable-next-line:no-const-enum const enum XlWebSelectionType { xlAllTables = 2, xlEntirePage = 1, xlSpecifiedTables = 3, } - // tslint:disable-next-line:no-const-enum const enum XlWindowState { xlMaximized = -4137, xlMinimized = -4140, xlNormal = -4143, } - // tslint:disable-next-line:no-const-enum const enum XlWindowType { xlChartAsWindow = 5, xlChartInPlace = 4, @@ -3164,34 +3004,29 @@ declare namespace Excel { xlWorkbook = 1, } - // tslint:disable-next-line:no-const-enum const enum XlWindowView { xlNormalView = 1, xlPageBreakPreview = 2, xlPageLayoutView = 3, } - // tslint:disable-next-line:no-const-enum const enum XlXLMMacroType { xlCommand = 2, xlFunction = 1, xlNotXLM = 3, } - // tslint:disable-next-line:no-const-enum const enum XlXmlExportResult { xlXmlExportSuccess = 0, xlXmlExportValidationFailed = 1, } - // tslint:disable-next-line:no-const-enum const enum XlXmlImportResult { xlXmlImportElementsTruncated = 1, xlXmlImportSuccess = 0, xlXmlImportValidationFailed = 2, } - // tslint:disable-next-line:no-const-enum const enum XlXmlLoadOption { xlXmlLoadImportToList = 2, xlXmlLoadMapXml = 3, @@ -3199,13 +3034,37 @@ declare namespace Excel { xlXmlLoadPromptUser = 0, } - // tslint:disable-next-line:no-const-enum const enum XlYesNoGuess { xlGuess = 0, xlNo = 2, xlYes = 1, } + class AboveAverage { + private 'Excel.AboveAverage_typekey': AboveAverage; + private constructor(); + AboveBelow: XlAboveBelow; + readonly Application: Application; + readonly AppliesTo: Range; + readonly Borders: Borders; + CalcFor: XlCalcFor; + readonly Creator: XlCreator; + Delete(): void; + readonly Font: Font; + readonly Interior: Interior; + ModifyAppliesToRange(Range: Range): void; + NumberFormat: string; + NumStdDev: number; + readonly Parent: any; + Priority: number; + readonly PTCondition: boolean; + ScopeType: XlPivotConditionScope; + SetFirstPriority(): void; + SetLastPriority(): void; + StopIfTrue: boolean; + readonly Type: number; + } + class Action { private 'Excel.Action_typekey': Action; private constructor(); @@ -3220,15 +3079,14 @@ declare namespace Excel { readonly Type: XlActionType; } - class Actions { - private 'Excel.Actions_typekey': Actions; - private constructor(); - _Default(Index: any): Action; + interface Actions { + _Default(Index: number | string): Action; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): Action; + Item(Index: number | string): Action; readonly Parent: any; + (Index: number | string): Action; } class AddIn { @@ -3251,38 +3109,26 @@ declare namespace Excel { readonly Title: string; } - class AddIns { - private 'Excel.AddIns_typekey': AddIns; - private constructor(); - _Default(Index: any): AddIn; - Add(Filename: string, CopyFile?: any): AddIn; + interface AddIns { + _Default(Index: number | string): AddIn; + Add(Filename: string, CopyFile?: boolean): AddIn; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): AddIn; + Item(Index: number | string): AddIn; readonly Parent: any; + (Index: number | string): AddIn; } - class AddIns2 { - private 'Excel.AddIns2_typekey': AddIns2; - private constructor(); - _Default(Index: any): AddIn; - Add(Filename: string, CopyFile?: any): AddIn; - readonly Application: Application; - readonly Count: number; - readonly Creator: XlCreator; - Item(Index: any): AddIn; - readonly Parent: any; - } + type AddIns2 = AddIns; - class Adjustments { - private 'Excel.Adjustments_typekey': Adjustments; - private constructor(); + interface Adjustments { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): number; readonly Parent: any; + (Index: number): number; } class AllowEditRange { @@ -3292,17 +3138,16 @@ declare namespace Excel { Delete(): void; Range: Range; Title: string; - Unprotect(Password?: any): void; + Unprotect(Password?: string): void; readonly Users: UserAccessList; } - class AllowEditRanges { - private 'Excel.AllowEditRanges_typekey': AllowEditRanges; - private constructor(); - _Default(Index: any): AllowEditRange; - Add(Title: string, Range: Range, Password?: any): AllowEditRange; + interface AllowEditRanges { + _Default(Index: number | string): AllowEditRange; + Add(Title: string, Range: Range, Password?: string): AllowEditRange; readonly Count: number; - Item(Index: any): AllowEditRange; + Item(Index: number | string): AllowEditRange; + (Index: number | string): AllowEditRange; } class Application { @@ -3311,17 +3156,10 @@ declare namespace Excel { readonly _Default: string; _Evaluate(Name: any): any; _FindFile(): void; - _MacroOptions( - Macro?: any, Description?: any, HasMenu?: any, MenuText?: any, HasShortcutKey?: any, ShortcutKey?: any, Category?: any, StatusBar?: any, HelpContextID?: any, HelpFile?: any): void; - _Run2( - Macro?: any, Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + _MacroOptions(Macro?: any, Description?: any, HasMenu?: any, MenuText?: any, HasShortcutKey?: any, ShortcutKey?: any, Category?: any, StatusBar?: any, HelpContextID?: any, HelpFile?: any): void; + _Run2(Macro?: any, Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; _Wait(Time: any): void; - _WSFunction( - Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + _WSFunction(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; ActivateMicrosoftApp(Index: XlMSApplication): void; readonly ActiveCell: Range; readonly ActiveChart: Chart; @@ -3330,11 +3168,11 @@ declare namespace Excel { readonly ActiveMenuBar: MenuBar; ActivePrinter: string; readonly ActiveProtectedViewWindow: ProtectedViewWindow; - readonly ActiveSheet: Worksheet | Chart | DialogSheet; + readonly ActiveSheet: Sheet; readonly ActiveWindow: Window; readonly ActiveWorkbook: Workbook; AddChartAutoFormat(Chart: any, Name: string, Description?: any): void; - AddCustomList(ListArray: any, ByRow?: any): void; + AddCustomList(ListArray: SafeArray | Range, ByRow?: boolean): void; readonly AddIns: AddIns; readonly AddIns2: AddIns2; AlertBeforeOverwriting: boolean; @@ -3361,17 +3199,17 @@ declare namespace Excel { CalculationInterruptKey: XlCalculationInterruptKey; readonly CalculationState: XlCalculationState; readonly CalculationVersion: number; - Caller(Index?: any): any; + Caller(Index?: number): Range | string | Error; readonly CanPlaySounds: boolean; readonly CanRecordSounds: boolean; Caption: string; CellDragAndDrop: boolean; readonly Cells: Range; CentimetersToPoints(Centimeters: number): number; - readonly Charts: Sheets; - CheckAbort(KeepAbort?: any): void; - CheckSpelling(Word: string, CustomDictionary?: any, IgnoreUppercase?: any): boolean; - ClipboardFormats(Index?: any): any; + readonly Charts: Sheets; + CheckAbort(KeepAbort?: boolean): void; + CheckSpelling(Word: string, CustomDictionary?: string, IgnoreUppercase?: boolean): boolean; + ClipboardFormats: SafeArray & ((Index: number) => XlClipboardFormat); ClusterConnector: string; ColorButtons: boolean; readonly Columns: Range; @@ -3380,7 +3218,7 @@ declare namespace Excel { CommandUnderlines: XlCommandUnderlines; ConstrainNumeric: boolean; ControlCharacters: boolean; - ConvertFormula(Formula: any, FromReferenceStyle: XlReferenceStyle, ToReferenceStyle?: any, ToAbsolute?: any, RelativeTo?: any): any; + ConvertFormula(Formula: string, FromReferenceStyle: XlReferenceStyle, ToReferenceStyle?: XlReferenceStyle, ToAbsolute?: XlReferenceType, RelativeTo?: Range): string; CopyObjectsWithCells: boolean; readonly Creator: XlCreator; Cursor: XlMousePointer; @@ -3403,7 +3241,7 @@ declare namespace Excel { DeleteChartAutoFormat(Name: string): void; DeleteCustomList(ListNum: number): void; readonly Dialogs: Dialogs; - readonly DialogSheets: Sheets; + readonly DialogSheets: Sheets; DisplayAlerts: boolean; DisplayClipboardWindow: boolean; DisplayCommentIndicator: XlCommentDisplayMode; @@ -3421,26 +3259,21 @@ declare namespace Excel { DisplayRecentFiles: boolean; DisplayScrollBars: boolean; DisplayStatusBar: boolean; - DisplayXMLSourcePane(XmlMap?: any): void; + DisplayXMLSourcePane(XmlMap?: XmlMap): void; DoubleClick(): void; Dummy1(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any): any; Dummy10(arg?: any): boolean; readonly Dummy101: any; Dummy11(): void; Dummy12(p1: PivotTable, p2: PivotTable): void; - Dummy13( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + Dummy13(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; Dummy14(): void; Dummy2(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any): any; Dummy20(grfCompareFunctions: number): any; Dummy22: boolean; Dummy23: boolean; Dummy3(): any; - Dummy4( - Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any): any; + Dummy4(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any): any; Dummy5(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any): any; Dummy6(): any; Dummy7(): any; @@ -3456,13 +3289,13 @@ declare namespace Excel { EnableSound: boolean; EnableTipWizard: boolean; readonly ErrorCheckingOptions: ErrorCheckingOptions; - Evaluate(Name: any): any; + Evaluate(Name: string): any; readonly Excel4IntlMacroSheets: Sheets; readonly Excel4MacroSheets: Sheets; ExecuteExcel4Macro(String: string): any; ExtendList: boolean; FeatureInstall: Office.MsoFeatureInstall; - FileConverters(Index1?: any, Index2?: any): any; + FileConverters(Index1?: string, Index2?: string): SafeArray; FileDialog(fileDialogType: Office.MsoFileDialogType): Office.FileDialog; readonly FileExportConverters: FileExportConverters; readonly FileFind: Office.IFind; @@ -3476,27 +3309,31 @@ declare namespace Excel { FormulaBarHeight: number; GenerateGetPivotData: boolean; GenerateTableRefs: XlGenerateTableRefs; - GetCustomListContents(ListNum: number): any; - GetCustomListNum(ListArray: any): number; - GetOpenFilename(FileFilter?: any, FilterIndex?: any, Title?: any, ButtonText?: any, MultiSelect?: any): any; - GetPhonetic(Text?: any): string; - GetSaveAsFilename(InitialFilename?: any, FileFilter?: any, FilterIndex?: any, Title?: any, ButtonText?: any): any; - Goto(Reference?: any, Scroll?: any): void; + GetCustomListContents(ListNum: number): SafeArray; + GetCustomListNum(ListArray: SafeArray): number; + + /** @param ButtonText Macintosh only */ + GetOpenFilename(FileFilter?: string, FilterIndex?: number, Title?: string, ButtonText?: null, MultiSelect?: false): string; + + /** @param ButtonText Macintosh only */ + GetOpenFilename(FileFilter: string | null, FilterIndex: number | null, Title: string | null, ButtonText: null, MultiSelect: true): SafeArray; + GetPhonetic(Text?: string): string; + + /** @param ButtonText Macintosh only */ + GetSaveAsFilename(InitialFilename?: string, FileFilter?: string, FilterIndex?: number, Title?: string, ButtonText?: undefined): string; + Goto(Reference?: Range | string, Scroll?: boolean): void; Height: number; - Help(HelpFile?: any, HelpContextID?: any): void; + Help(HelpFile?: string, HelpContextID?: number): void; HighQualityModeForGraphics: boolean; readonly Hinstance: number; - readonly HinstancePtr: any; + readonly HinstancePtr: number; readonly Hwnd: number; IgnoreRemoteRequests: boolean; InchesToPoints(Inches: number): number; - InputBox(Prompt: string, Title?: any, Default?: any, Left?: any, Top?: any, HelpFile?: any, HelpContextID?: any, Type?: any): any; + InputBox(Prompt: string, Title?: string, Default?: string, Left?: number, Top?: number, HelpFile?: string, HelpContextID?: number, Type?: InputBoxReturnType): string | number | boolean | Range | Error | SafeArray | SafeArray | SafeArray; Interactive: boolean; - International(Index?: any): any; - Intersect( - Arg1: Range, Arg2: Range, Arg3?: Range, Arg4?: Range, Arg5?: Range, Arg6?: Range, Arg7?: Range, Arg8?: Range, Arg9?: Range, Arg10?: Range, Arg11?: Range, Arg12?: Range, - Arg13?: Range, Arg14?: Range, Arg15?: Range, Arg16?: Range, Arg17?: Range, Arg18?: Range, Arg19?: Range, Arg20?: Range, Arg21?: Range, Arg22?: Range, Arg23?: Range, Arg24?: Range, - Arg25?: Range, Arg26?: Range, Arg27?: Range, Arg28?: Range, Arg29?: Range, Arg30?: Range): Range; + International: SafeArray & ((Index: T) => InternationalResult); + Intersect(Arg1: Range, Arg2: Range, Arg3?: Range, Arg4?: Range, Arg5?: Range, Arg6?: Range, Arg7?: Range, Arg8?: Range, Arg9?: Range, Arg10?: Range, Arg11?: Range, Arg12?: Range, Arg13?: Range, Arg14?: Range, Arg15?: Range, Arg16?: Range, Arg17?: Range, Arg18?: Range, Arg19?: Range, Arg20?: Range, Arg21?: Range, Arg22?: Range, Arg23?: Range, Arg24?: Range, Arg25?: Range, Arg26?: Range, Arg27?: Range, Arg28?: Range, Arg29?: Range, Arg30?: Range): Range; readonly IsSandboxed: boolean; Iteration: boolean; readonly LanguageSettings: Office.LanguageSettings; @@ -3504,12 +3341,10 @@ declare namespace Excel { LargeOperationCellThousandCount: number; Left: number; readonly LibraryPath: string; - MacroOptions( - Macro?: any, Description?: any, HasMenu?: any, MenuText?: any, HasShortcutKey?: any, ShortcutKey?: any, Category?: any, StatusBar?: any, HelpContextID?: any, - HelpFile?: any, ArgumentDescriptions?: any): void; + MacroOptions(Macro?: string, Description?: string, HasMenu?: undefined, MenuText?: undefined, HasShortcutKey?: boolean, ShortcutKey?: string, Category?: FunctionCategory | string, StatusBar?: string, HelpContextID?: number, HelpFile?: string, ArgumentDescriptions?: SafeArray): void; MailLogoff(): void; - MailLogon(Name?: any, Password?: any, DownloadNewMail?: any): void; - readonly MailSession: any; + MailLogon(Name?: string, Password?: string, DownloadNewMail?: boolean): void; + readonly MailSession: string | null; readonly MailSystem: XlMailSystem; MapPaperSize: boolean; readonly MathCoprocessorAvailable: boolean; @@ -3537,11 +3372,11 @@ declare namespace Excel { OnData: string; OnDoubleClick: string; OnEntry: string; - OnKey(Key: string, Procedure?: any): void; + OnKey(Key: string, Procedure?: string): void; OnRepeat(Text: string, Procedure: string): void; OnSheetActivate: string; OnSheetDeactivate: string; - OnTime(EarliestTime: any, Procedure: string, LatestTime?: any, Schedule?: any): void; + OnTime(EarliestTime: any, Procedure: string, LatestTime?: any, Schedule?: boolean): void; OnUndo(Text: string, Procedure: string): void; OnWindow: string; readonly OperatingSystem: string; @@ -3550,7 +3385,7 @@ declare namespace Excel { readonly Path: string; readonly PathSeparator: string; PivotTableSelection: boolean; - PreviousSelections(Index?: any): any; + PreviousSelections(Index: 1 | 2 | 3 | 4): Range | null; PrintCommunication: boolean; readonly ProductCode: string; PromptForSummaryInfo: boolean; @@ -3560,10 +3395,13 @@ declare namespace Excel { Range(Cell1: string | Range, Cell2?: string | Range): Range; readonly Ready: boolean; readonly RecentFiles: RecentFiles; - RecordMacro(BasicCode?: any, XlmCode?: any): void; + RecordMacro(BasicCode: string): void; + + /** This overload prevents recording */ + RecordMacro(BasicCode: '', XlmCode: ''): void; readonly RecordRelative: boolean; ReferenceStyle: XlReferenceStyle; - RegisteredFunctions(Index1?: any, Index2?: any): any; + RegisteredFunctions(Index1: string | undefined, Index2?: string): SafeArray | null; RegisterXLL(Filename: string): boolean; Repeat(): void; ReplaceFormat: CellFormat; @@ -3571,16 +3409,15 @@ declare namespace Excel { RollZoom: boolean; readonly Rows: Range; readonly RTD: RTD; - Run( - Macro?: any, Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + Run(Macro?: string | Range | number, Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; Save(Filename?: any): void; SaveISO8601Dates: boolean; + + /** @deprecated */ SaveWorkspace(Filename?: any): void; ScreenUpdating: boolean; readonly Selection: any; - SendKeys(Keys: any, Wait?: any): void; + SendKeys(Keys: string, Wait?: boolean): void; SetDefaultChart(FormatName?: any, Gallery?: any): void; SharePointVersion(bstrUrl: string): number; readonly Sheets: Sheets; @@ -3603,7 +3440,15 @@ declare namespace Excel { StandardFont: string; StandardFontSize: number; readonly StartupPath: string; - StatusBar: any; + + /** + * Get or set the text of the status bar + * + * Returns `false` if Microsoft Excel has control of the status bar. + * + * To restore the default status bar text, set the property to False ; this works even if the status bar is hidden. + */ + StatusBar: string | false; Support(Object: any, ID: number, arg?: any): any; readonly TemplatesPath: string; readonly ThisCell: Range; @@ -3616,10 +3461,7 @@ declare namespace Excel { TransitionNavigKeys: boolean; UILanguage: number; Undo(): void; - Union( - Arg1: Range, Arg2: Range, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): Range; + Union(Arg1: Range, Arg2: Range, Arg3?: Range, Arg4?: Range, Arg5?: Range, Arg6?: Range, Arg7?: Range, Arg8?: Range, Arg9?: Range, Arg10?: Range, Arg11?: Range, Arg12?: Range, Arg13?: Range, Arg14?: Range, Arg15?: Range, Arg16?: Range, Arg17?: Range, Arg18?: Range, Arg19?: Range, Arg20?: Range, Arg21?: Range, Arg22?: Range, Arg23?: Range, Arg24?: Range, Arg25?: Range, Arg26?: Range, Arg27?: Range, Arg28?: Range, Arg29?: Range, Arg30?: Range): Range; readonly UsableHeight: number; readonly UsableWidth: number; UseClusterConnector: boolean; @@ -3632,7 +3474,11 @@ declare namespace Excel { readonly VBE: VBIDE.VBE; readonly Version: string; Visible: boolean; - Volatile(Volatile?: any): void; + + /** + * @param Volatile [Volatile=true] + */ + Volatile(Volatile?: boolean): void; Wait(Time: any): boolean; WarnOnFunctionNameConflict: boolean; readonly Watches: Watches; @@ -3642,24 +3488,25 @@ declare namespace Excel { WindowState: XlWindowState; readonly Workbooks: Workbooks; readonly WorksheetFunction: WorksheetFunction; - readonly Worksheets: Sheets; + readonly Worksheets: Sheets; } - class Areas { - private 'Excel.Areas_typekey': Areas; - private constructor(); + interface Areas { _Default(Index: number): Range; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): Range; readonly Parent: any; + (Index: number): Range; } class AutoCorrect { private 'Excel.AutoCorrect_typekey': AutoCorrect; private constructor(); - AddReplacement(What: string, Replacement: string): any; + + /** @returns The string to be replaced */ + AddReplacement(What: string, Replacement: string): string; readonly Application: Application; AutoExpandListRange: boolean; AutoFillFormulasInLists: boolean; @@ -3667,10 +3514,12 @@ declare namespace Excel { CorrectCapsLock: boolean; CorrectSentenceCap: boolean; readonly Creator: XlCreator; - DeleteReplacement(What: string): any; + + /** @returns The string to be replaced */ + DeleteReplacement(What: string): string; DisplayAutoCorrectOptions: boolean; readonly Parent: any; - ReplacementList(Index?: any): any; + ReplacementList(Index: number): SafeArray; ReplaceText: boolean; TwoInitialCapitals: boolean; } @@ -3700,62 +3549,172 @@ declare namespace Excel { Time: number; } + interface Axes { + /** @param AxisGroup [AxisGroup=1] */ + _Default(Type: XlAxisType, AxisGroup?: XlAxisGroup): Axis; + readonly Application: Application; + readonly Count: number; + readonly Creator: XlCreator; + + /** @param AxisGroup [AxisGroup=1] */ + Item(Type: XlAxisType, AxisGroup?: XlAxisGroup): Axis; + readonly Parent: any; + + /** @param AxisGroup [AxisGroup=1] */ + (Type: XlAxisType, AxisGroup?: XlAxisGroup): Axis; + } + + class Axis { + private 'Excel.Axis_typekey': Axis; + private constructor(); + readonly Application: Application; + AxisBetweenCategories: boolean; + readonly AxisGroup: XlAxisGroup; + readonly AxisTitle: AxisTitle; + BaseUnit: XlTimeUnit; + BaseUnitIsAuto: boolean; + readonly Border: Border; + CategoryNames: SafeArray | Range; + CategoryType: XlCategoryType; + readonly Creator: XlCreator; + Crosses: XlAxisCrosses; + CrossesAt: number; + Delete(): any; + DisplayUnit: XlDisplayUnit; + DisplayUnitCustom: number; + readonly DisplayUnitLabel: DisplayUnitLabel; + readonly Format: ChartFormat; + HasDisplayUnitLabel: boolean; + HasMajorGridlines: boolean; + HasMinorGridlines: boolean; + HasTitle: boolean; + readonly Height: number; + readonly Left: number; + LogBase: number; + readonly MajorGridlines: Gridlines; + MajorTickMark: XlTickMark; + MajorUnit: number; + MajorUnitIsAuto: boolean; + MajorUnitScale: XlTimeUnit; + MaximumScale: number; + MaximumScaleIsAuto: boolean; + MinimumScale: number; + MinimumScaleIsAuto: boolean; + readonly MinorGridlines: Gridlines; + MinorTickMark: XlTickMark; + MinorUnit: number; + MinorUnitIsAuto: boolean; + MinorUnitScale: XlTimeUnit; + readonly Parent: any; + ReversePlotOrder: boolean; + ScaleType: XlScaleType; + Select(): any; + TickLabelPosition: XlTickLabelPosition; + readonly TickLabels: TickLabels; + TickLabelSpacing: number; + TickLabelSpacingIsAuto: boolean; + TickMarkSpacing: number; + readonly Top: number; + Type: XlAxisType; + readonly Width: number; + } + + class AxisTitle { + private 'Excel.AxisTitle_typekey': AxisTitle; + private constructor(); + readonly Application: Application; + AutoScaleFont: any; + readonly Border: Border; + Caption: string; + Characters(Start?: number, Length?: number): Characters; + readonly Creator: XlCreator; + Delete(): any; + readonly Fill: ChartFillFormat; + readonly Font: Font; + readonly Format: ChartFormat; + Formula: string; + FormulaLocal: string; + FormulaR1C1: string; + FormulaR1C1Local: string; + readonly Height: number; + HorizontalAlignment: HorizontalAlignments; + IncludeInLayout: boolean; + readonly Interior: Interior; + Left: number; + readonly Name: string; + Orientation: number | XlOrientation; + readonly Parent: any; + Position: XlChartElementPosition; + ReadingOrder: number; + Select(): any; + Shadow: boolean; + Text: string; + Top: number; + VerticalAlignment: VerticalAlignments; + readonly Width: number; + } + class Border { private 'Excel.Border_typekey': Border; private constructor(); readonly Application: Application; - Color: any; - ColorIndex: any; + Color: XlRgbColor | number; + ColorIndex: number | XlColorIndex; readonly Creator: XlCreator; - LineStyle: XlLineStyle | Constants.xlGray25 | Constants.xlGray50 | Constants.xlGray75 | Constants.xlAutomatic; + LineStyle: LineStyle; readonly Parent: any; - ThemeColor: any; - TintAndShade: any; - Weight: any; + ThemeColor: XlThemeColor; + TintAndShade: number; + Weight: XlBorderWeight; } - class Borders { - private 'Excel.Borders_typekey': Borders; - private constructor(); + interface Borders { _Default(Index: XlBordersIndex): Border; readonly Application: Application; - Color: any; - ColorIndex: any; + Color: XlRgbColor | number; + ColorIndex: number | XlColorIndex | null; readonly Count: number; readonly Creator: XlCreator; Item(Index: XlBordersIndex): Border; - LineStyle: any; + LineStyle: LineStyle; readonly Parent: any; - ThemeColor: any; - TintAndShade: any; - Value: any; - Weight: any; + ThemeColor: XlThemeColor; + TintAndShade: number; + Value: LineStyle; + Weight: XlBorderWeight; + (Index: XlBordersIndex): Border; } - class CalculatedFields { - private 'Excel.CalculatedFields_typekey': CalculatedFields; - private constructor(); + interface CalculatedFields { _Add(Name: string, Formula: string): PivotField; _Default(Field: any): PivotField; - Add(Name: string, Formula: string, UseStandardFormula?: any): PivotField; + + /** + * @param UseStandardFormula [UseStandardFormula=false] + */ + Add(Name: string, Formula: string, UseStandardFormula?: boolean): PivotField; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotField; + Item(Index: number | string): PivotField; readonly Parent: any; + (Field: number | string): PivotField; } - class CalculatedItems { - private 'Excel.CalculatedItems_typekey': CalculatedItems; - private constructor(); + interface CalculatedItems { _Add(Name: string, Formula: string): PivotItem; - _Default(Field: any): PivotItem; - Add(Name: string, Formula: string, UseStandardFormula?: any): PivotItem; + _Default(Field: number | string): PivotItem; + + /** + * @param UseStandardFormula [UseStandardFormula=false] + */ + Add(Name: string, Formula: string, UseStandardFormula?: boolean): PivotItem; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotItem; + Item(Index: number | string): PivotItem; readonly Parent: any; + (Field: number | string): PivotItem; } class CalculatedMember { @@ -3778,17 +3737,19 @@ declare namespace Excel { readonly Type: XlCalculatedMemberType; } - class CalculatedMembers { - private 'Excel.CalculatedMembers_typekey': CalculatedMembers; - private constructor(); + interface CalculatedMembers { _Add(Name: string, Formula: string, SolveOrder?: any, Type?: any): CalculatedMember; _Default(Index: any): CalculatedMember; - Add(Name: string, Formula: any, SolveOrder?: any, Type?: any, Dynamic?: any, DisplayFolder?: any, HierarchizeDistinct?: any): CalculatedMember; + Add(Name: string, Formula: string, SolveOrder?: number, Type?: XlCalculatedMemberType, Dynamic?: boolean, DisplayFolder?: string, HierarchizeDistinct?: boolean): CalculatedMember; + + /** @version 2013 */ + AddCalculatedMember(Name: string, Formula: string, SolveOrder?: number, Type?: XlCalculatedMemberType, DisplayFolder?: string, MeasureGroup?: any, ParentMember?: any, NumberFormat?: any): CalculatedMember; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): CalculatedMember; + Item(Index: number | string): CalculatedMember; readonly Parent: any; + (Index: number | string): CalculatedMember; } class CalloutFormat { @@ -3816,25 +3777,25 @@ declare namespace Excel { class CellFormat { private 'Excel.CellFormat_typekey': CellFormat; private constructor(); - AddIndent: any; + AddIndent: boolean; readonly Application: Application; Borders: Borders; Clear(): void; readonly Creator: XlCreator; Font: Font; - FormulaHidden: any; - HorizontalAlignment: any; - IndentLevel: any; + FormulaHidden: boolean | null; + HorizontalAlignment: HorizontalAlignments; + IndentLevel: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15; Interior: Interior; - Locked: any; - MergeCells: any; - NumberFormat: any; - NumberFormatLocal: any; - Orientation: any; + Locked: boolean | null; + MergeCells: boolean; + NumberFormat: string | null; + NumberFormatLocal: string | null; + Orientation: number | XlOrientation; readonly Parent: any; - ShrinkToFit: any; - VerticalAlignment: any; - WrapText: any; + ShrinkToFit: boolean | null; + VerticalAlignment: VerticalAlignments; + WrapText: boolean | null; } class Characters { @@ -3844,9 +3805,9 @@ declare namespace Excel { Caption: string; readonly Count: number; readonly Creator: XlCreator; - Delete(): any; + Delete(): null; readonly Font: Font; - Insert(String: string): any; + Insert(String: string | null): string; readonly Parent: any; PhoneticCharacters: string; Text: string; @@ -3857,67 +3818,62 @@ declare namespace Excel { private constructor(); __PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any): void; - /** @param Excel.XlDataLabelsType [Type=2] */ + /** @param Type [Type=2] */ _ApplyDataLabels(Type?: XlDataLabelsType, LegendKey?: any, AutoText?: any, HasLeaderLines?: any): void; _CodeName: string; _Evaluate(Name: any): any; _PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void; _Protect(Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any): void; - _SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any): void; + _SaveAs(Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, TextVisualLayout?: any): void; Activate(): void; readonly Application: Application; ApplyChartTemplate(Filename: string): void; ApplyCustomType(ChartType: XlChartType, TypeName?: any): void; - /** @param Excel.XlDataLabelsType [Type=2] */ - ApplyDataLabels( - Type?: XlDataLabelsType, LegendKey?: any, AutoText?: any, HasLeaderLines?: any, ShowSeriesName?: any, ShowCategoryName?: any, ShowValue?: any, - ShowPercentage?: any, ShowBubbleSize?: any, Separator?: any): void; - ApplyLayout(Layout: number, ChartType?: any): void; + /** @param Type [Type=2] */ + ApplyDataLabels(Type?: XlDataLabelsType, LegendKey?: boolean, AutoText?: boolean, HasLeaderLines?: boolean, ShowSeriesName?: boolean, ShowCategoryName?: boolean, ShowValue?: boolean, ShowPercentage?: boolean, ShowBubbleSize?: boolean, Separator?: string): void; + ApplyLayout(Layout: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10, ChartType?: XlChartType): void; Arcs(Index?: any): any; readonly Area3DGroup: ChartGroup; AreaGroups(Index?: any): any; AutoFormat(Gallery: number, Format?: any): void; AutoScaling: boolean; - /** @param Excel.XlAxisGroup [AxisGroup=1] */ - Axes(Type: any, AxisGroup?: XlAxisGroup): any; + /** @param AxisGroup [AxisGroup=1] */ + Axes(Type?: XlAxisType, AxisGroup?: XlAxisGroup): Axes | Axis; readonly BackWall: Walls; readonly Bar3DGroup: ChartGroup; BarGroups(Index?: any): any; BarShape: XlBarShape; Buttons(Index?: any): any; readonly ChartArea: ChartArea; - ChartGroups(Index?: any): any; - ChartObjects(Index?: any): any; - ChartStyle: any; + ChartObjects(Index?: SafeArray): ChartObjects; + ChartObjects(Index: string | number): ChartObject; + ChartStyle: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48; readonly ChartTitle: ChartTitle; ChartType: XlChartType; - ChartWizard( - Source?: any, Gallery?: any, Format?: any, PlotBy?: any, CategoryLabels?: any, SeriesLabels?: any, HasLegend?: any, Title?: any, CategoryTitle?: any, - ValueTitle?: any, ExtraTitle?: any): void; + ChartWizard(Source?: Range, Gallery?: XlChartType, Format?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10, PlotBy?: XlRowCol, CategoryLabels?: number, SeriesLabels?: number, HasLegend?: boolean, Title?: string, CategoryTitle?: string, ValueTitle?: string, ExtraTitle?: string): void; CheckBoxes(Index?: any): any; - CheckSpelling(CustomDictionary?: any, IgnoreUppercase?: any, AlwaysSuggest?: any, SpellLang?: any): void; + CheckSpelling(CustomDictionary?: string, IgnoreUppercase?: boolean, AlwaysSuggest?: boolean, SpellLang?: Office.MsoLanguageID): void; ClearToMatchStyle(): void; readonly CodeName: string; readonly Column3DGroup: ChartGroup; ColumnGroups(Index?: any): any; - Copy(Before?: any, After?: any): void; + Copy(Before?: Sheet): void; + Copy(Before: undefined, After: Sheet): void; CopyChartBuild(): void; /** - * @param Excel.XlPictureAppearance [Appearance=1] - * @param Excel.XlCopyPictureFormat [Format=-4147] - * @param Excel.XlPictureAppearance [Size=2] + * @param Appearance [Appearance=1] + * @param Format [Format=-4147] + * @param Size [Size=2] */ CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat, Size?: XlPictureAppearance): void; readonly Corners: Corners; /** - * @param Excel.XlPictureAppearance [Appearance=1] - * @param Excel.XlPictureAppearance [Size=1] + * @param Appearance [Appearance=1] + * @param Size [Size=1] */ CreatePublisher(Edition: any, Appearance?: XlPictureAppearance, Size?: XlPictureAppearance, ContainsPICT?: any, ContainsBIFF?: any, ContainsRTF?: any, ContainsVALU?: any): void; readonly Creator: XlCreator; @@ -3933,17 +3889,15 @@ declare namespace Excel { Dummy24: boolean; Dummy25: boolean; Elevation: number; - Evaluate(Name: any): any; - Export(Filename: string, FilterName?: any, Interactive?: any): boolean; - ExportAsFixedFormat( - Type: XlFixedFormatType, Filename?: any, Quality?: any, IncludeDocProperties?: any, IgnorePrintAreas?: any, From?: any, To?: any, OpenAfterPublish?: any, - FixedFormatExtClassPtr?: any): void; + Evaluate(Name: string): any; + Export(Filename: string, FilterName?: string, Interactive?: boolean): boolean; + ExportAsFixedFormat(Type: XlFixedFormatType, Filename?: string, Quality?: XlFixedFormatQuality, IncludeDocProperties?: boolean, IgnorePrintAreas?: boolean, From?: number, To?: number, OpenAfterPublish?: boolean, FixedFormatExtClassPtr?: any): void; readonly Floor: Floor; GapDepth: number; GetChartElement(x: number, y: number, ElementID: number, Arg1: number, Arg2: number): void; GroupBoxes(Index?: any): any; GroupObjects(Index?: any): any; - HasAxis(Index1?: any, Index2?: any): any; + HasAxis(Index1?: XlAxisType, Index2?: XlAxisGroup): boolean; HasDataTable: boolean; HasLegend: boolean; HasPivotFields: boolean; @@ -3957,12 +3911,14 @@ declare namespace Excel { LineGroups(Index?: any): any; Lines(Index?: any): any; ListBoxes(Index?: any): any; - Location(Where: XlChartLocation, Name?: any): Chart; + Location(Where: XlChartLocation.xlLocationAsObject, Name: string): Chart; + Location(Where: XlChartLocation, Name?: string): Chart; readonly MailEnvelope: Office.MsoEnvelope; - Move(Before?: any, After?: any): void; + Move(Before?: Sheet, After?: Sheet): void; Name: string; - readonly Next: any; - OLEObjects(Index?: any): any; + readonly Next: Sheet; + OLEObjects(Index: number | string): OLEObject; + OLEObjects(): OLEObjects; OnDoubleClick: string; OnSheetActivate: string; OnSheetDeactivate: string; @@ -3970,7 +3926,7 @@ declare namespace Excel { Ovals(Index?: any): any; readonly PageSetup: PageSetup; readonly Parent: any; - Paste(Type?: any): void; + Paste(Type?: XlPasteType.xlPasteAll | XlPasteType.xlPasteFormats | XlPasteType.xlPasteFormulas): void; Perspective: number; Pictures(Index?: any): any; readonly Pie3DGroup: ChartGroup; @@ -3979,11 +3935,13 @@ declare namespace Excel { readonly PlotArea: PlotArea; PlotBy: XlRowCol; PlotVisibleOnly: boolean; - readonly Previous: any; + readonly Previous: Sheet; readonly PrintedCommentPages: number; - PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void; - PrintPreview(EnableChanges?: any): void; - Protect(Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any): void; + PrintOut(From?: number, To?: number, Copies?: number, Preview?: boolean, ActivePrinter?: string, PrintToFile?: T, Collate?: boolean, PrToFileName?: PrintToFileName): any; + PrintPreview(EnableChanges?: boolean): void; + + /** @param Scenarios Passing `true` for this argument is only valid on worksheets */ + Protect(Password?: string, DrawingObjects?: boolean, Contents?: boolean, Scenarios?: false, UserInterfaceOnly?: boolean): void; readonly ProtectContents: boolean; ProtectData: boolean; readonly ProtectDrawingObjects: boolean; @@ -3994,20 +3952,20 @@ declare namespace Excel { RadarGroups(Index?: any): any; Rectangles(Index?: any): any; Refresh(): void; - RightAngleAxes: any; - Rotation: any; - SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any, Local?: any): void; + + /** `true` if the chart axes are at right angles, independent of chart rotation or elevation. Applies only to 3-D line, column, and bar charts. */ + RightAngleAxes: boolean; + Rotation: number; + SaveAs(Filename: string, FileFormat?: XlFileFormat, Password?: string, WriteResPassword?: string, ReadOnlyRecommended?: boolean, CreateBackup?: boolean, AddToMru?: boolean, TextCodepage?: any, TextVisualLayout?: any, Local?: any): void; SaveChartTemplate(Filename: string): void; readonly Scripts: Office.Scripts; ScrollBars(Index?: any): any; - Select(Replace?: any): void; - SeriesCollection(Index?: any): any; + Select(Replace?: boolean): void; + SeriesCollection(Index?: number | string): SeriesCollection | Series; SetBackgroundPicture(Filename: string): void; SetDefaultChart(Name: any): void; SetElement(Element: Office.MsoChartElementType): void; - SetSourceData(Source: Range, PlotBy?: any): void; + SetSourceData(Source: Range, PlotBy?: XlRowCol): void; readonly Shapes: Shapes; ShowAllFieldButtons: boolean; ShowAxisFieldButtons: boolean; @@ -4024,7 +3982,7 @@ declare namespace Excel { readonly Tab: Tab; TextBoxes(Index?: any): any; Type: number; - Unprotect(Password?: any): void; + Unprotect(Password?: string): void; Visible: XlSheetVisibility; readonly Walls: Walls; WallsAndGridlines2D: boolean; @@ -4138,18 +4096,114 @@ declare namespace Excel { readonly Parent: any; readonly RadarAxisLabels: TickLabels; SecondPlotSize: number; - SeriesCollection(Index?: any): any; + SeriesCollection(Index?: number | string): SeriesCollection | Series; readonly SeriesLines: SeriesLines; ShowNegativeBubbles: boolean; SizeRepresents: XlSizeRepresents; SplitType: XlChartSplitType; - SplitValue: any; + SplitValue: number; SubType: number; Type: number; readonly UpBars: UpBars; VaryByCategories: boolean; } + interface ChartGroups { + readonly Application: Application; + readonly Count: number; + readonly Creator: XlCreator; + Item(Index: number): ChartGroup; + readonly Parent: any; + (Index: number): ChartGroup; + } + + class ChartObject { + private 'Excel.ChartObject_typekey': ChartObject; + private constructor(); + _Copy(): any; + Activate(): any; + readonly Application: Application; + readonly Border: Border; + readonly BottomRightCell: Range; + BringToFront(): any; + readonly Chart: Chart; + Copy(): any; + + /** + * @param Appearance [Appearance=2] + * @param Format [Format=-4147] + */ + CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): any; + readonly Creator: XlCreator; + Cut(): any; + Delete(): any; + Duplicate(): any; + Enabled: boolean; + Height: number; + readonly Index: number; + readonly Interior: Interior; + Left: number; + Locked: boolean; + Name: string; + OnAction: string; + readonly Parent: any; + Placement: XlPlacement; + PrintObject: boolean; + ProtectChartObject: boolean; + RoundedCorners: boolean; + Select(Replace?: boolean): any; + SendToBack(): any; + Shadow: boolean; + readonly ShapeRange: ShapeRange; + Top: number; + readonly TopLeftCell: Range; + Visible: boolean; + Width: number; + readonly ZOrder: number; + } + + interface ChartObjects { + _Copy(): any; + _Default(Index: any): any; + Add(Left: number, Top: number, Width: number, Height: number): ChartObject; + readonly Application: Application; + readonly Border: Border; + BringToFront(): any; + Copy(): any; + + /** + * @param Appearance [Appearance=2] + * @param Format [Format=-4147] + */ + CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): any; + readonly Count: number; + readonly Creator: XlCreator; + Cut(): any; + Delete(): any; + Duplicate(): any; + Enabled: boolean; + Group(): GroupObject; + Height: number; + readonly Interior: Interior; + Item(Index: number | string): ChartObject; + Left: number; + Locked: boolean; + OnAction: string; + readonly Parent: any; + Placement: XlPlacement; + PrintObject: boolean; + ProtectChartObject: boolean; + RoundedCorners: boolean; + Select(Replace?: boolean): any; + SendToBack(): any; + Shadow: boolean; + readonly ShapeRange: ShapeRange; + Top: number; + Visible: boolean; + Width: number; + (Index: number | string): any; + } + class ChartTitle { private 'Excel.ChartTitle_typekey': ChartTitle; private constructor(); @@ -4157,7 +4211,7 @@ declare namespace Excel { AutoScaleFont: any; readonly Border: Border; Caption: string; - Characters(Start?: any, Length?: any): Characters; + Characters(Start?: number, Length?: number): Characters; readonly Creator: XlCreator; Delete(): any; readonly Fill: ChartFillFormat; @@ -4168,7 +4222,7 @@ declare namespace Excel { FormulaR1C1: string; FormulaR1C1Local: string; readonly Height: number; - HorizontalAlignment: any; + HorizontalAlignment: HorizontalAlignments; IncludeInLayout: boolean; readonly Interior: Interior; Left: number; @@ -4181,7 +4235,7 @@ declare namespace Excel { Shadow: boolean; Text: string; Top: number; - VerticalAlignment: any; + VerticalAlignment: VerticalAlignments; readonly Width: number; } @@ -4199,6 +4253,42 @@ declare namespace Excel { readonly Type: Office.MsoColorType; } + class ColorScale { + private 'Excel.ColorScale_typekey': ColorScale; + private constructor(); + readonly Application: Application; + readonly AppliesTo: Range; + readonly ColorScaleCriteria: ColorScaleCriteria; + readonly Creator: XlCreator; + Delete(): void; + Formula: string; + ModifyAppliesToRange(Range: Range): void; + readonly Parent: any; + Priority: number; + readonly PTCondition: boolean; + ScopeType: XlPivotConditionScope; + SetFirstPriority(): void; + SetLastPriority(): void; + readonly StopIfTrue: boolean; + readonly Type: number; + } + + interface ColorScaleCriteria { + _Default(Index: any): ColorScaleCriterion; + readonly Count: number; + Item(Index: number): ColorScaleCriterion; + (Index: number): ColorScaleCriterion; + } + + class ColorScaleCriterion { + private 'Excel.ColorScaleCriterion_typekey': ColorScaleCriterion; + private constructor(); + readonly FormatColor: FormatColor; + readonly Index: number; + Type: XlConditionValueTypes; + Value: any; + } + class Comment { private 'Excel.Comment_typekey': Comment; private constructor(); @@ -4210,32 +4300,44 @@ declare namespace Excel { readonly Parent: any; Previous(): Comment; readonly Shape: Shape; - Text(Text?: any, Start?: any, Overwrite?: any): string; + Text(Text?: string, Start?: number, Overwrite?: boolean): string; Visible: boolean; } - class Comments { - private 'Excel.Comments_typekey': Comments; - private constructor(); + interface Comments { _Default(Index: number): Comment; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): Comment; readonly Parent: any; + (Index: number): Comment; } - class Connections { - private 'Excel.Connections_typekey': Connections; + class ConditionValue { + private 'Excel.ConditionValue_typekey': ConditionValue; private constructor(); + readonly Application: Application; + readonly Creator: XlCreator; + Modify(newtype: XlConditionValueTypes.xlConditionValueLowestValue | XlConditionValueTypes.xlConditionValueHighestValue): void; + Modify(newtype: XlConditionValueTypes.xlConditionValueNumber | XlConditionValueTypes.xlConditionValuePercent | XlConditionValueTypes.xlConditionValuePercentile, newvalue: number): void; + Modify(newtype: XlConditionValueTypes.xlConditionValueFormula, newvalue: string): void; + Modify(newtype: XlConditionValueTypes, newvalue?: any): void; + readonly Parent: any; + readonly Type: XlConditionValueTypes; + Value: number | string; + } + + interface Connections { _Default(Index: any): WorkbookConnection; - Add(Name: string, Description: string, ConnectionString: any, CommandText: any, lCmdtype?: any): WorkbookConnection; + Add(Name: string, Description: string, ConnectionString: string, CommandText: string, lCmdtype?: any): WorkbookConnection; AddFromFile(Filename: string): WorkbookConnection; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): WorkbookConnection; + Item(Index: number): WorkbookConnection; readonly Parent: any; + (Index: number): WorkbookConnection; } class ConnectorFormat { @@ -4261,14 +4363,15 @@ declare namespace Excel { private 'Excel.ControlFormat_typekey': ControlFormat; private constructor(); _Default: number; - AddItem(Text: string, Index?: any): void; + AddItem(Text: string, Index?: number): void; readonly Application: Application; readonly Creator: XlCreator; DropDownLines: number; Enabled: boolean; LargeChange: number; LinkedCell: string; - List(Index?: any): any; + List(Index: number): string; + List(): SafeArray; ListCount: number; ListFillRange: string; ListIndex: number; @@ -4279,7 +4382,7 @@ declare namespace Excel { readonly Parent: any; PrintObject: boolean; RemoveAllItems(): void; - RemoveItem(Index: number, Count?: any): void; + RemoveItem(Index: number, Count?: number): void; SmallChange: number; Value: number; } @@ -4299,7 +4402,7 @@ declare namespace Excel { private constructor(); _AddMemberPropertyField(Property: string, PropertyOrder?: any): void; readonly _Caption: string; - AddMemberPropertyField(Property: string, PropertyOrder?: any, PropertyDisplayedIn?: any): void; + AddMemberPropertyField(Property: string, PropertyOrder?: number, PropertyDisplayedIn?: XlPropertyDisplayedIn): void; readonly AllItemsVisible: boolean; readonly Application: Application; Caption: string; @@ -4334,28 +4437,26 @@ declare namespace Excel { readonly Value: string; } - class CubeFields { - private 'Excel.CubeFields_typekey': CubeFields; - private constructor(); + interface CubeFields { _Default(Index: any): CubeField; AddSet(Name: string, Caption: string): CubeField; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): CubeField; + Item(Index: number | string): CubeField; readonly Parent: any; + (Index: number | string): CubeField; } - class CustomProperties { - private 'Excel.CustomProperties_typekey': CustomProperties; - private constructor(); + interface CustomProperties { _Default(Index: any): CustomProperty; Add(Name: string, Value: any): CustomProperty; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): CustomProperty; + Item(Index: number | string): CustomProperty; readonly Parent: any; + (Index: number | string): CustomProperty; } class CustomProperty { @@ -4383,16 +4484,139 @@ declare namespace Excel { Show(): void; } - class CustomViews { - private 'Excel.CustomViews_typekey': CustomViews; - private constructor(); + interface CustomViews { _Default(ViewName: any): CustomView; - Add(ViewName: string, PrintSettings?: any, RowColSettings?: any): CustomView; + Add(ViewName: string, PrintSettings?: boolean, RowColSettings?: boolean): CustomView; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(ViewName: any): CustomView; + Item(ViewName: number | string): CustomView; readonly Parent: any; + (ViewName: number | string): CustomView; + } + + class Databar { + private 'Excel.Databar_typekey': Databar; + private constructor(); + readonly Application: Application; + readonly AppliesTo: Range; + readonly AxisColor: FormatColor; + AxisPosition: XlDataBarAxisPosition; + readonly BarBorder: DataBarBorder; + readonly BarColor: FormatColor; + BarFillType: XlDataBarFillType; + readonly Creator: XlCreator; + Delete(): void; + Direction: number; + Formula: string; + readonly MaxPoint: ConditionValue; + readonly MinPoint: ConditionValue; + ModifyAppliesToRange(Range: Range): void; + readonly NegativeBarFormat: NegativeBarFormat; + readonly Parent: any; + PercentMax: number; + PercentMin: number; + Priority: number; + readonly PTCondition: boolean; + ScopeType: XlPivotConditionScope; + SetFirstPriority(): void; + SetLastPriority(): void; + ShowValue: boolean; + readonly StopIfTrue: boolean; + readonly Type: number; + } + + class DataBarBorder { + private 'Excel.DataBarBorder_typekey': DataBarBorder; + private constructor(); + readonly Application: Application; + readonly Color: FormatColor; + readonly Creator: XlCreator; + readonly Parent: any; + Type: XlDataBarBorderType; + } + + class DataLabel { + private 'Excel.DataLabel_typekey': DataLabel; + private constructor(); + readonly Application: Application; + AutoScaleFont: any; + AutoText: boolean; + readonly Border: Border; + Caption: string; + Characters(Start?: number, Length?: number): Characters; + readonly Creator: XlCreator; + Delete(): any; + readonly Fill: ChartFillFormat; + readonly Font: Font; + readonly Format: ChartFormat; + Formula: string; + FormulaLocal: string; + FormulaR1C1: string; + FormulaR1C1Local: string; + readonly Height: number; + HorizontalAlignment: HorizontalAlignments; + readonly Interior: Interior; + Left: number; + readonly Name: string; + NumberFormat: string; + NumberFormatLinked: boolean; + NumberFormatLocal: string; + Orientation: XlOrientation; + readonly Parent: any; + Position: XlDataLabelPosition; + ReadingOrder: number; + Select(): any; + Separator: string | XlDataLabelSeparator; + Shadow: boolean; + ShowBubbleSize: boolean; + ShowCategoryName: boolean; + ShowLegendKey: boolean; + ShowPercentage: boolean; + ShowSeriesName: boolean; + ShowValue: boolean; + Text: string; + Top: number; + Type: any; + VerticalAlignment: VerticalAlignments; + readonly Width: number; + } + + interface DataLabels { + _Default(Index: any): DataLabel; + readonly Application: Application; + AutoScaleFont: any; + AutoText: boolean; + readonly Border: Border; + readonly Count: number; + readonly Creator: XlCreator; + Delete(): any; + readonly Fill: ChartFillFormat; + readonly Font: Font; + readonly Format: ChartFormat; + HorizontalAlignment: HorizontalAlignments; + readonly Interior: Interior; + Item(Index: number): DataLabel; + readonly Name: string; + NumberFormat: string; + NumberFormatLinked: boolean; + NumberFormatLocal: string; + Orientation: XlOrientation; + readonly Parent: any; + Position: XlDataLabelPosition; + ReadingOrder: number; + Select(): any; + Separator: string | XlDataLabelSeparator; + Shadow: boolean; + ShowBubbleSize: boolean; + ShowCategoryName: boolean; + ShowLegendKey: boolean; + ShowPercentage: boolean; + ShowSeriesName: boolean; + ShowValue: boolean; + Type: any; + VerticalAlignment: VerticalAlignments; + (Index: number): DataLabel; } class DataTable { @@ -4460,14 +4684,14 @@ declare namespace Excel { private constructor(); /** - * @param Office.MsoRelativeNodePosition [pos=2] - * @param Office.MsoDiagramNodeType [nodeType=1] + * @param pos [pos=2] + * @param nodeType [nodeType=1] */ AddNode(pos?: Office.MsoRelativeNodePosition, nodeType?: Office.MsoDiagramNodeType): DiagramNode; readonly Application: any; readonly Children: DiagramNodeChildren; - /** @param Office.MsoRelativeNodePosition [pos=2] */ + /** @param pos [pos=2] */ CloneNode(copyChildren: boolean, pTargetNode: DiagramNode, pos?: Office.MsoRelativeNodePosition): DiagramNode; readonly Creator: number; Delete(): void; @@ -4481,19 +4705,16 @@ declare namespace Excel { readonly Root: DiagramNode; readonly Shape: Shape; - /** @param boolean [swapChildren=true] */ + /** @param swapChildren [swapChildren=true] */ SwapNode(pTargetNode: DiagramNode, swapChildren?: boolean): void; readonly TextShape: Shape; TransferChildren(pReceivingNode: DiagramNode): void; } - class DiagramNodeChildren { - private 'Excel.DiagramNodeChildren_typekey': DiagramNodeChildren; - private constructor(); - + interface DiagramNodeChildren { /** - * @param any [Index=-1] - * @param Office.MsoDiagramNodeType [nodeType=1] + * @param Index [Index=-1] + * @param nodeType [nodeType=1] */ AddNode(Index?: any, nodeType?: Office.MsoDiagramNodeType): DiagramNode; readonly Application: any; @@ -4504,17 +4725,17 @@ declare namespace Excel { readonly LastChild: DiagramNode; readonly Parent: any; SelectAll(): void; + (Index: any): DiagramNode; } - class DiagramNodes { - private 'Excel.DiagramNodes_typekey': DiagramNodes; - private constructor(); + interface DiagramNodes { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: any): DiagramNode; readonly Parent: any; SelectAll(): void; + (Index: any): DiagramNode; } class Dialog { @@ -4523,10 +4744,7 @@ declare namespace Excel { readonly Application: Application; readonly Creator: XlCreator; readonly Parent: any; - Show( - Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): boolean; + Show(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): boolean; } class DialogFrame { @@ -4538,8 +4756,8 @@ declare namespace Excel { CheckSpelling(CustomDictionary?: any, IgnoreUppercase?: any, AlwaysSuggest?: any, SpellLang?: any): any; /** - * @param Excel.XlPictureAppearance [Appearance=2] - * @param Excel.XlCopyPictureFormat [Format=-4147] + * @param Appearance [Appearance=2] + * @param Format [Format=-4147] */ CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): any; readonly Creator: XlCreator; @@ -4557,15 +4775,14 @@ declare namespace Excel { Width: number; } - class Dialogs { - private 'Excel.Dialogs_typekey': Dialogs; - private constructor(); + interface Dialogs { _Default(Index: XlBuiltInDialog): Dialog; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: XlBuiltInDialog): Dialog; readonly Parent: any; + (Index: XlBuiltInDialog): Dialog; } class DialogSheet { @@ -4579,9 +4796,7 @@ declare namespace Excel { _PasteSpecial(Format?: any, Link?: any, DisplayAsIcon?: any, IconFileName?: any, IconIndex?: any, IconLabel?: any): void; _PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void; _Protect(Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any): void; - _SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any): void; + _SaveAs(Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, TextVisualLayout?: any): void; Activate(): void; readonly Application: Application; Arcs(Index?: any): any; @@ -4594,7 +4809,8 @@ declare namespace Excel { ClearCircles(): void; readonly CodeName: string; readonly Comments: Comments; - Copy(Before?: any, After?: any): void; + Copy(Before?: Sheet): void; + Copy(Before: undefined, After: Sheet): void; readonly Creator: XlCreator; readonly CustomProperties: CustomProperties; DefaultButton: any; @@ -4614,9 +4830,7 @@ declare namespace Excel { EnablePivotTable: boolean; EnableSelection: XlEnableSelection; Evaluate(Name: any): any; - ExportAsFixedFormat( - Type: XlFixedFormatType, Filename?: any, Quality?: any, IncludeDocProperties?: any, IgnorePrintAreas?: any, From?: any, To?: any, OpenAfterPublish?: any, - FixedFormatExtClassPtr?: any): void; + ExportAsFixedFormat(Type: XlFixedFormatType, Filename?: any, Quality?: any, IncludeDocProperties?: any, IgnorePrintAreas?: any, From?: any, To?: any, OpenAfterPublish?: any, FixedFormatExtClassPtr?: any): void; Focus: any; GroupBoxes(Index?: any): any; GroupObjects(Index?: any): any; @@ -4628,7 +4842,7 @@ declare namespace Excel { Lines(Index?: any): any; ListBoxes(Index?: any): any; readonly MailEnvelope: Office.MsoEnvelope; - Move(Before?: any, After?: any): void; + Move(Before?: Sheet, After?: Sheet): void; Name: string; readonly Names: Names; readonly Next: any; @@ -4645,12 +4859,9 @@ declare namespace Excel { Pictures(Index?: any): any; readonly Previous: any; readonly PrintedCommentPages: number; - PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void; + PrintOut(From?: number, To?: number, Copies?: number, Preview?: boolean, ActivePrinter?: string, PrintToFile?: T, Collate?: boolean, PrToFileName?: PrintToFileName): any; PrintPreview(EnableChanges?: any): void; - Protect( - Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any, AllowFormattingCells?: any, AllowFormattingColumns?: any, - AllowFormattingRows?: any, AllowInsertingColumns?: any, AllowInsertingRows?: any, AllowInsertingHyperlinks?: any, AllowDeletingColumns?: any, - AllowDeletingRows?: any, AllowSorting?: any, AllowFiltering?: any, AllowUsingPivotTables?: any): void; + Protect(Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any, AllowFormattingCells?: any, AllowFormattingColumns?: any, AllowFormattingRows?: any, AllowInsertingColumns?: any, AllowInsertingRows?: any, AllowInsertingHyperlinks?: any, AllowDeletingColumns?: any, AllowDeletingRows?: any, AllowSorting?: any, AllowFiltering?: any, AllowUsingPivotTables?: any): void; readonly ProtectContents: boolean; readonly ProtectDrawingObjects: boolean; readonly Protection: Protection; @@ -4659,9 +4870,7 @@ declare namespace Excel { readonly QueryTables: QueryTables; Rectangles(Index?: any): any; ResetAllPageBreaks(): void; - SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any, Local?: any): void; + SaveAs(Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, TextVisualLayout?: any, Local?: any): void; readonly Scripts: Office.Scripts; ScrollArea: string; ScrollBars(Index?: any): any; @@ -4678,30 +4887,73 @@ declare namespace Excel { readonly VPageBreaks: VPageBreaks; } + class DialogSheetView { + private 'Excel.DialogSheetView_typekey': DialogSheetView; + private constructor(); + readonly Application: Application; + readonly Creator: XlCreator; + readonly Parent: any; + readonly Sheet: DialogSheet; + } + class DisplayFormat { private 'Excel.DisplayFormat_typekey': DisplayFormat; private constructor(); - readonly AddIndent: any; + readonly AddIndent: boolean | null; readonly Application: Application; readonly Borders: Borders; - Characters(Start?: any, Length?: any): Characters; + Characters(Start?: number, Length?: number): Characters; readonly Creator: XlCreator; readonly Font: Font; - readonly FormulaHidden: any; + readonly FormulaHidden: boolean | null; readonly HorizontalAlignment: any; readonly IndentLevel: any; readonly Interior: Interior; - readonly Locked: any; - readonly MergeCells: any; - readonly NumberFormat: any; - readonly NumberFormatLocal: any; + readonly Locked: boolean | null; + readonly MergeCells: boolean; + readonly NumberFormat: string | null; + readonly NumberFormatLocal: string | null; readonly Orientation: any; readonly Parent: any; readonly ReadingOrder: number; - readonly ShrinkToFit: any; - readonly Style: any; + readonly ShrinkToFit: boolean; + readonly Style: Style; readonly VerticalAlignment: any; - readonly WrapText: any; + readonly WrapText: boolean; + } + + class DisplayUnitLabel { + private 'Excel.DisplayUnitLabel_typekey': DisplayUnitLabel; + private constructor(); + readonly Application: Application; + AutoScaleFont: any; + readonly Border: Border; + Caption: string; + Characters(Start?: number, Length?: number): Characters; + readonly Creator: XlCreator; + Delete(): any; + readonly Fill: ChartFillFormat; + readonly Font: Font; + readonly Format: ChartFormat; + Formula: string; + FormulaLocal: string; + FormulaR1C1: string; + FormulaR1C1Local: string; + readonly Height: number; + HorizontalAlignment: HorizontalAlignments; + readonly Interior: Interior; + Left: number; + readonly Name: string; + Orientation: XlOrientation; + readonly Parent: any; + Position: XlChartElementPosition; + ReadingOrder: number; + Select(): any; + Shadow: boolean; + Text: string; + Top: number; + VerticalAlignment: VerticalAlignments; + readonly Width: number; } class DownBars { @@ -4742,6 +4994,21 @@ declare namespace Excel { readonly Value: boolean; } + class ErrorBars { + private 'Excel.ErrorBars_typekey': ErrorBars; + private constructor(); + readonly Application: Application; + readonly Border: Border; + ClearFormats(): any; + readonly Creator: XlCreator; + Delete(): any; + EndStyle: XlEndStyleCap; + readonly Format: ChartFormat; + readonly Name: string; + readonly Parent: any; + Select(): any; + } + class ErrorCheckingOptions { private 'Excel.ErrorCheckingOptions_typekey': ErrorCheckingOptions; private constructor(); @@ -4761,14 +5028,13 @@ declare namespace Excel { UnlockedFormulaCells: boolean; } - class Errors { - private 'Excel.Errors_typekey': Errors; - private constructor(); + interface Errors { _Default(Index: any): Error; readonly Application: Application; readonly Creator: XlCreator; - Item(Index: any): Error; + Item(Index: number | XlErrorChecks): Error; readonly Parent: any; + (Index: number | XlErrorChecks): Error; } class FileExportConverter { @@ -4782,15 +5048,14 @@ declare namespace Excel { readonly Parent: any; } - class FileExportConverters { - private 'Excel.FileExportConverters_typekey': FileExportConverters; - private constructor(); + interface FileExportConverters { _Default(Index: any): FileExportConverter; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): FileExportConverter; + Item(Index: number): FileExportConverter; readonly Parent: any; + (Index: number): FileExportConverter; } class FillFormat { @@ -4848,15 +5113,14 @@ declare namespace Excel { readonly Parent: any; } - class Filters { - private 'Excel.Filters_typekey': Filters; - private constructor(); + interface Filters { _Default(Index: number): Filter; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): Filter; readonly Parent: any; + (Index: number): Filter; } class Floor { @@ -4872,7 +5136,7 @@ declare namespace Excel { readonly Name: string; readonly Parent: any; Paste(): void; - PictureType: any; + PictureType: XlChartPictureType; Select(): any; Thickness: number; } @@ -4881,133 +5145,103 @@ declare namespace Excel { private 'Excel.Font_typekey': Font; private constructor(); readonly Application: Application; - Background: any; - Bold: any; - Color: any; - ColorIndex: any; + Background: XlBackground; + Bold: boolean; + Color: XlRgbColor | number; + ColorIndex: number | XlColorIndex; readonly Creator: XlCreator; - FontStyle: any; - Italic: any; - Name: any; + FontStyle: 'Regular' | 'Italic' | 'Bold' | 'Bold Italic'; + Italic: boolean; + Name: string; OutlineFont: any; readonly Parent: any; Shadow: any; - Size: any; - Strikethrough: any; - Subscript: any; - Superscript: any; - ThemeColor: any; + Size: number; + Strikethrough: boolean; + Subscript: boolean; + Superscript: boolean; + ThemeColor: XlThemeColor; ThemeFont: XlThemeFont; - TintAndShade: any; - Underline: any; + TintAndShade: number; + Underline: XlUnderlineStyle; } class FormatColor { private 'Excel.FormatColor_typekey': FormatColor; private constructor(); readonly Application: Application; - Color: any; + Color: XlRgbColor | number; ColorIndex: XlColorIndex; readonly Creator: XlCreator; readonly Parent: any; - ThemeColor: any; - TintAndShade: any; + ThemeColor: XlThemeColor; + TintAndShade: number; } - class FormatConditions { - private 'Excel.FormatConditions_typekey': FormatConditions; + class FormatCondition { + private 'Excel.FormatCondition_typekey': FormatCondition; private constructor(); + _Modify(Type: XlFormatConditionType, Operator?: any, Formula1?: any, Formula2?: any): void; + readonly Application: Application; + readonly AppliesTo: Range; + readonly Borders: Borders; + readonly Creator: XlCreator; + DateOperator: XlTimePeriods; + Delete(): void; + readonly Font: Font; + readonly Formula1: string; + readonly Formula2: string; + readonly Interior: Interior; + Modify(Type: XlFormatConditionType.xlExpression, Operator: undefined, Formula1: string): void; + Modify(Type: XlFormatConditionType, Operator: XlFormatConditionOperator.xlBetween | XlFormatConditionOperator.xlNotBetween, Formula1: string, Formula2: string): void; + Modify(Type: XlFormatConditionType, Operator?: XlFormatConditionOperator, Formula1?: string, Formula2?: string, String?: any, Operator2?: any): void; + ModifyAppliesToRange(Range: Range): void; + NumberFormat: string; + readonly Operator: number; + readonly Parent: any; + Priority: number; + readonly PTCondition: boolean; + ScopeType: XlPivotConditionScope; + SetFirstPriority(): void; + SetLastPriority(): void; + StopIfTrue: boolean; + Text: string; + TextOperator: XlContainsOperator; + readonly Type: number; + } + + interface FormatConditions { _Default(Index: any): any; - Add(Type: XlFormatConditionType, Operator?: any, Formula1?: any, Formula2?: any, String?: any, TextOperator?: any, DateOperator?: any, ScopeType?: any): any; - AddAboveAverage(): any; - AddColorScale(ColorScaleType: number): any; - AddDatabar(): any; - AddIconSetCondition(): any; - AddTop10(): any; - AddUniqueValues(): any; + Add(Type: XlFormatConditionType.xlExpression, Operator: undefined, Formula1: string): FormatCondition; + Add(Type: XlFormatConditionType, Operator: XlFormatConditionOperator.xlBetween | XlFormatConditionOperator.xlNotBetween, Formula1: string, Formula2: string): FormatCondition; + Add(Type: XlFormatConditionType, Operator?: XlFormatConditionOperator, Formula1?: string, Formula2?: string, String?: any, TextOperator?: any, DateOperator?: any, ScopeType?: any): FormatCondition; + AddAboveAverage(): AboveAverage; + AddColorScale(ColorScaleType: number): ColorScale; + AddDatabar(): Databar; + AddIconSetCondition(): IconSetCondition; + AddTop10(): Top10; + AddUniqueValues(): UniqueValues; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Delete(): void; - Item(Index: any): any; + Item(Index: number | string): FormatCondition; readonly Parent: any; + (Index: number | string): FormatCondition; } class FreeformBuilder { private 'Excel.FreeformBuilder_typekey': FreeformBuilder; private constructor(); - AddNodes(SegmentType: Office.MsoSegmentType, EditingType: Office.MsoEditingType, X1: number, Y1: number, X2?: any, Y2?: any, X3?: any, Y3?: any): void; + AddNodes(SegmentType: Office.MsoSegmentType.msoSegmentCurve, EditingType: Office.MsoEditingType.msoEditingCorner, X1: number, Y1: number, X2: number, Y2: number, X3: number, Y3: number): void; + AddNodes(SegmentType: Office.MsoSegmentType, EditingType: Office.MsoEditingType.msoEditingAuto, X1: number, Y1: number): void; readonly Application: Application; ConvertToShape(): Shape; readonly Creator: XlCreator; readonly Parent: any; } - class Global { - private 'Excel.Global_typekey': Global; - private constructor(); - _Evaluate(Name: any): any; - _Run2( - Macro?: any, Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; - readonly ActiveCell: Range; - readonly ActiveChart: Chart; - readonly ActiveDialog: DialogSheet; - readonly ActiveMenuBar: MenuBar; - ActivePrinter: string; - readonly ActiveSheet: any; - readonly ActiveWindow: Window; - readonly ActiveWorkbook: Workbook; - readonly AddIns: AddIns; - readonly Application: Application; - readonly Assistant: Office.Assistant; - Calculate(): void; - readonly Cells: Range; - readonly Charts: Sheets; - readonly Columns: Range; - readonly CommandBars: Office.CommandBars; - readonly Creator: XlCreator; - readonly DDEAppReturnCode: number; - DDEExecute(Channel: number, String: string): void; - DDEInitiate(App: string, Topic: string): number; - DDEPoke(Channel: number, Item: any, Data: any): void; - DDERequest(Channel: number, Item: string): any; - DDETerminate(Channel: number): void; - readonly DialogSheets: Sheets; - Evaluate(Name: any): any; - readonly Excel4IntlMacroSheets: Sheets; - readonly Excel4MacroSheets: Sheets; - ExecuteExcel4Macro(String: string): any; - Intersect( - Arg1: Range, Arg2: Range, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): Range; - readonly MenuBars: MenuBars; - readonly Modules: Modules; - readonly Names: Names; - readonly Parent: Application; - Range(Cell1: any, Cell2?: any): Range; - readonly Rows: Range; - Run( - Macro?: any, Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; - readonly Selection: any; - SendKeys(Keys: any, Wait?: any): void; - readonly Sheets: Sheets; - ShortcutMenus(Index: number): Menu; - readonly ThisWorkbook: Workbook; - readonly Toolbars: Toolbars; - Union( - Arg1: Range, Arg2: Range, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): Range; - readonly Windows: Windows; - readonly Workbooks: Workbooks; - readonly WorksheetFunction: WorksheetFunction; - readonly Worksheets: Sheets; - } + // there is no way to use the Globals class from within Javascript class Graphic { private 'Excel.Graphic_typekey': Graphic; @@ -5028,16 +5262,82 @@ declare namespace Excel { Width: number; } - class GroupShapes { - private 'Excel.GroupShapes_typekey': GroupShapes; + class Gridlines { + private 'Excel.Gridlines_typekey': Gridlines; private constructor(); + readonly Application: Application; + readonly Border: Border; + readonly Creator: XlCreator; + Delete(): any; + readonly Format: ChartFormat; + readonly Name: string; + readonly Parent: any; + Select(): any; + } + + class GroupObject { + private 'Excel.GroupObject_typekey': GroupObject; + private constructor(); + _Default: number; + AddIndent: boolean; + readonly Application: Application; + ArrowHeadLength: any; + ArrowHeadStyle: any; + ArrowHeadWidth: any; + AutoSize: boolean; + readonly Border: Border; + readonly BottomRightCell: Range; + BringToFront(): any; + CheckSpelling(CustomDictionary?: any, IgnoreUppercase?: any, AlwaysSuggest?: any, SpellLang?: any): any; + Copy(): any; + + /** + * @param Appearance [Appearance=2] + * @param Format [Format=-4147] + */ + CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): any; + readonly Creator: XlCreator; + Cut(): any; + Delete(): any; + Duplicate(): any; + Enabled: boolean; + readonly Font: Font; + Height: number; + HorizontalAlignment: any; + readonly Index: number; + readonly Interior: Interior; + Left: number; + Locked: boolean; + Name: string; + OnAction: string; + Orientation: any; + readonly Parent: any; + Placement: any; + PrintObject: boolean; + ReadingOrder: number; + RoundedCorners: boolean; + Select(Replace?: any): any; + SendToBack(): any; + Shadow: boolean; + readonly ShapeRange: ShapeRange; + Top: number; + readonly TopLeftCell: Range; + Ungroup(): any; + VerticalAlignment: any; + Visible: boolean; + Width: number; + readonly ZOrder: number; + } + + interface GroupShapes { _Default(Index: any): Shape; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): Shape; + Item(Index: number | string): Shape; readonly Parent: any; - Range(Index: any): ShapeRange; + Range(Index: number | string | SafeArray): ShapeRange; + (Index: number | string): Shape; } class HeaderFooter { @@ -5073,16 +5373,15 @@ declare namespace Excel { Type: XlPageBreak; } - class HPageBreaks { - private 'Excel.HPageBreaks_typekey': HPageBreaks; - private constructor(); + interface HPageBreaks { _Default(Index: number): HPageBreak; - Add(Before: any): HPageBreak; + Add(Before: Range): HPageBreak; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): HPageBreak; readonly Parent: any; + (Index: number): HPageBreak; } class Hyperlink { @@ -5095,7 +5394,7 @@ declare namespace Excel { readonly Creator: XlCreator; Delete(): void; EmailSubject: string; - Follow(NewWindow?: any, AddHistory?: any, ExtraInfo?: any, Method?: any, HeaderInfo?: any): void; + Follow(NewWindow?: boolean, AddHistory?: undefined, ExtraInfo?: string | Office.ByteArray, Method?: Office.MsoExtraInfoMethod, HeaderInfo?: string): void; readonly Name: string; readonly Parent: any; readonly Range: Range; @@ -5106,17 +5405,16 @@ declare namespace Excel { readonly Type: number; } - class Hyperlinks { - private 'Excel.Hyperlinks_typekey': Hyperlinks; - private constructor(); + interface Hyperlinks { _Default(Index: any): Hyperlink; - Add(Anchor: any, Address: string, SubAddress?: any, ScreenTip?: any, TextToDisplay?: any): any; + Add(Anchor: Range | Shape, Address: string, SubAddress?: string, ScreenTip?: string, TextToDisplay?: string): Hyperlink; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Delete(): void; - Item(Index: any): Hyperlink; + Item(Index: number | string): Hyperlink; readonly Parent: any; + (Index: number | string): Hyperlink; } class Icon { @@ -5128,46 +5426,100 @@ declare namespace Excel { readonly Parent: IconSet; } - class IconSet { - private 'Excel.IconSet_typekey': IconSet; - private constructor(); + // tslint:disable-next-line:interface-name + interface IconSet { _Default(Index: any): Icon; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; readonly ID: XlIconSet; - Item(Index: any): Icon; + Item(Index: number): Icon; readonly Parent: any; + (Index: number): Icon; } - class IconSets { - private 'Excel.IconSets_typekey': IconSets; + class IconSetCondition { + private 'Excel.IconSetCondition_typekey': IconSetCondition; private constructor(); + readonly Application: Application; + readonly AppliesTo: Range; + readonly Creator: XlCreator; + Delete(): void; + Formula: string; + readonly IconCriteria: IconCriteria; + IconSet: IconSets; + ModifyAppliesToRange(Range: Range): void; + readonly Parent: any; + PercentileValues: boolean; + Priority: number; + readonly PTCondition: boolean; + ReverseOrder: boolean; + ScopeType: XlPivotConditionScope; + SetFirstPriority(): void; + SetLastPriority(): void; + ShowIconOnly: boolean; + readonly StopIfTrue: boolean; + readonly Type: number; + } + + // tslint:disable-next-line:interface-name + interface IconCriteria { + _Default(Index: any): IconCriterion; + readonly Count: number; + Item(Index: number): IconCriterion; + (Index: number): IconCriterion; + } + + class IconCriterion { + private 'Excel.IconCriterion_typekey': IconCriterion; + private constructor(); + Icon: XlIcon; + readonly Index: number; + Operator: number; + Type: XlConditionValueTypes; + Value: number | string; + } + + // tslint:disable-next-line:interface-name + interface IconSets { _Default(Index: any): any; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): any; + Item(Index: number): IconSet; readonly Parent: any; + (Index: number): IconSet; } class Interior { private 'Excel.Interior_typekey': Interior; private constructor(); readonly Application: Application; - Color: any; + Color: XlRgbColor | number; ColorIndex: number | XlColorIndex; readonly Creator: XlCreator; readonly Gradient: any; - InvertIfNegative: any; + InvertIfNegative: boolean; readonly Parent: any; - Pattern: any; - PatternColor: any; - PatternColorIndex: any; - PatternThemeColor: any; - PatternTintAndShade: any; - ThemeColor: any; - TintAndShade: any; + Pattern: XlPattern; + PatternColor: XlRgbColor | number; + PatternColorIndex: number | XlColorIndex; + PatternThemeColor: XlThemeColor; + PatternTintAndShade: number; + ThemeColor: XlThemeColor; + TintAndShade: number; + } + + class LeaderLines { + private 'Excel.LeaderLines_typekey': LeaderLines; + private constructor(); + readonly Application: Application; + readonly Border: Border; + readonly Creator: XlCreator; + Delete(): void; + readonly Format: ChartFormat; + readonly Parent: any; + Select(): void; } class Legend { @@ -5186,7 +5538,7 @@ declare namespace Excel { IncludeInLayout: boolean; readonly Interior: Interior; Left: number; - LegendEntries(Index?: any): any; + LegendEntries: LegendEntries & ((Index: number) => LegendEntry); readonly Name: string; readonly Parent: any; Position: XlLegendPosition; @@ -5196,6 +5548,66 @@ declare namespace Excel { Width: number; } + interface LegendEntries { + _Default(Index: any): LegendEntry; + readonly Application: Application; + readonly Count: number; + readonly Creator: XlCreator; + Item(Index: number): LegendEntry; + readonly Parent: any; + (Index: number): LegendEntry; + } + + class LegendEntry { + private 'Excel.LegendEntry_typekey': LegendEntry; + private constructor(); + readonly Application: Application; + AutoScaleFont: any; + readonly Creator: XlCreator; + Delete(): any; + readonly Font: Font; + readonly Format: ChartFormat; + readonly Height: number; + readonly Index: number; + readonly Left: number; + readonly LegendKey: LegendKey; + readonly Parent: any; + Select(): any; + readonly Top: number; + readonly Width: number; + } + + class LegendKey { + private 'Excel.LegendKey_typekey': LegendKey; + private constructor(); + readonly Application: Application; + readonly Border: Border; + ClearFormats(): any; + readonly Creator: XlCreator; + Delete(): any; + readonly Fill: ChartFillFormat; + readonly Format: ChartFormat; + readonly Height: number; + readonly Interior: Interior; + InvertIfNegative: boolean; + readonly Left: number; + MarkerBackgroundColor: number; + MarkerBackgroundColorIndex: XlColorIndex; + MarkerForegroundColor: number; + MarkerForegroundColorIndex: XlColorIndex; + MarkerSize: number; + MarkerStyle: XlMarkerStyle; + readonly Parent: any; + PictureType: number; + PictureUnit: number; + PictureUnit2: number; + Select(): any; + Shadow: boolean; + Smooth: boolean; + readonly Top: number; + readonly Width: number; + } + class LineFormat { private 'Excel.LineFormat_typekey': LineFormat; private constructor(); @@ -5249,16 +5661,15 @@ declare namespace Excel { readonly XPath: XPath; } - class ListColumns { - private 'Excel.ListColumns_typekey': ListColumns; - private constructor(); + interface ListColumns { _Default(Index: any): ListColumn; - Add(Position?: any): ListColumn; + Add(Position?: number): ListColumn; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): ListColumn; + Item(Index: number | string): ListColumn; readonly Parent: any; + (Index: number | string): ListColumn; } class ListDataFormat { @@ -5267,15 +5678,15 @@ declare namespace Excel { readonly _Default: XlListDataType; readonly AllowFillIn: boolean; readonly Application: Application; - readonly Choices: any; + readonly Choices: SafeArray; readonly Creator: XlCreator; readonly DecimalPlaces: number; readonly DefaultValue: any; readonly IsPercent: boolean; readonly lcid: number; readonly MaxCharacters: number; - readonly MaxNumber: any; - readonly MinNumber: any; + readonly MaxNumber: number | null; + readonly MinNumber: number | null; readonly Parent: any; readonly ReadOnly: boolean; readonly Required: boolean; @@ -5303,7 +5714,7 @@ declare namespace Excel { readonly ListRows: ListRows; Name: string; readonly Parent: any; - Publish(Target: any, LinkSource: boolean): string; + Publish(Target: SafeArray, LinkSource: boolean): string; readonly QueryTable: QueryTable; readonly Range: Range; Refresh(): void; @@ -5324,32 +5735,33 @@ declare namespace Excel { Unlink(): void; Unlist(): void; - /** @param Excel.XlListConflict [iConflictType=0] */ + /** @param iConflictType [iConflictType=0] */ UpdateChanges(iConflictType?: XlListConflict): void; readonly XmlMap: XmlMap; } - class ListObjects { - private 'Excel.ListObjects_typekey': ListObjects; - private constructor(); - + interface ListObjects { /** - * @param Excel.XlListObjectSourceType [SourceType=1] - * @param Excel.XlYesNoGuess [XlListObjectHasHeaders=0] + * @param SourceType [SourceType=1] + * @param XlListObjectHasHeaders [XlListObjectHasHeaders=0] */ _Add(SourceType?: XlListObjectSourceType, Source?: any, LinkSource?: any, XlListObjectHasHeaders?: XlYesNoGuess, Destination?: any): ListObject; _Default(Index: any): ListObject; + Add(SourceType: XlListObjectSourceType.xlSrcRange, Source?: Range, LinkSource?: undefined, XlListObjectHasHeaders?: XlYesNoGuess, Destination?: undefined, TableStyleName?: string): ListObject; + Add(SourceType: XlListObjectSourceType.xlSrcExternal, Source: SafeArray, LinkSource: boolean, XlListObjectHasHeaders: XlYesNoGuess, Destination: Range, TableStyleName?: string): ListObject; + /** - * @param Excel.XlListObjectSourceType [SourceType=1] - * @param Excel.XlYesNoGuess [XlListObjectHasHeaders=0] + * @param SourceType [SourceType=1] + * @param XlListObjectHasHeaders [XlListObjectHasHeaders=0] */ - Add(SourceType?: XlListObjectSourceType, Source?: any, LinkSource?: any, XlListObjectHasHeaders?: XlYesNoGuess, Destination?: any, TableStyleName?: any): ListObject; + Add(SourceType?: XlListObjectSourceType, Source?: any, LinkSource?: boolean, XlListObjectHasHeaders?: XlYesNoGuess, Destination?: Range, TableStyleName?: string): ListObject; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): ListObject; + Item(Index: number | string): ListObject; readonly Parent: any; + (Index: number | string): ListObject; } class ListRow { @@ -5364,19 +5776,19 @@ declare namespace Excel { readonly Range: Range; } - class ListRows { - private 'Excel.ListRows_typekey': ListRows; - private constructor(); + interface ListRows { _Add(Position?: any): ListRow; _Default(Index: any): ListRow; - Add(Position?: any, AlwaysInsert?: any): ListRow; + Add(Position?: number, AlwaysInsert?: boolean): ListRow; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): ListRow; + Item(Index: number | string): ListRow; readonly Parent: any; + (Index: number | string): ListRow; } + /** Macintosh only */ class Mailer { private 'Excel.Mailer_typekey': Mailer; private constructor(); @@ -5422,9 +5834,7 @@ declare namespace Excel { Reset(): void; } - class MenuBars { - private 'Excel.MenuBars_typekey': MenuBars; - private constructor(); + interface MenuBars { _Default(Index: any): MenuBar; Add(Name?: any): MenuBar; readonly Application: Application; @@ -5432,6 +5842,7 @@ declare namespace Excel { readonly Creator: XlCreator; Item(Index: any): MenuBar; readonly Parent: any; + (Index: any): MenuBar; } class MenuItem { @@ -5451,9 +5862,7 @@ declare namespace Excel { StatusBar: string; } - class MenuItems { - private 'Excel.MenuItems_typekey': MenuItems; - private constructor(); + interface MenuItems { _Default(Index: any): any; Add(Caption: string, OnAction?: any, ShortcutKey?: any, Before?: any, Restore?: any, StatusBar?: any, HelpFile?: any, HelpContextID?: any): MenuItem; AddMenu(Caption: string, Before?: any, Restore?: any): Menu; @@ -5462,11 +5871,10 @@ declare namespace Excel { readonly Creator: XlCreator; Item(Index: any): any; readonly Parent: any; + (Index: any): any; } - class Menus { - private 'Excel.Menus_typekey': Menus; - private constructor(); + interface Menus { _Default(Index: any): Menu; Add(Caption: string, Before?: any, Restore?: any): Menu; readonly Application: Application; @@ -5474,6 +5882,7 @@ declare namespace Excel { readonly Creator: XlCreator; Item(Index: any): Menu; readonly Parent: any; + (Index: any): Menu; } class Module { @@ -5483,9 +5892,7 @@ declare namespace Excel { _CodeName: string; _PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any): void; _Protect(Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any): void; - _SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any): void; + _SaveAs(Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, TextVisualLayout?: any): void; Activate(): void; readonly Application: Application; readonly CodeName: string; @@ -5507,18 +5914,14 @@ declare namespace Excel { Protect(Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any): void; readonly ProtectContents: boolean; readonly ProtectionMode: boolean; - SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any): void; + SaveAs(Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, TextVisualLayout?: any): void; Select(Replace?: any): void; readonly Shapes: Shapes; Unprotect(Password?: any): void; Visible: XlSheetVisibility; } - class Modules { - private 'Excel.Modules_typekey': Modules; - private constructor(); + interface Modules { __PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any): void; _Default(Index: any): any; _PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void; @@ -5536,6 +5939,7 @@ declare namespace Excel { Select(Replace?: any): void; Visible: any; readonly VPageBreaks: VPageBreaks; + (Index: any): any; } class MultiThreadedCalculation { @@ -5564,10 +5968,10 @@ declare namespace Excel { Name: string; NameLocal: string; readonly Parent: any; - RefersTo: any; - RefersToLocal: any; - RefersToR1C1: any; - RefersToR1C1Local: any; + RefersTo: string; + RefersToLocal: string; + RefersToR1C1: string; + RefersToR1C1Local: string; readonly RefersToRange: Range; ShortcutKey: string; readonly ValidWorkbookParameter: boolean; @@ -5576,17 +5980,30 @@ declare namespace Excel { WorkbookParameter: boolean; } - class Names { - private 'Excel.Names_typekey': Names; - private constructor(); + interface Names { _Default(Index?: any, IndexLocal?: any, RefersTo?: any): Name; - Add( - Name?: any, RefersTo?: any, Visible?: any, MacroType?: any, ShortcutKey?: any, Category?: any, NameLocal?: any, RefersToLocal?: any, CategoryLocal?: any, - RefersToR1C1?: any, RefersToR1C1Local?: any): Name; + Add(Name?: string, RefersTo?: string, Visible?: boolean, MacroType?: 1 | 2 | 3, ShortcutKey?: string, Category?: FunctionCategory | string, NameLocal?: string, RefersToLocal?: string, CategoryLocal?: string, RefersToR1C1?: string, RefersToR1C1Local?: string): Name; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index?: any, IndexLocal?: any, RefersTo?: any): Name; + Item(Index: number | string): Name; + Item(Index: undefined, IndexLocal: string): Name; + Item(Index: undefined, IndexLocal: undefined, RefersTo: string): Name; + readonly Parent: any; + (Index: number | string): Name; + (Index: undefined, IndexLocal: string): Name; + (Index: undefined, IndexLocal: undefined, RefersTo: string): Name; + } + + class NegativeBarFormat { + private 'Excel.NegativeBarFormat_typekey': NegativeBarFormat; + private constructor(); + readonly Application: Application; + readonly BorderColor: FormatColor; + BorderColorType: XlDataBarNegativeColorType; + readonly Color: FormatColor; + ColorType: XlDataBarNegativeColorType; + readonly Creator: XlCreator; readonly Parent: any; } @@ -5597,9 +6014,9 @@ declare namespace Excel { readonly Application: Application; BackgroundQuery: boolean; CancelRefresh(): void; - CommandText: any; + CommandText: string; CommandType: XlCmdType; - Connection: any; + Connection: string; readonly Creator: XlCreator; EnableRefresh: boolean; readonly Parent: any; @@ -5609,12 +6026,12 @@ declare namespace Excel { RefreshOnFileOpen: boolean; RefreshPeriod: number; RobustConnect: XlRobustConnect; - SaveAsODC(ODCFileName: string, Description?: any, Keywords?: any): void; + SaveAsODC(ODCFileName: string, Description?: string, Keywords?: string): void; SavePassword: boolean; ServerCredentialsMethod: XlCredentialsMethod; ServerSSOApplicationID: string; SourceConnectionFile: string; - SourceData: any; + SourceData: string | SafeArray | PivotTable; SourceDataFile: string; } @@ -5628,33 +6045,32 @@ declare namespace Excel { readonly SqlState: string; } - class ODBCErrors { - private 'Excel.ODBCErrors_typekey': ODBCErrors; - private constructor(); + interface ODBCErrors { _Default(Index: number): ODBCError; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): ODBCError; readonly Parent: any; + (Index: number): ODBCError; } class OLEDBConnection { private 'Excel.OLEDBConnection_typekey': OLEDBConnection; private constructor(); - readonly ADOConnection: any; + readonly ADOConnection: ADODB.Connection; AlwaysUseConnectionFile: boolean; readonly Application: Application; BackgroundQuery: boolean; readonly CalculatedMembers: CalculatedMembers; CancelRefresh(): void; - CommandText: any; + CommandText: string; CommandType: XlCmdType; - Connection: any; + Connection: string; readonly Creator: XlCreator; EnableRefresh: boolean; readonly IsConnected: boolean; - LocalConnection: any; + LocalConnection: string; LocaleID: number; MaintainConnection: boolean; MakeConnection(): void; @@ -5669,7 +6085,7 @@ declare namespace Excel { RefreshPeriod: number; RetrieveInOfficeUILang: boolean; RobustConnect: XlRobustConnect; - SaveAsODC(ODCFileName: string, Description?: any, Keywords?: any): void; + SaveAsODC(ODCFileName: string, Description?: string, Keywords?: string): void; SavePassword: boolean; ServerCredentialsMethod: XlCredentialsMethod; ServerFillColor: boolean; @@ -5695,15 +6111,14 @@ declare namespace Excel { readonly Stage: number; } - class OLEDBErrors { - private 'Excel.OLEDBErrors_typekey': OLEDBErrors; - private constructor(); + interface OLEDBErrors { _Default(Index: number): OLEDBError; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): OLEDBError; readonly Parent: any; + (Index: number): OLEDBError; } class OLEFormat { @@ -5715,7 +6130,7 @@ declare namespace Excel { readonly Object: any; readonly Parent: any; readonly progID: string; - Verb(Verb?: any): void; + Verb(Verb?: XlOLEVerb): void; } class OLEObject { @@ -5732,8 +6147,8 @@ declare namespace Excel { Copy(): any; /** - * @param Excel.XlPictureAppearance [Appearance=2] - * @param Excel.XlCopyPictureFormat [Format=-4147] + * @param Appearance [Appearance=2] + * @param Format [Format=-4147] */ CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): any; readonly Creator: XlCreator; @@ -5750,13 +6165,13 @@ declare namespace Excel { Locked: boolean; Name: string; readonly Object: any; - readonly OLEType: any; + readonly OLEType: XlOLEType.xlOLELink | XlOLEType.xlOLEEmbed; OnAction: string; readonly Parent: any; - Placement: any; + Placement: XlPlacement; PrintObject: boolean; readonly progID: string; - Select(Replace?: any): any; + Select(Replace?: boolean): any; SendToBack(): any; Shadow: boolean; readonly ShapeRange: ShapeRange; @@ -5765,13 +6180,58 @@ declare namespace Excel { readonly TopLeftCell: Range; Update(): any; - /** @param Excel.XlOLEVerb [Verb=1] */ + /** @param Verb [Verb=1] */ Verb(Verb?: XlOLEVerb): any; Visible: boolean; Width: number; readonly ZOrder: number; } + class OLEObjects { + private 'Excel.OLEObjects_typekey': OLEObjects; + private constructor(); + Add(ClassType: string, Filename: undefined, Link: undefined, DisplayAsIcon: true, IconFileName?: string, IconIndex?: number, IconLabel?: string, Left?: number, Top?: number, Width?: number, Height?: number): OLEObject; + Add(ClassType: string, Filename?: undefined, Link?: undefined, DisplayAsIcon?: false, IconFileName?: undefined, IconIndex?: undefined, IconLabel?: undefined, Left?: number, Top?: number, Width?: number, Height?: number): OLEObject; + Add(ClassType: undefined, Filename: string, Link: boolean, DisplayAsIcon: true, IconFileName?: string, IconIndex?: number, IconLabel?: string, Left?: number, Top?: number, Width?: number, Height?: number): OLEObject; + Add(ClassType: undefined, Filename: string, Link?: boolean, DisplayAsIcon?: false, IconFileName?: undefined, IconIndex?: undefined, IconLabel?: undefined, Left?: number, Top?: number, Width?: number, Height?: number): OLEObject; + readonly Application: Application; + AutoLoad: boolean; + readonly Border: Border; + BringToFront(): any; + Copy(): any; + + /** + * @param Appearance [Appearance=2] + * @param Format [Format=-4147] + */ + CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): any; + readonly Count: number; + readonly Creator: XlCreator; + Cut(): any; + Delete(): any; + Duplicate(): any; + Enabled: boolean; + Group(): GroupObject; + Height: number; + readonly Interior: Interior; + Item(Index: number | string): any; + Left: number; + Locked: boolean; + OnAction: string; + readonly Parent: any; + Placement: any; + PrintObject: boolean; + Select(Replace?: boolean): any; + SendToBack(): any; + Shadow: boolean; + readonly ShapeRange: ShapeRange; + SourceName: string; + Top: number; + Visible: boolean; + Width: number; + readonly ZOrder: number; + } + class Outline { private 'Excel.Outline_typekey': Outline; private constructor(); @@ -5779,7 +6239,7 @@ declare namespace Excel { AutomaticStyles: boolean; readonly Creator: XlCreator; readonly Parent: any; - ShowLevels(RowLevels?: any, ColumnLevels?: any): any; + ShowLevels(RowLevels?: number, ColumnLevels?: number): any; SummaryColumn: XlSummaryColumn; SummaryRow: XlSummaryRow; } @@ -5795,12 +6255,11 @@ declare namespace Excel { readonly RightHeader: HeaderFooter; } - class Pages { - private 'Excel.Pages_typekey': Pages; - private constructor(); + interface Pages { _Default(Index: any): Page; readonly Count: number; - Item(Index: any): Page; + Item(Index: number): Page; + (Index: number): Page; } class PageSetup { @@ -5823,8 +6282,8 @@ declare namespace Excel { readonly EvenPage: Page; readonly FirstPage: Page; FirstPageNumber: number; - FitToPagesTall: any; - FitToPagesWide: any; + FitToPagesTall: number | false; + FitToPagesWide: number | false; FooterMargin: number; HeaderMargin: number; LeftFooter: string; @@ -5844,7 +6303,7 @@ declare namespace Excel { PrintGridlines: boolean; PrintHeadings: boolean; PrintNotes: boolean; - PrintQuality(Index?: any): any; + PrintQuality: SafeArray & ((Index: 1 | 2) => number); PrintTitleColumns: string; PrintTitleRows: string; RightFooter: string; @@ -5854,7 +6313,9 @@ declare namespace Excel { RightMargin: number; ScaleWithDocHeaderFooter: boolean; TopMargin: number; - Zoom: any; + + /** Represents a percentage between 10 and 400 */ + Zoom: number; } class Pane { @@ -5864,26 +6325,25 @@ declare namespace Excel { readonly Application: Application; readonly Creator: XlCreator; readonly Index: number; - LargeScroll(Down?: any, Up?: any, ToRight?: any, ToLeft?: any): any; + LargeScroll(Down?: number, Up?: number, ToRight?: number, ToLeft?: number): any; readonly Parent: any; PointsToScreenPixelsX(Points: number): number; PointsToScreenPixelsY(Points: number): number; ScrollColumn: number; - ScrollIntoView(Left: number, Top: number, Width: number, Height: number, Start?: any): void; + ScrollIntoView(Left: number, Top: number, Width: number, Height: number, Start?: boolean): void; ScrollRow: number; - SmallScroll(Down?: any, Up?: any, ToRight?: any, ToLeft?: any): any; + SmallScroll(Down?: number, Up?: number, ToRight?: number, ToLeft?: number): any; readonly VisibleRange: Range; } - class Panes { - private 'Excel.Panes_typekey': Panes; - private constructor(); + interface Panes { _Default(Index: number): Pane; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): Pane; readonly Parent: any; + (Index: number): Pane; } class Parameter { @@ -5902,17 +6362,16 @@ declare namespace Excel { readonly Value: any; } - class Parameters { - private 'Excel.Parameters_typekey': Parameters; - private constructor(); + interface Parameters { _Default(Index: any): Parameter; - Add(Name: string, iDataType?: any): Parameter; + Add(Name: string, iDataType?: XlParameterDataType): Parameter; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Delete(): void; - Item(Index: any): Parameter; + Item(Index: number | string): Parameter; readonly Parent: any; + (Index: number | string): Parameter; } class Phonetic { @@ -5928,9 +6387,7 @@ declare namespace Excel { Visible: boolean; } - class Phonetics { - private 'Excel.Phonetics_typekey': Phonetics; - private constructor(); + interface Phonetics { _Default(Index: number): any; Add(Start: number, Length: number, Text: string): void; Alignment: number; @@ -5940,12 +6397,13 @@ declare namespace Excel { readonly Creator: XlCreator; Delete(): void; readonly Font: Font; - Item(Index: number): any; + Item(Index: number): Phonetic; readonly Length: number; readonly Parent: any; readonly Start: number; Text: string; Visible: boolean; + (Index: number): Phonetic; } class PictureFormat { @@ -5980,18 +6438,18 @@ declare namespace Excel { class PivotCache { private 'Excel.PivotCache_typekey': PivotCache; private constructor(); - readonly ADOConnection: any; + readonly ADOConnection: ADODB.Connection; readonly Application: Application; BackgroundQuery: boolean; - CommandText: any; + CommandText: string; CommandType: XlCmdType; - Connection: any; - CreatePivotTable(TableDestination: any, TableName?: any, ReadData?: any, DefaultVersion?: any): PivotTable; + Connection: string; + CreatePivotTable(TableDestination: Range, TableName?: string, ReadData?: boolean, DefaultVersion?: any): PivotTable; readonly Creator: XlCreator; EnableRefresh: boolean; readonly Index: number; readonly IsConnected: boolean; - LocalConnection: any; + LocalConnection: string; MaintainConnection: boolean; MakeConnection(): void; readonly MemoryUsed: number; @@ -6001,7 +6459,7 @@ declare namespace Excel { readonly Parent: any; readonly QueryType: XlQueryType; readonly RecordCount: number; - Recordset: any; + Recordset: ADODB.Recordset; Refresh(): void; readonly RefreshDate: VarDate; readonly RefreshName: string; @@ -6009,10 +6467,10 @@ declare namespace Excel { RefreshPeriod: number; ResetTimer(): void; RobustConnect: XlRobustConnect; - SaveAsODC(ODCFileName: string, Description?: any, Keywords?: any): void; + SaveAsODC(ODCFileName: string, Description?: string, Keywords?: string): void; SavePassword: boolean; SourceConnectionFile: string; - SourceData: any; + SourceData: string | SafeArray | PivotTable; readonly SourceDataFile: string; readonly SourceType: XlPivotTableSourceType; Sql: any; @@ -6022,17 +6480,17 @@ declare namespace Excel { readonly WorkbookConnection: WorkbookConnection; } - class PivotCaches { - private 'Excel.PivotCaches_typekey': PivotCaches; - private constructor(); + interface PivotCaches { _Default(Index: any): PivotCache; Add(SourceType: XlPivotTableSourceType, SourceData?: any): PivotCache; readonly Application: Application; readonly Count: number; - Create(SourceType: XlPivotTableSourceType, SourceData?: any, Version?: any): PivotCache; + Create(SourceType: XlPivotTableSourceType.xlDatabase | XlPivotTableSourceType.xlConsolidation, SourceData: string, Version?: XlPivotTableVersionList): PivotCache; + Create(SourceType: XlPivotTableSourceType.xlExternal, SourceData: WorkbookConnection, Version?: XlPivotTableVersionList): PivotCache; readonly Creator: XlCreator; - Item(Index: any): PivotCache; + Item(Index: number): PivotCache; readonly Parent: any; + (Index: number): PivotCache; } class PivotCell { @@ -6065,7 +6523,7 @@ declare namespace Excel { private constructor(); _AutoSort(Order: number, Field: string): void; _Default: string; - AddPageItem(Item: string, ClearList?: any): void; + AddPageItem(Item: string, ClearList?: boolean): void; readonly AllItemsVisible: boolean; readonly Application: Application; AutoShow(Type: number, Range: number, Count: number, Field: string): void; @@ -6084,15 +6542,15 @@ declare namespace Excel { Calculation: XlPivotFieldCalculation; Caption: string; readonly ChildField: PivotField; - ChildItems(Index?: any): any; + readonly ChildItems: PivotItemsResult; ClearAllFilters(): void; ClearLabelFilters(): void; ClearManualFilter(): void; ClearValueFilters(): void; readonly Creator: XlCreator; readonly CubeField: CubeField; - CurrentPage: any; - CurrentPageList: any; + CurrentPage: PivotItem; + CurrentPageList: SafeArray; CurrentPageName: string; DatabaseSort: boolean; readonly DataRange: Range; @@ -6112,10 +6570,10 @@ declare namespace Excel { EnableMultiplePageItems: boolean; Formula: string; Function: XlConsolidationFunction; - readonly GroupLevel: any; + readonly GroupLevel: number; Hidden: boolean; - HiddenItems(Index?: any): any; - HiddenItemsList: any; + readonly HiddenItems: PivotItemsResult; + HiddenItemsList: SafeArray; IncludeNewItemsInFilter: boolean; readonly IsCalculated: boolean; readonly IsMemberProperty: boolean; @@ -6132,9 +6590,9 @@ declare namespace Excel { Orientation: XlPivotFieldOrientation; readonly Parent: any; readonly ParentField: PivotField; - ParentItems(Index?: any): any; + readonly ParentItems: PivotItemsResult; readonly PivotFilters: PivotFilters; - PivotItems(Index?: any): any; + readonly PivotItems: PivotItemsResult; Position: any; PropertyOrder: number; readonly PropertyParentField: PivotField; @@ -6147,12 +6605,12 @@ declare namespace Excel { readonly SourceName: string; StandardFormula: string; SubtotalName: string; - Subtotals(Index?: any): any; - readonly TotalLevels: any; + readonly Subtotals: SafeArray & ((Index: PivotFieldSubtotal) => boolean); + readonly TotalLevels: number; UseMemberPropertyAsCaption: boolean; Value: string; - VisibleItems(Index?: any): any; - VisibleItemsList: any; + readonly VisibleItems: PivotItemsResult; + VisibleItemsList: SafeArray; } class PivotFields { @@ -6161,10 +6619,12 @@ declare namespace Excel { readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): any; + Item(Index: number | string): PivotField; readonly Parent: PivotTable; } + type PivotFieldsResult = PivotFields & ((Index: number | string) => PivotField) & ((Indexes: SafeArray) => PivotFields); + class PivotFilter { private 'Excel.PivotFilter_typekey': PivotFilter; private constructor(); @@ -6186,16 +6646,15 @@ declare namespace Excel { readonly Value2: any; } - class PivotFilters { - private 'Excel.PivotFilters_typekey': PivotFilters; - private constructor(); + interface PivotFilters { _Default(Index: any): PivotFilter; Add(Type: XlPivotFilterType, DataField?: any, Value1?: any, Value2?: any, Order?: any, Name?: any, Description?: any, MemberPropertyField?: any): PivotFilter; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotFilter; + Item(Index: number): PivotFilter; readonly Parent: any; + (Index: number): PivotFilter; } class PivotFormula { @@ -6212,17 +6671,16 @@ declare namespace Excel { Value: string; } - class PivotFormulas { - private 'Excel.PivotFormulas_typekey': PivotFormulas; - private constructor(); + interface PivotFormulas { _Add(Formula: string): PivotFormula; _Default(Index: any): PivotFormula; Add(Formula: string, UseStandardFormula?: any): PivotFormula; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotFormula; + Item(Index: number | string): PivotFormula; readonly Parent: any; + (Index: number | string): PivotFormula; } class PivotItem { @@ -6231,7 +6689,7 @@ declare namespace Excel { _Default: string; readonly Application: Application; Caption: string; - ChildItems(Index?: any): any; + ChildItems: PivotItemsResult; readonly Creator: XlCreator; readonly DataRange: Range; Delete(): void; @@ -6254,17 +6712,29 @@ declare namespace Excel { Visible: boolean; } - class PivotItemList { - private 'Excel.PivotItemList_typekey': PivotItemList; - private constructor(); + interface PivotItemList { _Default(Field: any): PivotItem; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotItem; + Item(Index: number | string): PivotItem; readonly Parent: any; + (Field: number | string): PivotItem; } + class PivotItems { + private 'Excel.PivotItems_typekey': PivotItems; + private constructor(); + Add(Name: string): void; + readonly Application: Application; + readonly Count: number; + readonly Creator: XlCreator; + Item(Index: number | string): any; + readonly Parent: PivotField; + } + + type PivotItemsResult = PivotItems & ((Index: number | string) => PivotItem) & ((Indexes: SafeArray) => PivotItems); + class PivotLayout { private 'Excel.PivotLayout_typekey': PivotLayout; private constructor(); @@ -6296,26 +6766,24 @@ declare namespace Excel { readonly Position: number; } - class PivotLineCells { - private 'Excel.PivotLineCells_typekey': PivotLineCells; - private constructor(); + interface PivotLineCells { _Default(Index: any): PivotCell; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotCell; + Item(Index: number): PivotCell; readonly Parent: any; + (Index: number): PivotCell; } - class PivotLines { - private 'Excel.PivotLines_typekey': PivotLines; - private constructor(); + interface PivotLines { _Default(Index: any): PivotLine; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotLine; + Item(Index: number): PivotLine; readonly Parent: any; + (Index: number): PivotLine; } class PivotTable { @@ -6323,11 +6791,11 @@ declare namespace Excel { private constructor(); _Default: string; - /** @param Excel.XlPTSelectionMode [Mode=0] */ + /** @param Mode [Mode=0] */ _PivotSelect(Name: string, Mode?: XlPTSelectionMode): void; readonly ActiveFilters: PivotFilters; AddDataField(Field: any, Caption?: any, Function?: any): PivotField; - AddFields(RowFields?: any, ColumnFields?: any, PageFields?: any, AddToTable?: any): any; + AddFields(RowFields?: string | SafeArray, ColumnFields?: string | SafeArray, PageFields?: string | SafeArray, AddToTable?: boolean): any; AllocateChanges(): void; Allocation: XlAllocation; AllocationMethod: XlAllocationMethod; @@ -6342,10 +6810,10 @@ declare namespace Excel { CalculatedMembersInFilters: boolean; ChangeConnection(conn: WorkbookConnection): void; readonly ChangeList: PivotTableChangeList; - ChangePivotCache(PivotCache: any): void; + ChangePivotCache(PivotCache: string): void; ClearAllFilters(): void; ClearTable(): void; - ColumnFields(Index?: any): any; + ColumnFields: PivotFieldsResult; ColumnGrand: boolean; readonly ColumnRange: Range; CommitChanges(): void; @@ -6353,11 +6821,11 @@ declare namespace Excel { CompactLayoutRowHeader: string; CompactRowIndent: number; ConvertToFormulas(ConvertFilters: boolean): void; - CreateCubeFile(File: string, Measures?: any, Levels?: any, Members?: any, Properties?: any): string; + CreateCubeFile(File: string, Measures?: SafeArray, Levels?: SafeArray, Members?: SafeArray>, Properties?: boolean): string; readonly Creator: XlCreator; readonly CubeFields: CubeFields; readonly DataBodyRange: Range; - DataFields(Index?: any): any; + DataFields: PivotFieldsResult; readonly DataLabelRange: Range; readonly DataPivotField: PivotField; DiscardChanges(): void; @@ -6369,10 +6837,7 @@ declare namespace Excel { DisplayImmediateItems: boolean; DisplayMemberPropertyTooltips: boolean; DisplayNullString: boolean; - Dummy15( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + Dummy15(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; EnableDataValueEditing: boolean; EnableDrilldown: boolean; EnableFieldDialog: boolean; @@ -6383,13 +6848,10 @@ declare namespace Excel { FieldListSortAscending: boolean; Format(Format: XlPivotFormatType): void; GetData(Name: string): number; - GetPivotData( - DataField?: any, Field1?: any, Item1?: any, Field2?: any, Item2?: any, Field3?: any, Item3?: any, Field4?: any, Item4?: any, Field5?: any, Item5?: any, - Field6?: any, Item6?: any, Field7?: any, Item7?: any, Field8?: any, Item8?: any, Field9?: any, Item9?: any, Field10?: any, Item10?: any, Field11?: any, - Item11?: any, Field12?: any, Item12?: any, Field13?: any, Item13?: any, Field14?: any, Item14?: any): Range; + GetPivotData(DataField?: string, Field1?: string, Item1?: string, Field2?: string, Item2?: string, Field3?: string, Item3?: string, Field4?: string, Item4?: string, Field5?: string, Item5?: string, Field6?: string, Item6?: string, Field7?: string, Item7?: string, Field8?: string, Item8?: string, Field9?: string, Item9?: string, Field10?: string, Item10?: string, Field11?: string, Item11?: string, Field12?: string, Item12?: string, Field13?: string, Item13?: string, Field14?: string, Item14?: string): Range; GrandTotalName: string; HasAutoFormat: boolean; - HiddenFields(Index?: any): any; + HiddenFields: PivotFieldsResult; InGridDropZones: boolean; InnerDetail: string; LayoutRowDefault: XlLayoutRowType; @@ -6401,7 +6863,7 @@ declare namespace Excel { Name: string; NullString: string; PageFieldOrder: number; - PageFields(Index?: any): any; + PageFields: PivotFieldsResult; PageFieldStyle: string; PageFieldWrapCount: number; readonly PageRange: Range; @@ -6409,17 +6871,16 @@ declare namespace Excel { readonly Parent: any; PivotCache(): PivotCache; readonly PivotColumnAxis: PivotAxis; - PivotFields(Index?: any): any; + PivotFields: PivotFieldsResult; readonly PivotFormulas: PivotFormulas; readonly PivotRowAxis: PivotAxis; - /** @param Excel.XlPTSelectionMode [Mode=0] */ - PivotSelect(Name: string, Mode?: XlPTSelectionMode, UseStandardName?: any): void; + /** @param Mode [Mode=0] */ + PivotSelect(Name: string, Mode?: XlPTSelectionMode, UseStandardName?: boolean): void; PivotSelection: string; PivotSelectionStandard: string; - PivotTableWizard( - SourceType?: any, SourceData?: any, TableDestination?: any, TableName?: any, RowGrand?: any, ColumnGrand?: any, SaveData?: any, HasAutoFormat?: any, - AutoPage?: any, Reserved?: any, BackgroundQuery?: any, OptimizeCache?: any, PageFieldOrder?: any, PageFieldWrapCount?: any, ReadData?: any, Connection?: any): void; + PivotTableWizard(): void; + PivotTableWizard(SourceType: TSourceType, SourceData: PivotTableWizardSourceData, TableDestination?: Range, TableName?: string, RowGrand?: boolean, ColumnGrand?: boolean, SaveData?: boolean, HasAutoFormat?: boolean, AutoPage?: PivotTableWizardAutoPage, Reserved?: undefined, BackgroundQuery?: boolean, OptimizeCache?: boolean, PageFieldOrder?: XlOrder, PageFieldWrapCount?: number, ReadData?: boolean, Connection?: string): void; PreserveFormatting: boolean; PrintDrillIndicators: boolean; PrintTitles: boolean; @@ -6430,7 +6891,7 @@ declare namespace Excel { RepeatAllLabels(Repeat: XlPivotFieldRepeatLabels): void; RepeatItemsOnEachPrintedPage: boolean; RowAxisLayout(RowLayout: XlLayoutRowType): void; - RowFields(Index?: any): any; + RowFields: PivotFieldsResult; RowGrand: boolean; readonly RowRange: Range; SaveData: boolean; @@ -6438,7 +6899,7 @@ declare namespace Excel { ShowCellBackgroundFromOLAP: boolean; ShowDrillIndicators: boolean; ShowPageMultipleItemLabel: boolean; - ShowPages(PageField?: any): any; + ShowPages(PageField?: string): any; ShowTableStyleColumnHeaders: boolean; ShowTableStyleColumnStripes: boolean; ShowTableStyleLastColumn: boolean; @@ -6463,21 +6924,20 @@ declare namespace Excel { Value: string; readonly Version: XlPivotTableVersionList; ViewCalculatedMembers: boolean; - VisibleFields(Index?: any): any; + VisibleFields: PivotFieldsResult; VisualTotals: boolean; VisualTotalsForSets: boolean; } - class PivotTableChangeList { - private 'Excel.PivotTableChangeList_typekey': PivotTableChangeList; - private constructor(); + interface PivotTableChangeList { _Default(Index: any): ValueChange; Add(Tuple: string, Value: number, AllocationValue?: any, AllocationMethod?: any, AllocationWeightExpression?: any): ValueChange; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): ValueChange; + Item(Index: number | string): ValueChange; readonly Parent: any; + (Index: number | string): ValueChange; } class PlotArea { @@ -6508,6 +6968,66 @@ declare namespace Excel { Width: number; } + class Point { + private 'Excel.Point_typekey': Point; + private constructor(); + + /** @param Type [Type=2] */ + _ApplyDataLabels(Type?: XlDataLabelsType, LegendKey?: any, AutoText?: any, HasLeaderLines?: any): any; + readonly Application: Application; + + /** @param Type [Type=2] */ + ApplyDataLabels(Type?: XlDataLabelsType, LegendKey?: boolean, AutoText?: boolean, HasLeaderLines?: boolean, ShowSeriesName?: boolean, ShowCategoryName?: boolean, ShowValue?: boolean, ShowPercentage?: boolean, ShowBubbleSize?: boolean, Separator?: string): any; + ApplyPictToEnd: boolean; + ApplyPictToFront: boolean; + ApplyPictToSides: boolean; + readonly Border: Border; + ClearFormats(): any; + Copy(): any; + readonly Creator: XlCreator; + readonly DataLabel: DataLabel; + Delete(): any; + Explosion: number; + readonly Fill: ChartFillFormat; + readonly Format: ChartFormat; + Has3DEffect: boolean; + HasDataLabel: boolean; + readonly Height: number; + readonly Interior: Interior; + InvertIfNegative: boolean; + readonly Left: number; + MarkerBackgroundColor: number; + MarkerBackgroundColorIndex: XlColorIndex; + MarkerForegroundColor: number; + MarkerForegroundColorIndex: XlColorIndex; + MarkerSize: number; + MarkerStyle: XlMarkerStyle; + readonly Name: string; + readonly Parent: any; + Paste(): any; + PictureType: XlChartPictureType; + PictureUnit: number; + PictureUnit2: number; + + /** @param Index [Index=2] */ + PieSliceLocation(loc: XlPieSliceLocation, Index?: XlPieSliceIndex): number; + SecondaryPlot: boolean; + Select(): any; + Shadow: boolean; + readonly Top: number; + readonly Width: number; + } + + interface Points { + _Default(Index: number): Point; + readonly Application: Application; + readonly Count: number; + readonly Creator: XlCreator; + Item(Index: number): Point; + readonly Parent: any; + (Index: number): Point; + } + class ProtectedViewWindow { private 'Excel.ProtectedViewWindow_typekey': ProtectedViewWindow; private constructor(); @@ -6515,7 +7035,7 @@ declare namespace Excel { Activate(): void; Caption: string; Close(): boolean; - Edit(WriteResPassword?: any, UpdateLinks?: any): Workbook; + Edit(WriteResPassword?: string, UpdateLinks?: 0 | 1): Workbook; EnableResize: boolean; Height: number; Left: number; @@ -6528,16 +7048,15 @@ declare namespace Excel { readonly Workbook: Workbook; } - class ProtectedViewWindows { - private 'Excel.ProtectedViewWindows_typekey': ProtectedViewWindows; - private constructor(); + interface ProtectedViewWindows { _Default(Index: any): ProtectedViewWindow; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): ProtectedViewWindow; - Open(Filename: string, Password?: any, AddToMru?: any, RepairMode?: any): ProtectedViewWindow; + Item(Index: number | string): ProtectedViewWindow; + Open(Filename: string, Password?: string, AddToMru?: boolean, RepairMode?: boolean): ProtectedViewWindow; readonly Parent: any; + (Index: number | string): ProtectedViewWindow; } class Protection { @@ -6568,25 +7087,24 @@ declare namespace Excel { Filename: string; HtmlType: XlHtmlType; readonly Parent: any; - Publish(Create?: any): void; + Publish(Create?: boolean): void; readonly Sheet: string; readonly Source: string; readonly SourceType: XlSourceType; Title: string; } - class PublishObjects { - private 'Excel.PublishObjects_typekey': PublishObjects; - private constructor(); + interface PublishObjects { _Default(Index: any): PublishObject; - Add(SourceType: XlSourceType, Filename: string, Sheet?: any, Source?: any, HtmlType?: any, DivID?: any, Title?: any): PublishObject; + Add(SourceType: XlSourceType, Filename: string, Sheet?: string, Source?: XlSourceType.xlSourceAutoFilter | XlSourceType.xlSourceChart | XlSourceType.xlSourcePivotTable | XlSourceType.xlSourcePrintArea | XlSourceType.xlSourceQuery | XlSourceType.xlSourceRange, HtmlType?: XlHtmlType, DivID?: string, Title?: string): PublishObject; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Delete(): void; - Item(Index: any): PublishObject; + Item(Index: number | string): PublishObject; readonly Parent: any; Publish(): void; + (Index: number | string): PublishObject; } class QueryTable { @@ -6596,13 +7114,13 @@ declare namespace Excel { readonly Application: Application; BackgroundQuery: boolean; CancelRefresh(): void; - CommandText: any; + CommandText: string; CommandType: XlCmdType; - Connection: any; + Connection: string; readonly Creator: XlCreator; Delete(): void; readonly Destination: Range; - EditWebPage: any; + EditWebPage: string; EnableEditing: boolean; EnableRefresh: boolean; readonly FetchedRowOverflow: boolean; @@ -6618,8 +7136,8 @@ declare namespace Excel { PreserveColumnInfo: boolean; PreserveFormatting: boolean; readonly QueryType: XlQueryType; - Recordset: any; - Refresh(BackgroundQuery?: any): boolean; + Recordset: DAO.Recordset | ADODB.Recordset; + Refresh(BackgroundQuery?: boolean): boolean; readonly Refreshing: boolean; RefreshOnFileOpen: boolean; RefreshPeriod: number; @@ -6628,7 +7146,7 @@ declare namespace Excel { readonly ResultRange: Range; RobustConnect: XlRobustConnect; RowNumbers: boolean; - SaveAsODC(ODCFileName: string, Description?: any, Keywords?: any): void; + SaveAsODC(ODCFileName: string, Description?: string, Keywords?: string): void; SaveData: boolean; SavePassword: boolean; readonly Sort: Sort; @@ -6636,11 +7154,11 @@ declare namespace Excel { SourceDataFile: string; Sql: any; TablesOnlyFromHTML: boolean; - TextFileColumnDataTypes: any; + TextFileColumnDataTypes: SafeArray; TextFileCommaDelimiter: boolean; TextFileConsecutiveDelimiter: boolean; TextFileDecimalSeparator: string; - TextFileFixedColumnWidths: any; + TextFileFixedColumnWidths: SafeArray; TextFileOtherDelimiter: string; TextFileParseType: XlTextParsingType; TextFilePlatform: number; @@ -6664,79 +7182,77 @@ declare namespace Excel { readonly WorkbookConnection: WorkbookConnection; } - class QueryTables { - private 'Excel.QueryTables_typekey': QueryTables; - private constructor(); + interface QueryTables { _Default(Index: any): QueryTable; - Add(Connection: any, Destination: Range, Sql?: any): QueryTable; + Add(Connection: QueryTable | DAO.Recordset | ADODB.Recordset, Destination: Range): QueryTable; + Add(Connection: string, Destination: Range, Sql?: string): QueryTable; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): QueryTable; + Item(Index: number | string): QueryTable; readonly Parent: any; + (Index: number | string): QueryTable; } - class Range { - private 'Excel.Range_typekey': Range; - private constructor(); + interface Range { __PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any): any; /** - * @param Excel.XlBorderWeight [Weight=2] - * @param Excel.XlColorIndex [ColorIndex=-4105] + * @param Weight [Weight=2] + * @param ColorIndex [ColorIndex=-4105] */ _BorderAround(LineStyle: any, Weight?: XlBorderWeight, ColorIndex?: XlColorIndex, Color?: any): any; _Default(RowIndex?: any, ColumnIndex?: any): any; /** - * @param Excel.XlPasteType [Paste=-4104] - * @param Excel.XlPasteSpecialOperation [Operation=-4142] + * @param Paste [Paste=-4104] + * @param Operation [Operation=-4142] */ _PasteSpecial(Paste?: XlPasteType, Operation?: XlPasteSpecialOperation, SkipBlanks?: any, Transpose?: any): any; _PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): any; Activate(): any; - AddComment(Text?: any): Comment; - AddIndent: any; + AddComment(Text?: string): Comment; + AddIndent: boolean; - /** @param Excel.XlReferenceStyle [ReferenceStyle=1] */ + /** @param ReferenceStyle [ReferenceStyle=1] */ Address(RowAbsolute?: boolean, ColumnAbsolute?: boolean, ReferenceStyle?: XlReferenceStyle, External?: boolean, RelativeTo?: Range): string; - /** @param Excel.XlReferenceStyle [ReferenceStyle=1] */ - AddressLocal(RowAbsolute: any, ColumnAbsolute: any, ReferenceStyle?: XlReferenceStyle, External?: any, RelativeTo?: any): string; + /** @param ReferenceStyle [ReferenceStyle=1] */ + AddressLocal(RowAbsolute?: boolean, ColumnAbsolute?: boolean, ReferenceStyle?: XlReferenceStyle, External?: boolean, RelativeTo?: Range): string; AdvancedFilter(Action: XlFilterAction.xlFilterCopy, CriteriaRange?: Range, CopyToRange?: Range, Unique?: boolean): any; AdvancedFilter(Action: XlFilterAction, CriteriaRange?: Range, CopyToRange?: undefined, Unique?: boolean): any; AllocateChanges(): void; readonly AllowEdit: boolean; readonly Application: Application; - /** @param Excel.XlApplyNamesOrder [Order=1] */ - ApplyNames(Names: any, IgnoreRelativeAbsolute: any, UseRowColumnNames: any, OmitColumn: any, OmitRow: any, Order?: XlApplyNamesOrder, AppendLast?: any): any; + /** @param Order [Order=1] */ + ApplyNames(Names?: SafeArray, IgnoreRelativeAbsolute?: boolean, UseRowColumnNames?: boolean, OmitColumn?: boolean, OmitRow?: boolean, Order?: XlApplyNamesOrder, AppendLast?: boolean): any; ApplyOutlineStyles(): any; readonly Areas: Areas; AutoComplete(String: string): string; - /** @param Excel.XlAutoFillType [Type=0] */ + /** @param Type [Type=0] */ AutoFill(Destination: Range, Type?: XlAutoFillType): any; - /** @param Excel.XlAutoFilterOperator [Operator=1] */ - AutoFilter(Field: any, Criteria1: any, Operator?: XlAutoFilterOperator, Criteria2?: any, VisibleDropDown?: any): any; + /** @param Operator [Operator=1] */ + AutoFilter(Field: number, Criteria1: string, Operator?: XlAutoFilterOperator, Criteria2?: string, VisibleDropDown?: boolean): any; AutoFit(): any; - /** @param Excel.XlRangeAutoFormat [Format=1] */ + /** @param Format [Format=1] */ AutoFormat(Format?: XlRangeAutoFormat, Number?: any, Font?: any, Alignment?: any, Border?: any, Pattern?: any, Width?: any): any; AutoOutline(): any; /** - * @param Excel.XlBorderWeight [Weight=2] - * @param Excel.XlColorIndex [ColorIndex=-4105] + * @param Weight [Weight=2] + * @param ColorIndex [ColorIndex=-4105] */ - BorderAround(LineStyle: any, Weight?: XlBorderWeight, ColorIndex?: XlColorIndex, Color?: any, ThemeColor?: any): any; + BorderAround(LineStyle?: XlLineStyle, Weight?: XlBorderWeight, ColorIndex?: XlColorIndex, Color?: number, ThemeColor?: number | XlThemeColor): any; readonly Borders: Borders; Calculate(): any; CalculateRowMajorOrder(): any; readonly Cells: Range; - Characters(Start?: any, Length?: any): Characters; - CheckSpelling(CustomDictionary?: any, IgnoreUppercase?: any, AlwaysSuggest?: any, SpellLang?: any): any; + Characters(Start?: number, Length?: number): Characters; + CheckSpelling(CustomDictionary?: string, IgnoreUppercase?: boolean, AlwaysSuggest?: boolean, SpellLang?: Office.MsoLanguageID): any; Clear(): any; ClearComments(): void; ClearContents(): any; @@ -6745,38 +7261,39 @@ declare namespace Excel { ClearNotes(): any; ClearOutline(): any; readonly Column: number; - ColumnDifferences(Comparison: any): Range; + ColumnDifferences(Comparison: Range): Range; readonly Columns: Range; - ColumnWidth: any; + ColumnWidth: number | null; readonly Comment: Comment; - Consolidate(Sources?: any, Function?: any, TopRow?: any, LeftColumn?: any, CreateLinks?: any): any; - Copy(Destination?: any): any; - CopyFromRecordset(Data: any, MaxRows?: any, MaxColumns?: any): number; + Consolidate(Sources?: SafeArray, Function?: XlConsolidationFunction, TopRow?: boolean, LeftColumn?: boolean, CreateLinks?: boolean): any; + Copy(Destination?: Range): any; + CopyFromRecordset(Data: DAO.Recordset | ADODB.Recordset, MaxRows?: number, MaxColumns?: number): number; /** - * @param Excel.XlPictureAppearance [Appearance=1] - * @param Excel.XlCopyPictureFormat [Format=-4147] + * @param Appearance [Appearance=1] + * @param Format [Format=-4147] */ CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): any; readonly Count: number; - readonly CountLarge: any; - CreateNames(Top?: any, Left?: any, Bottom?: any, Right?: any): any; + readonly CountLarge: number; + CreateNames(Top?: boolean, Left?: boolean, Bottom?: boolean, Right?: boolean): any; - /** @param Excel.XlPictureAppearance [Appearance=1] */ + /** @param Appearance [Appearance=1] */ CreatePublisher(Edition: any, Appearance?: XlPictureAppearance, ContainsPICT?: any, ContainsBIFF?: any, ContainsRTF?: any, ContainsVALU?: any): any; readonly Creator: XlCreator; readonly CurrentArray: Range; readonly CurrentRegion: Range; - Cut(Destination?: any): any; + Cut(Destination?: Range): any; /** - * @param Excel.XlDataSeriesType [Type=-4132] - * @param Excel.XlDataSeriesDate [Date=1] + * @param Type [Type=-4132] + * @param Date [Date=1] + * @param Step [Step=1] */ - DataSeries(Rowcol: any, Type?: XlDataSeriesType, Date?: XlDataSeriesDate, Step?: any, Stop?: any, Trend?: any): any; - Delete(Shift?: any): any; + DataSeries(Rowcol: XlRowCol, Type?: XlDataSeriesType, Date?: XlDataSeriesDate, Step?: number, Stop?: number, Trend?: boolean): any; + Delete(Shift?: XlDeleteShiftDirection): any; readonly Dependents: Range; - DialogBox(): any; + DialogBox(): number | false; readonly DirectDependents: Range; readonly DirectPrecedents: Range; Dirty(): void; @@ -6784,81 +7301,78 @@ declare namespace Excel { readonly DisplayFormat: DisplayFormat; /** - * @param Excel.XlPictureAppearance [Appearance=1] - * @param Excel.XlPictureAppearance [ChartSize=1] + * @param Appearance [Appearance=1] + * @param ChartSize [ChartSize=1] */ EditionOptions(Type: XlEditionType, Option: XlEditionOptionsOption, Name: any, Reference: any, Appearance?: XlPictureAppearance, ChartSize?: XlPictureAppearance, Format?: any): any; End(Direction: XlDirection): Range; readonly EntireColumn: Range; readonly EntireRow: Range; readonly Errors: Errors; - ExportAsFixedFormat( - Type: XlFixedFormatType, Filename?: any, Quality?: any, IncludeDocProperties?: any, IgnorePrintAreas?: any, From?: any, To?: any, OpenAfterPublish?: any, - FixedFormatExtClassPtr?: any): void; + ExportAsFixedFormat(Type: XlFixedFormatType, Filename?: string, Quality?: XlFixedFormatQuality, IncludeDocProperties?: boolean, IgnorePrintAreas?: boolean, From?: number, To?: number, OpenAfterPublish?: boolean, FixedFormatExtClassPtr?: any): void; FillDown(): any; FillLeft(): any; FillRight(): any; FillUp(): any; - /** @param Excel.XlSearchDirection [SearchDirection=1] */ - Find(What: any, After?: any, LookIn?: XlFindLookIn, LookAt?: XlLookAt, SearchOrder?: XlSearchOrder, SearchDirection?: XlSearchDirection, MatchCase?: boolean, - MatchByte?: boolean, SearchFormat?: any): Range; + /** @param SearchDirection [SearchDirection=1] */ + Find(What: any, After?: any, LookIn?: XlFindLookIn, LookAt?: XlLookAt, SearchOrder?: XlSearchOrder, SearchDirection?: XlSearchDirection, MatchCase?: boolean, MatchByte?: boolean, SearchFormat?: any): Range; FindNext(After?: any): Range; FindPrevious(After?: any): Range; readonly Font: Font; readonly FormatConditions: FormatConditions; - Formula: any; - FormulaArray: any; - FormulaHidden: any; + Formula: string | SafeArray; + FormulaArray: string | SafeArray | null; + FormulaHidden: boolean | null; FormulaLabel: XlFormulaLabel; - FormulaLocal: any; - FormulaR1C1: any; - FormulaR1C1Local: any; + FormulaLocal: string | SafeArray; + FormulaR1C1: string | SafeArray; + FormulaR1C1Local: string | SafeArray; FunctionWizard(): any; GoalSeek(Goal: any, ChangingCell: Range): boolean; - Group(Start?: any, End?: any, By?: any, Periods?: any): any; - readonly HasArray: any; - readonly HasFormula: any; - readonly Height: any; - Hidden: any; - HorizontalAlignment: any; + Group(Start?: any, End?: any, By?: number, Periods?: SafeArray): any; + readonly HasArray: boolean; + readonly HasFormula: boolean | null; + Height: number; + Hidden: boolean; + HorizontalAlignment: HorizontalAlignments; readonly Hyperlinks: Hyperlinks; ID: string; - IndentLevel: any; - Insert(Shift?: any, CopyOrigin?: any): any; + IndentLevel: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15; + Insert(Shift?: XlInsertShiftDirection, CopyOrigin?: any): any; InsertIndent(InsertAmount: number): void; readonly Interior: Interior; Item(RowIndex: number, ColumnIndex?: number): Range; Item(Address: string): Range; Justify(): any; - readonly Left: any; + readonly Left: number; readonly ListHeaderRows: number; ListNames(): any; readonly ListObject: ListObject; readonly LocationInTable: XlLocationInTable; - Locked: any; + Locked: boolean | null; readonly MDX: string; - Merge(Across?: any): void; + Merge(Across?: boolean): void; readonly MergeArea: Range; - MergeCells: any; - Name: any; - NavigateArrow(TowardPrecedent?: any, ArrowNumber?: any, LinkNumber?: any): any; + MergeCells: boolean; + Name: string | Name; + NavigateArrow(TowardPrecedent?: boolean, ArrowNumber?: number, LinkNumber?: number): any; readonly Next: Range; - NoteText(Text?: any, Start?: any, Length?: any): string; - NumberFormat: any; - NumberFormatLocal: any; + NoteText(Text?: string, Start?: number, Length?: number): string; + NumberFormat: string | null; + NumberFormatLocal: string | null; Offset(RowOffset?: number, ColumnOffset?: number): Range; - Orientation: any; - OutlineLevel: any; + Orientation: number | XlOrientation; + OutlineLevel: number; PageBreak: number; readonly Parent: any; - Parse(ParseLine?: any, Destination?: any): any; + Parse(ParseLine?: string, Destination?: Range): any; /** - * @param Excel.XlPasteType [Paste=-4104] - * @param Excel.XlPasteSpecialOperation [Operation=-4142] + * @param Paste [Paste=-4104] + * @param Operation [Operation=-4142] */ - PasteSpecial(Paste?: XlPasteType, Operation?: XlPasteSpecialOperation, SkipBlanks?: any, Transpose?: any): any; + PasteSpecial(Paste?: XlPasteType, Operation?: XlPasteSpecialOperation, SkipBlanks?: boolean, Transpose?: boolean): any; readonly Phonetic: Phonetic; readonly Phonetics: Phonetics; readonly PivotCell: PivotCell; @@ -6866,114 +7380,108 @@ declare namespace Excel { readonly PivotItem: PivotItem; readonly PivotTable: PivotTable; readonly Precedents: Range; - readonly PrefixCharacter: any; + readonly PrefixCharacter: "'" | '"' | '^' | '\\' | ''; readonly Previous: Range; - PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): any; - PrintPreview(EnableChanges?: any): any; + PrintOut(From?: number, To?: number, Copies?: number, Preview?: boolean, ActivePrinter?: string, PrintToFile?: T, Collate?: boolean, PrToFileName?: PrintToFileName): any; + PrintPreview(EnableChanges?: boolean): any; readonly QueryTable: QueryTable; - Range(Cell1: any, Cell2?: any): Range; + Range(Cell1: string | Range, Cell2?: string | Range): Range; ReadingOrder: number; - /** @param Excel.XlYesNoGuess [Header=2] */ - RemoveDuplicates(Columns: any, Header?: XlYesNoGuess): void; + /** @param Header [Header=2] */ + RemoveDuplicates(Columns: SafeArray, Header?: XlYesNoGuess): void; RemoveSubtotal(): any; - Replace(What: any, Replacement: any, LookAt?: any, SearchOrder?: any, MatchCase?: any, MatchByte?: any, SearchFormat?: any, ReplaceFormat?: any): boolean; - Resize(RowSize?: any, ColumnSize?: any): Range; + Replace(What: string, Replacement: string, LookAt?: XlLookAt, SearchOrder?: XlSearchOrder, MatchCase?: boolean, MatchByte?: boolean, SearchFormat?: boolean, ReplaceFormat?: boolean): boolean; + Resize(RowSize?: number, ColumnSize?: number): Range; readonly Row: number; - RowDifferences(Comparison: any): Range; - RowHeight: any; + RowDifferences(Comparison: Range): Range; + RowHeight: number | null; readonly Rows: Range; - Run( - Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + Run(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; Select(): any; readonly ServerActions: Actions; SetPhonetic(): void; Show(): any; - ShowDependents(Remove?: any): any; + ShowDependents(Remove?: boolean): any; ShowDetail: any; ShowErrors(): any; - ShowPrecedents(Remove?: any): any; - ShrinkToFit: any; + ShowPrecedents(Remove?: boolean): any; + ShrinkToFit: boolean | null; readonly SmartTags: SmartTags; /** - * @param Excel.XlSortOrder [Order1=1] - * @param Excel.XlSortOrder [Order2=1] - * @param Excel.XlSortOrder [Order3=1] - * @param Excel.XlYesNoGuess [Header=2] - * @param Excel.XlSortOrientation [Orientation=2] - * @param Excel.XlSortMethod [SortMethod=1] - * @param Excel.XlSortDataOption [DataOption1=0] - * @param Excel.XlSortDataOption [DataOption2=0] - * @param Excel.XlSortDataOption [DataOption3=0] + * @param Order1 [Order1=1] + * @param Order2 [Order2=1] + * @param Order3 [Order3=1] + * @param Header [Header=2] + * @param Orientation [Orientation=2] + * @param SortMethod [SortMethod=1] + * @param DataOption1 [DataOption1=0] + * @param DataOption2 [DataOption2=0] + * @param DataOption3 [DataOption3=0] */ - Sort( - Key1: any, Order1?: XlSortOrder, Key2?: any, Type?: any, Order2?: XlSortOrder, Key3?: any, Order3?: XlSortOrder, Header?: XlYesNoGuess, OrderCustom?: any, - MatchCase?: any, Orientation?: XlSortOrientation, SortMethod?: XlSortMethod, DataOption1?: XlSortDataOption, DataOption2?: XlSortDataOption, DataOption3?: XlSortDataOption): any; + Sort(Key1: string | Range, Order1?: XlSortOrder, Key2?: any, Type?: any, Order2?: XlSortOrder, Key3?: any, Order3?: XlSortOrder, Header?: XlYesNoGuess, OrderCustom?: number, MatchCase?: boolean, Orientation?: XlSortOrientation, SortMethod?: XlSortMethod, DataOption1?: XlSortDataOption, DataOption2?: XlSortDataOption, DataOption3?: XlSortDataOption): any; /** - * @param Excel.XlSortMethod [SortMethod=1] - * @param Excel.XlSortOrder [Order1=1] - * @param Excel.XlSortOrder [Order2=1] - * @param Excel.XlSortOrder [Order3=1] - * @param Excel.XlYesNoGuess [Header=2] - * @param Excel.XlSortOrientation [Orientation=2] - * @param Excel.XlSortDataOption [DataOption1=0] - * @param Excel.XlSortDataOption [DataOption2=0] - * @param Excel.XlSortDataOption [DataOption3=0] + * @param SortMethod [SortMethod=1] + * @param Order1 [Order1=1] + * @param Order2 [Order2=1] + * @param Order3 [Order3=1] + * @param Header [Header=2] + * @param Orientation [Orientation=2] + * @param DataOption1 [DataOption1=0] + * @param DataOption2 [DataOption2=0] + * @param DataOption3 [DataOption3=0] */ - SortSpecial( - SortMethod?: XlSortMethod, Key1?: any, Order1?: XlSortOrder, Type?: any, Key2?: any, Order2?: XlSortOrder, Key3?: any, Order3?: XlSortOrder, - Header?: XlYesNoGuess, OrderCustom?: any, MatchCase?: any, Orientation?: XlSortOrientation, DataOption1?: XlSortDataOption, DataOption2?: XlSortDataOption, - DataOption3?: XlSortDataOption): any; + SortSpecial(SortMethod?: XlSortMethod, Key1?: string | Range, Order1?: XlSortOrder, Type?: any, Key2?: string | Range, Order2?: XlSortOrder, Key3?: string | Range, Order3?: XlSortOrder, Header?: XlYesNoGuess, OrderCustom?: number, MatchCase?: boolean, Orientation?: XlSortOrientation, DataOption1?: XlSortDataOption, DataOption2?: XlSortDataOption, DataOption3?: XlSortDataOption): any; readonly SoundNote: SoundNote; readonly SparklineGroups: SparklineGroups; - Speak(SpeakDirection?: any, SpeakFormulas?: any): void; - SpecialCells(Type: XlCellType, Value?: any): Range; - Style: any; + Speak(SpeakDirection?: XlSpeakDirection, SpeakFormulas?: boolean): void; + SpecialCells(Type: XlCellType.xlCellTypeConstants | XlCellType.xlCellTypeFormulas, Value?: XlSpecialCellsValue): Range; + SpecialCells(Type: XlCellType): Range; + Style: Style; - /** @param Excel.XlSubscribeToFormat [Format=-4158] */ + /** @param Format [Format=-4158] */ SubscribeTo(Edition: string, Format?: XlSubscribeToFormat): any; - /** @param Excel.XlSummaryRow [SummaryBelowData=1] */ - Subtotal(GroupBy: number, Function: XlConsolidationFunction, TotalList: any, Replace: any, PageBreaks: any, SummaryBelowData?: XlSummaryRow): any; - readonly Summary: any; - Table(RowInput?: any, ColumnInput?: any): any; - readonly Text: any; + /** @param SummaryBelowData [SummaryBelowData=1] */ + Subtotal(GroupBy: number, Function: XlConsolidationFunction, TotalList: SafeArray, Replace: boolean, PageBreaks: boolean, SummaryBelowData?: XlSummaryRow): any; + readonly Summary: boolean; + Table(RowInput?: Range, ColumnInput?: Range): any; + readonly Text: string; /** - * @param Excel.XlTextParsingType [DataType=1] - * @param Excel.XlTextQualifier [TextQualifier=1] + * @param DataType [DataType=1] + * @param TextQualifier [TextQualifier=1] */ - TextToColumns( - Destination: any, DataType?: XlTextParsingType, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: any, Tab?: any, Semicolon?: any, Comma?: any, - Space?: any, Other?: any, OtherChar?: any, FieldInfo?: any, DecimalSeparator?: any, ThousandsSeparator?: any, TrailingMinusNumbers?: any): any; - readonly Top: any; + TextToColumns(Destination: Range, DataType?: XlTextParsingType, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: boolean, Tab?: boolean, Semicolon?: boolean, Comma?: boolean, Space?: boolean, Other?: boolean, OtherChar?: string, FieldInfo?: SafeArray, DecimalSeparator?: string, ThousandsSeparator?: string, TrailingMinusNumbers?: any): any; + readonly Top: number; Ungroup(): any; UnMerge(): void; - UseStandardHeight: any; - UseStandardWidth: any; + UseStandardHeight: boolean | null; + UseStandardWidth: boolean | null; readonly Validation: Validation; - Value(RangeValueDataType?: XlRangeValueDataType): any; + + // tslint:disable-next-line: ban-types + Value: Exclude & ((RangeValueDataType?: XlRangeValueDataType) => any); Value2: any; - VerticalAlignment: any; - readonly Width: any; + VerticalAlignment: VerticalAlignments; + readonly Width: number; readonly Worksheet: Worksheet; - WrapText: any; + WrapText: boolean | null; readonly XPath: XPath; + (RowIndex: number, ColumnIndex?: number): Range; + (Address: string): Range; } - class Ranges { - private 'Excel.Ranges_typekey': Ranges; - private constructor(); + interface Ranges { _Default(Index: any): Range; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: any): Range; readonly Parent: any; + (Index: any): Range; } class RecentFile { @@ -6989,9 +7497,7 @@ declare namespace Excel { readonly Path: string; } - class RecentFiles { - private 'Excel.RecentFiles_typekey': RecentFiles; - private constructor(); + interface RecentFiles { _Default(Index: number): RecentFile; Add(Name: string): RecentFile; readonly Application: Application; @@ -7000,6 +7506,7 @@ declare namespace Excel { Item(Index: number): RecentFile; Maximum: number; readonly Parent: any; + (Index: number): RecentFile; } class Research { @@ -7009,7 +7516,7 @@ declare namespace Excel { readonly Creator: XlCreator; IsResearchService(ServiceID: string): boolean; readonly Parent: any; - Query(ServiceID: string, QueryString?: any, QueryLanguage?: any, UseSelection?: any, LaunchQuery?: any): any; + Query(ServiceID: string, QueryString?: string, QueryLanguage?: any, UseSelection?: boolean, LaunchQuery?: boolean): any; SetLanguagePair(LanguageFrom: number, LanguageTo: number): any; } @@ -7037,6 +7544,123 @@ declare namespace Excel { ThrottleInterval: number; } + class Scenario { + private 'Excel.Scenario_typekey': Scenario; + private constructor(); + readonly Application: Application; + ChangeScenario(ChangingCells: Range, Values?: SafeArray): any; + readonly ChangingCells: Range; + Comment: string; + readonly Creator: XlCreator; + Delete(): any; + Hidden: boolean; + readonly Index: number; + Locked: boolean; + Name: string; + readonly Parent: any; + Show(): any; + Values(): SafeArray; + Values(Index: number): any; + } + + interface Scenarios { + Add(Name: string, ChangingCells: Range, Values?: SafeArray, Comment?: string, Locked?: boolean, Hidden?: boolean): Scenario; + readonly Application: Application; + readonly Count: number; + + /** @param ReportType [ReportType=1] */ + CreateSummary(ReportType?: XlSummaryReportType, ResultCells?: Range): any; + readonly Creator: XlCreator; + Item(Index: number | string): Scenario; + Merge(Source: string | Worksheet): any; + readonly Parent: any; + (Index: number | string): Scenario; + } + + class Series { + private 'Excel.Series_typekey': Series; + private constructor(); + + /** @param Type [Type=2] */ + _ApplyDataLabels(Type?: XlDataLabelsType, LegendKey?: any, AutoText?: any, HasLeaderLines?: any): any; + readonly Application: Application; + ApplyCustomType(ChartType: XlChartType): void; + + /** @param Type [Type=2] */ + ApplyDataLabels(Type?: XlDataLabelsType, LegendKey?: boolean, AutoText?: boolean, HasLeaderLines?: boolean, ShowSeriesName?: boolean, ShowCategoryName?: boolean, ShowValue?: boolean, ShowPercentage?: boolean, ShowBubbleSize?: boolean, Separator?: string): any; + ApplyPictToEnd: boolean; + ApplyPictToFront: boolean; + ApplyPictToSides: boolean; + AxisGroup: XlAxisGroup; + BarShape: XlBarShape; + readonly Border: Border; + BubbleSizes: string; + ChartType: XlChartType; + ClearFormats(): any; + Copy(): any; + readonly Creator: XlCreator; + DataLabels: DataLabels & ((Index: number) => DataLabel); + Delete(): any; + ErrorBar(Direction: XlErrorBarDirection, Include: XlErrorBarInclude, Type: XlErrorBarType, Amount?: any, MinusValues?: any): any; + readonly ErrorBars: ErrorBars; + Explosion: number; + readonly Fill: ChartFillFormat; + readonly Format: ChartFormat; + Formula: string; + FormulaLocal: string; + FormulaR1C1: string; + FormulaR1C1Local: string; + Has3DEffect: boolean; + HasDataLabels: boolean; + HasErrorBars: boolean; + HasLeaderLines: boolean; + readonly Interior: Interior; + InvertColor: number; + InvertColorIndex: number; + InvertIfNegative: boolean; + readonly LeaderLines: LeaderLines; + MarkerBackgroundColor: number; + MarkerBackgroundColorIndex: XlColorIndex; + MarkerForegroundColor: number; + MarkerForegroundColorIndex: XlColorIndex; + MarkerSize: number; + MarkerStyle: XlMarkerStyle; + Name: string; + readonly Parent: any; + Paste(): any; + PictureType: XlChartPictureType; + PictureUnit: number; + PictureUnit2: number; + readonly PlotColorIndex: number; + PlotOrder: number; + Points: Points & ((Index: number) => Point); + Select(): any; + Shadow: boolean; + Smooth: boolean; + Trendlines: Trendlines & ((Index: number | string) => Trendline); + Type: number; + Values: Range | SafeArray; + XValues: Range | SafeArray; + } + + interface SeriesCollection { + _Default(Index: any): Series; + + /** @param Rowcol [Rowcol=-4105] */ + Add(Source: Range, Rowcol?: XlRowCol, SeriesLabels?: boolean, CategoryLabels?: boolean, Replace?: boolean): Series; + readonly Application: Application; + readonly Count: number; + readonly Creator: XlCreator; + Extend(Source: Range, Rowcol?: XlRowCol, CategoryLabels?: boolean): any; + Item(Index: number | string): Series; + NewSeries(): Series; + readonly Parent: any; + + /** @param Rowcol [Rowcol=-4105] */ + Paste(Rowcol?: XlRowCol, SeriesLabels?: boolean, CategoryLabels?: boolean, Replace?: boolean, NewSeries?: boolean): any; + (Index: number | string): Series; + } + class SeriesLines { private 'Excel.SeriesLines_typekey': SeriesLines; private constructor(); @@ -7050,18 +7674,17 @@ declare namespace Excel { Select(): any; } - class ServerViewableItems { - private 'Excel.ServerViewableItems_typekey': ServerViewableItems; - private constructor(); + interface ServerViewableItems { _Default(Index: any): any; Add(Obj: any): any; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Delete(Index: any): void; + Delete(Index: number): void; DeleteAll(): void; - Item(Index: any): any; + Item(Index: number): any; readonly Parent: any; + (Index: number): any; } class ShadowFormat { @@ -7109,7 +7732,7 @@ declare namespace Excel { readonly ConnectorFormat: ConnectorFormat; readonly ControlFormat: ControlFormat; Copy(): void; - CopyPicture(Appearance?: any, Format?: any): void; + CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): void; readonly Creator: XlCreator; Cut(): void; Delete(): void; @@ -7150,10 +7773,10 @@ declare namespace Excel { readonly Reflection: Office.ReflectionFormat; RerouteConnections(): void; Rotation: number; - ScaleHeight(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: any): void; - ScaleWidth(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: any): void; + ScaleHeight(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: Office.MsoScaleFrom): void; + ScaleWidth(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: Office.MsoScaleFrom): void; readonly Script: Office.Script; - Select(Replace?: any): void; + Select(Replace?: boolean): void; SetShapesDefaultProperties(): void; readonly Shadow: ShadowFormat; ShapeStyle: Office.MsoShapeStyleIndex; @@ -7169,7 +7792,7 @@ declare namespace Excel { readonly Type: Office.MsoShapeType; Ungroup(): ShapeRange; readonly VerticalFlip: Office.MsoTriState; - readonly Vertices: any; + readonly Vertices: SafeArray; Visible: Office.MsoTriState; Width: number; ZOrder(ZOrderCmd: Office.MsoZOrderCmd): void; @@ -7183,35 +7806,32 @@ declare namespace Excel { readonly Creator: number; readonly EditingType: Office.MsoEditingType; readonly Parent: any; - readonly Points: any; + readonly Points: SafeArray; readonly SegmentType: Office.MsoSegmentType; } - class ShapeNodes { - private 'Excel.ShapeNodes_typekey': ShapeNodes; - private constructor(); + interface ShapeNodes { readonly Application: any; readonly Count: number; readonly Creator: number; Delete(Index: number): void; /** - * @param number [X2=0] - * @param number [Y2=0] - * @param number [X3=0] - * @param number [Y3=0] + * @param X2 [X2=0] + * @param Y2 [Y2=0] + * @param X3 [X3=0] + * @param Y3 [Y3=0] */ Insert(Index: number, SegmentType: Office.MsoSegmentType, EditingType: Office.MsoEditingType, X1: number, Y1: number, X2?: number, Y2?: number, X3?: number, Y3?: number): void; - Item(Index: any): ShapeNode; + Item(Index: number | string): ShapeNode; readonly Parent: any; SetEditingType(Index: number, EditingType: Office.MsoEditingType): void; SetPosition(Index: number, X1: number, Y1: number): void; SetSegmentType(Index: number, SegmentType: Office.MsoSegmentType): void; + (Index: number | string): ShapeNode; } - class ShapeRange { - private 'Excel.ShapeRange_typekey': ShapeRange; - private constructor(); + interface ShapeRange { _Default(Index: any): Shape; readonly Adjustments: Adjustments; Align(AlignCmd: Office.MsoAlignCmd, RelativeTo: Office.MsoTriState): void; @@ -7253,7 +7873,7 @@ declare namespace Excel { IncrementLeft(Increment: number): void; IncrementRotation(Increment: number): void; IncrementTop(Increment: number): void; - Item(Index: any): Shape; + Item(Index: number | string): Shape; Left: number; readonly Line: LineFormat; LockAspectRatio: Office.MsoTriState; @@ -7267,9 +7887,9 @@ declare namespace Excel { Regroup(): Shape; RerouteConnections(): void; Rotation: number; - ScaleHeight(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: any): void; - ScaleWidth(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: any): void; - Select(Replace?: any): void; + ScaleHeight(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: Office.MsoScaleFrom): void; + ScaleWidth(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: Office.MsoScaleFrom): void; + Select(Replace?: boolean): void; SetShapesDefaultProperties(): void; readonly Shadow: ShadowFormat; ShapeStyle: Office.MsoShapeStyleIndex; @@ -7283,82 +7903,81 @@ declare namespace Excel { readonly Type: Office.MsoShapeType; Ungroup(): ShapeRange; readonly VerticalFlip: Office.MsoTriState; - readonly Vertices: any; + readonly Vertices: SafeArray; Visible: Office.MsoTriState; Width: number; ZOrder(ZOrderCmd: Office.MsoZOrderCmd): void; readonly ZOrderPosition: number; + (Index: number | string): Shape; } - class Shapes { - private 'Excel.Shapes_typekey': Shapes; - private constructor(); + interface Shapes { _Default(Index: any): Shape; AddCallout(Type: Office.MsoCalloutType, Left: number, Top: number, Width: number, Height: number): Shape; AddCanvas(Left: number, Top: number, Width: number, Height: number): Shape; - AddChart(XlChartType?: any, Left?: any, Top?: any, Width?: any, Height?: any): Shape; + AddChart(XlChartType?: XlChartType, Left?: number, Top?: number, Width?: number, Height?: number, NewLayout?: boolean): Shape; AddConnector(Type: Office.MsoConnectorType, BeginX: number, BeginY: number, EndX: number, EndY: number): Shape; - AddCurve(SafeArrayOfPoints: any): Shape; + AddCurve(SafeArrayOfPoints: SafeArray): Shape; AddDiagram(Type: Office.MsoDiagramType, Left: number, Top: number, Width: number, Height: number): Shape; AddFormControl(Type: XlFormControl, Left: number, Top: number, Width: number, Height: number): Shape; AddLabel(Orientation: Office.MsoTextOrientation, Left: number, Top: number, Width: number, Height: number): Shape; AddLine(BeginX: number, BeginY: number, EndX: number, EndY: number): Shape; - AddOLEObject(ClassType?: any, Filename?: any, Link?: any, DisplayAsIcon?: any, IconFileName?: any, IconIndex?: any, IconLabel?: any, Left?: any, Top?: any, Width?: any, - Height?: any): Shape; + AddOLEObject(ClassType: string, Filename?: undefined, Link?: false, DisplayAsIcon?: boolean, IconFileName?: string, IconIndex?: number, IconLabel?: string, Left?: number, Top?: number, Width?: number, Height?: number): Shape; + AddOLEObject(ClassType: undefined, Filename: string, Link?: boolean, DisplayAsIcon?: boolean, IconFileName?: string, IconIndex?: number, IconLabel?: string, Left?: number, Top?: number, Width?: number, Height?: number): Shape; AddPicture(Filename: string, LinkToFile: Office.MsoTriState, SaveWithDocument: Office.MsoTriState, Left: number, Top: number, Width: number, Height: number): Shape; - AddPolyline(SafeArrayOfPoints: any): Shape; + AddPolyline(SafeArrayOfPoints: SafeArray): Shape; AddShape(Type: Office.MsoAutoShapeType, Left: number, Top: number, Width: number, Height: number): Shape; - AddSmartArt(Layout: Office.SmartArtLayout, Left?: any, Top?: any, Width?: any, Height?: any): Shape; + AddSmartArt(Layout: Office.SmartArtLayout, Left?: number, Top?: number, Width?: number, Height?: number): Shape; AddTextbox(Orientation: Office.MsoTextOrientation, Left: number, Top: number, Width: number, Height: number): Shape; - AddTextEffect( - PresetTextEffect: Office.MsoPresetTextEffect, Text: string, FontName: string, FontSize: number, FontBold: Office.MsoTriState, FontItalic: Office.MsoTriState, - Left: number, Top: number): Shape; + AddTextEffect(PresetTextEffect: Office.MsoPresetTextEffect, Text: string, FontName: string, FontSize: number, FontBold: Office.MsoTriState, FontItalic: Office.MsoTriState, Left: number, Top: number): Shape; readonly Application: Application; BuildFreeform(EditingType: Office.MsoEditingType, X1: number, Y1: number): FreeformBuilder; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): Shape; + Item(Index: number | string): Shape; readonly Parent: any; - Range(Index: any): ShapeRange; + Range(Index: number | string | SafeArray): ShapeRange; SelectAll(): void; + (Index: number | string): Shape; } - class Sheets { - private 'Excel.Sheets_typekey': Sheets; - private constructor(); + interface Sheets { __PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any): void; _Default(Index: any): any; _PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void; - Add(Before?: any, After?: any, Count?: any, Type?: any): any; + Add(Before?: Sheet, After?: Sheet, Count?: number, Type?: T): AddSheetResult; readonly Application: Application; - Copy(Before?: any, After?: any): void; + Copy(Before?: Sheet): void; + Copy(Before: undefined, After: Sheet): void; readonly Count: number; readonly Creator: XlCreator; Delete(): void; - /** @param Excel.XlFillWith [Type=-4104] */ + /** @param Type [Type=-4104] */ FillAcrossSheets(Range: Range, Type?: XlFillWith): void; readonly HPageBreaks: HPageBreaks; - Item(Index: string | number): Worksheet | Chart | DialogSheet; - Item(Indexes: SafeArray): Sheets; - Move(Before?: any, After?: any): void; + Item(Index: string | number): TSheet; + Item(Indexes: SafeArray): Sheets; + Move(Before?: Sheet | number): void; + Move(Before: undefined, After: Sheet | number): void; readonly Parent: any; - PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any, IgnorePrintAreas?: any): void; - PrintPreview(EnableChanges?: any): void; + PrintOut(From?: number, To?: number, Copies?: number, Preview?: boolean, ActivePrinter?: string, PrintToFile?: T, Collate?: boolean, PrToFileName?: PrintToFileName, IgnorePrintAreas?: boolean): void; + PrintPreview(EnableChanges?: boolean): void; Select(Replace?: boolean): void; Visible: any; readonly VPageBreaks: VPageBreaks; + (Index: string | number): TSheet; + (Indexes: SafeArray): Sheets; } - class SheetViews { - private 'Excel.SheetViews_typekey': SheetViews; - private constructor(); + interface SheetViews { _Default(Index: any): any; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): any; + Item(Index: any): SheetView; readonly Parent: any; + (Index: any): SheetView; } class Slicer { @@ -7430,27 +8049,25 @@ declare namespace Excel { readonly VisibleSlicerItemsList: any; } - class SlicerCacheLevels { - private 'Excel.SlicerCacheLevels_typekey': SlicerCacheLevels; - private constructor(); + interface SlicerCacheLevels { _Default(Level?: any): SlicerCacheLevel; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Level?: any): SlicerCacheLevel; + Item(Level?: number | string): SlicerCacheLevel; readonly Parent: any; + (Level?: number | string): SlicerCacheLevel; } - class SlicerCaches { - private 'Excel.SlicerCaches_typekey': SlicerCaches; - private constructor(); + interface SlicerCaches { _Default(Index: any): SlicerCache; - Add(Source: any, SourceField: any, Name?: any): SlicerCache; + Add(Source: WorkbookConnection | PivotTable | string, SourceField: any, Name?: any): SlicerCache; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): SlicerCache; + Item(Index: number | string): SlicerCache; readonly Parent: any; + (Index: number | string): SlicerCache; } class SlicerItem { @@ -7468,40 +8085,37 @@ declare namespace Excel { readonly Value: string; } - class SlicerItems { - private 'Excel.SlicerItems_typekey': SlicerItems; - private constructor(); + interface SlicerItems { _Default(Index: any): SlicerItem; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): SlicerItem; + Item(Index: number | string): SlicerItem; readonly Parent: any; + (Index: number | string): SlicerItem; } - class SlicerPivotTables { - private 'Excel.SlicerPivotTables_typekey': SlicerPivotTables; - private constructor(); + interface SlicerPivotTables { _Default(Index: any): PivotTable; AddPivotTable(PivotTable: PivotTable): void; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotTable; + Item(Index: number | string): PivotTable; readonly Parent: any; - RemovePivotTable(PivotTable: any): void; + RemovePivotTable(PivotTable: PivotTable | number | string): void; + (Index: number | string): PivotTable; } - class Slicers { - private 'Excel.Slicers_typekey': Slicers; - private constructor(); + interface Slicers { _Default(Index: any): Slicer; - Add(SlicerDestination: any, Level?: any, Name?: any, Caption?: any, Top?: any, Left?: any, Width?: any, Height?: any): Slicer; + Add(SlicerDestination: string | Worksheet, Level?: any, Name?: string, Caption?: string, Top?: number, Left?: number, Width?: number, Height?: number): Slicer; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): Slicer; + Item(Index: number | string): Slicer; readonly Parent: any; + (Index: number | string): Slicer; } class SmartTag { @@ -7539,15 +8153,14 @@ declare namespace Excel { readonly Type: XlSmartTagControlType; } - class SmartTagActions { - private 'Excel.SmartTagActions_typekey': SmartTagActions; - private constructor(); + interface SmartTagActions { _Default(Index: any): SmartTagAction; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: any): SmartTagAction; readonly Parent: any; + (Index: any): SmartTagAction; } class SmartTagOptions { @@ -7572,9 +8185,7 @@ declare namespace Excel { readonly progID: string; } - class SmartTagRecognizers { - private 'Excel.SmartTagRecognizers_typekey': SmartTagRecognizers; - private constructor(); + interface SmartTagRecognizers { _Default(Index: any): SmartTagRecognizer; readonly Application: Application; readonly Count: number; @@ -7582,17 +8193,17 @@ declare namespace Excel { Item(Index: any): SmartTagRecognizer; readonly Parent: any; Recognize: boolean; + (Index: any): SmartTagRecognizer; } - class SmartTags { - private 'Excel.SmartTags_typekey': SmartTags; - private constructor(); + interface SmartTags { _Default(Index: any): SmartTag; Add(SmartTagType: string): SmartTag; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; readonly Parent: any; + (Index: any): SmartTag; } class Sort { @@ -7629,9 +8240,7 @@ declare namespace Excel { readonly SortOnValue: any; } - class SortFields { - private 'Excel.SortFields_typekey': SortFields; - private constructor(); + interface SortFields { _Default(Index: any): SortField; Add(Key: Range, SortOn?: any, Order?: any, CustomOrder?: any, DataOption?: any): SortField; readonly Application: Application; @@ -7640,6 +8249,7 @@ declare namespace Excel { readonly Creator: XlCreator; Item(Index: any): SortField; readonly Parent: any; + (Index: any): SortField; } class SoundNote { @@ -7723,9 +8333,7 @@ declare namespace Excel { Type: XlSparkType; } - class SparklineGroups { - private 'Excel.SparklineGroups_typekey': SparklineGroups; - private constructor(); + interface SparklineGroups { _Default(Index: any): SparklineGroup; Add(Type: XlSparkType, SourceData: string): SparklineGroup; readonly Application: Application; @@ -7734,9 +8342,10 @@ declare namespace Excel { readonly Count: number; readonly Creator: XlCreator; Group(Location: Range): void; - Item(Index: any): SparklineGroup; + Item(Index: number): SparklineGroup; readonly Parent: any; Ungroup(): void; + (Index: number): SparklineGroup; } class SparkPoints { @@ -7769,7 +8378,7 @@ declare namespace Excel { private 'Excel.Speech_typekey': Speech; private constructor(); Direction: XlSpeakDirection; - Speak(Text: string, SpeakAsync?: any, SpeakXML?: any, Purge?: any): void; + Speak(Text: string, SpeakAsync?: boolean, SpeakXML?: boolean, Purge?: boolean): void; SpeakCellOnEnter: boolean; } @@ -7819,7 +8428,7 @@ declare namespace Excel { IndentLevel: number; readonly Interior: Interior; Locked: boolean; - MergeCells: any; + MergeCells: boolean; readonly Name: string; readonly NameLocal: string; NumberFormat: string; @@ -7833,29 +8442,28 @@ declare namespace Excel { WrapText: boolean; } - class Styles { - private 'Excel.Styles_typekey': Styles; - private constructor(); + interface Styles { _Default(Index: any): Style; Add(Name: string, BasedOn?: any): Style; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): Style; - Merge(Workbook: any): any; + Item(Index: number | string): Style; + Merge(Workbook: Workbook): any; readonly Parent: any; + (Index: any): Style; } class Tab { private 'Excel.Tab_typekey': Tab; private constructor(); readonly Application: Application; - Color: any; + Color: XlRgbColor | number; ColorIndex: XlColorIndex; readonly Creator: XlCreator; readonly Parent: any; ThemeColor: XlThemeColor; - TintAndShade: any; + TintAndShade: number; } class TableStyle { @@ -7866,7 +8474,7 @@ declare namespace Excel { readonly BuiltIn: boolean; readonly Creator: XlCreator; Delete(): void; - Duplicate(NewTableStyleName?: any): TableStyle; + Duplicate(NewTableStyleName?: string): TableStyle; readonly Name: string; readonly NameLocal: string; readonly Parent: any; @@ -7890,27 +8498,25 @@ declare namespace Excel { StripeSize: number; } - class TableStyleElements { - private 'Excel.TableStyleElements_typekey': TableStyleElements; - private constructor(); + interface TableStyleElements { _Default(Index: XlTableStyleElementType): TableStyleElement; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: XlTableStyleElementType): TableStyleElement; readonly Parent: any; + (Index: XlTableStyleElementType): TableStyleElement; } - class TableStyles { - private 'Excel.TableStyles_typekey': TableStyles; - private constructor(); + interface TableStyles { _Default(Index: any): TableStyle; Add(TableStyleName: string): TableStyle; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): TableStyle; + Item(Index: number | string): TableStyle; readonly Parent: any; + (Index: number | string): TableStyle; } class TextEffectFormat { @@ -7940,7 +8546,7 @@ declare namespace Excel { readonly Application: Application; AutoMargins: boolean; AutoSize: boolean; - Characters(Start?: any, Length?: any): Characters; + Characters(Start?: number, Length?: number): Characters; readonly Creator: XlCreator; HorizontalAlignment: XlHAlign; HorizontalOverflow: XlOartHorizontalOverflow; @@ -8041,7 +8647,7 @@ declare namespace Excel { readonly Name: string; NumberFormat: string; NumberFormatLinked: boolean; - NumberFormatLocal: any; + NumberFormatLocal: string; Offset: number; Orientation: XlTickLabelOrientation; readonly Parent: any; @@ -8096,9 +8702,7 @@ declare namespace Excel { Width: number; } - class ToolbarButtons { - private 'Excel.ToolbarButtons_typekey': ToolbarButtons; - private constructor(); + interface ToolbarButtons { _Default(Index: number): ToolbarButton; Add(Button?: any, Before?: any, OnAction?: any, Pushed?: any, Enabled?: any, StatusBar?: any, HelpFile?: any, HelpContextID?: any): ToolbarButton; readonly Application: Application; @@ -8106,11 +8710,10 @@ declare namespace Excel { readonly Creator: XlCreator; Item(Index: number): ToolbarButton; readonly Parent: any; + (Index: number): ToolbarButton; } - class Toolbars { - private 'Excel.Toolbars_typekey': Toolbars; - private constructor(); + interface Toolbars { _Default(Index: any): Toolbar; Add(Name?: any): Toolbar; readonly Application: Application; @@ -8118,6 +8721,33 @@ declare namespace Excel { readonly Creator: XlCreator; Item(Index: any): Toolbar; readonly Parent: any; + (Index: any): Toolbar; + } + + class Top10 { + private 'Excel.Top10_typekey': Top10; + private constructor(); + readonly Application: Application; + readonly AppliesTo: Range; + readonly Borders: Borders; + CalcFor: XlCalcFor; + readonly Creator: XlCreator; + Delete(): void; + readonly Font: Font; + readonly Interior: Interior; + ModifyAppliesToRange(Range: Range): void; + NumberFormat: string; + readonly Parent: any; + Percent: boolean; + Priority: number; + readonly PTCondition: boolean; + Rank: number; + ScopeType: XlPivotConditionScope; + SetFirstPriority(): void; + SetLastPriority(): void; + StopIfTrue: boolean; + TopBottom: XlTopBottom; + readonly Type: number; } class TreeviewControl { @@ -8126,10 +8756,74 @@ declare namespace Excel { readonly Application: Application; readonly Creator: XlCreator; Drilled: any; - Hidden: any; + Hidden: SafeArray>; readonly Parent: any; } + class Trendline { + private 'Excel.Trendline_typekey': Trendline; + private constructor(); + readonly Application: Application; + Backward: number; + Backward2: number; + readonly Border: Border; + ClearFormats(): any; + readonly Creator: XlCreator; + readonly DataLabel: DataLabel; + Delete(): any; + DisplayEquation: boolean; + DisplayRSquared: boolean; + readonly Format: ChartFormat; + Forward: number; + Forward2: number; + readonly Index: number; + Intercept: number; + InterceptIsAuto: boolean; + Name: string; + NameIsAuto: boolean; + Order: number; + readonly Parent: any; + Period: number; + Select(): any; + Type: XlTrendlineType; + } + + interface Trendlines { + _Default(Index?: any): Trendline; + + /** @param Type [Type=-4132] */ + Add(Type?: XlTrendlineType, Order?: number, Period?: number, Forward?: number, Backward?: number, Intercept?: any, DisplayEquation?: boolean, DisplayRSquared?: boolean, Name?: string): Trendline; + readonly Application: Application; + readonly Count: number; + readonly Creator: XlCreator; + Item(Index: number): Trendline; + readonly Parent: any; + (Index: number): Trendline; + } + + class UniqueValues { + private 'Excel.UniqueValues_typekey': UniqueValues; + private constructor(); + readonly Application: Application; + readonly AppliesTo: Range; + readonly Borders: Borders; + readonly Creator: XlCreator; + Delete(): void; + DupeUnique: XlDupeUnique; + readonly Font: Font; + readonly Interior: Interior; + ModifyAppliesToRange(Range: Range): void; + NumberFormat: string; + readonly Parent: any; + Priority: number; + readonly PTCondition: boolean; + ScopeType: XlPivotConditionScope; + SetFirstPriority(): void; + SetLastPriority(): void; + StopIfTrue: boolean; + readonly Type: XlFormatConditionType.xlUniqueValues; + } + class UpBars { private 'Excel.UpBars_typekey': UpBars; private constructor(); @@ -8145,15 +8839,14 @@ declare namespace Excel { Select(): any; } - class UsedObjects { - private 'Excel.UsedObjects_typekey': UsedObjects; - private constructor(); + interface UsedObjects { _Default(Index: any): any; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): any; + Item(Index: number | string): any; readonly Parent: any; + (Index: number | string): any; } class UserAccess { @@ -8164,20 +8857,21 @@ declare namespace Excel { readonly Name: string; } - class UserAccessList { - private 'Excel.UserAccessList_typekey': UserAccessList; - private constructor(); + interface UserAccessList { _Default(Index: any): UserAccess; Add(Name: string, AllowEdit: boolean): UserAccess; readonly Count: number; DeleteAll(): void; - Item(Index: any): UserAccess; + Item(Index: number | string): UserAccess; + (Index: number | string): UserAccess; } class Validation { private 'Excel.Validation_typekey': Validation; private constructor(); - Add(Type: XlDVType, AlertStyle?: any, Operator?: any, Formula1?: any, Formula2?: any): void; + Add(Type: XlDVType.xlValidateInputOnly): void; + Add(Type: XlDVType.xlValidateWholeNumber | XlDVType.xlValidateDate | XlDVType.xlValidateDecimal | XlDVType.xlValidateTextLength | XlDVType.xlValidateTime, AlertStyle?: XlDVAlertStyle, Operator?: XlFormatConditionOperator.xlBetween | XlFormatConditionOperator.xlNotBetween, Formula1?: string, Formula2?: string): void; + Add(Type?: XlDVType, AlertStyle?: XlDVAlertStyle, Operator?: XlFormatConditionOperator, Formula1?: string): void; readonly AlertStyle: number; readonly Application: Application; readonly Creator: XlCreator; @@ -8191,7 +8885,9 @@ declare namespace Excel { InCellDropdown: boolean; InputMessage: string; InputTitle: string; - Modify(Type?: any, AlertStyle?: any, Operator?: any, Formula1?: any, Formula2?: any): void; + Modify(Type: XlDVType.xlValidateInputOnly): void; + Modify(Type: XlDVType.xlValidateWholeNumber | XlDVType.xlValidateDate | XlDVType.xlValidateDecimal | XlDVType.xlValidateTextLength | XlDVType.xlValidateTime, AlertStyle?: XlDVAlertStyle, Operator?: XlFormatConditionOperator.xlBetween | XlFormatConditionOperator.xlNotBetween, Formula1?: string, Formula2?: string): void; + Modify(Type?: XlDVType, AlertStyle?: XlDVAlertStyle, Operator?: XlFormatConditionOperator, Formula1?: string): void; readonly Operator: number; readonly Parent: any; ShowError: boolean; @@ -8230,16 +8926,15 @@ declare namespace Excel { Type: XlPageBreak; } - class VPageBreaks { - private 'Excel.VPageBreaks_typekey': VPageBreaks; - private constructor(); + interface VPageBreaks { _Default(Index: number): VPageBreak; - Add(Before: any): VPageBreak; + Add(Before: Range): VPageBreak; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): VPageBreak; readonly Parent: any; + (Index: number): VPageBreak; } class Walls { @@ -8255,8 +8950,8 @@ declare namespace Excel { readonly Name: string; readonly Parent: any; Paste(): void; - PictureType: any; - PictureUnit: any; + PictureType: XlChartPictureType; + PictureUnit: number; Select(): any; Thickness: number; } @@ -8271,17 +8966,16 @@ declare namespace Excel { readonly Source: any; } - class Watches { - private 'Excel.Watches_typekey': Watches; - private constructor(); + interface Watches { _Default(Index: any): Watch; Add(Source: any): Watch; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Delete(): void; - Item(Index: any): Watch; + Item(Index: number | string): Watch; readonly Parent: any; + (Index: number | string): Watch; } class WebOptions { @@ -8316,12 +9010,12 @@ declare namespace Excel { readonly ActiveCell: Range; readonly ActiveChart: Chart; readonly ActivePane: Pane; - readonly ActiveSheet: any; - readonly ActiveSheetView: any; + readonly ActiveSheet: Sheet | null; + readonly ActiveSheetView: SheetView | null; readonly Application: Application; AutoFilterDateGrouping: boolean; - Caption: any; - Close(SaveChanges?: any, Filename?: any, RouteWorkbook?: any): boolean; + Caption: string; + Close(SaveChanges?: boolean, Filename?: string, RouteWorkbook?: boolean): boolean; readonly Creator: XlCreator; DisplayFormulas: boolean; DisplayGridlines: boolean; @@ -8340,7 +9034,7 @@ declare namespace Excel { GridlineColorIndex: XlColorIndex; Height: number; readonly Index: number; - LargeScroll(Down?: any, Up?: any, ToRight?: any, ToLeft?: any): any; + LargeScroll(Down?: number, Up?: number, ToRight?: number, ToLeft?: number): any; Left: number; NewWindow(): Window; OnWindow: string; @@ -8348,18 +9042,19 @@ declare namespace Excel { readonly Parent: any; PointsToScreenPixelsX(Points: number): number; PointsToScreenPixelsY(Points: number): number; - PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): any; - PrintPreview(EnableChanges?: any): any; - RangeFromPoint(x: number, y: number): any; + PrintOut(From?: number, To?: number, Copies?: number, Preview?: boolean, ActivePrinter?: string, PrintToFile?: T, Collate?: boolean, PrToFileName?: PrintToFileName): any; + PrintPreview(EnableChanges?: boolean): any; + RangeFromPoint(x: number, y: number): Shape | Range | null; readonly RangeSelection: Range; ScrollColumn: number; - ScrollIntoView(Left: number, Top: number, Width: number, Height: number, Start?: any): void; + ScrollIntoView(Left: number, Top: number, Width: number, Height: number, Start?: boolean): void; ScrollRow: number; - ScrollWorkbookTabs(Sheets?: any, Position?: any): any; + ScrollWorkbookTabs(Sheets: 0, Position: Constants.xlFirst | Constants.xlLast): any; + ScrollWorkbookTabs(Sheets: number): any; readonly SelectedSheets: Sheets; readonly Selection: any; readonly SheetViews: SheetViews; - SmallScroll(Down?: any, Up?: any, ToRight?: any, ToLeft?: any): any; + SmallScroll(Down?: number, Up?: number, ToRight?: number, ToLeft?: number): any; Split: boolean; SplitColumn: number; SplitHorizontal: number; @@ -8376,25 +9071,25 @@ declare namespace Excel { Width: number; readonly WindowNumber: number; WindowState: XlWindowState; - Zoom: any; + Zoom: number | true; } - class Windows { - private 'Excel.Windows_typekey': Windows; - private constructor(); + interface Windows { _Default(Index: any): Window; readonly Application: Application; + Arrange(ArrangeStyle: XlArrangeStyle, ActiveWorkbook: true, SyncHorizontal?: boolean, SyncVertical?: boolean): any; - /** @param Excel.XlArrangeStyle [ArrangeStyle=1] */ - Arrange(ArrangeStyle?: XlArrangeStyle, ActiveWorkbook?: any, SyncHorizontal?: any, SyncVertical?: any): any; + /** @param ArrangeStyle [ArrangeStyle=1] */ + Arrange(ArrangeStyle?: XlArrangeStyle, ActiveWorkbook?: boolean, SyncHorizontal?: boolean, SyncVertical?: boolean): any; BreakSideBySide(): boolean; - CompareSideBySideWith(WindowName: any): boolean; + CompareSideBySideWith(WindowName: string): boolean; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): Window; + Item(Index: number | string): Window; readonly Parent: any; ResetPositionsSideBySide(): void; SyncScrollingSideBySide: boolean; + (Index: number | string): Window; } class Workbook { @@ -8407,16 +9102,14 @@ declare namespace Excel { _ProtectSharing(Filename?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, SharingPassword?: any): void; readonly _ReadOnlyRecommended: boolean; - /** @param Excel.XlSaveAsAccessMode [AccessMode=1] */ - _SaveAs( - Filename: string, FileFormat?: XlFileFormat, Password?: string, WriteResPassword?: string, ReadOnlyRecommended?: boolean, CreateBackup?: boolean, AccessMode?: XlSaveAsAccessMode, - ConflictResolution?: XlSaveConflictResolution, AddToMru?: boolean, TextCodepage?: any, TextVisualLayout?: any): void; + /** @param AccessMode [AccessMode=1] */ + _SaveAs(Filename: string, FileFormat?: XlFileFormat, Password?: string, WriteResPassword?: string, ReadOnlyRecommended?: boolean, CreateBackup?: boolean, AccessMode?: XlSaveAsAccessMode, ConflictResolution?: XlSaveConflictResolution, AddToMru?: boolean, TextCodepage?: any, TextVisualLayout?: any): void; AcceptAllChanges(When?: any, Who?: any, Where?: any): void; AcceptLabelsInFormulas: boolean; AccuracyVersion: number; Activate(): void; readonly ActiveChart: Chart; - readonly ActiveSheet: any; + readonly ActiveSheet: Sheet; readonly ActiveSlicer: Slicer; AddToFavorites(): void; readonly Application: Application; @@ -8428,18 +9121,21 @@ declare namespace Excel { readonly BuiltinDocumentProperties: Office.DocumentProperties; readonly CalculationVersion: number; CanCheckIn(): boolean; - ChangeFileAccess(Mode: XlFileAccess, WritePassword?: any, Notify?: any): void; + ChangeFileAccess(Mode: XlFileAccess.xlReadWrite, WritePassword?: string, Notify?: boolean): void; + ChangeFileAccess(Mode: XlFileAccess): void; ChangeHistoryDuration: number; - /** @param Excel.XlLinkType [Type=1] */ + /** @param Type [Type=1] */ ChangeLink(Name: string, NewName: string, Type?: XlLinkType): void; - readonly Charts: Sheets; + readonly Charts: Sheets; CheckCompatibility: boolean; - CheckIn(SaveChanges?: any, Comments?: any, MakePublic?: any): void; - CheckInWithVersion(SaveChanges?: any, Comments?: any, MakePublic?: any, VersionType?: any): void; - Close(SaveChanges?: any, Filename?: any, RouteWorkbook?: any): void; + CheckIn(SaveChanges: true, Comments?: string, MakePublic?: boolean): void; + CheckIn(SaveChanges?: any): void; + CheckInWithVersion(SaveChanges?: boolean, Comments?: any, MakePublic?: any, VersionType?: any): void; + Close(SaveChanges: true, Filename?: string, RouteWorkbook?: boolean): void; + Close(SaveChanges?: boolean, Filename?: undefined, RouteWorkbook?: boolean): void; readonly CodeName: string; - Colors(Index?: any): any; + Colors: SafeArray & ((Index: number) => number); readonly CommandBars: Office.CommandBars; Comments: string; ConflictResolution: XlSaveConflictResolution; @@ -8457,7 +9153,7 @@ declare namespace Excel { DefaultSlicerStyle: any; DefaultTableStyle: any; DeleteNumberFormat(NumberFormat: string): void; - readonly DialogSheets: Sheets; + readonly DialogSheets: Sheets; DisplayDrawingObjects: XlDisplayDrawingObjects; DisplayInkComments: boolean; readonly DocumentInspectors: Office.DocumentInspectors; @@ -8476,12 +9172,10 @@ declare namespace Excel { readonly Excel4MacroSheets: Sheets; readonly Excel8CompatibilityMode: boolean; ExclusiveAccess(): boolean; - ExportAsFixedFormat( - Type: XlFixedFormatType, Filename?: any, Quality?: any, IncludeDocProperties?: any, IgnorePrintAreas?: any, From?: any, To?: any, OpenAfterPublish?: any, - FixedFormatExtClassPtr?: any): void; + ExportAsFixedFormat(Type: XlFixedFormatType, Filename?: string, Quality?: XlFixedFormatQuality, IncludeDocProperties?: boolean, IgnorePrintAreas?: boolean, From?: number, To?: number, OpenAfterPublish?: boolean, FixedFormatExtClassPtr?: any): void; readonly FileFormat: XlFileFormat; Final: boolean; - FollowHyperlink(Address: string, SubAddress?: any, NewWindow?: any, AddHistory?: any, ExtraInfo?: any, Method?: any, HeaderInfo?: any): void; + FollowHyperlink(Address: string, SubAddress?: string, NewWindow?: boolean, AddHistory?: undefined, ExtraInfo?: string | Office.ByteArray, Method?: Office.MsoExtraInfoMethod, HeaderInfo?: string): void; ForceFullCalculation: boolean; ForwardMailer(): void; readonly FullName: string; @@ -8493,7 +9187,7 @@ declare namespace Excel { HasRoutingSlip: boolean; readonly HasVBProject: boolean; HighlightChangesOnScreen: boolean; - HighlightChangesOptions(When?: any, Who?: any, Where?: any): void; + HighlightChangesOptions(When?: XlHighlightChangesTime, Who?: 'Everyone' | 'Everyone but me' | string, Where?: string): void; readonly HTMLProject: Office.HTMLProject; readonly IconSets: IconSets; InactiveListBorderVisible: boolean; @@ -8501,12 +9195,12 @@ declare namespace Excel { readonly IsInplace: boolean; KeepChangeHistory: boolean; Keywords: string; - LinkInfo(Name: string, LinkInfo: XlLinkInfo, Type?: any, EditionRef?: any): any; - LinkSources(Type?: any): any; + LinkInfo(Name: string, LinkInfo: XlLinkInfo, Type?: XlLinkInfoType, EditionRef?: string): any; + LinkSources(Type?: XlLink): SafeArray; ListChangesOnNewSheet: boolean; LockServerFile(): void; readonly Mailer: Mailer; - MergeWorkbook(Filename: any): void; + MergeWorkbook(Filename: string): void; readonly Modules: Sheets; readonly MultiUserEditing: boolean; readonly Name: string; @@ -8515,7 +9209,7 @@ declare namespace Excel { OnSave: string; OnSheetActivate: string; OnSheetDeactivate: string; - OpenLinks(Name: string, ReadOnly?: any, Type?: any): void; + OpenLinks(Name: string, ReadOnly?: boolean, Type?: XlLink): void; readonly Parent: any; Password: string; readonly PasswordEncryptionAlgorithm: string; @@ -8527,19 +9221,18 @@ declare namespace Excel { PersonalViewListSettings: boolean; PersonalViewPrintSettings: boolean; PivotCaches(): PivotCaches; - PivotTableWizard( - SourceType?: any, SourceData?: any, TableDestination?: any, TableName?: any, RowGrand?: any, ColumnGrand?: any, SaveData?: any, HasAutoFormat?: any, - AutoPage?: any, Reserved?: any, BackgroundQuery?: any, OptimizeCache?: any, PageFieldOrder?: any, PageFieldWrapCount?: any, ReadData?: any, Connection?: any): void; - Post(DestName?: any): void; + PivotTableWizard(): void; + PivotTableWizard(SourceType: TSourceType, SourceData: PivotTableWizardSourceData, TableDestination?: Range, TableName?: string, RowGrand?: boolean, ColumnGrand?: boolean, SaveData?: boolean, HasAutoFormat?: boolean, AutoPage?: PivotTableWizardAutoPage, Reserved?: undefined, BackgroundQuery?: boolean, OptimizeCache?: boolean, PageFieldOrder?: XlOrder, PageFieldWrapCount?: number, ReadData?: boolean, Connection?: string): void; + Post(): void; PrecisionAsDisplayed: boolean; - PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any, IgnorePrintAreas?: any): void; - PrintPreview(EnableChanges?: any): void; - Protect(Password?: any, Structure?: any, Windows?: any): void; - ProtectSharing(Filename?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, SharingPassword?: any, FileFormat?: any): void; + PrintOut(From?: number, To?: number, Copies?: number, Preview?: boolean, ActivePrinter?: string, PrintToFile?: T, Collate?: boolean, PrToFileName?: PrintToFileName, IgnorePrintAreas?: boolean): void; + PrintPreview(EnableChanges?: boolean): void; + Protect(Password?: string, Structure?: boolean, Windows?: boolean): void; + ProtectSharing(Filename?: string, Password?: string, WriteResPassword?: string, ReadOnlyRecommended?: boolean, CreateBackup?: boolean, SharingPassword?: string, FileFormat?: any): void; readonly ProtectStructure: boolean; readonly ProtectWindows: boolean; readonly PublishObjects: PublishObjects; - PurgeChangeHistoryNow(Days: number, SharingPassword?: any): void; + PurgeChangeHistoryNow(Days: number, SharingPassword?: string): void; readonly ReadOnly: boolean; ReadOnlyRecommended: boolean; RecheckSmartTags(): void; @@ -8551,7 +9244,7 @@ declare namespace Excel { RemoveUser(Index: number): void; Reply(): void; ReplyAll(): void; - ReplyWithChanges(ShowMessage?: any): void; + ReplyWithChanges(ShowMessage?: boolean): void; readonly Research: Research; ResetColors(): void; readonly RevisionNumber: number; @@ -8561,25 +9254,27 @@ declare namespace Excel { RunAutoMacros(Which: XlRunAutoMacro): void; Save(): void; - /** @param Excel.XlSaveAsAccessMode [AccessMode=1] */ - SaveAs( - Filename: string, FileFormat?: XlFileFormat, Password?: string, WriteResPassword?: string, ReadOnlyRecommended?: boolean, CreateBackup?: boolean, AccessMode?: XlSaveAsAccessMode, - ConflictResolution?: XlSaveConflictResolution, AddToMru?: boolean, TextCodepage?: any, TextVisualLayout?: any): void; + /** @param AccessMode [AccessMode=1] */ + SaveAs(Filename: string, FileFormat?: XlFileFormat, Password?: string, WriteResPassword?: string, ReadOnlyRecommended?: boolean, CreateBackup?: boolean, AccessMode?: XlSaveAsAccessMode, ConflictResolution?: XlSaveConflictResolution, AddToMru?: boolean, TextCodepage?: any, TextVisualLayout?: any): void; SaveAsXMLData(Filename: string, Map: XmlMap): void; - SaveCopyAs(Filename?: any): void; + SaveCopyAs(Filename: string): void; Saved: boolean; SaveLinkValues: boolean; sblt(s: string): void; - SendFaxOverInternet(Recipients?: any, Subject?: any, ShowMessage?: any): void; - SendForReview(Recipients?: any, Subject?: any, ShowMessage?: any, IncludeAttachment?: any): void; - SendMail(Recipients: any, Subject?: any, ReturnReceipt?: any): void; + SendFaxOverInternet(Recipients?: string, Subject?: string, ShowMessage?: boolean): void; + SendForReview(Recipients?: string, Subject?: string, ShowMessage?: boolean, IncludeAttachment?: boolean): void; + SendMail(Recipients: string | SafeArray, Subject?: string, ReturnReceipt?: boolean): void; - /** @param Excel.XlPriority [Priority=-4143] */ + /** + * Macintosh only + * + * @param Priority [Priority=-4143] + */ SendMailer(FileFormat: any, Priority?: XlPriority): void; readonly ServerPolicy: Office.ServerPolicy; readonly ServerViewableItems: ServerViewableItems; - SetLinkOnData(Name: string, Procedure?: any): void; - SetPasswordEncryptionOptions(PasswordEncryptionProvider?: any, PasswordEncryptionAlgorithm?: any, PasswordEncryptionKeyLength?: any, PasswordEncryptionFileProperties?: any): void; + SetLinkOnData(Name: string, Procedure?: string): void; + SetPasswordEncryptionOptions(PasswordEncryptionProvider?: string, PasswordEncryptionAlgorithm?: string, PasswordEncryptionKeyLength?: number, PasswordEncryptionFileProperties?: boolean): void; readonly SharedWorkspace: Office.SharedWorkspace; readonly Sheets: Sheets; ShowConflictHistory: boolean; @@ -8597,25 +9292,25 @@ declare namespace Excel { readonly Theme: Office.OfficeTheme; Title: string; ToggleFormsDesign(): void; - Unprotect(Password?: any): void; - UnprotectSharing(SharingPassword?: any): void; + Unprotect(Password?: string): void; + UnprotectSharing(SharingPassword?: string): void; UpdateFromFile(): void; - UpdateLink(Name?: any, Type?: any): void; + UpdateLink(Name?: string, Type?: XlLinkType): void; UpdateLinks: XlUpdateLinks; UpdateRemoteReferences: boolean; UserControl: boolean; - readonly UserStatus: any; + readonly UserStatus: SafeArray; readonly VBASigned: boolean; readonly VBProject: VBIDE.VBProject; readonly WebOptions: WebOptions; WebPagePreview(): void; readonly Windows: Windows; - readonly Worksheets: Sheets; + readonly Worksheets: Sheets; WritePassword: string; readonly WriteReserved: boolean; readonly WriteReservedBy: string; - XmlImport(Url: string, ImportMap: XmlMap, Overwrite?: any, Destination?: any): XlXmlImportResult; - XmlImportXml(Data: string, ImportMap: XmlMap, Overwrite?: any, Destination?: any): XlXmlImportResult; + XmlImport(Url: string, ImportMap: XmlMap, Overwrite?: boolean, Destination?: any): XlXmlImportResult; + XmlImportXml(Data: string, ImportMap: XmlMap, Overwrite?: boolean, Destination?: any): XlXmlImportResult; readonly XmlMaps: XmlMaps; readonly XmlNamespaces: XmlNamespaces; } @@ -8637,25 +9332,16 @@ declare namespace Excel { readonly Type: XlConnectionType; } - class Workbooks { - private 'Excel.Workbooks_typekey': Workbooks; - private constructor(); - - /** @param Excel.XlTextQualifier [TextQualifier=1] */ - __OpenText( - Filename: string, Origin: any, StartRow: any, DataType: any, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: any, Tab?: any, Semicolon?: any, - Comma?: any, Space?: any, Other?: any, OtherChar?: any, FieldInfo?: any, TextVisualLayout?: any): void; + interface Workbooks { + /** @param TextQualifier [TextQualifier=1] */ + __OpenText(Filename: string, Origin: any, StartRow: any, DataType: any, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: any, Tab?: any, Semicolon?: any, Comma?: any, Space?: any, Other?: any, OtherChar?: any, FieldInfo?: any, TextVisualLayout?: any): void; _Default(Index: any): Workbook; - _Open( - Filename: string, UpdateLinks?: any, ReadOnly?: any, Format?: any, Password?: any, WriteResPassword?: any, IgnoreReadOnlyRecommended?: any, Origin?: any, - Delimiter?: any, Editable?: any, Notify?: any, Converter?: any, AddToMru?: any): Workbook; + _Open(Filename: string, UpdateLinks?: any, ReadOnly?: any, Format?: any, Password?: any, WriteResPassword?: any, IgnoreReadOnlyRecommended?: any, Origin?: any, Delimiter?: any, Editable?: any, Notify?: any, Converter?: any, AddToMru?: any): Workbook; - /** @param Excel.XlTextQualifier [TextQualifier=1] */ - _OpenText( - Filename: string, Origin: any, StartRow: any, DataType: any, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: any, Tab?: any, Semicolon?: any, - Comma?: any, Space?: any, Other?: any, OtherChar?: any, FieldInfo?: any, TextVisualLayout?: any, DecimalSeparator?: any, ThousandsSeparator?: any): void; + /** @param TextQualifier [TextQualifier=1] */ + _OpenText(Filename: string, Origin: any, StartRow: any, DataType: any, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: any, Tab?: any, Semicolon?: any, Comma?: any, Space?: any, Other?: any, OtherChar?: any, FieldInfo?: any, TextVisualLayout?: any, DecimalSeparator?: any, ThousandsSeparator?: any): void; _OpenXML(Filename: string, Stylesheets?: any): Workbook; - Add(Template?: any): Workbook; + Add(Template?: string | XlWBATemplate): Workbook; readonly Application: Application; CanCheckOut(Filename: string): boolean; CheckOut(Filename: string): void; @@ -8663,18 +9349,21 @@ declare namespace Excel { readonly Count: number; readonly Creator: XlCreator; Item(Index: number | string): Workbook; - Open( - Filename: string, UpdateLinks?: any, ReadOnly?: any, Format?: any, Password?: any, WriteResPassword?: any, IgnoreReadOnlyRecommended?: any, Origin?: any, - Delimiter?: any, Editable?: any, Notify?: any, Converter?: any, AddToMru?: any, Local?: any, CorruptLoad?: any): Workbook; - OpenDatabase(Filename: string, CommandText?: any, CommandType?: any, BackgroundQuery?: any, ImportDataAs?: any): Workbook; + Open(Filename: string, UpdateLinks?: 0 | 3, ReadOnly?: boolean, Format?: 1 | 2 | 3 | 4 | 5, Password?: string, WriteResPassword?: string, IgnoreReadOnlyRecommended?: boolean, Origin?: XlPlatform, Delimiter?: undefined, Editable?: boolean, Notify?: boolean, Converter?: number, AddToMru?: boolean, Local?: boolean, CorruptLoad?: XlCorruptLoad): Workbook; + Open(Filename: string, UpdateLinks?: 0 | 3, ReadOnly?: boolean, Format?: 6, Password?: string, WriteResPassword?: string, IgnoreReadOnlyRecommended?: boolean, Origin?: XlPlatform, Delimiter?: string, Editable?: boolean, Notify?: boolean, Converter?: number, AddToMru?: boolean, Local?: boolean, CorruptLoad?: XlCorruptLoad): Workbook; + OpenDatabase(Filename: string, CommandText?: string, CommandType?: XlCmdType, BackgroundQuery?: boolean, ImportDataAs?: XlImportDataAs): Workbook; - /** @param Excel.XlTextQualifier [TextQualifier=1] */ - OpenText( - Filename: string, Origin: any, StartRow: any, DataType: any, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: any, Tab?: any, Semicolon?: any, - Comma?: any, Space?: any, Other?: any, OtherChar?: any, FieldInfo?: any, TextVisualLayout?: any, DecimalSeparator?: any, ThousandsSeparator?: any, - TrailingMinusNumbers?: any, Local?: any): void; - OpenXML(Filename: string, Stylesheets?: any, LoadOption?: any): Workbook; + /** @param TextQualifier [TextQualifier=1] */ + OpenText(Filename: string, Origin: XlPlatform, StartRow: number, DataType: XlTextParsingType.xlDelimited, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: boolean, Tab?: boolean, Semicolon?: boolean, Comma?: boolean, Space?: boolean, Other?: true, OtherChar?: string, FieldInfo?: SafeArray, TextVisualLayout?: any, DecimalSeparator?: string, ThousandsSeparator?: string, TrailingMinusNumbers?: boolean, Local?: boolean): void; + + /** @param TextQualifier [TextQualifier=1] */ + OpenText(Filename: string, Origin: XlPlatform, StartRow: number, DataType: XlTextParsingType.xlDelimited, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: boolean, Tab?: boolean, Semicolon?: boolean, Comma?: boolean, Space?: boolean, Other?: boolean, OtherChar?: undefined, FieldInfo?: SafeArray, TextVisualLayout?: any, DecimalSeparator?: string, ThousandsSeparator?: string, TrailingMinusNumbers?: boolean, Local?: boolean): void; + + /** @param TextQualifier [TextQualifier=1] */ + OpenText(Filename: string, Origin: XlPlatform, StartRow: number, DataType: XlTextParsingType, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: undefined, Tab?: undefined, Semicolon?: undefined, Comma?: undefined, Space?: undefined, Other?: undefined, OtherChar?: undefined, FieldInfo?: SafeArray, TextVisualLayout?: any, DecimalSeparator?: string, ThousandsSeparator?: string, TrailingMinusNumbers?: boolean, Local?: boolean): void; + OpenXML(Filename: string, Stylesheets?: string | SafeArray, LoadOption?: XlXmlLoadOption): Workbook; readonly Parent: any; + (Index: number | string): Workbook; } class Worksheet { @@ -8688,9 +9377,7 @@ declare namespace Excel { _PasteSpecial(Format?: any, Link?: any, DisplayAsIcon?: any, IconFileName?: any, IconIndex?: any, IconLabel?: any): void; _PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void; _Protect(Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any): void; - _SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any): void; + _SaveAs(Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, TextVisualLayout?: any): void; Activate(): void; readonly Application: Application; Arcs(Index?: any): any; @@ -8699,9 +9386,10 @@ declare namespace Excel { Buttons(Index?: any): any; Calculate(): void; readonly Cells: Range; - ChartObjects(Index?: any): any; + ChartObjects(Index?: SafeArray): ChartObjects; + ChartObjects(Index: string | number): ChartObject; CheckBoxes(Index?: any): any; - CheckSpelling(CustomDictionary?: any, IgnoreUppercase?: any, AlwaysSuggest?: any, SpellLang?: any): void; + CheckSpelling(CustomDictionary?: string, IgnoreUppercase?: boolean, AlwaysSuggest?: boolean, SpellLang?: Office.MsoLanguageID): void; CircleInvalid(): void; readonly CircularReference: Range; ClearArrows(): void; @@ -8710,9 +9398,10 @@ declare namespace Excel { readonly Columns: Range; readonly Comments: Comments; readonly ConsolidationFunction: XlConsolidationFunction; - readonly ConsolidationOptions: any; - readonly ConsolidationSources: any; - Copy(Before?: any, After?: any): void; + readonly ConsolidationOptions: SafeArray; + readonly ConsolidationSources: SafeArray | undefined; + Copy(Before?: Sheet): void; + Copy(Before: undefined, After: Sheet): void; readonly Creator: XlCreator; readonly CustomProperties: CustomProperties; Delete(): void; @@ -8728,10 +9417,8 @@ declare namespace Excel { EnableOutlining: boolean; EnablePivotTable: boolean; EnableSelection: XlEnableSelection; - Evaluate(Name: any): any; - ExportAsFixedFormat( - Type: XlFixedFormatType, Filename?: any, Quality?: any, IncludeDocProperties?: any, IgnorePrintAreas?: any, From?: any, To?: any, OpenAfterPublish?: any, - FixedFormatExtClassPtr?: any): void; + Evaluate(Name: string): any; + ExportAsFixedFormat(Type: XlFixedFormatType, Filename?: string, Quality?: XlFixedFormatQuality, IncludeDocProperties?: boolean, IgnorePrintAreas?: boolean, From?: number, To?: number, OpenAfterPublish?: boolean, FixedFormatExtClassPtr?: any): void; readonly FilterMode: boolean; GroupBoxes(Index?: any): any; GroupObjects(Index?: any): any; @@ -8743,11 +9430,12 @@ declare namespace Excel { ListBoxes(Index?: any): any; readonly ListObjects: ListObjects; readonly MailEnvelope: Office.MsoEnvelope; - Move(Before?: any, After?: any): void; + Move(Before?: Sheet, After?: Sheet): void; Name: string; readonly Names: Names; - readonly Next: any; - OLEObjects(Index?: any): any; + readonly Next: Worksheet; + OLEObjects(Index: number | string): OLEObject; + OLEObjects(): OLEObjects; OnCalculate: string; OnData: string; OnDoubleClick: string; @@ -8759,21 +9447,18 @@ declare namespace Excel { Ovals(Index?: any): any; readonly PageSetup: PageSetup; readonly Parent: any; - Paste(Destination?: any, Link?: any): void; - PasteSpecial(Format?: any, Link?: any, DisplayAsIcon?: any, IconFileName?: any, IconIndex?: any, IconLabel?: any, NoHTMLFormatting?: any): void; + Paste(Destination?: Range, Link?: boolean): void; + PasteSpecial(Format: string | undefined, Link: boolean | undefined, DisplayAsIcon: true, IconFileName?: string, IconIndex?: number, IconLabel?: string, NoHTMLFormatting?: boolean): void; + PasteSpecial(Format?: string, Link?: boolean, DisplayAsIcon?: boolean, IconFileName?: undefined, IconIndex?: undefined, IconLabel?: undefined, NoHTMLFormatting?: boolean): void; Pictures(Index?: any): any; PivotTables(Index?: any): any; - PivotTableWizard( - SourceType?: any, SourceData?: any, TableDestination?: any, TableName?: any, RowGrand?: any, ColumnGrand?: any, SaveData?: any, HasAutoFormat?: any, - AutoPage?: any, Reserved?: any, BackgroundQuery?: any, OptimizeCache?: any, PageFieldOrder?: any, PageFieldWrapCount?: any, ReadData?: any, Connection?: any): PivotTable; - readonly Previous: any; + PivotTableWizard(): void; + PivotTableWizard(SourceType: TSourceType, SourceData: PivotTableWizardSourceData, TableDestination?: Range, TableName?: string, RowGrand?: boolean, ColumnGrand?: boolean, SaveData?: boolean, HasAutoFormat?: boolean, AutoPage?: PivotTableWizardAutoPage, Reserved?: undefined, BackgroundQuery?: boolean, OptimizeCache?: boolean, PageFieldOrder?: XlOrder, PageFieldWrapCount?: number, ReadData?: boolean, Connection?: string): void; + readonly Previous: Worksheet; readonly PrintedCommentPages: number; - PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any, IgnorePrintAreas?: any): void; - PrintPreview(EnableChanges?: any): void; - Protect( - Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any, AllowFormattingCells?: any, AllowFormattingColumns?: any, - AllowFormattingRows?: any, AllowInsertingColumns?: any, AllowInsertingRows?: any, AllowInsertingHyperlinks?: any, AllowDeletingColumns?: any, - AllowDeletingRows?: any, AllowSorting?: any, AllowFiltering?: any, AllowUsingPivotTables?: any): void; + PrintOut(From?: number, To?: number, Copies?: number, Preview?: boolean, ActivePrinter?: string, PrintToFile?: T, Collate?: boolean, PrToFileName?: PrintToFileName, IgnorePrintAreas?: boolean): void; + PrintPreview(EnableChanges?: boolean): void; + Protect(Password?: string, DrawingObjects?: boolean, Contents?: boolean, Scenarios?: boolean, UserInterfaceOnly?: boolean, AllowFormattingCells?: boolean, AllowFormattingColumns?: boolean, AllowFormattingRows?: boolean, AllowInsertingColumns?: boolean, AllowInsertingRows?: boolean, AllowInsertingHyperlinks?: boolean, AllowDeletingColumns?: boolean, AllowDeletingRows?: boolean, AllowSorting?: boolean, AllowFiltering?: boolean, AllowUsingPivotTables?: boolean): void; readonly ProtectContents: boolean; readonly ProtectDrawingObjects: boolean; readonly Protection: Protection; @@ -8784,14 +9469,13 @@ declare namespace Excel { Rectangles(Index?: any): any; ResetAllPageBreaks(): void; readonly Rows: Range; - SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any, Local?: any): void; - Scenarios(Index?: any): any; + SaveAs(Filename: string, FileFormat?: XlFileFormat, Password?: string, WriteResPassword?: string, ReadOnlyRecommended?: boolean, CreateBackup?: boolean, AddToMru?: boolean, TextCodepage?: any, TextVisualLayout?: any, Local?: boolean): void; + Scenarios(Index: number | string): Scenario; + Scenarios(Index?: SafeArray): Scenarios; readonly Scripts: Office.Scripts; ScrollArea: string; ScrollBars(Index?: any): any; - Select(Replace?: any): void; + Select(Replace?: boolean): void; SetBackgroundPicture(Filename: string): void; readonly Shapes: Shapes; ShowAllData(): void; @@ -8806,54 +9490,36 @@ declare namespace Excel { TransitionExpEval: boolean; TransitionFormEntry: boolean; readonly Type: XlSheetType; - Unprotect(Password?: any): void; + Unprotect(Password?: string): void; readonly UsedRange: Range; Visible: XlSheetVisibility; readonly VPageBreaks: VPageBreaks; - XmlDataQuery(XPath: string, SelectionNamespaces?: any, Map?: any): Range; - XmlMapQuery(XPath: string, SelectionNamespaces?: any, Map?: any): Range; + XmlDataQuery(XPath: string, SelectionNamespaces?: string, Map?: XmlMap): Range | null; + XmlMapQuery(XPath: string, SelectionNamespaces?: string, Map?: XmlMap): Range; } class WorksheetFunction { private 'Excel.WorksheetFunction_typekey': WorksheetFunction; private constructor(); - _WSFunction( - Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + _WSFunction(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; AccrInt(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6: any, Arg7?: any): number; AccrIntM(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5?: any): number; Acos(Arg1: number): number; Acosh(Arg1: number): number; - Aggregate( - Arg1: number, Arg2: number, Arg3: Range, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Aggregate(Arg1: number, Arg2: number, Arg3: Range, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; AmorDegrc(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6: any, Arg7?: any): number; AmorLinc(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6: any, Arg7?: any): number; - And( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): boolean; + And(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): boolean; readonly Application: Application; Asc(Arg1: string): string; Asin(Arg1: number): number; Asinh(Arg1: number): number; Atan2(Arg1: number, Arg2: number): number; Atanh(Arg1: number): number; - AveDev( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - Average( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + AveDev(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Average(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; AverageIf(Arg1: Range, Arg2: any, Arg3?: any): number; - AverageIfs( - Arg1: Range, Arg2: Range, Arg3: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any): number; + AverageIfs(Arg1: Range, Arg2: Range, Arg3: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any): number; BahtText(Arg1: number): string; BesselI(Arg1: any, Arg2: any): number; BesselJ(Arg1: any, Arg2: any): number; @@ -8879,10 +9545,7 @@ declare namespace Excel { ChiSq_Inv_RT(Arg1: number, Arg2: number): number; ChiSq_Test(Arg1: any, Arg2: any): number; ChiTest(Arg1: any, Arg2: any): number; - Choose( - Arg1: any, Arg2: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + Choose(Arg1: any, Arg2: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; Clean(Arg1: string): string; Combin(Arg1: number, Arg2: number): number; Complex(Arg1: any, Arg2: any, Arg3?: any): string; @@ -8892,20 +9555,11 @@ declare namespace Excel { Convert(Arg1: any, Arg2: any, Arg3: any): number; Correl(Arg1: any, Arg2: any): number; Cosh(Arg1: number): number; - Count( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - CountA( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Count(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + CountA(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; CountBlank(Arg1: Range): number; CountIf(Arg1: Range, Arg2: string | number): number; - CountIfs( - Arg1: Range, Arg2: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + CountIfs(Arg1: Range, Arg2: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; CoupDayBs(Arg1: any, Arg2: any, Arg3: any, Arg4?: any): number; CoupDays(Arg1: any, Arg2: any, Arg3: any, Arg4?: any): number; CoupDaysNc(Arg1: any, Arg2: any, Arg3: any, Arg4?: any): number; @@ -8931,10 +9585,7 @@ declare namespace Excel { Dec2Oct(Arg1: any, Arg2?: any): string; Degrees(Arg1: number): number; Delta(Arg1: any, Arg2?: any): number; - DevSq( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + DevSq(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; DGet(Arg1: Range, Arg2: any, Arg3: any): any; Disc(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5?: any): number; DMax(Arg1: Range, Arg2: any, Arg3: any): number; @@ -8946,10 +9597,7 @@ declare namespace Excel { DStDev(Arg1: Range, Arg2: any, Arg3: any): number; DStDevP(Arg1: Range, Arg2: any, Arg3: any): number; DSum(Arg1: Range, Arg2: any, Arg3: any): number; - Dummy19( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + Dummy19(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; Dummy21(Arg1: number, Arg2: number): number; Duration(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6?: any): number; DVar(Arg1: Range, Arg2: any, Arg3: any): number; @@ -8991,20 +9639,11 @@ declare namespace Excel { GammaInv(Arg1: number, Arg2: number, Arg3: number): number; GammaLn(Arg1: number): number; GammaLn_Precise(Arg1: number): number; - Gcd( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - GeoMean( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Gcd(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + GeoMean(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; GeStep(Arg1: any, Arg2?: any): number; Growth(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any): any; - HarMean( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + HarMean(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; Hex2Bin(Arg1: any, Arg2?: any): string; Hex2Dec(Arg1: any): string; Hex2Oct(Arg1: any, Arg2?: any): string; @@ -9023,18 +9662,12 @@ declare namespace Excel { ImLog10(Arg1: any): string; ImLog2(Arg1: any): string; ImPower(Arg1: any, Arg2: any): string; - ImProduct( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): string; + ImProduct(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): string; ImReal(Arg1: any): number; ImSin(Arg1: any): string; ImSqrt(Arg1: any): string; ImSub(Arg1: any, Arg2: any): string; - ImSum( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): string; + ImSum(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): string; Index(Arg1: any, Arg2: number, Arg3?: any, Arg4?: any): any; Intercept(Arg1: any, Arg2: any): number; IntRate(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5?: any): number; @@ -9052,15 +9685,9 @@ declare namespace Excel { Ispmt(Arg1: number, Arg2: number, Arg3: number, Arg4: number): number; IsText(Arg1: any): boolean; IsThaiDigit(Arg1: string): boolean; - Kurt( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Kurt(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; Large(Arg1: any, Arg2: number): number; - Lcm( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Lcm(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; LinEst(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any): any; Ln(Arg1: number): number; Log(Arg1: number, Arg2?: any): number; @@ -9072,40 +9699,19 @@ declare namespace Excel { LogNormDist(Arg1: number, Arg2: number, Arg3: number): number; Lookup(Arg1: any, Arg2: any, Arg3?: any): any; Match(Arg1: any, Arg2: any, Arg3?: any): number; - Max( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Max(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; MDeterm(Arg1: any): number; MDuration(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6?: any): number; - Median( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - Min( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Median(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Min(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; MInverse(Arg1: any): any; MIrr(Arg1: any, Arg2: number, Arg3: number): number; MMult(Arg1: any, Arg2: any): any; - Mode( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - Mode_Mult( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; - Mode_Sngl( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Mode(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Mode_Mult(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + Mode_Sngl(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; MRound(Arg1: any, Arg2: any): number; - MultiNomial( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + MultiNomial(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; NegBinom_Dist(Arg1: number, Arg2: number, Arg3: number, Arg4: boolean): number; NegBinomDist(Arg1: number, Arg2: number, Arg3: number): number; NetworkDays(Arg1: any, Arg2: any, Arg3?: any): number; @@ -9120,10 +9726,7 @@ declare namespace Excel { NormSDist(Arg1: number): number; NormSInv(Arg1: number): number; NPer(Arg1: number, Arg2: number, Arg3: number, Arg4?: any, Arg5?: any): number; - Npv( - Arg1: number, Arg2: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Npv(Arg1: number, Arg2: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; Oct2Bin(Arg1: any, Arg2?: any): string; Oct2Dec(Arg1: any): string; Oct2Hex(Arg1: any, Arg2?: any): string; @@ -9132,10 +9735,7 @@ declare namespace Excel { OddFYield(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6: any, Arg7: any, Arg8: any, Arg9?: any): number; OddLPrice(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6: any, Arg7: any, Arg8?: any): number; OddLYield(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6: any, Arg7: any, Arg8?: any): number; - Or( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): boolean; + Or(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): boolean; readonly Parent: any; Pearson(Arg1: any, Arg2: any): number; Percentile(Arg1: any, Arg2: number): number; @@ -9156,10 +9756,7 @@ declare namespace Excel { PriceDisc(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5?: any): number; PriceMat(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6?: any): number; Prob(Arg1: any, Arg2: any, Arg3: number, Arg4?: any): number; - Product( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Product(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; Proper(Arg1: string): string; Pv(Arg1: number, Arg2: number, Arg3: number, Arg4?: any, Arg5?: any): number; Quartile(Arg1: any, Arg2: number): number; @@ -9183,62 +9780,29 @@ declare namespace Excel { RoundDown(Arg1: number, Arg2: number): number; RoundUp(Arg1: number, Arg2: number): number; RSq(Arg1: any, Arg2: any): number; - RTD( - progID: any, server: any, topic1: any, topic2?: any, topic3?: any, topic4?: any, topic5?: any, topic6?: any, topic7?: any, topic8?: any, topic9?: any, - topic10?: any, topic11?: any, topic12?: any, topic13?: any, topic14?: any, topic15?: any, topic16?: any, topic17?: any, topic18?: any, topic19?: any, - topic20?: any, topic21?: any, topic22?: any, topic23?: any, topic24?: any, topic25?: any, topic26?: any, topic27?: any, topic28?: any): any; + RTD(progID: any, server: any, topic1: any, topic2?: any, topic3?: any, topic4?: any, topic5?: any, topic6?: any, topic7?: any, topic8?: any, topic9?: any, topic10?: any, topic11?: any, topic12?: any, topic13?: any, topic14?: any, topic15?: any, topic16?: any, topic17?: any, topic18?: any, topic19?: any, topic20?: any, topic21?: any, topic22?: any, topic23?: any, topic24?: any, topic25?: any, topic26?: any, topic27?: any, topic28?: any): any; Search(Arg1: string, Arg2: string, Arg3?: any): number; SearchB(Arg1: string, Arg2: string, Arg3?: any): number; SeriesSum(Arg1: any, Arg2: any, Arg3: any, Arg4: any): number; Sinh(Arg1: number): number; - Skew( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Skew(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; Sln(Arg1: number, Arg2: number, Arg3: number): number; Slope(Arg1: any, Arg2: any): number; Small(Arg1: any, Arg2: number): number; SqrtPi(Arg1: any): number; Standardize(Arg1: number, Arg2: number, Arg3: number): number; - StDev( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - StDev_P( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - StDev_S( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - StDevP( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + StDev(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + StDev_P(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + StDev_S(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + StDevP(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; StEyx(Arg1: any, Arg2: any): number; Substitute(Arg1: string, Arg2: string, Arg3: string, Arg4?: any): string; - Subtotal( - Arg1: number, Arg2: Range, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - Sum( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Subtotal(Arg1: number, Arg2: Range, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Sum(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; SumIf(Arg1: Range, Arg2: any, Arg3?: any): number; - SumIfs( - Arg1: Range, Arg2: Range, Arg3: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any): number; - SumProduct( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - SumSq( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + SumIfs(Arg1: Range, Arg2: Range, Arg3: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any): number; + SumProduct(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + SumSq(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; SumX2MY2(Arg1: any, Arg2: any): number; SumX2PY2(Arg1: any, Arg2: any): number; SumXMY2(Arg1: any, Arg2: any): number; @@ -9269,22 +9833,10 @@ declare namespace Excel { TrimMean(Arg1: any, Arg2: number): number; TTest(Arg1: any, Arg2: any, Arg3: number, Arg4: number): number; USDollar(Arg1: number, Arg2: number): string; - Var( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - Var_P( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - Var_S( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - VarP( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Var(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Var_P(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Var_S(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + VarP(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; Vdb(Arg1: number, Arg2: number, Arg3: number, Arg4: number, Arg5: number, Arg6?: any, Arg7?: any): number; VLookup(Arg1: any, Arg2: any, Arg3: any, Arg4?: any): any; Weekday(Arg1: any, Arg2?: any): number; @@ -9302,6 +9854,20 @@ declare namespace Excel { ZTest(Arg1: any, Arg2: number, Arg3?: any): number; } + class WorksheetView { + private 'Excel.WorksheetView_typekey': WorksheetView; + private constructor(); + readonly Application: Application; + readonly Creator: XlCreator; + DisplayFormulas: boolean; + DisplayGridlines: boolean; + DisplayHeadings: boolean; + DisplayOutline: boolean; + DisplayZeros: boolean; + readonly Parent: any; + readonly Sheet: Worksheet; + } + class XmlDataBinding { private 'Excel.XmlDataBinding_typekey': XmlDataBinding; private constructor(); @@ -9325,10 +9891,10 @@ declare namespace Excel { readonly Creator: XlCreator; readonly DataBinding: XmlDataBinding; Delete(): void; - Export(Url: string, Overwrite?: any): XlXmlExportResult; + Export(Url: string, Overwrite?: boolean): XlXmlExportResult; ExportXml(Data: string): XlXmlExportResult; - Import(Url: string, Overwrite?: any): XlXmlImportResult; - ImportXml(XmlData: string, Overwrite?: any): XlXmlImportResult; + Import(Url: string, Overwrite?: boolean): XlXmlImportResult; + ImportXml(XmlData: string, Overwrite?: boolean): XlXmlImportResult; readonly IsExportable: boolean; Name: string; readonly Parent: any; @@ -9342,16 +9908,15 @@ declare namespace Excel { readonly WorkbookConnection: WorkbookConnection; } - class XmlMaps { - private 'Excel.XmlMaps_typekey': XmlMaps; - private constructor(); + interface XmlMaps { _Default(Index: any): XmlMap; - Add(Schema: string, RootElementName?: any): XmlMap; + Add(Schema: string, RootElementName?: string): XmlMap; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): XmlMap; + Item(Index: number | string): XmlMap; readonly Parent: any; + (Index: number | string): XmlMap; } class XmlNamespace { @@ -9365,17 +9930,16 @@ declare namespace Excel { readonly Uri: string; } - class XmlNamespaces { - private 'Excel.XmlNamespaces_typekey': XmlNamespaces; - private constructor(); + interface XmlNamespaces { _Default(Index: any): XmlNamespace; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - InstallManifest(Path: string, InstallForAllUsers?: any): void; - Item(Index: any): XmlNamespace; + InstallManifest(Path: string, InstallForAllUsers?: boolean): void; + Item(Index: number | string): XmlNamespace; readonly Parent: any; readonly Value: string; + (Index: number | string): XmlNamespace; } class XmlSchema { @@ -9389,15 +9953,14 @@ declare namespace Excel { readonly XML: string; } - class XmlSchemas { - private 'Excel.XmlSchemas_typekey': XmlSchemas; - private constructor(); + interface XmlSchemas { _Default(Index: any): XmlSchema; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): XmlSchema; + Item(Index: number | string): XmlSchema; readonly Parent: any; + (Index: number | string): XmlSchema; } class XPath { @@ -9410,7 +9973,7 @@ declare namespace Excel { readonly Map: XmlMap; readonly Parent: any; readonly Repeating: boolean; - SetValue(Map: XmlMap, XPath: string, SelectionNamespace?: any, Repeating?: any): void; + SetValue(Map: XmlMap, XPath: string, SelectionNamespace?: any, Repeating?: boolean): void; readonly Value: string; } @@ -9495,223 +10058,100 @@ declare namespace Excel { } } +interface EnumeratorConstructor { + // we need this because there are two overloads for Item on the Sheets object + new (sheets: Excel.Sheets): Enumerator; +} + interface ActiveXObject { - on( - obj: Excel.Application, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Excel.Application, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; - on( - obj: Excel.Application, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Excel.Application, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; + on(obj: Excel.Application, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Excel.Application, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; + on(obj: Excel.Application, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Excel.Application, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; on(obj: Excel.Application, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Excel.Application, parameter: { pctinfo: number }) => void): void; - on( - obj: Excel.Application, event: 'Invoke', argNames: Excel.EventHelperTypes.Application_Invoke_ArgNames, handler: ( - this: Excel.Application, parameter: Excel.EventHelperTypes.Application_Invoke_Parameter) => void): void; - on( - obj: Excel.Application, event: 'NewWorkbook' | 'WorkbookActivate' | 'WorkbookAddinInstall' | 'WorkbookAddinUninstall' | 'WorkbookDeactivate' | 'WorkbookOpen', - argNames: ['Wb'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook }) => void): void; - on( - obj: Excel.Application, event: 'ProtectedViewWindowActivate' | 'ProtectedViewWindowDeactivate' | 'ProtectedViewWindowOpen' | 'ProtectedViewWindowResize', - argNames: ['Pvw'], handler: (this: Excel.Application, parameter: { readonly Pvw: Excel.ProtectedViewWindow }) => void): void; - on( - obj: Excel.Application, event: 'ProtectedViewWindowBeforeClose', argNames: ['Pvw', 'Reason', 'Cancel'], handler: ( - this: Excel.Application, parameter: { readonly Pvw: Excel.ProtectedViewWindow, readonly Reason: Excel.XlProtectedViewCloseReason, Cancel: boolean }) => void): void; - on( - obj: Excel.Application, event: 'ProtectedViewWindowBeforeEdit', argNames: ['Pvw', 'Cancel'], handler: ( - this: Excel.Application, parameter: { readonly Pvw: Excel.ProtectedViewWindow, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'Invoke', argNames: Excel.EventHelperTypes.Application_Invoke_ArgNames, handler: (this: Excel.Application, parameter: Excel.EventHelperTypes.Application_Invoke_Parameter) => void): void; + on(obj: Excel.Application, event: 'NewWorkbook' | 'WorkbookActivate' | 'WorkbookAddinInstall' | 'WorkbookAddinUninstall' | 'WorkbookDeactivate' | 'WorkbookOpen', argNames: ['Wb'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook }) => void): void; + on(obj: Excel.Application, event: 'ProtectedViewWindowActivate' | 'ProtectedViewWindowDeactivate' | 'ProtectedViewWindowOpen' | 'ProtectedViewWindowResize', argNames: ['Pvw'], handler: (this: Excel.Application, parameter: { readonly Pvw: Excel.ProtectedViewWindow }) => void): void; + on(obj: Excel.Application, event: 'ProtectedViewWindowBeforeClose', argNames: ['Pvw', 'Reason', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Pvw: Excel.ProtectedViewWindow, readonly Reason: Excel.XlProtectedViewCloseReason, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'ProtectedViewWindowBeforeEdit', argNames: ['Pvw', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Pvw: Excel.ProtectedViewWindow, Cancel: boolean }) => void): void; on(obj: Excel.Application, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Excel.Application, parameter: { readonly riid: stdole.GUID, ppvObj: undefined }) => void): void; - on(obj: Excel.Application, event: 'SheetActivate' | 'SheetCalculate' | 'SheetDeactivate', argNames: ['Sh'], handler: (this: Excel.Application, parameter: { readonly Sh: any }) => void): void; - on( - obj: Excel.Application, event: 'SheetBeforeDoubleClick' | 'SheetBeforeRightClick', argNames: ['Sh', 'Target', 'Cancel'], handler: ( - this: Excel.Application, parameter: { readonly Sh: any, readonly Target: Excel.Range, Cancel: boolean }) => void): void; - on( - obj: Excel.Application, event: 'SheetChange' | 'SheetSelectionChange', argNames: ['Sh', 'Target'], handler: ( - this: Excel.Application, parameter: { readonly Sh: any, readonly Target: Excel.Range }) => void): void; - on( - obj: Excel.Application, event: 'SheetFollowHyperlink', argNames: ['Sh', 'Target'], handler: ( - this: Excel.Application, parameter: { readonly Sh: any, readonly Target: Excel.Hyperlink }) => void): void; - on( - obj: Excel.Application, event: 'SheetPivotTableAfterValueChange', argNames: ['Sh', 'TargetPivotTable', 'TargetRange'], handler: ( - this: Excel.Application, parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly TargetRange: Excel.Range }) => void): void; - on( - obj: Excel.Application, event: 'SheetPivotTableBeforeAllocateChanges' | 'SheetPivotTableBeforeCommitChanges', - argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd', 'Cancel'], handler: ( - this: Excel.Application, - parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number, Cancel: boolean }) => void): void; - on( - obj: Excel.Application, event: 'SheetPivotTableBeforeDiscardChanges', argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd'], - handler: ( - this: Excel.Application, parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number }) => void): void; - on( - obj: Excel.Application, event: 'SheetPivotTableUpdate', argNames: ['Sh', 'Target'], handler: ( - this: Excel.Application, parameter: { readonly Sh: any, readonly Target: Excel.PivotTable }) => void): void; - on( - obj: Excel.Application, event: 'WindowActivate' | 'WindowDeactivate' | 'WindowResize', argNames: ['Wb', 'Wn'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Wn: Excel.Window }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookAfterSave', argNames: ['Wb', 'Success'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Success: boolean }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookAfterXmlExport', argNames: ['Wb', 'Map', 'Url', 'Result'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly Url: string, readonly Result: Excel.XlXmlExportResult }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookAfterXmlImport', argNames: ['Wb', 'Map', 'IsRefresh', 'Result'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly IsRefresh: boolean, readonly Result: Excel.XlXmlImportResult }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookBeforeClose' | 'WorkbookBeforePrint', argNames: ['Wb', 'Cancel'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, Cancel: boolean }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookBeforeSave', argNames: ['Wb', 'SaveAsUI', 'Cancel'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly SaveAsUI: boolean, Cancel: boolean }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookBeforeXmlExport', argNames: ['Wb', 'Map', 'Url', 'Cancel'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly Url: string, Cancel: boolean }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookBeforeXmlImport', argNames: ['Wb', 'Map', 'Url', 'IsRefresh', 'Cancel'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly Url: string, readonly IsRefresh: boolean, Cancel: boolean }) => void): void; - on(obj: Excel.Application, event: 'WorkbookNewChart', argNames: ['Wb', 'Ch'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Ch: Excel.Chart }) => void): void; - on(obj: Excel.Application, event: 'WorkbookNewSheet', argNames: ['Wb', 'Sh'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Sh: any }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookPivotTableCloseConnection' | 'WorkbookPivotTableOpenConnection', argNames: ['Wb', 'Target'], - handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Target: Excel.PivotTable }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookRowsetComplete', argNames: ['Wb', 'Description', 'Sheet', 'Success'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Description: string, readonly Sheet: string, readonly Success: boolean }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookSync', argNames: ['Wb', 'SyncEventType'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly SyncEventType: Office.MsoSyncEventType }) => void): void; - on( - obj: Excel.Chart, event: 'BeforeDoubleClick', argNames: ['ElementID', 'Arg1', 'Arg2', 'Cancel'], handler: ( - this: Excel.Chart, parameter: { readonly ElementID: number, readonly Arg1: number, readonly Arg2: number, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'SheetActivate' | 'SheetCalculate' | 'SheetDeactivate', argNames: ['Sh'], handler: (this: Excel.Application, parameter: { readonly Sh: Excel.Chart | Excel.Worksheet }) => void): void; + on(obj: Excel.Application, event: 'SheetBeforeDoubleClick' | 'SheetBeforeRightClick', argNames: ['Sh', 'Target', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.Range, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'SheetChange' | 'SheetSelectionChange', argNames: ['Sh', 'Target'], handler: (this: Excel.Application, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.Range }) => void): void; + on(obj: Excel.Application, event: 'SheetFollowHyperlink', argNames: ['Sh', 'Target'], handler: (this: Excel.Application, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.Hyperlink }) => void): void; + on(obj: Excel.Application, event: 'SheetPivotTableAfterValueChange', argNames: ['Sh', 'TargetPivotTable', 'TargetRange'], handler: (this: Excel.Application, parameter: { readonly Sh: Excel.Worksheet, readonly TargetPivotTable: Excel.PivotTable, readonly TargetRange: Excel.Range }) => void): void; + on(obj: Excel.Application, event: 'SheetPivotTableBeforeAllocateChanges' | 'SheetPivotTableBeforeCommitChanges', argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Sh: Excel.Worksheet, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'SheetPivotTableBeforeDiscardChanges', argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd'], handler: (this: Excel.Application, parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number }) => void): void; + on(obj: Excel.Application, event: 'SheetPivotTableUpdate', argNames: ['Sh', 'Target'], handler: (this: Excel.Application, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.PivotTable }) => void): void; + on(obj: Excel.Application, event: 'WindowActivate' | 'WindowDeactivate' | 'WindowResize', argNames: ['Wb', 'Wn'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Wn: Excel.Window }) => void): void; + on(obj: Excel.Application, event: 'WorkbookAfterSave', argNames: ['Wb', 'Success'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Success: boolean }) => void): void; + on(obj: Excel.Application, event: 'WorkbookAfterXmlExport', argNames: ['Wb', 'Map', 'Url', 'Result'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly Url: string, readonly Result: Excel.XlXmlExportResult }) => void): void; + on(obj: Excel.Application, event: 'WorkbookAfterXmlImport', argNames: ['Wb', 'Map', 'IsRefresh', 'Result'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly IsRefresh: boolean, readonly Result: Excel.XlXmlImportResult }) => void): void; + on(obj: Excel.Application, event: 'WorkbookBeforeClose' | 'WorkbookBeforePrint', argNames: ['Wb', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'WorkbookBeforeSave', argNames: ['Wb', 'SaveAsUI', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly SaveAsUI: boolean, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'WorkbookBeforeXmlExport', argNames: ['Wb', 'Map', 'Url', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly Url: string, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'WorkbookBeforeXmlImport', argNames: ['Wb', 'Map', 'Url', 'IsRefresh', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly Url: string, readonly IsRefresh: boolean, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'WorkbookNewChart', argNames: ['Wb', 'Ch'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Ch: Excel.Chart }) => void): void; + on(obj: Excel.Application, event: 'WorkbookNewSheet', argNames: ['Wb', 'Sh'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Sh: Excel.Worksheet }) => void): void; + on(obj: Excel.Application, event: 'WorkbookPivotTableCloseConnection' | 'WorkbookPivotTableOpenConnection', argNames: ['Wb', 'Target'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Target: Excel.PivotTable }) => void): void; + on(obj: Excel.Application, event: 'WorkbookRowsetComplete', argNames: ['Wb', 'Description', 'Sheet', 'Success'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Description: string, readonly Sheet: string, readonly Success: boolean }) => void): void; + on(obj: Excel.Application, event: 'WorkbookSync', argNames: ['Wb', 'SyncEventType'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly SyncEventType: Office.MsoSyncEventType }) => void): void; + on(obj: Excel.Chart, event: 'BeforeDoubleClick', argNames: ['ElementID', 'Arg1', 'Arg2', 'Cancel'], handler: (this: Excel.Chart, parameter: { readonly ElementID: number, readonly Arg1: number, readonly Arg2: number, Cancel: boolean }) => void): void; on(obj: Excel.Chart, event: 'BeforeRightClick', argNames: ['Cancel'], handler: (this: Excel.Chart, parameter: { Cancel: boolean }) => void): void; - on( - obj: Excel.Chart, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Excel.Chart, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; - on( - obj: Excel.Chart, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Excel.Chart, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; + on(obj: Excel.Chart, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Excel.Chart, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; + on(obj: Excel.Chart, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Excel.Chart, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; on(obj: Excel.Chart, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Excel.Chart, parameter: { pctinfo: number }) => void): void; on(obj: Excel.Chart, event: 'Invoke', argNames: Excel.EventHelperTypes.Chart_Invoke_ArgNames, handler: (this: Excel.Chart, parameter: Excel.EventHelperTypes.Chart_Invoke_Parameter) => void): void; - on( - obj: Excel.Chart, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'x', 'y'], handler: ( - this: Excel.Chart, parameter: { readonly Button: number, readonly Shift: number, readonly x: number, readonly y: number }) => void): void; + on(obj: Excel.Chart, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'x', 'y'], handler: (this: Excel.Chart, parameter: { readonly Button: number, readonly Shift: number, readonly x: number, readonly y: number }) => void): void; on(obj: Excel.Chart, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Excel.Chart, parameter: { readonly riid: stdole.GUID, ppvObj: undefined }) => void): void; - on( - obj: Excel.Chart, event: 'Select', argNames: ['ElementID', 'Arg1', 'Arg2'], handler: ( - this: Excel.Chart, parameter: { readonly ElementID: number, readonly Arg1: number, readonly Arg2: number }) => void): void; - on( - obj: Excel.Chart, event: 'SeriesChange', argNames: ['SeriesIndex', 'PointIndex'], handler: ( - this: Excel.Chart, parameter: { readonly SeriesIndex: number, readonly PointIndex: number }) => void): void; - on( - obj: Excel.OLEObject, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Excel.OLEObject, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; - on( - obj: Excel.OLEObject, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Excel.OLEObject, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; + on(obj: Excel.Chart, event: 'Select', argNames: ['ElementID', 'Arg1', 'Arg2'], handler: (this: Excel.Chart, parameter: { readonly ElementID: number, readonly Arg1: number, readonly Arg2: number }) => void): void; + on(obj: Excel.Chart, event: 'SeriesChange', argNames: ['SeriesIndex', 'PointIndex'], handler: (this: Excel.Chart, parameter: { readonly SeriesIndex: number, readonly PointIndex: number }) => void): void; + on(obj: Excel.OLEObject, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Excel.OLEObject, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; + on(obj: Excel.OLEObject, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Excel.OLEObject, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; on(obj: Excel.OLEObject, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Excel.OLEObject, parameter: { pctinfo: number }) => void): void; - on( - obj: Excel.OLEObject, event: 'Invoke', argNames: Excel.EventHelperTypes.OLEObject_Invoke_ArgNames, handler: ( - this: Excel.OLEObject, parameter: Excel.EventHelperTypes.OLEObject_Invoke_Parameter) => void): void; + on(obj: Excel.OLEObject, event: 'Invoke', argNames: Excel.EventHelperTypes.OLEObject_Invoke_ArgNames, handler: (this: Excel.OLEObject, parameter: Excel.EventHelperTypes.OLEObject_Invoke_Parameter) => void): void; on(obj: Excel.OLEObject, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Excel.OLEObject, parameter: { readonly riid: stdole.GUID, ppvObj: undefined }) => void): void; on(obj: Excel.QueryTable, event: 'AfterRefresh', argNames: ['Success'], handler: (this: Excel.QueryTable, parameter: { readonly Success: boolean }) => void): void; on(obj: Excel.QueryTable, event: 'BeforeRefresh', argNames: ['Cancel'], handler: (this: Excel.QueryTable, parameter: { Cancel: boolean }) => void): void; - on( - obj: Excel.QueryTable, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Excel.QueryTable, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; - on( - obj: Excel.QueryTable, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Excel.QueryTable, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; + on(obj: Excel.QueryTable, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Excel.QueryTable, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; + on(obj: Excel.QueryTable, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Excel.QueryTable, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; on(obj: Excel.QueryTable, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Excel.QueryTable, parameter: { pctinfo: number }) => void): void; - on( - obj: Excel.QueryTable, event: 'Invoke', argNames: Excel.EventHelperTypes.QueryTable_Invoke_ArgNames, handler: ( - this: Excel.QueryTable, parameter: Excel.EventHelperTypes.QueryTable_Invoke_Parameter) => void): void; + on(obj: Excel.QueryTable, event: 'Invoke', argNames: Excel.EventHelperTypes.QueryTable_Invoke_ArgNames, handler: (this: Excel.QueryTable, parameter: Excel.EventHelperTypes.QueryTable_Invoke_Parameter) => void): void; on(obj: Excel.QueryTable, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Excel.QueryTable, parameter: { readonly riid: stdole.GUID, ppvObj: undefined }) => void): void; on(obj: Excel.Workbook, event: 'AfterSave', argNames: ['Success'], handler: (this: Excel.Workbook, parameter: { readonly Success: boolean }) => void): void; - on( - obj: Excel.Workbook, event: 'AfterXmlExport', argNames: ['Map', 'Url', 'Result'], handler: ( - this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly Url: string, readonly Result: Excel.XlXmlExportResult }) => void): void; - on( - obj: Excel.Workbook, event: 'AfterXmlImport', argNames: ['Map', 'IsRefresh', 'Result'], handler: ( - this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly IsRefresh: boolean, readonly Result: Excel.XlXmlImportResult }) => void): void; + on(obj: Excel.Workbook, event: 'AfterXmlExport', argNames: ['Map', 'Url', 'Result'], handler: (this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly Url: string, readonly Result: Excel.XlXmlExportResult }) => void): void; + on(obj: Excel.Workbook, event: 'AfterXmlImport', argNames: ['Map', 'IsRefresh', 'Result'], handler: (this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly IsRefresh: boolean, readonly Result: Excel.XlXmlImportResult }) => void): void; on(obj: Excel.Workbook, event: 'BeforeClose' | 'BeforePrint', argNames: ['Cancel'], handler: (this: Excel.Workbook, parameter: { Cancel: boolean }) => void): void; on(obj: Excel.Workbook, event: 'BeforeSave', argNames: ['SaveAsUI', 'Cancel'], handler: (this: Excel.Workbook, parameter: { readonly SaveAsUI: boolean, Cancel: boolean }) => void): void; - on( - obj: Excel.Workbook, event: 'BeforeXmlExport', argNames: ['Map', 'Url', 'Cancel'], handler: ( - this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly Url: string, Cancel: boolean }) => void): void; - on( - obj: Excel.Workbook, event: 'BeforeXmlImport', argNames: ['Map', 'Url', 'IsRefresh', 'Cancel'], handler: ( - this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly Url: string, readonly IsRefresh: boolean, Cancel: boolean }) => void): void; - on( - obj: Excel.Workbook, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Excel.Workbook, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; - on( - obj: Excel.Workbook, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Excel.Workbook, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; + on(obj: Excel.Workbook, event: 'BeforeXmlExport', argNames: ['Map', 'Url', 'Cancel'], handler: (this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly Url: string, Cancel: boolean }) => void): void; + on(obj: Excel.Workbook, event: 'BeforeXmlImport', argNames: ['Map', 'Url', 'IsRefresh', 'Cancel'], handler: (this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly Url: string, readonly IsRefresh: boolean, Cancel: boolean }) => void): void; + on(obj: Excel.Workbook, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Excel.Workbook, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; + on(obj: Excel.Workbook, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Excel.Workbook, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; on(obj: Excel.Workbook, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Excel.Workbook, parameter: { pctinfo: number }) => void): void; - on( - obj: Excel.Workbook, event: 'Invoke', argNames: Excel.EventHelperTypes.Workbook_Invoke_ArgNames, handler: ( - this: Excel.Workbook, parameter: Excel.EventHelperTypes.Workbook_Invoke_Parameter) => void): void; + on(obj: Excel.Workbook, event: 'Invoke', argNames: Excel.EventHelperTypes.Workbook_Invoke_ArgNames, handler: (this: Excel.Workbook, parameter: Excel.EventHelperTypes.Workbook_Invoke_Parameter) => void): void; on(obj: Excel.Workbook, event: 'NewChart', argNames: ['Ch'], handler: (this: Excel.Workbook, parameter: { readonly Ch: Excel.Chart }) => void): void; - on(obj: Excel.Workbook, event: 'NewSheet' | 'SheetActivate' | 'SheetCalculate' | 'SheetDeactivate', argNames: ['Sh'], handler: ( - this: Excel.Workbook, parameter: { readonly Sh: any }) => void): void; - on( - obj: Excel.Workbook, event: 'PivotTableCloseConnection' | 'PivotTableOpenConnection', argNames: ['Target'], handler: ( - this: Excel.Workbook, parameter: { readonly Target: Excel.PivotTable }) => void): void; + on(obj: Excel.Workbook, event: 'NewSheet' | 'SheetActivate' | 'SheetCalculate' | 'SheetDeactivate', argNames: ['Sh'], handler: (this: Excel.Workbook, parameter: { readonly Sh: Excel.Chart | Excel.Worksheet }) => void): void; + on(obj: Excel.Workbook, event: 'PivotTableCloseConnection' | 'PivotTableOpenConnection', argNames: ['Target'], handler: (this: Excel.Workbook, parameter: { readonly Target: Excel.PivotTable }) => void): void; on(obj: Excel.Workbook, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Excel.Workbook, parameter: { readonly riid: stdole.GUID, ppvObj: undefined }) => void): void; - on( - obj: Excel.Workbook, event: 'RowsetComplete', argNames: ['Description', 'Sheet', 'Success'], handler: ( - this: Excel.Workbook, parameter: { readonly Description: string, readonly Sheet: string, readonly Success: boolean }) => void): void; - on( - obj: Excel.Workbook, event: 'SheetBeforeDoubleClick' | 'SheetBeforeRightClick', argNames: ['Sh', 'Target', 'Cancel'], handler: ( - this: Excel.Workbook, parameter: { readonly Sh: any, readonly Target: Excel.Range, Cancel: boolean }) => void): void; - on( - obj: Excel.Workbook, event: 'SheetChange' | 'SheetSelectionChange', argNames: ['Sh', 'Target'], handler: ( - this: Excel.Workbook, parameter: { readonly Sh: any, readonly Target: Excel.Range }) => void): void; - on(obj: Excel.Workbook, event: 'SheetFollowHyperlink', argNames: ['Sh', 'Target'], handler: ( - this: Excel.Workbook, parameter: { readonly Sh: any, readonly Target: Excel.Hyperlink }) => void): void; - on( - obj: Excel.Workbook, event: 'SheetPivotTableAfterValueChange', argNames: ['Sh', 'TargetPivotTable', 'TargetRange'], handler: ( - this: Excel.Workbook, parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly TargetRange: Excel.Range }) => void): void; - on( - obj: Excel.Workbook, event: 'SheetPivotTableBeforeAllocateChanges' | 'SheetPivotTableBeforeCommitChanges', - argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd', 'Cancel'], handler: ( - this: Excel.Workbook, - parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number, Cancel: boolean }) => void): void; - on( - obj: Excel.Workbook, event: 'SheetPivotTableBeforeDiscardChanges', argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd'], handler: ( - this: Excel.Workbook, parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number }) => void): void; - on( - obj: Excel.Workbook, event: 'SheetPivotTableChangeSync' | 'SheetPivotTableUpdate', argNames: ['Sh', 'Target'], handler: ( - this: Excel.Workbook, parameter: { readonly Sh: any, readonly Target: Excel.PivotTable }) => void): void; + on(obj: Excel.Workbook, event: 'RowsetComplete', argNames: ['Description', 'Sheet', 'Success'], handler: (this: Excel.Workbook, parameter: { readonly Description: string, readonly Sheet: string, readonly Success: boolean }) => void): void; + on(obj: Excel.Workbook, event: 'SheetBeforeDoubleClick' | 'SheetBeforeRightClick', argNames: ['Sh', 'Target', 'Cancel'], handler: (this: Excel.Workbook, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.Range, Cancel: boolean }) => void): void; + on(obj: Excel.Workbook, event: 'SheetChange' | 'SheetSelectionChange', argNames: ['Sh', 'Target'], handler: (this: Excel.Workbook, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.Range }) => void): void; + on(obj: Excel.Workbook, event: 'SheetFollowHyperlink', argNames: ['Sh', 'Target'], handler: (this: Excel.Workbook, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.Hyperlink }) => void): void; + on(obj: Excel.Workbook, event: 'SheetPivotTableAfterValueChange', argNames: ['Sh', 'TargetPivotTable', 'TargetRange'], handler: (this: Excel.Workbook, parameter: { readonly Sh: Excel.Worksheet, readonly TargetPivotTable: Excel.PivotTable, readonly TargetRange: Excel.Range }) => void): void; + on(obj: Excel.Workbook, event: 'SheetPivotTableBeforeAllocateChanges' | 'SheetPivotTableBeforeCommitChanges', argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd', 'Cancel'], handler: (this: Excel.Workbook, parameter: { readonly Sh: Excel.Worksheet, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number, Cancel: boolean }) => void): void; + on(obj: Excel.Workbook, event: 'SheetPivotTableBeforeDiscardChanges', argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd'], handler: (this: Excel.Workbook, parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number }) => void): void; + on(obj: Excel.Workbook, event: 'SheetPivotTableChangeSync' | 'SheetPivotTableUpdate', argNames: ['Sh', 'Target'], handler: (this: Excel.Workbook, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.PivotTable }) => void): void; on(obj: Excel.Workbook, event: 'Sync', argNames: ['SyncEventType'], handler: (this: Excel.Workbook, parameter: { readonly SyncEventType: Office.MsoSyncEventType }) => void): void; on(obj: Excel.Workbook, event: 'WindowActivate' | 'WindowDeactivate' | 'WindowResize', argNames: ['Wn'], handler: (this: Excel.Workbook, parameter: { readonly Wn: Excel.Window }) => void): void; - on( - obj: Excel.Worksheet, event: 'BeforeDoubleClick' | 'BeforeRightClick', argNames: ['Target', 'Cancel'], handler: ( - this: Excel.Worksheet, parameter: { readonly Target: Excel.Range, Cancel: boolean }) => void): void; + on(obj: Excel.Worksheet, event: 'BeforeDoubleClick' | 'BeforeRightClick', argNames: ['Target', 'Cancel'], handler: (this: Excel.Worksheet, parameter: { readonly Target: Excel.Range, Cancel: boolean }) => void): void; on(obj: Excel.Worksheet, event: 'Change' | 'SelectionChange', argNames: ['Target'], handler: (this: Excel.Worksheet, parameter: { readonly Target: Excel.Range }) => void): void; on(obj: Excel.Worksheet, event: 'FollowHyperlink', argNames: ['Target'], handler: (this: Excel.Worksheet, parameter: { readonly Target: Excel.Hyperlink }) => void): void; - on( - obj: Excel.Worksheet, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Excel.Worksheet, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; - on( - obj: Excel.Worksheet, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Excel.Worksheet, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; + on(obj: Excel.Worksheet, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Excel.Worksheet, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; + on(obj: Excel.Worksheet, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Excel.Worksheet, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; on(obj: Excel.Worksheet, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Excel.Worksheet, parameter: { pctinfo: number }) => void): void; - on( - obj: Excel.Worksheet, event: 'Invoke', argNames: Excel.EventHelperTypes.Worksheet_Invoke_ArgNames, handler: ( - this: Excel.Worksheet, parameter: Excel.EventHelperTypes.Worksheet_Invoke_Parameter) => void): void; - on( - obj: Excel.Worksheet, event: 'PivotTableAfterValueChange', argNames: ['TargetPivotTable', 'TargetRange'], handler: ( - this: Excel.Worksheet, parameter: { readonly TargetPivotTable: Excel.PivotTable, readonly TargetRange: Excel.Range }) => void): void; - on( - obj: Excel.Worksheet, event: 'PivotTableBeforeAllocateChanges' | 'PivotTableBeforeCommitChanges', - argNames: ['TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd', 'Cancel'], handler: ( - this: Excel.Worksheet, parameter: { readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number, Cancel: boolean }) => void): void; - on( - obj: Excel.Worksheet, event: 'PivotTableBeforeDiscardChanges', argNames: ['TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd'], - handler: (this: Excel.Worksheet, parameter: { readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number }) => void): void; - on(obj: Excel.Worksheet, event: 'PivotTableChangeSync' | 'PivotTableUpdate', argNames: ['Target'], handler: ( - this: Excel.Worksheet, parameter: { readonly Target: Excel.PivotTable }) => void): void; + on(obj: Excel.Worksheet, event: 'Invoke', argNames: Excel.EventHelperTypes.Worksheet_Invoke_ArgNames, handler: (this: Excel.Worksheet, parameter: Excel.EventHelperTypes.Worksheet_Invoke_Parameter) => void): void; + on(obj: Excel.Worksheet, event: 'PivotTableAfterValueChange', argNames: ['TargetPivotTable', 'TargetRange'], handler: (this: Excel.Worksheet, parameter: { readonly TargetPivotTable: Excel.PivotTable, readonly TargetRange: Excel.Range }) => void): void; + on(obj: Excel.Worksheet, event: 'PivotTableBeforeAllocateChanges' | 'PivotTableBeforeCommitChanges', argNames: ['TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd', 'Cancel'], handler: (this: Excel.Worksheet, parameter: { readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number, Cancel: boolean }) => void): void; + on(obj: Excel.Worksheet, event: 'PivotTableBeforeDiscardChanges', argNames: ['TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd'], handler: (this: Excel.Worksheet, parameter: { readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number }) => void): void; + on(obj: Excel.Worksheet, event: 'PivotTableChangeSync' | 'PivotTableUpdate', argNames: ['Target'], handler: (this: Excel.Worksheet, parameter: { readonly Target: Excel.PivotTable }) => void): void; on(obj: Excel.Worksheet, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Excel.Worksheet, parameter: { readonly riid: stdole.GUID, ppvObj: undefined }) => void): void; on(obj: Excel.Application, event: 'AddRef' | 'AfterCalculate' | 'Release', handler: (this: Excel.Application, parameter: {}) => void): void; on(obj: Excel.Chart, event: 'Activate' | 'AddRef' | 'Calculate' | 'Deactivate' | 'DragOver' | 'DragPlot' | 'Release' | 'Resize', handler: (this: Excel.Chart, parameter: {}) => void): void; @@ -9719,10 +10159,13 @@ interface ActiveXObject { on(obj: Excel.QueryTable, event: 'AddRef' | 'Release', handler: (this: Excel.QueryTable, parameter: {}) => void): void; on(obj: Excel.Workbook, event: 'Activate' | 'AddinInstall' | 'AddinUninstall' | 'AddRef' | 'Deactivate' | 'Open' | 'Release', handler: (this: Excel.Workbook, parameter: {}) => void): void; on(obj: Excel.Worksheet, event: 'Activate' | 'AddRef' | 'Calculate' | 'Deactivate' | 'Release', handler: (this: Excel.Worksheet, parameter: {}) => void): void; - set(obj: Excel.Chart, propertyName: 'HasAxis', parameterTypes: [any, any], newValue: any): void; - set(obj: Excel.Workbook, propertyName: 'Colors', parameterTypes: [any], newValue: any): void; + set(obj: Excel.Chart, propertyName: 'HasAxis', parameterTypes: [Excel.XlAxisType | undefined, Excel.XlAxisGroup | undefined], newValue: boolean): void; + set(obj: Excel.ControlFormat, propertyName: 'List', parameterTypes: [number], newValue: string): void; + set(obj: Excel.ControlFormat, propertyName: 'List', parameterTypes: never[], newValue: SafeArray): void; + set(obj: Excel.PageSetup, propertyName: 'PrintQuality', parameterTypes: [number], newValue: number): void; + set(obj: Excel.Workbook, propertyName: 'Colors', parameterTypes: [number], newValue: number): void; set(obj: Excel.Range, propertyName: 'Value', parameterTypes: [Excel.XlRangeValueDataType], newValue: any): void; - set(obj: Excel.Range, propertyName: 'Value', newValue: any): void; // because Value is defined on the type as a method, not a property + set(obj: Excel.PivotField, propertyName: 'Subtotals', parameterTypes: [Excel.PivotFieldSubtotal], newValue: boolean): void; } interface ActiveXObjectNameMap { @@ -9730,57 +10173,3 @@ interface ActiveXObjectNameMap { 'Excel.Chart': Excel.Chart; 'Excel.Sheet': Excel.Worksheet; } - -interface EnumeratorConstructor { - new(col: Excel.Range): Enumerator; - - new(col: Excel.GroupShapes | Excel.ShapeRange | Excel.Shapes): Enumerator; - new(col: Excel.HPageBreaks): Enumerator; - new(col: Excel.Hyperlinks): Enumerator; - new(col: Excel.IconSet): Enumerator; - new(col: Excel.ListColumns): Enumerator; - new(col: Excel.ListObjects): Enumerator; - new(col: Excel.ListRows): Enumerator; - new(col: Excel.MenuBars): Enumerator; - new(col: Excel.Menus): Enumerator; - new(col: Excel.Names): Enumerator; - new(col: Excel.ODBCErrors): Enumerator; - new(col: Excel.OLEDBErrors): Enumerator; - new(col: Excel.Pages): Enumerator; - new(col: Excel.Parameters): Enumerator; - new(col: Excel.PivotCaches): Enumerator; - new(col: Excel.PivotFilters): Enumerator; - new(col: Excel.PivotFormulas): Enumerator; - new(col: Excel.PivotLineCells): Enumerator; - new(col: Excel.PivotLines): Enumerator; - new(col: Excel.PivotTableChangeList): Enumerator; - new(col: Excel.ProtectedViewWindows): Enumerator; - new(col: Excel.PublishObjects): Enumerator; - new(col: Excel.QueryTables): Enumerator; - new(col: Excel.RecentFiles): Enumerator; - new(col: Excel.Sheets): Enumerator; - new(col: Excel.ShapeNodes): Enumerator; - new(col: Excel.SlicerCacheLevels): Enumerator; - new(col: Excel.SlicerCaches): Enumerator; - new(col: Excel.SlicerItems): Enumerator; - new(col: Excel.SlicerPivotTables): Enumerator; - new(col: Excel.Slicers): Enumerator; - new(col: Excel.SmartTagActions): Enumerator; - new(col: Excel.SmartTagRecognizers): Enumerator; - new(col: Excel.SortFields): Enumerator; - new(col: Excel.SparklineGroup): Enumerator; - new(col: Excel.SparklineGroups): Enumerator; - new(col: Excel.Styles): Enumerator; - new(col: Excel.TableStyleElements): Enumerator; - new(col: Excel.TableStyles): Enumerator; - new(col: Excel.ToolbarButtons): Enumerator; - new(col: Excel.Toolbars): Enumerator; - new(col: Excel.UserAccessList): Enumerator; - new(col: Excel.VPageBreaks): Enumerator; - new(col: Excel.Watches): Enumerator; - new(col: Excel.Windows): Enumerator; - new(col: Excel.Workbooks): Enumerator; - new(col: Excel.XmlMaps): Enumerator; - new(col: Excel.XmlNamespaces): Enumerator; - new(col: Excel.XmlSchemas): Enumerator; -} diff --git a/types/activex-excel/tslint.json b/types/activex-excel/tslint.json index f93cf8562a..7b89accc6d 100644 --- a/types/activex-excel/tslint.json +++ b/types/activex-excel/tslint.json @@ -1,3 +1,7 @@ { - "extends": "dtslint/dt.json" + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false, + "max-line-length": false + } } diff --git a/types/activex-interop/index.d.ts b/types/activex-interop/index.d.ts index 3bb13a5351..d59b315fcb 100644 --- a/types/activex-interop/index.d.ts +++ b/types/activex-interop/index.d.ts @@ -51,7 +51,6 @@ interface Enumerator { interface EnumeratorConstructor { new (collection: { Item(index: any): T }): Enumerator; - // new (collection: any): Enumerator; } declare var Enumerator: EnumeratorConstructor; diff --git a/types/activex-office/index.d.ts b/types/activex-office/index.d.ts index 18a7dd285d..6df01eb16e 100644 --- a/types/activex-office/index.d.ts +++ b/types/activex-office/index.d.ts @@ -10,6 +10,8 @@ declare namespace Office { type MsoRGBType = number; + type ByteArray = SafeArray; + const enum BackstageGroupStyle { BackstageGroupStyleError = 2, BackstageGroupStyleNormal = 0, diff --git a/types/activex-outlook/index.d.ts b/types/activex-outlook/index.d.ts index 2b316d80bd..4789c10e19 100644 --- a/types/activex-outlook/index.d.ts +++ b/types/activex-outlook/index.d.ts @@ -5886,7 +5886,3 @@ interface EnumeratorConstructor { new(col: Outlook.Reminders): Enumerator; new(col: Outlook.Views): Enumerator; } - -interface SafeArray { - _brand: SafeArray; -} diff --git a/types/adone/index.d.ts b/types/adone/index.d.ts index c6add2eeea..521bdf6e03 100644 --- a/types/adone/index.d.ts +++ b/types/adone/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/ciferox/adone // Definitions by: am , Maximus // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.6 /// /// diff --git a/types/agenda/agenda-tests.ts b/types/agenda/agenda-tests.ts index a7031d2ef8..8e0e8b9fb6 100644 --- a/types/agenda/agenda-tests.ts +++ b/types/agenda/agenda-tests.ts @@ -3,107 +3,104 @@ import { Db, Server } from "mongodb"; var mongoConnectionString = "mongodb://127.0.0.1/agenda"; -var agenda = new Agenda({ db: { address: mongoConnectionString } }); +(async () => { + var agenda = new Agenda({ db: { address: mongoConnectionString } }); -agenda.define<{ foo: Error }>('delete old users', (job, done) => { - done(job.attrs.data.foo) + agenda.define<{ foo: Error }>('delete old users', (job, done) => { + done(job.attrs.data.foo) + }); + + agenda.on('ready', () => { + agenda.every('3 minutes', 'delete old users'); + + // Alternatively, you could also do: + agenda.every('*/3 * * * *', 'delete old users'); + + agenda.start(); + }); + + agenda.define('send email report', { priority: 'high', concurrency: 10 }, (job, done) => { + }); + + agenda.on('ready', () => { + agenda.schedule('in 20 minutes', 'send email report', { to: 'admin@example.com' }); + agenda.start(); + }); + + agenda.on('ready', () => { + var weeklyReport = agenda.create('send email report', { to: 'another-guy@example.com' }); + weeklyReport.repeatEvery('1 week').save(); + agenda.start(); + }); + + var agenda = new Agenda({ processEvery: '30 seconds' }); + + agenda.defaultConcurrency(5); + + var agenda = new Agenda({ defaultConcurrency: 5 }); + + agenda.lockLimit(0); + + var agenda = new Agenda({ lockLimit: 0 }); + + agenda.defaultLockLimit(0); + + var agenda = new Agenda({ defaultLockLimit: 0 }); + + agenda.defaultLockLifetime(10000); + + var agenda = new Agenda({ defaultLockLifetime: 10000 }); + + agenda.define('some long running job', function (job, done) { + done(); + }); + + agenda.every('15 minutes', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']); + + agenda.schedule('tomorrow at noon', 'printAnalyticsReport', { userCount: 100 }); + + agenda.schedule('tomorrow at noon', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']); + + agenda.now('do the hokey pokey'); + + var job = agenda.create<{ userCount: number }>('printAnalyticsReport', { userCount: 100 }); + await job.save(); + + const jobs = await agenda.jobs({ name: 'printAnalyticsReport' }); + jobs.forEach((job) => { + job.save(); + }); + + let numRemoved = await agenda.cancel({ name: 'printAnalyticsReport' }); + + numRemoved = await agenda.purge(); + + await agenda.stop(); + + await job.agenda.now('do the hokey pokey'); + + job.repeatEvery('10 minutes'); + + job.repeatEvery('10 minutes', { timezone: 'America/New_York' }); + + job.repeatEvery('10 minutes', { skipImmediate: true }); + + job.repeatAt('3:30pm'); + + job.schedule('tomorrow at 6pm'); + + job.priority('low'); + job.priority(10); + + job.unique({ 'data.type': 'active', 'data.userId': '123' }); + job.fail('insuficient disk space'); + job.fail(new Error('insufficient disk space')); + const job2 = await job.run(); + await job.remove(); }); -agenda.on('ready', () => { - agenda.every('3 minutes', 'delete old users'); - - // Alternatively, you could also do: - agenda.every('*/3 * * * *', 'delete old users'); - - agenda.start(); -}); - -agenda.define('send email report', { priority: 'high', concurrency: 10 }, (job, done) => { -}); - -agenda.on('ready', () => { - agenda.schedule('in 20 minutes', 'send email report', { to: 'admin@example.com' }); - agenda.start(); -}); - -agenda.on('ready', () => { - var weeklyReport = agenda.create('send email report', { to: 'another-guy@example.com' }); - weeklyReport.repeatEvery('1 week').save(); - agenda.start(); -}); - -var agenda = new Agenda({ processEvery: '30 seconds' }); - -agenda.defaultConcurrency(5); - -var agenda = new Agenda({ defaultConcurrency: 5 }); - -agenda.lockLimit(0); - -var agenda = new Agenda({ lockLimit: 0 }); - -agenda.defaultLockLimit(0); - -var agenda = new Agenda({ defaultLockLimit: 0 }); - -agenda.defaultLockLifetime(10000); - -var agenda = new Agenda({ defaultLockLifetime: 10000 }); - -agenda.define('some long running job', function(job, done) { - done(); -}); - -agenda.every('15 minutes', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']); - -agenda.schedule('tomorrow at noon', 'printAnalyticsReport', { userCount: 100 }); - -agenda.schedule('tomorrow at noon', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']); - -agenda.now('do the hokey pokey'); - -var job = agenda.create<{ userCount: number }>('printAnalyticsReport', { userCount: 100 }); -job.save(function(err) { - console.log("Job successfully saved"); -}); - -agenda.jobs({ name: 'printAnalyticsReport' }, function(err, jobs) { - // Work with jobs (see below) -}); - -agenda.cancel({ name: 'printAnalyticsReport' }, function(err, numRemoved) { -}); - -agenda.purge(function(err, numRemoved) { -}); - -agenda.stop(function() { - process.exit(0); -}); - -job.agenda.now('do the hokey pokey'); - -job.repeatEvery('10 minutes'); - -job.repeatAt('3:30pm'); - -job.schedule('tomorrow at 6pm'); - -job.priority('low'); -job.priority(10); - -job.unique({ 'data.type': 'active', 'data.userId': '123' }); -job.fail('insuficient disk space'); -job.fail(new Error('insufficient disk space')); -job.run(function(err, job) { - console.log("I don't know why you would need to do this..."); -}); -job.remove(function(err) { - if (!err) console.log("Successfully removed job from collection"); -}) - class ExtendedAgenda extends Agenda { - async start() { } + async start() { } } const extendedAgenda: ExtendedAgenda = new ExtendedAgenda() diff --git a/types/agenda/index.d.ts b/types/agenda/index.d.ts index b29158983d..206d40daf3 100644 --- a/types/agenda/index.d.ts +++ b/types/agenda/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Agenda v1.0.3 +// Type definitions for Agenda v2.0.0 // Project: https://github.com/agenda/agenda // Definitions by: Meir Gottlieb // Jeff Principe @@ -95,16 +95,14 @@ declare class Agenda extends EventEmitter { /** * Find all Jobs matching `query` and pass same back in cb(). * @param query - * @param cb */ - jobs(query: any, cb: ResultCallback[]>): void; + jobs(query: any): Promise[]>; /** * Removes all jobs in the database without defined behaviors. Useful if you change a definition name and want * to remove old jobs. - * @param cb Called with the number of jobs removed. */ - purge(cb?: ResultCallback): void; + purge(): Promise; /** * Defines a job with the name of jobName. When a job of job name gets run, it will be passed to fn(job, done). @@ -123,46 +121,41 @@ declare class Agenda extends EventEmitter { * @param names The name or names of the job(s) to run. * @param data An optional argument that will be passed to the processing function under job.attrs.data. * @param options An optional argument that will be passed to job.repeatEvery. - * @param cb An optional callback function which will be called when the job has been persisted in the database. */ - every(interval: number | string, names: string, data?: T, options?: any, cb?: ResultCallback>): Agenda.Job; - every(interval: number | string, names: string[], data?: T, options?: any, cb?: ResultCallback[]>): Agenda.Job[]; + every(interval: number | string, names: string, data?: T, options?: any): Promise>; + every(interval: number | string, names: string[], data?: T, options?: any): Promise[]>; /** * Schedules a job to run name once at a given time. * @param when A Date or a String such as tomorrow at 5pm. * @param names The name or names of the job(s) to run. * @param data An optional argument that will be passed to the processing function under job.attrs.data. - * @param cb An optional callback function which will be called when the job has been persisted in the database. */ - schedule(when: Date | string, names: string, data?: T, cb?: ResultCallback>): Agenda.Job; - schedule(when: Date | string, names: string[], data?: T, cb?: ResultCallback[]>): Agenda.Job[]; + schedule(when: Date | string, names: string, data?: T): Promise>; + schedule(when: Date | string, names: string[], data?: T): Promise[]>; /** * Schedules a job to run name once immediately. * @param name The name of the job to run. * @param data An optional argument that will be passed to the processing function under job.attrs.data. - * @param cb An optional callback function which will be called when the job has been persisted in the database. */ - now(name: string, data?: T, cb?: ResultCallback>): Agenda.Job; + now(name: string, data?: T): Promise>; /** * Cancels any jobs matching the passed mongodb-native query, and removes them from the database. * @param query Mongodb native query. - * @param cb Called with the number of jobs removed. */ - cancel(query: any, cb?: ResultCallback): void; + cancel(query: any): Promise; /** * Starts the job queue processing, checking processEvery time to see if there are new jobs. */ - start(): void; + start(): Promise; /** * Stops the job queue processing. Unlocks currently running jobs. - * @param cb Called after the job processing queue shuts down and unlocks all jobs. */ - stop(cb: Callback): void; + stop(): Promise; } declare namespace Agenda { @@ -350,57 +343,57 @@ declare namespace Agenda { /** * Specifies an interval on which the job should repeat. * @param interval A human-readable format String, a cron format String, or a Number. - * @param options An optional argument that can include a timezone field. The timezone should be a string as - * accepted by moment-timezone and is considered when using an interval in the cron string format. + * @param options An optional argument that can include a timezone field or skipImmediate field. + * The timezone should be a string as accepted by moment-timezone and is considered when using an interval in the cron string format. + * Setting skipImmediate as true will skip the immediate run. The first run will occur only in configured interval. */ - repeatEvery(interval: string | number, options?: { timezone?: string }): Job + repeatEvery(interval: string | number, options?: { timezone?: string, skipImmediate?: boolean }): this /** * Specifies a time when the job should repeat. [Possible values](https://github.com/matthewmueller/date#examples). * @param time */ - repeatAt(time: string): Job + repeatAt(time: string): this /** * Disables the job. */ - disable(): Job; + disable(): this; /** * Enables the job. */ - enable(): Job; + enable(): this; /** * Ensure that only one instance of this job exists with the specified properties * @param value The properties associated with the job that must be unqiue. * @param opts */ - unique(value: any, opts?: { insertOnly?: boolean }): Job; + unique(value: any, opts?: { insertOnly?: boolean }): this; /** * Specifies the next time at which the job should run. * @param time The next time at which the job should run. */ - schedule(time: string | Date): Job; + schedule(time: string | Date): this; /** * Specifies the priority weighting of the job. * @param value The priority of the job (lowest|low|normal|high|highest|number). */ - priority(value: string | number): Job; + priority(value: string | number): this; /** * Sets job.attrs.failedAt to now, and sets job.attrs.failReason to reason. * @param reason A message or Error object that indicates why the job failed. */ - fail(reason: string | Error): Job; + fail(reason: string | Error): this; /** * Runs the given job and calls callback(err, job) upon completion. Normally you never need to call this manually - * @param cb Called when the job is completed. */ - run(cb?: ResultCallback>): Job; + run(): Promise; /** * Returns true if the job is running; otherwise, returns false. @@ -409,27 +402,24 @@ declare namespace Agenda { /** * Saves the job into the database. - * @param cb Called when the job is saved. */ - save(cb?: ResultCallback>): Job; + save(): Promise; /** * Removes the job from the database and cancels the job. - * @param cb Called after the job has beeb removed from the database. */ - remove(cb?: Callback): void; + remove(): Promise; /** * Resets the lock on the job. Useful to indicate that the job hasn't timed out when you have very long running * jobs. - * @param cb Called after the job has been saved to the database. */ - touch(cb?: Callback): void; + touch(): Promise; /** * Calculates next time the job should run */ - computeNextRunAt(): Job; + computeNextRunAt(): this; } interface JobOptions { diff --git a/types/agent-base/agent-base-tests.ts b/types/agent-base/agent-base-tests.ts new file mode 100644 index 0000000000..116ff8af96 --- /dev/null +++ b/types/agent-base/agent-base-tests.ts @@ -0,0 +1,23 @@ +import agent = require('agent-base'); + +agent(); // $ExpectType Agent +agent({ timeout: 1000 }); // $ExpectType Agent + +agent((req, opts) => {}); // $ExpectType Agent +agent((req, opts) => {}, { timeout: 1000 }); // $ExpectType Agent + +agent(async (req, opts) => {}); // $ExpectType Agent +agent(async (req, opts) => {}, { timeout: 1000 }); // $ExpectType Agent + +agent(0); // $ExpectError +agent(1); // $ExpectError +agent(''); // $ExpectError +agent(true); // $ExpectError +agent(null); // $ExpectError + +agent((req, opts) => {}, 0); // $ExpectError +agent((req, opts) => {}, 1); // $ExpectError +agent((req, opts) => {}, ''); // $ExpectError +agent((req, opts) => {}, true); // $ExpectError +agent((req, opts) => {}, null); // $ExpectError +agent((req, opts) => {}, (req, opts) => {}); // $ExpectError diff --git a/types/agent-base/index.d.ts b/types/agent-base/index.d.ts new file mode 100644 index 0000000000..0b1e4d3018 --- /dev/null +++ b/types/agent-base/index.d.ts @@ -0,0 +1,44 @@ +// Type definitions for agent-base 4.2 +// Project: https://github.com/TooTallNate/node-agent-base#readme +// Definitions by: Christopher Quadflieg +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +import { EventEmitter } from 'events'; + +declare namespace Agent { + type AgentCallback = ( + req?: any, + opts?: { + secureEndpoint: boolean; + } + ) => void; + + interface AgentOptions { + timeout?: number; + host?: string; + port?: number; + [key: string]: any; + } + + interface Agent extends EventEmitter { + _promisifiedCallback: boolean; + timeout: number | null; + options?: AgentOptions; + callback: AgentCallback; + addRequest: (req?: any, opts?: any) => void; + freeSocket: (socket: any, opts: any) => void; + } +} + +/** + * Base `http.Agent` implementation. + * No pooling/keep-alive is implemented by default. + */ +declare function Agent(opts?: Agent.AgentOptions): Agent.Agent; +declare function Agent( + callback: Agent.AgentCallback, + opts?: Agent.AgentOptions +): Agent.Agent; + +export = Agent; diff --git a/types/agent-base/tsconfig.json b/types/agent-base/tsconfig.json new file mode 100644 index 0000000000..dc6db21f70 --- /dev/null +++ b/types/agent-base/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "agent-base-tests.ts" + ] +} diff --git a/types/meteor-univserse-i18n/tslint.json b/types/agent-base/tslint.json similarity index 100% rename from types/meteor-univserse-i18n/tslint.json rename to types/agent-base/tslint.json diff --git a/types/almost-equal/almost-equal-tests.ts b/types/almost-equal/almost-equal-tests.ts new file mode 100644 index 0000000000..398017e7ec --- /dev/null +++ b/types/almost-equal/almost-equal-tests.ts @@ -0,0 +1,7 @@ +import * as almostEqual from 'almost-equal'; + +const res1 = almostEqual(1.999999, 2.0); + +const res2 = almostEqual(1.999999, 2.0, almostEqual.DBL_EPSILON); + +const res3 = almostEqual(1.999999, 2.0, almostEqual.FLT_EPSILON, almostEqual.FLT_EPSILON); diff --git a/types/almost-equal/index.d.ts b/types/almost-equal/index.d.ts new file mode 100644 index 0000000000..cacbaa4886 --- /dev/null +++ b/types/almost-equal/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for almost-equal 1.1 +// Project: https://github.com/mikolalysenko/almost-equal#readme +// Definitions by: Curtis Maddalozzo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function almostEqual(value: number, other: number, absoluteTolerance?: number, relativeTolerance?: number): boolean; +declare namespace almostEqual { + const FLT_EPSILON: number; + const DBL_EPSILON: number; +} +export = almostEqual; diff --git a/types/meteor-univserse-i18n/tsconfig.json b/types/almost-equal/tsconfig.json similarity index 91% rename from types/meteor-univserse-i18n/tsconfig.json rename to types/almost-equal/tsconfig.json index 7beab3bd30..a4a61b092b 100644 --- a/types/meteor-univserse-i18n/tsconfig.json +++ b/types/almost-equal/tsconfig.json @@ -7,17 +7,17 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], + "strictFunctionTypes": true, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, "files": [ "index.d.ts", - "meteor-univserse-i18n-tests.ts" + "almost-equal-tests.ts" ] } diff --git a/types/react-svg/tslint.json b/types/almost-equal/tslint.json similarity index 100% rename from types/react-svg/tslint.json rename to types/almost-equal/tslint.json diff --git a/types/alt/index.d.ts b/types/alt/index.d.ts index 0c69e4020a..9094642e70 100644 --- a/types/alt/index.d.ts +++ b/types/alt/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/goatslacker/alt // Definitions by: Michael Shearer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// diff --git a/types/amp/amp-tests.ts b/types/amp/amp-tests.ts index 1e17bc8507..983c1f993b 100644 --- a/types/amp/amp-tests.ts +++ b/types/amp/amp-tests.ts @@ -32,7 +32,7 @@ new Stream({ highWaterMark: 1, decodeStrings: true, objectMode: true, - destroy: (error?: Error) => { + destroy: (error: Error | null) => { return 'handle error'; }, final: (callback: (error?: Error) => void) => { 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..6eae738a3c --- /dev/null +++ b/types/amqp-connection-manager/amqp-connection-manager-tests.ts @@ -0,0 +1,25 @@ +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); + +channelWrapper.sendToQueue("foo", Buffer.from("bar")) + .catch((error: Error): void => { + // nothing + }); diff --git a/types/amqp-connection-manager/index.d.ts b/types/amqp-connection-manager/index.d.ts new file mode 100644 index 0000000000..ab69aadeb1 --- /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): Promise; + + /** + * @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): Promise; + + /** + * @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/fork-ts-checker-webpack-plugin/tsconfig.json b/types/amqp-connection-manager/tsconfig.json similarity index 90% rename from types/fork-ts-checker-webpack-plugin/tsconfig.json rename to types/amqp-connection-manager/tsconfig.json index cfd6ee81db..d707bd5a65 100644 --- a/types/fork-ts-checker-webpack-plugin/tsconfig.json +++ b/types/amqp-connection-manager/tsconfig.json @@ -6,8 +6,8 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": true, "strictFunctionTypes": true, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "fork-ts-checker-webpack-plugin-tests.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-desktop-notification/index.d.ts b/types/angular-desktop-notification/index.d.ts index 6281396b66..2e017da49b 100644 --- a/types/angular-desktop-notification/index.d.ts +++ b/types/angular-desktop-notification/index.d.ts @@ -22,7 +22,7 @@ declare module 'angular' { * This is an experimental technology * Ref: https://developer.mozilla.org/en-US/docs/Web/API/Notification/badge */ - badge?: USVString; + badge?: string; /** * The data read-only property of the Notification interface returns a structured clone of the notification's data, @@ -40,7 +40,7 @@ declare module 'angular' { * Note: This feature is available in Web Workers. * Ref: https://developer.mozilla.org/en-US/docs/Web/API/Notification/image */ - image?: USVString; + image?: string; /** * The renotify read-only property of the Notification interface specifies whether the user should be notified after a diff --git a/types/angular-gettext/angular-gettext-tests.ts b/types/angular-gettext/angular-gettext-tests.ts index 766b16a963..1b1d5b6342 100644 --- a/types/angular-gettext/angular-gettext-tests.ts +++ b/types/angular-gettext/angular-gettext-tests.ts @@ -24,6 +24,8 @@ angular.module("myApp").controller("helloController", function (gettextCatalog: angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) { var myString2: string = gettextCatalog.getPlural(3, "Bird", "Birds"); + var myStringWithScope: string = gettextCatalog.getPlural(4, "{{color}} Bird", "{{color}} Birds", {color: 'Blue'}); + var myStringWithContext: string = gettextCatalog.getPlural(5, "pick", "picks", null, 'noun'); }); angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) { diff --git a/types/angular-gettext/index.d.ts b/types/angular-gettext/index.d.ts index 5b6eb1d90f..6b5fe29e73 100644 --- a/types/angular-gettext/index.d.ts +++ b/types/angular-gettext/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for angular-gettext v2.1.0 +// Type definitions for angular-gettext v2.1.1 // Project: https://angular-gettext.rocketeer.be/ // Definitions by: Ákos Lukács // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -66,7 +66,7 @@ declare module 'angular' { getString(string: string, scope?: any, context?: string): string; /** Translate a plural string with the given context. */ - getPlural(n: number, string: string, stringPlural: string, context?: any): string; + getPlural(n: number, string: string, stringPlural: string, scope?: any, context?: string): string; /** Load a set of translation strings from a given URL.This should be a JSON catalog generated with grunt-angular-gettext. More details https://angular-gettext.rocketeer.be/dev-guide/lazy-loading/ */ loadRemote(url: string): ng.IHttpPromise; diff --git a/types/angular-mocks/angular-mocks-tests.ts b/types/angular-mocks/angular-mocks-tests.ts index 2d74dd26bc..662d75c079 100644 --- a/types/angular-mocks/angular-mocks-tests.ts +++ b/types/angular-mocks/angular-mocks-tests.ts @@ -87,7 +87,6 @@ timeoutService.verifyNoPendingTasks(); let intervalService: ng.IIntervalService; let intervalServiceTimeActuallyAdvanced: number; -intervalServiceTimeActuallyAdvanced = intervalService.flush(); intervalServiceTimeActuallyAdvanced = intervalService.flush(1234); /////////////////////////////////////// @@ -1516,6 +1515,23 @@ requestHandler.respond(404, { key: 'value' }); requestHandler.respond(404, { key: 'value' }, { header: 'value' }); requestHandler.respond(404, { key: 'value' }, { header: 'value' }, 'responseText'); +/////////////////////////////////////// +// IFlushPendingTasksService +/////////////////////////////////////// +let $flushPendingTasks: ng.IFlushPendingTasksService; +$flushPendingTasks(); +$flushPendingTasks(42); + +/////////////////////////////////////// +// IVerifyNoPendingTasksService +/////////////////////////////////////// +let $verifyNoPendingTasks: ng.IVerifyNoPendingTasksService; +$verifyNoPendingTasks(); +$verifyNoPendingTasks('task type'); + +/////////////////////////////////////// +// browserTrigger +/////////////////////////////////////// browserTrigger(document.body, 'click'); browserTrigger(angular.element(document.body), 'click'); browserTrigger(angular.element(document.body), 'click', { which: 1, keys: ['ctrl'] }); diff --git a/types/angular-mocks/index.d.ts b/types/angular-mocks/index.d.ts index 53157a1f08..a2aa4fe29e 100644 --- a/types/angular-mocks/index.d.ts +++ b/types/angular-mocks/index.d.ts @@ -1,6 +1,8 @@ -// Type definitions for Angular JS (ngMock, ngMockE2E module) 1.6 +// Type definitions for Angular JS (ngMock, ngMockE2E module) 1.7 // Project: http://angularjs.org -// Definitions by: Diego Vilar , Tony Curtis +// Definitions by: Diego Vilar +// Tony Curtis +// Georgii Dolzhykov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -59,7 +61,38 @@ declare module 'angular' { // Augments the original service /////////////////////////////////////////////////////////////////////////// interface ITimeoutService { + /** + * **Deprecated** since version 1.7.3. (Use `$flushPendingTasks` instead.) + * + * --- + * Flushes the queue of pending tasks. + * + * _This method is essentially an alias of `$flushPendingTasks`._ + * + * > For historical reasons, this method will also flush non-`$timeout` pending tasks, such as + * > `$q` promises and tasks scheduled via `$applyAsync` and `$evalAsync`. + * + * @param delay - The maximum timeout amount to flush up until. + */ flush(delay?: number): void; + + /** + * **Deprecated** since version 1.7.3. (Use `$verifyNoPendingTasks` instead.) + * + * --- + * Verifies that there are no pending tasks that need to be flushed. It throws an error if there + * are still pending tasks. + * + * _This method is essentially an alias of `$verifyNoPendingTasks` (called with no arguments)._ + * + * > For historical reasons, this method will also verify non-`$timeout` pending tasks, such as + * > pending `$http` requests, in-progress `$route` transitions, unresolved `$q` promises and + * > tasks scheduled via `$applyAsync` and `$evalAsync`. + * > + * > It is recommended to use `$verifyNoPendingTasks` instead, which additionally supports + * > verifying a specific type of tasks. For example, you can verify there are no pending + * > timeouts with `$verifyNoPendingTasks('$timeout')`. + */ verifyNoPendingTasks(): void; } @@ -69,7 +102,13 @@ declare module 'angular' { // Augments the original service /////////////////////////////////////////////////////////////////////////// interface IIntervalService { - flush(millis?: number): number; + /** + * Runs interval tasks scheduled to be run in the next `millis` milliseconds. + * + * @param millis - The maximum timeout amount to flush up until. + * @return The amount of time moved forward. + */ + flush(millis: number): number; } /////////////////////////////////////////////////////////////////////////// @@ -413,6 +452,65 @@ declare module 'angular' { whenRoute(method: string, url: string): mock.IRequestHandler; } + /////////////////////////////////////////////////////////////////////////// + // FlushPendingTasksService + // see https://docs.angularjs.org/api/ngMock/service/$flushPendingTasks + /////////////////////////////////////////////////////////////////////////// + interface IFlushPendingTasksService { + /** + * Flushes all currently pending tasks and executes the corresponding callbacks. + * + * Optionally, you can also pass a `delay` argument to only flush tasks that are scheduled to be + * executed within `delay` milliseconds. Currently, `delay` only applies to timeouts, since all + * other tasks have a delay of 0 (i.e. they are scheduled to be executed as soon as possible, but + * still asynchronously). + * + * If no delay is specified, it uses a delay such that all currently pending tasks are flushed. + * + * The types of tasks that are flushed include: + * + * - Pending timeouts (via `$timeout`). + * - Pending tasks scheduled via `$applyAsync`. + * - Pending tasks scheduled via `$evalAsync`. + * These include tasks scheduled via `$evalAsync()` indirectly (such as `$q` promises). + * + * > Periodic tasks scheduled via `$interval` use a different queue and are not flushed by + * > `$flushPendingTasks()`. Use `$interval.flush(millis)` instead. + * + * @param millis - The number of milliseconds to flush. + */ + (delay?: number): void; + } + + /////////////////////////////////////////////////////////////////////////// + // VerifyNoPendingTasksService + // see https://docs.angularjs.org/api/ngMock/service/$verifyNoPendingTasks + /////////////////////////////////////////////////////////////////////////// + interface IVerifyNoPendingTasksService { + /** + * Verifies that there are no pending tasks that need to be flushed. It throws an error if there + * are still pending tasks. + * + * You can check for a specific type of tasks only, by specifying a `taskType`. + * + * Available task types: + * + * - `$timeout`: Pending timeouts (via `$timeout`). + * - `$http`: Pending HTTP requests (via `$http`). + * - `$route`: In-progress route transitions (via `$route`). + * - `$applyAsync`: Pending tasks scheduled via `$applyAsync`. + * - `$evalAsync`: Pending tasks scheduled via `$evalAsync`. + * These include tasks scheduled via `$evalAsync()` indirectly (such as `$q` promises). + * + * > Periodic tasks scheduled via `$interval` use a different queue and are not taken into + * > account by `$verifyNoPendingTasks()`. There is currently no way to verify that there are no + * > pending `$interval` tasks. + * + * @param taskType - The type of tasks to check for. + */ + (taskType?: string): void; + } + /////////////////////////////////////////////////////////////////////////// // AnimateService // see https://docs.angularjs.org/api/ngMock/service/$animate @@ -513,6 +611,11 @@ declare module 'angular' { * for keyboard events (keydown, keypress, and keyup). */ charcode?: number; + /** + * [data](https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent/data) for + * [CompositionEvents](https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent). + */ + data?: string; /** * The elapsedTime for * [TransitionEvent](https://developer.mozilla.org/docs/Web/API/TransitionEvent) @@ -566,10 +669,11 @@ declare global { * This is a global (window) function that is only available when the `ngMock` module is included. * It can be used to trigger a native browser event on an element, which is useful for unit testing. * - * @param element Either a wrapped jQuery/jqLite node or a DOM element - * @param eventType Optional event type. If none is specified, the function tries to determine - * the right event type for the element, e.g. `change` for `input[text]`. - * @param eventData An optional object which contains additional event data used when creating the event. + * @param element Either a wrapped jQuery/jqLite node or a DOM element. + * @param eventType Optional event type. If none is specified, the function tries to determine the + * right event type for the element, e.g. `change` for `input[text]`. + * @param eventData An optional object which contains additional event data used when creating the + * event. */ function browserTrigger( element: JQuery | Element, diff --git a/types/angular-route/angular-route-tests.ts b/types/angular-route/angular-route-tests.ts index 677c1589ed..e1e7bd43fd 100644 --- a/types/angular-route/angular-route-tests.ts +++ b/types/angular-route/angular-route-tests.ts @@ -39,6 +39,21 @@ $routeProvider return "I return a string" } }) + .when('/projects/:projectId/dashboard6', { + resolve: { + foo: () => 'foo', + bar: () => 'bar', + }, + resolveAs: 'baz', + resolveRedirectTo: [ + '$http', + ($http: ng.IHttpService) => $http.get('/is-admin').then(() => '/admin/lounge', () => undefined), + ], + }) + .when('/projects/:projectId/dashboard7', { + reloadOnUrl: false, + resolveRedirectTo: () => (Math.random() < 0.5) ? '/some/route' : undefined, + }) .otherwise({ redirectTo: '/' }) .otherwise({ redirectTo: ($routeParams?: ng.route.IRouteParamsService, $locationPath?: string, $locationSearch?: any) => "" }) .otherwise("/"); diff --git a/types/angular-route/index.d.ts b/types/angular-route/index.d.ts index 56bd3f2263..15529f1572 100644 --- a/types/angular-route/index.d.ts +++ b/types/angular-route/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for Angular JS (ngRoute module) 1.3 +// Type definitions for Angular JS (ngRoute module) 1.7 // Project: http://angularjs.org // Definitions by: Jonathan Park +// George Kalpakas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -52,7 +53,7 @@ declare module 'angular' { */ interface IRoute { /** - * {(string|function()=} + * {(string|Function)=} * Controller fn that should be associated with newly created scope or the name of a registered controller if passed as a string. */ controller?: string | InlineAnnotatedFunction; @@ -61,56 +62,122 @@ declare module 'angular' { */ controllerAs?: string; /** - * Undocumented? - */ - name?: string; - /** - * {string=|function()=} + * {(string|Function)=} * Html template as a string or a function that returns an html template as a string which should be used by ngView or ngInclude directives. This property takes precedence over templateUrl. * * If template is a function, it will be called with the following parameters: * * {Array.} - route parameters extracted from the current $location.path() by applying the current route */ - template?: string | { ($routeParams?: angular.route.IRouteParamsService): string; } + template?: string | { ($routeParams?: IRouteParamsService): string; } /** - * {string=|function()=} + * {(string|Function)=} * Path or function that returns a path to an html template that should be used by ngView. * * If templateUrl is a function, it will be called with the following parameters: * * {Array.} - route parameters extracted from the current $location.path() by applying the current route */ - templateUrl?: string | { ($routeParams?: angular.route.IRouteParamsService): string; } + templateUrl?: string | { ($routeParams?: IRouteParamsService): string; } /** - * {Object.=} - An optional map of dependencies which should be injected into the controller. If any of these dependencies are promises, the router will wait for them all to be resolved or one to be rejected before the controller is instantiated. If all the promises are resolved successfully, the values of the resolved promises are injected and $routeChangeSuccess event is fired. If any of the promises are rejected the $routeChangeError event is fired. The map object is: + * {Object.=} + * An optional map of dependencies which should be injected into the controller. If any of these + * dependencies are promises, the router will wait for them all to be resolved or one to be rejected before + * the controller is instantiated. + * If all the promises are resolved successfully, the values of the resolved promises are injected and + * `$routeChangeSuccess` event is fired. If any of the promises are rejected the `$routeChangeError` event + * is fired. + * For easier access to the resolved dependencies from the template, the `resolve` map will be available on + * the scope of the route, under `$resolve` (by default) or a custom name specified by the `resolveAs` + * property (see below). This can be particularly useful, when working with components as route templates. * - * - key - {string}: a name of a dependency to be injected into the controller. - * - factory - {string|function}: If string then it is an alias for a service. Otherwise if function, then it is injected and the return value is treated as the dependency. If the result is a promise, it is resolved before its value is injected into the controller. Be aware that ngRoute.$routeParams will still refer to the previous route within these resolve functions. Use $route.current.params to access the new route parameters, instead. + * > **Note:** If your scope already contains a property with this name, it will be hidden or overwritten. + * > Make sure, you specify an appropriate name for this property, that does not collide with other + * > properties on the scope. + * + * The map object is: + * + * - `key` – `{string}`: a name of a dependency to be injected into the controller. + * - `factory` - `{string|Function}`: If `string` then it is an alias for a service. Otherwise if function, + * then it is called with `$injector#invoke()` and the return value is treated as the dependency. If the + * result is a promise, it is resolved before its value is injected into the controller. Be aware that + * `ngRoute.$routeParams` will still refer to the previous route within these resolve functions. Use + * `$route.current.params` to access the new route parameters, instead. */ resolve?: { [key: string]: any }; /** - * {(string|function())=} - * Value to update $location path with and trigger route redirection. - * - * If redirectTo is a function, it will be called with the following parameters: - * - * - {Object.} - route parameters extracted from the current $location.path() by applying the current route templateUrl. - * - {string} - current $location.path() - * - {Object} - current $location.search() - * - The custom redirectTo function is expected to return a string which will be used to update $location.path() and $location.search(). + * {string=} + * The name under which the `resolve` map will be available on the scope of the route. If omitted, defaults + * to `$resolve`. */ - redirectTo?: string | { ($routeParams?: angular.route.IRouteParamsService, $locationPath?: string, $locationSearch?: any): string }; + resolveAs?: string; /** - * Reload route when only $location.search() or $location.hash() changes. + * {(string|Function)=} + * Value to update `$location` path with and trigger route redirection. * - * This option defaults to true. If the option is set to false and url in the browser changes, then $routeUpdate event is broadcasted on the root scope. + * If `redirectTo` is a function, it will be called with the following parameters: + * + * - `{Object.}` - route parameters extracted from the current `$location.path()` by applying the + * current route templateUrl. + * - `{string}` - current `$location.path()` + * - `{Object}` - current `$location.search()` + * + * The custom `redirectTo` function is expected to return a string which will be used to update + * `$location.url()`. If the function throws an error, no further processing will take place and the + * `$routeChangeError` event will be fired. + * + * Routes that specify `redirectTo` will not have their controllers, template functions or resolves called, + * the `$location` will be changed to the redirect url and route processing will stop. The exception to this + * is if the `redirectTo` is a function that returns `undefined`. In this case the route transition occurs + * as though there was no redirection. + */ + redirectTo?: string | { ($routeParams?: IRouteParamsService, $locationPath?: string, $locationSearch?: any): string }; + /** + * {Function=} + * A function that will (eventually) return the value to update `$location` URL with and trigger route + * redirection. In contrast to `redirectTo`, dependencies can be injected into `resolveRedirectTo` and the + * return value can be either a string or a promise that will be resolved to a string. + * + * Similar to `redirectTo`, if the return value is `undefined` (or a promise that gets resolved to + * `undefined`), no redirection takes place and the route transition occurs as though there was no + * redirection. + * + * If the function throws an error or the returned promise gets rejected, no further processing will take + * place and the `$routeChangeError` event will be fired. + * + * `redirectTo` takes precedence over `resolveRedirectTo`, so specifying both on the same route definition, + * will cause the latter to be ignored. + */ + resolveRedirectTo?: angular.Injectable<(...deps: any[]) => angular.IPromise | string | undefined>; + /** + * {boolean=true} + * Reload route when any part of the URL changes (including the path) even if the new URL maps to the same + * route. + * + * If the option is set to `false` and the URL in the browser changes, but the new URL maps to the same + * route, then a `$routeUpdate` event is broadcasted on the root scope (without reloading the route). + * + * Defaults to `true`. + */ + reloadOnUrl?: boolean; + /** + * {boolean=true} + * Reload route when only `$location.search()` or `$location.hash()` changes. + * + * If the option is set to `false` and the URL in the browser changes, then a `$routeUpdate` event is + * broadcasted on the root scope (without reloading the route). + * + * > Note: This option has no effect if `reloadOnUrl` is set to `false`. + * + * Defaults to `true`. */ reloadOnSearch?: boolean; /** - * Match routes without being case sensitive + * {boolean=false} + * Match routes without being case sensitive. + * If the option is set to `true`, then the particular route can be matched without being case sensitive. * - * This option defaults to false. If the option is set to true, then the particular route can be matched without being case sensitive + * Defaults to `false`. */ caseInsensitiveMatch?: boolean; } diff --git a/types/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts b/types/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts index 9dbbf8e002..f21ee43ab3 100644 --- a/types/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts +++ b/types/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts @@ -57,6 +57,28 @@ testApp.config(( /** * $datepickerPopupConfig tests */ + $datepickerPopupConfig.datepickerMode = 'month'; + $datepickerPopupConfig.formatDay = 'd'; + $datepickerPopupConfig.formatDayHeader = 'E'; + $datepickerPopupConfig.formatDayTitle = 'dd-MM-yyyy'; + $datepickerPopupConfig.formatMonth = 'M'; + $datepickerPopupConfig.formatMonthTitle = 'yy'; + $datepickerPopupConfig.formatYear = 'y'; + $datepickerPopupConfig.initDate = '1389586124979'; + $datepickerPopupConfig.maxDate = '1389586124979'; + $datepickerPopupConfig.maxMode = 'month'; + $datepickerPopupConfig.minDate = '1389586124979'; + $datepickerPopupConfig.minMode = 'month'; + $datepickerPopupConfig.shortcutPropagation = true; + $datepickerPopupConfig.showWeeks = false; + $datepickerPopupConfig.startingDay = 1; + $datepickerPopupConfig.yearRange = 10; + $datepickerPopupConfig.monthColumns = 3; + $datepickerPopupConfig.yearColumns = 9; + $datepickerPopupConfig.yearRows = 6; + $datepickerPopupConfig.ngModelOptions.allowInvalid = false; + $datepickerPopupConfig.ngModelOptions.timezone = "EST"; + $datepickerPopupConfig.ngModelOptions.updateOn = "click"; $datepickerPopupConfig.altInputFormats = ["mm/dd/YYYY", "mm-dd-YY"]; $datepickerPopupConfig.appendToBody = true; $datepickerPopupConfig.currentText = 'Select Today'; diff --git a/types/angular-ui-bootstrap/index.d.ts b/types/angular-ui-bootstrap/index.d.ts index 0c41fcc15c..db08aae252 100644 --- a/types/angular-ui-bootstrap/index.d.ts +++ b/types/angular-ui-bootstrap/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for Angular UI Bootstrap 0.13.3 // Project: https://github.com/angular-ui/bootstrap -// Definitions by: Brian Surowiec , Ryan Southgate +// Definitions by: Brian Surowiec , +// Ryan Southgate +// Alfie Johnson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -227,7 +229,7 @@ declare module 'angular' { customClass?: DatepickerCallback; } - interface IDatepickerPopupConfig { + interface IDatepickerPopupConfig extends IDatepickerConfig { /** * A list of alternate formats acceptable for manual entry. diff --git a/types/angular/angular-tests.ts b/types/angular/angular-tests.ts index 5d7dd7cbb8..44f8539af2 100644 --- a/types/angular/angular-tests.ts +++ b/types/angular/angular-tests.ts @@ -311,8 +311,10 @@ namespace TestQ { } const abcObject: AbcObject = null; const abcObjectPromise: angular.IPromise = null; + const abcObjectPromiseLike: PromiseLike = null; const efObject: EfObject = null; const efObjectPromise: angular.IPromise = null; + const efObjectPromiseLike: PromiseLike = null; const ghObject: GhObject = null; const ghObjectPromise: angular.IPromise = null; @@ -404,6 +406,7 @@ namespace TestQ { result = $q.when(abcObject); result = $q.when(abcObjectPromise); + result = $q.when(abcObjectPromiseLike); result = $q.when(efObject, (result: EfObject) => abcObject); result = $q.when(efObject, (result: EfObject) => abcObject, (any) => any); @@ -416,10 +419,21 @@ namespace TestQ { resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObjectPromise); resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObjectPromise, (any) => any); + result = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject); + resultOther = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObject); + resultOther = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObject); + resultOther = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObject, (any) => any); + resultOther = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObjectPromise); + resultOther = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObjectPromise, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObjectPromise); result = $q.when(efObject, (result: EfObject) => abcObjectPromise, (any) => any); result = $q.when(efObject, (result: EfObject) => abcObjectPromise, (any) => any, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObjectPromiseLike); + result = $q.when(efObject, (result: EfObject) => abcObjectPromiseLike, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObjectPromiseLike, (any) => any, (any) => any); + result = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise); resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObject); resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObject, (any) => any); @@ -520,6 +534,20 @@ namespace TestInjector { anyResult = $injector.invoke(inlineAnnotatedFunction, 'anyContext'); anyResult = $injector.invoke(inlineAnnotatedFunction, undefined, 'anyLocals'); } + + // $injector.loadNewModules + { + const inlineAnnotatedFunction: any[] = [false, (v: boolean) => {}]; + const modA = angular.module('$injector.moduleA', []); + $injector.loadNewModules([modA]); + $injector.loadNewModules([modA.name]); + $injector.loadNewModules([inlineAnnotatedFunction]); + } + + // $injector.modules + { + const module: angular.IModule = $injector.modules['$injector.module']; + } } // Promise signature tests @@ -717,11 +745,12 @@ function test_angular_forEach() { this.push(`${key}: ${value}`); }, log); // expect(log).toEqual(['name: misko', 'gender: male']); - // $ExpectType NodeListOf - angular.forEach(document.getElementsByTagName('img'), (value, key, obj) => { + // TODO: Set minimum version to ts3.1 where this is always HTMLCollectionOf + type Collection = NodeListOf | HTMLCollectionOf; + const collection: Collection = angular.forEach(document.getElementsByTagName('img'), (value, key, obj) => { value; // $ExpectType HTMLImageElement key; // $ExpectType number - obj; // $ExpectType NodeListOf + const collection: Collection = obj; }); // $ExpectType number[] angular.forEach([1, 2, 3], (value, key, obj) => { diff --git a/types/angular/index.d.ts b/types/angular/index.d.ts index c05ee388a8..99977b57b5 100644 --- a/types/angular/index.d.ts +++ b/types/angular/index.d.ts @@ -1137,12 +1137,12 @@ declare namespace angular { * * @param value Value or a promise */ - resolve(value: IPromise|T): IPromise; + resolve(value: PromiseLike|T): IPromise; /** * @deprecated Since TS 2.4, inference is stricter and no longer produces the desired type when T1 !== T2. * To use resolve with two different types, pass a union type to the single-type-argument overload. */ - resolve(value: IPromise|T2): IPromise; + resolve(value: PromiseLike|T2): IPromise; /** * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. */ @@ -1152,11 +1152,11 @@ declare namespace angular { * * @param value Value or a promise */ - when(value: IPromise|T): IPromise; - when(value: IPromise|T2): IPromise; - when(value: IPromise|T, successCallback: (promiseValue: T) => IPromise|TResult): IPromise; - when(value: T, successCallback: (promiseValue: T) => IPromise|TResult, errorCallback: null | undefined | ((reason: any) => any), notifyCallback?: (state: any) => any): IPromise; - when(value: IPromise, successCallback: (promiseValue: T) => IPromise|TResult, errorCallback: (reason: any) => TResult2 | IPromise, notifyCallback?: (state: any) => any): IPromise; + when(value: PromiseLike|T): IPromise; + when(value: PromiseLike|T2): IPromise; + when(value: PromiseLike|T, successCallback: (promiseValue: T) => PromiseLike|TResult): IPromise; + when(value: T, successCallback: (promiseValue: T) => PromiseLike|TResult, errorCallback: null | undefined | ((reason: any) => any), notifyCallback?: (state: any) => any): IPromise; + when(value: PromiseLike, successCallback: (promiseValue: T) => PromiseLike|TResult, errorCallback: (reason: any) => TResult2 | PromiseLike, notifyCallback?: (state: any) => any): IPromise; /** * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. */ @@ -2183,6 +2183,14 @@ declare namespace angular { has(name: string): boolean; instantiate(typeConstructor: {new(...args: any[]): T}, locals?: any): T; invoke(func: Injectable T)>, context?: any, locals?: any): T; + /** + * Add the specified modules to the current injector. + * This method will add each of the injectables to the injector and execute all of the config and run blocks for each module passed to the method. + * @param modules A module, module name or annotated injection function. + */ + loadNewModules(modules: Array void>>): void; + /** An object map of all the modules that have been loaded into the injector. */ + modules: {[moduleName: string]: IModule}; strictDi: boolean; } 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/react-dnd-test-backend/tslint.json b/types/antlr4/tslint.json similarity index 100% rename from types/react-dnd-test-backend/tslint.json rename to types/antlr4/tslint.json diff --git a/types/aphrodite/index.d.ts b/types/aphrodite/index.d.ts index a82ec2f36b..bd2749f737 100644 --- a/types/aphrodite/index.d.ts +++ b/types/aphrodite/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/Khan/aphrodite // Definitions by: Alexey Svetliakov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as CSS from "csstype"; 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/arangodb/arangodb-tests.ts b/types/arangodb/arangodb-tests.ts index 7e0fd6383e..98315235ea 100644 --- a/types/arangodb/arangodb-tests.ts +++ b/types/arangodb/arangodb-tests.ts @@ -96,3 +96,13 @@ console.log( RETURN u `.toArray() ); + +const view = db._view("yolo")!; +view.properties({ + locale: "C", + commit: { + consolidate: { + bytes: { segmentThreshold: 20 } + } + } +}); diff --git a/types/arangodb/index.d.ts b/types/arangodb/index.d.ts index 5c3f56020f..be738e6717 100644 --- a/types/arangodb/index.d.ts +++ b/types/arangodb/index.d.ts @@ -837,11 +837,68 @@ declare namespace ArangoDB { // Views - interface View { - // TODO - [key: string]: any; + interface ArangoSearchView { + _dbName: string; + _id: string; + name(): string; + type(): ViewType; + rename(newName: string): void; + properties( + newProperties?: ArangoSearchViewPropertiesOptions + ): ArangoSearchViewProperties; + } + + interface ArangoSearchViewConsolidate { + threshold: number; + segmentThreshold: number; + } + + interface ArangoSearchViewCollectionLink { + analyzers?: string[]; + fields?: { [key: string]: ArangoSearchViewCollectionLink | undefined }; + includeAllFields?: boolean; + trackListPositions?: boolean; + storeValues?: "none" | "id"; + } + + interface ArangoSearchViewProperties { + id: string; + name: string; + type: "arangosearch"; + commit: { + cleanupIntervalStep: number; + commitIntervalMsec: number; + consolidate: { + bytes?: ArangoSearchViewConsolidate; + bytes_accum?: ArangoSearchViewConsolidate; + count?: ArangoSearchViewConsolidate; + fill?: ArangoSearchViewConsolidate; + }; + }; + locale: string; + links: { + [key: string]: ArangoSearchViewCollectionLink | undefined; + }; + } + + interface ArangoSearchViewPropertiesOptions { + locale?: string; + commit?: { + consolidate?: + | "none" + | { + count?: Partial; + bytes?: Partial; + bytes_accum?: Partial; + fill?: Partial; + }; + commitIntervalMsec?: number; + cleanupIntervalStep?: number; + }; + links?: { + [key: string]: ArangoSearchViewCollectionLink | undefined; + }; } - type ViewProperties = object; // TODO // Global @@ -923,13 +980,13 @@ declare namespace ArangoDB { ): DocumentMetadata; // Views - _view(name: string): View | null; - _views(): View[]; + _view(name: string): ArangoSearchView | null; + _views(): ArangoSearchView[]; _createView( name: string, type: ViewType, - properties: ViewProperties - ): View; + properties: ArangoSearchViewPropertiesOptions + ): ArangoSearchView; _dropView(name: string): void; // Global @@ -1392,7 +1449,7 @@ declare module "@arangodb/foxx/router" { } declare module "@arangodb/foxx/graphql" { - import { GraphQLSchema, formatError } from "graphql"; + import { formatError, GraphQLSchema } from "graphql"; type GraphQLModule = object; type GraphQLFormatErrorFunction = typeof formatError; interface GraphQLOptions { diff --git a/types/arcgis-js-api/index.d.ts b/types/arcgis-js-api/index.d.ts index baf6145ff9..97eb679110 100644 --- a/types/arcgis-js-api/index.d.ts +++ b/types/arcgis-js-api/index.d.ts @@ -682,7 +682,7 @@ declare namespace __esri { export type AfterInterceptorCallback = (response: RequestResponse) => void; - export type BeforeInterceptorCallback = (params: any, requestOptions: RequestOptions) => any; + export type BeforeInterceptorCallback = (params: any) => any; export interface configRequest extends Object { @@ -731,7 +731,7 @@ declare namespace __esri { */ 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: + * Allows developers to modify requests before or after they are sent. The first interceptor that matches the request URL will be used. Example: * ```js * const featureLayerUrl = "http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/0"; * @@ -909,19 +909,19 @@ declare namespace __esri { */ after?: AfterInterceptorCallback; /** - * Callback function that can make changes to the url or options before the request is sent. + * 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`. + * Sets or adds headers into `requestOptions.headers`. See also: [requestOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) */ headers?: any; /** - * Appends a query statement to the request in the Query String Parameters of the header. + * Sets or adds a query parameter into `requestOptions.query`. See also: [requestOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) */ @@ -933,11 +933,11 @@ declare namespace __esri { */ responseData?: any; /** - * Specifies the url(s) to apply to the interceptors. If undefined, interceptors will apply to all relevant requests. + * Specifies the URL(s) to apply to the interceptors. If the value is type `String`, then it matches if the request URL starts with that string. If null or undefined, the interceptor will apply to all relevant requests. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) */ - urls?: string | RegExp | any[]; + urls?: string | RegExp | (string | RegExp)[]; } @@ -47653,7 +47653,7 @@ declare namespace __esri { */ readonly expanded: boolean; /** - * Icon font used to style the Expand button. + * Icon font used to style the Expand button. Will automatically use the [content's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#content) iconClass if it has one. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expandIconClass) */ @@ -47778,7 +47778,7 @@ declare namespace __esri { */ content?: Node | string | WidgetProperties; /** - * Icon font used to style the Expand button. + * Icon font used to style the Expand button. Will automatically use the [content's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#content) iconClass if it has one. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expandIconClass) */ @@ -49921,7 +49921,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) */ - content?: string; + content?: string | HTMLElement | Widget; /** * Sets the popup's [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location), which is the geometry used to position the popup. * diff --git a/types/array-sort/array-sort-tests.ts b/types/array-sort/array-sort-tests.ts new file mode 100644 index 0000000000..bfd19b1bbf --- /dev/null +++ b/types/array-sort/array-sort-tests.ts @@ -0,0 +1,16 @@ +import arraySort from 'array-sort'; + +const numberArr = [1, 2, 3]; +const objArr = [{foo: "asd"}, {foo: "fas"}]; + +arraySort(objArr); +arraySort(numberArr); + +arraySort(objArr, "foo"); +arraySort(objArr, "foo", {reverse: true}); + +arraySort(objArr, ["foo"]); +arraySort(objArr, ["foo"], {reverse: true}); + +arraySort(numberArr, ["foo", (a, b) => -1]); +arraySort(numberArr, [(a, b) => 1], {reverse: true}); diff --git a/types/array-sort/index.d.ts b/types/array-sort/index.d.ts new file mode 100644 index 0000000000..3c886d386d --- /dev/null +++ b/types/array-sort/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for array-sort 1.0 +// Project: https://github.com/jonschlinkert/array-sort +// Definitions by: Daniel Schmidt +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +type Comparator = (a: T, b: T) => number; +type ComparisonArg = string | Comparator; +type ComparisonArgs = ComparisonArg | Array>; + +interface Options { + readonly reverse: boolean; +} + +declare function arraySort( + arr: T[], + props?: ComparisonArgs, + options?: Options +): T[]; + +export default arraySort; diff --git a/types/array-sort/tsconfig.json b/types/array-sort/tsconfig.json new file mode 100644 index 0000000000..e3ae7fe409 --- /dev/null +++ b/types/array-sort/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "array-sort-tests.ts" + ] +} diff --git a/types/array-sort/tslint.json b/types/array-sort/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/array-sort/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } 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/assert-equal-jsx/index.d.ts b/types/assert-equal-jsx/index.d.ts index e017fcf57c..735ab5974a 100644 --- a/types/assert-equal-jsx/index.d.ts +++ b/types/assert-equal-jsx/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/thejameskyle/assert-equal-jsx // Definitions by: Josh Toft // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from 'react'; diff --git a/types/atlaskit__button/index.d.ts b/types/atlaskit__button/index.d.ts index e9a613fabd..95ac1e0961 100644 --- a/types/atlaskit__button/index.d.ts +++ b/types/atlaskit__button/index.d.ts @@ -2,7 +2,7 @@ // Project: https://bitbucket.org/atlassian/atlaskit-mk-2/ // Definitions by: Jimmy Luong // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { Component, diff --git a/types/atlaskit__calendar/index.d.ts b/types/atlaskit__calendar/index.d.ts index e92776c1f3..e1c76eb397 100644 --- a/types/atlaskit__calendar/index.d.ts +++ b/types/atlaskit__calendar/index.d.ts @@ -2,7 +2,7 @@ // Project: https://bitbucket.org/atlassian/atlaskit-mk-2/src/master/ // Definitions by: Lee Standen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { Component, HTMLAttributes, FocusEvent } from 'react'; diff --git a/types/atlaskit__inline-edit/index.d.ts b/types/atlaskit__inline-edit/index.d.ts index 4ee82ee4c3..d2d706c5a4 100644 --- a/types/atlaskit__inline-edit/index.d.ts +++ b/types/atlaskit__inline-edit/index.d.ts @@ -2,7 +2,7 @@ // Project: https://bitbucket.org/atlassian/atlaskit-mk-2/ // Definitions by: Lee Standen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { ReactElement, Component } from 'react'; export default class InlineEdit extends Component {} diff --git a/types/atlaskit__layer/index.d.ts b/types/atlaskit__layer/index.d.ts index 2f50a5abcf..03673c47a3 100644 --- a/types/atlaskit__layer/index.d.ts +++ b/types/atlaskit__layer/index.d.ts @@ -2,7 +2,7 @@ // Project: https://bitbucket.org/atlassian/atlaskit-mk-2/src/master/ // Definitions by: Lee Standen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { Component, ReactNode } from 'react'; diff --git a/types/atlaskit__single-select/index.d.ts b/types/atlaskit__single-select/index.d.ts index 6536869512..4910c10a11 100644 --- a/types/atlaskit__single-select/index.d.ts +++ b/types/atlaskit__single-select/index.d.ts @@ -2,7 +2,7 @@ // Project: https://bitbucket.org/atlassian/atlaskit-mk-2/src/master/ // Definitions by: Lee Standen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { Component, ReactNode, SyntheticEvent } from 'react'; diff --git a/types/auth0-js/auth0-js-tests.ts b/types/auth0-js/auth0-js-tests.ts index d05ee2251e..f13599ebae 100644 --- a/types/auth0-js/auth0-js-tests.ts +++ b/types/auth0-js/auth0-js-tests.ts @@ -9,7 +9,9 @@ webAuth.authorize({ audience: 'https://mystore.com/api/v2', scope: 'read:order write:order', responseType: 'token', - redirectUri: 'https://example.com/auth/callback' + redirectUri: 'https://example.com/auth/callback', + language: 'en', + prompt: 'login', }); webAuth.parseHash((err, authResult) => { diff --git a/types/auth0-js/index.d.ts b/types/auth0-js/index.d.ts index c7224599bd..033a4bcbde 100644 --- a/types/auth0-js/index.d.ts +++ b/types/auth0-js/index.d.ts @@ -760,6 +760,9 @@ export interface AuthorizeOptions { nonce?: string; scope?: string; audience?: string; + language?: string; + prompt?: string; + mode?: "login" | "signUp"; } export interface CheckSessionOptions extends AuthorizeOptions { 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/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index 51f0635da1..94575006ab 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -479,6 +479,7 @@ str = cloudwatchLogsDecodedData.messageType; str = cloudwatchLogsDecodedData.logEvents[0].id; num = cloudwatchLogsDecodedData.logEvents[0].timestamp; str = cloudwatchLogsDecodedData.logEvents[0].message; +str = cloudwatchLogsDecodedData.logEvents[0].extractedFields!["example"]; /* ClientContext */ clientContextClient = clientCtx.client; @@ -585,7 +586,9 @@ const CloudFrontRequestEvent: AWSLambda.CloudFrontRequestEvent = { { cf: { config: { + distributionDomainName: "d123.cloudfront.net", distributionId: "EDFDVBD6EXAMPLE", + eventType: "viewer-request", requestId: "MRVMF7KydIvxMWfJIglgwHQwZsbG2IhRJ07sn9AkKUFSHS9EXAMPLE==" }, request: { @@ -654,7 +657,9 @@ const CloudFrontResponseEvent: AWSLambda.CloudFrontResponseEvent = { { cf: { config: { + distributionDomainName: "d123.cloudfront.net", distributionId: "EDFDVBD6EXAMPLE", + eventType: "viewer-response", requestId: "xGN7KWpVEmB9Dp7ctcVFQC4E-nrcOcEKS3QyAez--06dV7TEXAMPLE==" }, request: { @@ -737,7 +742,7 @@ context.fail(error); context.fail(str); /* Handler */ -let handler: AWSLambda.Handler = (event: any, context: AWSLambda.Context, cb: AWSLambda.Callback) => { }; +const handler: AWSLambda.Handler = (event: any, context: AWSLambda.Context, cb: AWSLambda.Callback) => { }; /* In node8.10 runtime, handlers may return a promise for the result value, so existing async * handlers that return Promise before calling the callback will now have a `null` result. @@ -745,7 +750,7 @@ let handler: AWSLambda.Handler = (event: any, context: AWSLambda.Context, cb: AW * since the upgrade effort should be pretty low in most cases, and it points them at a nicer solution. */ // $ExpectError -let legacyAsyncHandler: AWSLambda.APIGatewayProxyHandler = async ( +const legacyAsyncHandler: AWSLambda.APIGatewayProxyHandler = async ( event: AWSLambda.APIGatewayProxyEvent, context: AWSLambda.Context, cb: AWSLambda.Callback, @@ -753,7 +758,7 @@ let legacyAsyncHandler: AWSLambda.APIGatewayProxyHandler = async ( cb(null, { statusCode: 200, body: 'No longer valid' }); }; -let node8AsyncHandler: AWSLambda.APIGatewayProxyHandler = async ( +const node8AsyncHandler: AWSLambda.APIGatewayProxyHandler = async ( event: AWSLambda.APIGatewayProxyEvent, context: AWSLambda.Context, cb: AWSLambda.Callback, @@ -761,7 +766,7 @@ let node8AsyncHandler: AWSLambda.APIGatewayProxyHandler = async ( return { statusCode: 200, body: 'Is now valid!' }; }; -let inferredHandler: AWSLambda.S3Handler = (event, context, cb) => { +const inferredHandler: AWSLambda.S3Handler = (event, context, cb) => { // $ExpectType S3Event event; str = event.Records[0].eventName; @@ -778,35 +783,35 @@ let inferredHandler: AWSLambda.S3Handler = (event, context, cb) => { }; // Test using default Callback type still works. -let defaultCallbackHandler: AWSLambda.APIGatewayProxyHandler = (event: AWSLambda.APIGatewayEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => { }; +const defaultCallbackHandler: AWSLambda.APIGatewayProxyHandler = (event: AWSLambda.APIGatewayEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => { }; // Specific types let s3Handler: AWSLambda.S3Handler = (event: AWSLambda.S3Event, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; // Test old name -let s3CreateHandler: AWSLambda.S3Handler = (event: AWSLambda.S3CreateEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; +const s3CreateHandler: AWSLambda.S3Handler = (event: AWSLambda.S3CreateEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; s3Handler = s3CreateHandler; -let dynamoDBStreamHandler: AWSLambda.DynamoDBStreamHandler = (event: AWSLambda.DynamoDBStreamEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; +const dynamoDBStreamHandler: AWSLambda.DynamoDBStreamHandler = (event: AWSLambda.DynamoDBStreamEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; -let snsHandler: AWSLambda.SNSHandler = (event: AWSLambda.SNSEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; +const snsHandler: AWSLambda.SNSHandler = (event: AWSLambda.SNSEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; -let cognitoUserPoolHandler: AWSLambda.CognitoUserPoolTriggerHandler = (event: AWSLambda.CognitoUserPoolEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; +const cognitoUserPoolHandler: AWSLambda.CognitoUserPoolTriggerHandler = (event: AWSLambda.CognitoUserPoolEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; -let cloudFormationCustomResourceHandler: AWSLambda.CloudFormationCustomResourceHandler = +const cloudFormationCustomResourceHandler: AWSLambda.CloudFormationCustomResourceHandler = (event: AWSLambda.CloudFormationCustomResourceEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; -let cloudWatchLogsHandler: AWSLambda.CloudWatchLogsHandler = (event: AWSLambda.CloudWatchLogsEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; +const cloudWatchLogsHandler: AWSLambda.CloudWatchLogsHandler = (event: AWSLambda.CloudWatchLogsEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; -let scheduledHandler: AWSLambda.ScheduledHandler = (event: AWSLambda.ScheduledEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; +const scheduledHandler: AWSLambda.ScheduledHandler = (event: AWSLambda.ScheduledEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; let apiGtwProxyHandler: AWSLambda.APIGatewayProxyHandler = (event: AWSLambda.APIGatewayProxyEvent, context: AWSLambda.Context, cb: AWSLambda.APIGatewayProxyCallback) => { }; // Test old names -let proxyHandler: AWSLambda.ProxyHandler = (event: AWSLambda.APIGatewayEvent, context: AWSLambda.Context, cb: AWSLambda.ProxyCallback) => { }; +const proxyHandler: AWSLambda.ProxyHandler = (event: AWSLambda.APIGatewayEvent, context: AWSLambda.Context, cb: AWSLambda.ProxyCallback) => { }; apiGtwProxyHandler = proxyHandler; -let codePipelineHandler: AWSLambda.CodePipelineHandler = (event: AWSLambda.CodePipelineEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; +const codePipelineHandler: AWSLambda.CodePipelineHandler = (event: AWSLambda.CodePipelineEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; -let cloudFrontRequestHandler: AWSLambda.CloudFrontRequestHandler = (event: AWSLambda.CloudFrontRequestEvent, context: AWSLambda.Context, cb: AWSLambda.CloudFrontRequestCallback) => { +const cloudFrontRequestHandler: AWSLambda.CloudFrontRequestHandler = (event: AWSLambda.CloudFrontRequestEvent, context: AWSLambda.Context, cb: AWSLambda.CloudFrontRequestCallback) => { cb(); cb(null); cb(new Error('')); @@ -816,14 +821,14 @@ let cloudFrontRequestHandler: AWSLambda.CloudFrontRequestHandler = (event: AWSLa cb(null, { }); }; -let cloudFrontResponseHandler: AWSLambda.CloudFrontResponseHandler = (event: AWSLambda.CloudFrontResponseEvent, context: AWSLambda.Context, cb: AWSLambda.CloudFrontResponseCallback) => { }; +const cloudFrontResponseHandler: AWSLambda.CloudFrontResponseHandler = (event: AWSLambda.CloudFrontResponseEvent, context: AWSLambda.Context, cb: AWSLambda.CloudFrontResponseCallback) => { }; -let customAuthorizerHandler: AWSLambda.CustomAuthorizerHandler = (event: AWSLambda.CustomAuthorizerEvent, context: AWSLambda.Context, cb: AWSLambda.CustomAuthorizerCallback) => { }; +const customAuthorizerHandler: AWSLambda.CustomAuthorizerHandler = (event: AWSLambda.CustomAuthorizerEvent, context: AWSLambda.Context, cb: AWSLambda.CustomAuthorizerCallback) => { }; interface CustomEvent { eventString: string; eventBool: boolean; } interface CustomResult { resultString: string; resultBool?: boolean; } type CustomCallback = AWSLambda.Callback; -let customHandler: AWSLambda.Handler = (event, context, cb) => { +const customHandler: AWSLambda.Handler = (event, context, cb) => { // $ExpectType CustomEvent event; str = event.eventString; @@ -837,4 +842,84 @@ let customHandler: AWSLambda.Handler = (event, contex cb(null, { resultString: bool }); }; -let kinesisStreamHandler: AWSLambda.KinesisStreamHandler = (event: AWSLambda.KinesisStreamEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => { }; +const kinesisStreamHandler: AWSLambda.KinesisStreamHandler = (event: AWSLambda.KinesisStreamEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => { }; + +const SQSMessageHandler: AWSLambda.SQSHandler = (event: AWSLambda.SQSEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => { }; + +// See https://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-sqs +const SQSEvent: AWSLambda.SQSEvent = { + Records: [ + { + messageId: "c80e8021-a70a-42c7-a470-796e1186f753", + receiptHandle: "AQEBJQ+/u6NsnT5t8Q/VbVxgdUl4TMKZ5FqhksRdIQvLBhwNvADoBxYSOVeCBXdnS9P+", + body: "{\"foo\":\"bar\"}", + attributes: { + ApproximateReceiveCount: "3", + SentTimestamp: "1529104986221", + SenderId: "594035263019", + ApproximateFirstReceiveTimestamp: "1529104986230" + }, + messageAttributes: {}, + md5OfBody: "9bb58f26192e4ba00f01e2e7b136bbd8", + eventSource: "aws:sqs", + eventSourceARN: "arn:aws:sqs:us-west-2:594035263019:NOTFIFOQUEUE", + awsRegion: "us-west-2" + } + ] +}; + +const SQSMessageLegacyAsyncHandler: AWSLambda.SQSHandler = async ( + event: AWSLambda.SQSEvent, + context: AWSLambda.Context, + cb: AWSLambda.Callback, +) => { + // $ExpectType SQSEvent + event; + str = event.Records[0].messageId; + anyObj = event.Records[0].body; + // $ExpectType Context + context; + str = context.functionName; + // $ExpectType Callback + cb; + cb(); + cb(null); + cb(new Error()); +}; + +const SQSMessageNode8AsyncHandler: AWSLambda.SQSHandler = async ( + event: AWSLambda.SQSEvent, + context: AWSLambda.Context +) => { + // $ExpectType SQSEvent + event; + str = event.Records[0].messageId; + anyObj = event.Records[0].body; + // $ExpectType Context + context; + str = context.functionName; + return; +}; + +const firehoseEventHandler: AWSLambda.FirehoseTransformationHandler = ( + event: AWSLambda.FirehoseTransformationEvent, + context: AWSLambda.Context, + callback: AWSLambda.FirehoseTransformationCallback +) => { + // $ExpectType FirehoseTransformationEvent + event; + str = event.records[0].recordId; + + // $ExpectType Context + context; + str = context.functionName; + callback(null, { + records: [ + { + recordId: event.records[0].recordId, + result: 'Ok' as AWSLambda.FirehoseRecordTransformationStatus, + data: 'eyJmb28iOiJiYXIifQ==', + } + ] + }); +}; diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index 4c10da216f..35d0b1d7a6 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -19,6 +19,8 @@ // Chris Redekop // Aneil Mallavarapu // Jeremy Nagel +// Louis Larry +// Daniel Papukchiev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -211,27 +213,27 @@ export type S3CreateEvent = S3Event; // old name export interface CognitoUserPoolTriggerEvent { version: number; triggerSource: - | "PreSignUp_SignUp" - | "PostConfirmation_ConfirmSignUp" - | "PreAuthentication_Authentication" - | "PostAuthentication_Authentication" - | "CustomMessage_SignUp" - | "CustomMessage_AdminCreateUser" - | "CustomMessage_ResendCode" - | "CustomMessage_ForgotPassword" - | "CustomMessage_UpdateUserAttribute" - | "CustomMessage_VerifyUserAttribute" - | "CustomMessage_Authentication" - | "DefineAuthChallenge_Authentication" - | "CreateAuthChallenge_Authentication" - | "VerifyAuthChallengeResponse_Authentication" - | "PreSignUp_AdminCreateUser" - | "PostConfirmation_ConfirmForgotPassword" - | "TokenGeneration_HostedAuth" - | "TokenGeneration_Authentication" - | "TokenGeneration_NewPasswordChallenge" - | "TokenGeneration_AuthenticateDevice" - | "TokenGeneration_RefreshTokens"; + | "PreSignUp_SignUp" + | "PostConfirmation_ConfirmSignUp" + | "PreAuthentication_Authentication" + | "PostAuthentication_Authentication" + | "CustomMessage_SignUp" + | "CustomMessage_AdminCreateUser" + | "CustomMessage_ResendCode" + | "CustomMessage_ForgotPassword" + | "CustomMessage_UpdateUserAttribute" + | "CustomMessage_VerifyUserAttribute" + | "CustomMessage_Authentication" + | "DefineAuthChallenge_Authentication" + | "CreateAuthChallenge_Authentication" + | "VerifyAuthChallengeResponse_Authentication" + | "PreSignUp_AdminCreateUser" + | "PostConfirmation_ConfirmForgotPassword" + | "TokenGeneration_HostedAuth" + | "TokenGeneration_Authentication" + | "TokenGeneration_NewPasswordChallenge" + | "TokenGeneration_AuthenticateDevice" + | "TokenGeneration_RefreshTokens"; region: string; userPoolId: string; userName?: string; @@ -240,8 +242,8 @@ export interface CognitoUserPoolTriggerEvent { clientId: string; }; request: { - userAttributes: {[key: string]: string}; - validationData?: {[key: string]: string}; + userAttributes: { [key: string]: string }; + validationData?: { [key: string]: string }; codeParameter?: string; usernameParameter?: string; newDeviceUsed?: boolean; @@ -251,8 +253,8 @@ export interface CognitoUserPoolTriggerEvent { challengeMetaData?: string; }>; challengeName?: string; - privateChallengeParameters?: {[key: string]: string}; - challengeAnswer?: {[key: string]: string}; + privateChallengeParameters?: { [key: string]: string }; + challengeAnswer?: { [key: string]: string }; }; response: { autoConfirmUser?: boolean; @@ -262,8 +264,8 @@ export interface CognitoUserPoolTriggerEvent { challengeName?: string; issueTokens?: boolean; failAuthentication?: boolean; - publicChallengeParameters?: {[key: string]: string}; - privateChallengeParameters?: {[key: string]: string}; + publicChallengeParameters?: { [key: string]: string }; + privateChallengeParameters?: { [key: string]: string }; challengeMetaData?: string; answerCorrect?: boolean; }; @@ -369,6 +371,7 @@ export interface CloudWatchLogsLogEvent { id: string; timestamp: number; message: string; + extractedFields?: {[key: string]: string}; } // Context @@ -549,7 +552,7 @@ export interface CodePipelineEvent { inputArtifacts: Artifact[]; outputArtifacts: Artifact[]; artifactCredentials: Credentials; - encryptionKey?: EncryptionKey & {type: 'KMS'}; + encryptionKey?: EncryptionKey & { type: 'KMS' }; continuationToken?: string; }; }; @@ -582,7 +585,9 @@ export interface CloudFrontRequest { export interface CloudFrontEvent { config: { + distributionDomainName: string; distributionId: string; + eventType: 'origin-request' | 'origin-response' | 'viewer-request' | 'viewer-response'; requestId: string; }; } @@ -642,6 +647,80 @@ export interface KinesisStreamEvent { Records: KinesisStreamRecord[]; } +// Kinesis Data Firehose Event +// https://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-kinesis-firehose +// https://docs.aws.amazon.com/firehose/latest/dev/data-transformation.html +// https://aws.amazon.com/blogs/compute/amazon-kinesis-firehose-data-transformation-with-aws-lambda/ +// Examples in the lambda blueprints +export interface FirehoseTransformationEvent { + invocationId: string; + deliveryStreamArn: string; + region: string; + records: FirehoseTransformationEventRecord[]; +} + +export interface FirehoseTransformationEventRecord { + recordId: string; + approximateArrivalTimestamp: number; + /** Base64 encoded */ + data: string; + kinesisRecordMetadata?: FirehoseRecordMetadata; +} + +export interface FirehoseRecordMetadata { + shardId: string; + partitionKey: string; + approximateArrivalTimestamp: string; + sequenceNumber: string; + subsequenceNumber: string; +} + +export type FirehoseRecordTransformationStatus = 'Ok' | 'Dropped' | 'ProcessingFailed'; + +export interface FirehoseTransformationResultRecord { + recordId: string; + result: FirehoseRecordTransformationStatus; + /** Encode in Base64 */ + data: string; +} + +export interface FirehoseTransformationResult { + records: FirehoseTransformationResultRecord[]; +} + +// SQS +// https://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-function.html#supported-event-source-sqs +export interface SQSRecord { + messageId: string; + receiptHandle: string; + body: string; + attributes: SQSRecordAttributes; + messageAttributes: SQSMessageAttributes; + md5OfBody: string; + eventSource: string; + eventSourceARN: string; + awsRegion: string; +} + +export interface SQSEvent { + Records: SQSRecord[]; +} + +export interface SQSRecordAttributes { + ApproximateReceiveCount: string; + SentTimestamp: string; + SenderId: string; + ApproximateFirstReceiveTimestamp: string; +} +export interface SQSMessageAttribute { + Name: string; + Type: string; + Value: string; +} +export interface SQSMessageAttributes { + [name: string]: SQSMessageAttribute; +} + /** * AWS Lambda handler function. * http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html @@ -686,6 +765,8 @@ export type SNSHandler = Handler; export type CognitoUserPoolTriggerHandler = Handler; // TODO: Different event/handler types for each event trigger so we can type the result? +export type SQSHandler = Handler; + // TODO: CognitoSync export type CloudFormationCustomResourceHandler = Handler; @@ -719,7 +800,8 @@ export type CloudFrontResponseCallback = Callback; export type KinesisStreamHandler = Handler; -// TODO: Kinesis Firehose +export type FirehoseTransformationCallback = Callback; +export type FirehoseTransformationHandler = Handler; export type CustomAuthorizerHandler = Handler; export type CustomAuthorizerCallback = Callback; diff --git a/types/babel__core/babel__core-tests.ts b/types/babel__core/babel__core-tests.ts new file mode 100644 index 0000000000..a873c3392f --- /dev/null +++ b/types/babel__core/babel__core-tests.ts @@ -0,0 +1,31 @@ +import * as babel from "@babel/core"; + +const options: babel.TransformOptions = { + ast: true, + sourceMaps: true +}; + +babel.transform("code();", options, (err, result) => { + const { code, map, ast } = result!; +}); + +const transformSyncResult = babel.transformSync("code();", options); +if (transformSyncResult) { + const { code, map, ast } = transformSyncResult; +} + +babel.transformFile("filename.js", options, (err, result) => { + const { code, map, ast } = result!; +}); + +babel.transformFileSync("filename.js", options)!.code; + +const sourceCode = "if (true) return;"; +const parsedAst = babel.parse(sourceCode, options); + +babel.transformFromAst(parsedAst!, sourceCode, options, (err, result) => { + const { code, map, ast } = result!; +}); + +const transformFromAstSyncResult = babel.transformFromAstSync(parsedAst!, sourceCode, options); +const { code, map, ast } = transformFromAstSyncResult!; diff --git a/types/babel__core/index.d.ts b/types/babel__core/index.d.ts new file mode 100644 index 0000000000..277228341b --- /dev/null +++ b/types/babel__core/index.d.ts @@ -0,0 +1,531 @@ +// Type definitions for @babel/core 7.0 +// Project: https://github.com/babel/babel/tree/master/packages/babel-core +// Definitions by: Troy Gerwien +// Marvin Hagemeister +// Melvin Groenhoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { GeneratorOptions } from "@babel/generator"; +import traverse, { Visitor, NodePath } from "@babel/traverse"; +import template from "@babel/template"; +import * as t from "@babel/types"; +import { ParseOptions } from "@babel/parser"; + +export { + ParseOptions, + GeneratorOptions, + t as types, + template, + traverse, + Visitor +}; + +export type Node = t.Node; +export type ParseResult = t.File | t.Program; +export const version: string; + +export interface TransformOptions { + /** + * Include the AST in the returned object + * + * Default: `false` + */ + ast?: boolean | null; + + /** + * Attach a comment after all non-user injected code + * + * Default: `null` + */ + auxiliaryCommentAfter?: string | null; + + /** + * Attach a comment before all non-user injected code + * + * Default: `null` + */ + auxiliaryCommentBefore?: string | null; + + /** + * Specify the "root" folder that defines the location to search for "babel.config.js", and the default folder to allow `.babelrc` files inside of. + * + * Default: `"."` + */ + root?: string | null; + + /** + * The config file to load Babel's config from. Defaults to searching for "babel.config.js" inside the "root" folder. `false` will disable searching for config files. + * + * Default: `undefined` + */ + configFile?: string | false | null; + + /** + * Specify whether or not to use .babelrc and + * .babelignore files. + * + * Default: `true` + */ + babelrc?: boolean | null; + + /** + * Specify which packages should be search for .babelrc files when they are being compiled. `true` to always search, or a path string or an array of paths to packages to search + * inside of. Defaults to only searching the "root" package. + * + * Default: `(root)` + */ + babelrcRoots?: true | string | string[] | null; + + /** + * Defaults to environment variable `BABEL_ENV` if set, or else `NODE_ENV` if set, or else it defaults to `"development"` + * + * Default: env vars + */ + envName?: string | null; + + /** + * Enable code generation + * + * Default: `true` + */ + code?: boolean | null; + + /** + * Output comments in generated output + * + * Default: `true` + */ + comments?: boolean | null; + + /** + * Do not include superfluous whitespace characters and line terminators. When set to `"auto"` compact is set to `true` on input sizes of >500KB + * + * Default: `"auto"` + */ + compact?: boolean | "auto" | null; + + /** + * The working directory that Babel's programmatic options are loaded relative to. + * + * Default: `"."` + */ + cwd?: string | null; + + /** + * This is an object of keys that represent different environments. For example, you may have: `{ env: { production: { \/* specific options *\/ } } }` + * which will use those options when the `envName` is `production` + * + * Default: `{}` + */ + env?: { [index: string]: TransformOptions | null | undefined; } | null; + + /** + * A path to a `.babelrc` file to extend + * + * Default: `null` + */ + extends?: string | null; + + /** + * Filename for use in errors etc + * + * Default: `"unknown"` + */ + filename?: string | null; + + /** + * Filename relative to `sourceRoot` + * + * Default: `(filename)` + */ + filenameRelative?: string | null; + + /** + * An object containing the options to be passed down to the babel code generator, @babel/generator + * + * Default: `{}` + */ + generatorOpts?: GeneratorOptions | null; + + /** + * Specify a custom callback to generate a module id with. Called as `getModuleId(moduleName)`. If falsy value is returned then the generated module id is used + * + * Default: `null` + */ + getModuleId?: ((moduleName: string) => string | null | undefined) | null; + + /** + * ANSI highlight syntax error code frames + * + * Default: `true` + */ + highlightCode?: boolean | null; + + /** + * Opposite to the `only` option. `ignore` is disregarded if `only` is specified + * + * Default: `null` + */ + ignore?: string[] | null; + + /** + * A source map object that the output source map will be based on + * + * Default: `null` + */ + inputSourceMap?: object | null; + + /** + * Should the output be minified (not printing last semicolons in blocks, printing literal string values instead of escaped ones, stripping `()` from `new` when safe) + * + * Default: `false` + */ + minified?: boolean | null; + + /** + * Specify a custom name for module ids + * + * Default: `null` + */ + moduleId?: string | null; + + /** + * If truthy, insert an explicit id for modules. By default, all modules are anonymous. (Not available for `common` modules) + * + * Default: `false` + */ + moduleIds?: boolean | null; + + /** + * Optional prefix for the AMD module formatter that will be prepend to the filename on module definitions + * + * Default: `(sourceRoot)` + */ + moduleRoot?: string | null; + + /** + * A glob, regex, or mixed array of both, matching paths to **only** compile. Can also be an array of arrays containing paths to explicitly match. When attempting to compile + * a non-matching file it's returned verbatim + * + * Default: `null` + */ + only?: string | RegExp | Array | null; + + /** + * An object containing the options to be passed down to the babel parser, @babel/parser + * + * Default: `{}` + */ + parserOpts?: ParseOptions | null; + + /** + * List of plugins to load and use + * + * Default: `[]` + */ + plugins?: PluginItem[] | null; + + /** + * List of presets (a set of plugins) to load and use + * + * Default: `[]` + */ + presets?: PluginItem[] | null; + + /** + * Retain line numbers. This will lead to wacky code but is handy for scenarios where you can't use source maps. (**NOTE**: This will not retain the columns) + * + * Default: `false` + */ + retainLines?: boolean | null; + + /** + * An optional callback that controls whether a comment should be output or not. Called as `shouldPrintComment(commentContents)`. **NOTE**: This overrides the `comment` option when used + * + * Default: `null` + */ + shouldPrintComment?: ((commentContents: string) => boolean) | null; + + /** + * Set `sources[0]` on returned source map + * + * Default: `(filenameRelative)` + */ + sourceFileName?: string | null; + + /** + * If truthy, adds a `map` property to returned output. If set to `"inline"`, a comment with a sourceMappingURL directive is added to the bottom of the returned code. If set to `"both"` + * then a `map` property is returned as well as a source map comment appended. **This does not emit sourcemap files by itself!** + * + * Default: `false` + */ + sourceMaps?: boolean | "inline" | "both" | null; + + /** + * The root from which all sources are relative + * + * Default: `(moduleRoot)` + */ + sourceRoot?: string | null; + + /** + * Indicate the mode the code should be parsed in. Can be one of "script", "module", or "unambiguous". `"unambiguous"` will make Babel attempt to guess, based on the presence of ES6 + * `import` or `export` statements. Files with ES6 `import`s and `export`s are considered `"module"` and are otherwise `"script"`. + * + * Default: `("module")` + */ + sourceType?: "script" | "module" | "unambiguous" | null; + + /** + * An optional callback that can be used to wrap visitor methods. **NOTE**: This is useful for things like introspection, and not really needed for implementing anything. Called as + * `wrapPluginVisitorMethod(pluginAlias, visitorType, callback)`. + */ + wrapPluginVisitorMethod?: ((pluginAlias: string, visitorType: "enter" | "exit", callback: (path: NodePath, state: any) => void) => (path: NodePath, state: any) => void) | null; +} + +export type FileResultCallback = (err: Error | null, result: BabelFileResult | null) => any; + +/** + * Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST. + */ +export function transform(code: string, callback: FileResultCallback): void; + +/** + * Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST. + */ +export function transform(code: string, opts: TransformOptions | undefined, callback: FileResultCallback): void; + +/** + * Here for backward-compatibility. Ideally use `transformSync` if you want a synchronous API. + */ +export function transform(code: string, opts?: TransformOptions): BabelFileResult | null; + +/** + * Transforms the passed in code. Returning an object with the generated code, source map, and AST. + */ +export function transformSync(code: string, opts?: TransformOptions): BabelFileResult | null; + +/** + * Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST. + */ +export function transformAsync(code: string, opts?: TransformOptions): Promise; + +/** + * Asynchronously transforms the entire contents of a file. + */ +export function transformFile(filename: string, callback: FileResultCallback): void; + +/** + * Asynchronously transforms the entire contents of a file. + */ +export function transformFile(filename: string, opts: TransformOptions | undefined, callback: FileResultCallback): void; + +/** + * Synchronous version of `babel.transformFile`. Returns the transformed contents of the `filename`. + */ +export function transformFileSync(filename: string, opts?: TransformOptions): BabelFileResult | null; + +/** + * Asynchronously transforms the entire contents of a file. + */ +export function transformFileAsync(filename: string, opts?: TransformOptions): Promise; + +/** + * Given an AST, transform it. + */ +export function transformFromAst(ast: Node, code: string | undefined, callback: FileResultCallback): void; + +/** + * Given an AST, transform it. + */ +export function transformFromAst(ast: Node, code: string | undefined, opts: TransformOptions | undefined, callback: FileResultCallback): void; + +/** + * Here for backward-compatibility. Ideally use ".transformSync" if you want a synchronous API. + */ +export function transformFromAstSync(ast: Node, code?: string, opts?: TransformOptions): BabelFileResult | null; + +/** + * Given an AST, transform it. + */ +export function transformFromAstSync(ast: Node, code?: string, opts?: TransformOptions): Promise; + +// A babel plugin is a simple function which must return an object matching +// the following interface. Babel will throw if it finds unknown properties. +// The list of allowed plugin keys is here: +// https://github.com/babel/babel/blob/4e50b2d9d9c376cee7a2cbf56553fe5b982ea53c/packages/babel-core/src/config/option-manager.js#L71 +export interface PluginObj { + name?: string; + manipulateOptions?(opts: any, parserOpts: any): void; + pre?(this: S, state: any): void; + visitor: Visitor; + post?(this: S, state: any): void; + inherits?: any; +} + +export interface BabelFileResult { + ast?: Node | null; + code?: string | null; + ignored?: boolean; + map?: { + version: number; + sources: string[]; + names: string[]; + sourceRoot?: string; + sourcesContent?: string[]; + mappings: string; + file: string; + } | null; + metadata?: BabelFileMetadata; +} + +export interface BabelFileMetadata { + usedHelpers: string[]; + marked: Array<{ + type: string; + message: string; + loc: object; + }>; + modules: BabelFileModulesMetadata; +} + +export interface BabelFileModulesMetadata { + imports: object[]; + exports: { + exported: object[]; + specifiers: object[]; + }; +} + +export type FileParseCallback = (err: Error | null, result: ParseResult | null) => any; + +/** + * Given some code, parse it using Babel's standard behavior. + * Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled. + */ +export function parse(code: string, callback: FileParseCallback): void; + +/** + * Given some code, parse it using Babel's standard behavior. + * Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled. + */ +export function parse(code: string, options: TransformOptions | undefined, callback: FileParseCallback): void; + +/** + * Given some code, parse it using Babel's standard behavior. + * Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled. + */ +export function parse(code: string, options?: TransformOptions): ParseResult | null; + +/** + * Given some code, parse it using Babel's standard behavior. + * Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled. + */ +export function parseSync(code: string, options?: TransformOptions): ParseResult | null; + +/** + * Given some code, parse it using Babel's standard behavior. + * Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled. + */ +export function parseAsync(code: string, options?: TransformOptions): Promise; + +/** + * Resolve Babel's options fully, resulting in an options object where: + * + * * opts.plugins is a full list of Plugin instances. + * * opts.presets is empty and all presets are flattened into opts. + * * It can be safely passed back to Babel. Fields like babelrc have been set to false so that later calls to Babel + * will not make a second attempt to load config files. + * + * Plugin instances aren't meant to be manipulated directly, but often callers will serialize this opts to JSON to + * use it as a cache key representing the options Babel has received. Caching on this isn't 100% guaranteed to + * invalidate properly, but it is the best we have at the moment. + */ +export function loadOptions(options?: TransformOptions): object | null; + +/** + * To allow systems to easily manipulate and validate a user's config, this function resolves the plugins and + * presets and proceeds no further. The expectation is that callers will take the config's .options, manipulate it + * as then see fit and pass it back to Babel again. + * + * * `babelrc: string | void` - The path of the `.babelrc` file, if there was one. + * * `babelignore: string | void` - The path of the `.babelignore` file, if there was one. + * * `options: ValidatedOptions` - The partially resolved options, which can be manipulated and passed back + * to Babel again. + * * `plugins: Array` - See below. + * * `presets: Array` - See below. + * * It can be safely passed back to Babel. Fields like `babelrc` have been set to false so that later calls to + * Babel will not make a second attempt to load config files. + * + * `ConfigItem` instances expose properties to introspect the values, but each item should be treated as + * immutable. If changes are desired, the item should be removed from the list and replaced with either a normal + * Babel config value, or with a replacement item created by `babel.createConfigItem`. See that function for + * information about `ConfigItem` fields. + */ +export function loadPartialConfig(options?: TransformOptions): Readonly | null; + +export interface PartialConfig { + options: TransformOptions; + babelrc?: string; + babelignore?: string; + config?: string; +} + +export interface ConfigItem { + /** + * The name that the user gave the plugin instance, e.g. `plugins: [ ['env', {}, 'my-env'] ]` + */ + name?: string; + + /** + * The resolved value of the plugin. + */ + value: object | ((...args: any[]) => any); + + /** + * The options object passed to the plugin. + */ + options?: object | false; + + /** + * The path that the options are relative to. + */ + dirname: string; + + /** + * Information about the plugin's file, if Babel knows it. + * * + */ + file?: { + /** + * The file that the user requested, e.g. `"@babel/env"` + */ + request: string; + + /** + * The full path of the resolved file, e.g. `"/tmp/node_modules/@babel/preset-env/lib/index.js"` + */ + resolved: string; + } | null; +} + +export type PluginOptions = object | undefined | false; + +export type PluginTarget = string | object | ((...args: any[]) => any); + +export type PluginItem = ConfigItem | PluginObj | PluginTarget | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined]; + +export interface CreateConfigItemOptions { + dirname?: string; + type?: "preset" | "plugin"; +} + +/** + * Allows build tooling to create and cache config items up front. If this function is called multiple times for a + * given plugin, Babel will call the plugin's function itself multiple times. If you have a clear set of expected + * plugins and presets to inject, pre-constructing the config items would be recommended. + */ +export function createConfigItem(value: PluginTarget | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined], options?: CreateConfigItemOptions): ConfigItem; + +export as namespace babel; diff --git a/types/babel__core/package.json b/types/babel__core/package.json new file mode 100644 index 0000000000..c2ca8a8f9b --- /dev/null +++ b/types/babel__core/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "@babel/types": "^7.0.0-beta.54" + } +} diff --git a/types/babel__core/tsconfig.json b/types/babel__core/tsconfig.json new file mode 100644 index 0000000000..2f96e019cb --- /dev/null +++ b/types/babel__core/tsconfig.json @@ -0,0 +1,40 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "@babel/core": [ + "babel__core" + ], + "@babel/generator": [ + "babel__generator" + ], + "@babel/parser": [ + "babel__parser" + ], + "@babel/template": [ + "babel__template" + ], + "@babel/traverse": [ + "babel__traverse" + ] + } + }, + "files": [ + "index.d.ts", + "babel__core-tests.ts" + ] +} diff --git a/types/babel__core/tslint.json b/types/babel__core/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/babel__core/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/babel__generator/babel__generator-tests.ts b/types/babel__generator/babel__generator-tests.ts new file mode 100644 index 0000000000..90a668ad55 --- /dev/null +++ b/types/babel__generator/babel__generator-tests.ts @@ -0,0 +1,23 @@ +// Example from https://github.com/babel/babel/tree/master/packages/babel-generator +import generate from "@babel/generator"; +import { parse } from "@babel/parser"; + +const code = "class Example {}"; +const ast = parse(code); + +ast.type; +ast.loc!.start; + +const output = generate(ast, { /* options */ }, code); + +// Example from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-generator +const result = generate(ast, { + retainLines: false, + compact: "auto", + concise: false, + quotes: "double", + jsonCompatibleStrings: true, + // ... +}, code); +result.code; +result.map; diff --git a/types/babel__generator/index.d.ts b/types/babel__generator/index.d.ts new file mode 100644 index 0000000000..03fcf2765a --- /dev/null +++ b/types/babel__generator/index.d.ts @@ -0,0 +1,117 @@ +// Type definitions for @babel/generator 7.0 +// Project: https://github.com/babel/babel/tree/master/packages/babel-generator +// Definitions by: Troy Gerwien +// Johnny Estilles +// Melvin Groenhoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as t from "@babel/types"; + +export interface GeneratorOptions { + /** + * Optional string to add as a block comment at the start of the output file. + */ + auxiliaryCommentBefore?: string; + + /** + * Optional string to add as a block comment at the end of the output file. + */ + auxiliaryCommentAfter?: string; + + /** + * Function that takes a comment (as a string) and returns true if the comment should be included in the output. + * By default, comments are included if `opts.comments` is `true` or if `opts.minifed` is `false` and the comment + * contains `@preserve` or `@license`. + */ + shouldPrintComment?(comment: string): boolean; + + /** + * Attempt to use the same line numbers in the output code as in the source code (helps preserve stack traces). + * Defaults to `false`. + */ + retainLines?: boolean; + + /** + * Should comments be included in output? Defaults to `true`. + */ + comments?: boolean; + + /** + * Set to true to avoid adding whitespace for formatting. Defaults to the value of `opts.minified`. + */ + compact?: boolean | "auto"; + + /** + * Should the output be minified. Defaults to `false`. + */ + minified?: boolean; + + /** + * Set to true to reduce whitespace (but not as much as opts.compact). Defaults to `false`. + */ + concise?: boolean; + + /** + * The type of quote to use in the output. If omitted, autodetects based on `ast.tokens`. + */ + quotes?: "single" | "double"; + + /** + * Used in warning messages + */ + filename?: string; + + /** + * Enable generating source maps. Defaults to `false`. + */ + sourceMaps?: boolean; + + /** + * The filename of the generated code that the source map will be associated with. + */ + sourceMapTarget?: string; + + /** + * A root for all relative URLs in the source map. + */ + sourceRoot?: string; + + /** + * The filename for the source code (i.e. the code in the `code` argument). + * This will only be used if `code` is a string. + */ + sourceFileName?: string; + + /** + * Set to true to run jsesc with "json": true to print "\u00A9" vs. "©"; + */ + jsonCompatibleStrings?: boolean; +} + +export class CodeGenerator { + constructor(ast: t.Node, opts?: GeneratorOptions, code?: string); + generate(): GeneratorResult; +} + +/** + * Turns an AST into code, maintaining sourcemaps, user preferences, and valid output. + * @param ast - the abstract syntax tree from which to generate output code. + * @param opts - used for specifying options for code generation. + * @param code - the original source code, used for source maps. + * @returns - an object containing the output code and source map. + */ +export default function generate(ast: t.Node, opts?: GeneratorOptions, code?: string | { [filename: string]: string; }): GeneratorResult; + +export interface GeneratorResult { + code: string; + map: { + version: number; + sources: string[]; + names: string[]; + sourceRoot?: string; + sourcesContent?: string[]; + mappings: string; + file: string; + } | null; +} diff --git a/types/babel__generator/package.json b/types/babel__generator/package.json new file mode 100644 index 0000000000..c2ca8a8f9b --- /dev/null +++ b/types/babel__generator/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "@babel/types": "^7.0.0-beta.54" + } +} diff --git a/types/babel__generator/tsconfig.json b/types/babel__generator/tsconfig.json new file mode 100644 index 0000000000..be65e3da1f --- /dev/null +++ b/types/babel__generator/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "@babel/generator": [ + "babel__generator" + ], + "@babel/parser": [ + "babel__parser" + ] + } + }, + "files": [ + "index.d.ts", + "babel__generator-tests.ts" + ] +} diff --git a/types/babel__generator/tslint.json b/types/babel__generator/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/babel__generator/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/babel__parser/babel__parser-tests.ts b/types/babel__parser/babel__parser-tests.ts new file mode 100644 index 0000000000..1c9873e5e8 --- /dev/null +++ b/types/babel__parser/babel__parser-tests.ts @@ -0,0 +1,18 @@ +import { parse, parseExpression } from "@babel/parser"; + +declare function assert(expr: boolean): void; + +const code = `function square(n) { + return n * n; +}`; + +const node = parse(code); +assert(node.type === "File"); +assert(node.start === 0); +assert(node.end === 38); +assert(!!node.loc && node.loc.start > node.loc.end); + +parse(code, { + sourceType: "module", // default: "script" + plugins: ["jsx"] // default: [] +}); diff --git a/types/babel__parser/index.d.ts b/types/babel__parser/index.d.ts new file mode 100644 index 0000000000..bf383ffa0c --- /dev/null +++ b/types/babel__parser/index.d.ts @@ -0,0 +1,107 @@ +// Type definitions for @babel/parser 7.0 +// Project: https://github.com/babel/babel/tree/master/packages/babel-parser +// Definitions by: Troy Gerwien +// Marvin Hagemeister +// Melvin Groenhoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { File, Expression } from "@babel/types"; + +export function parse(code: string, opts?: ParseOptions): File; + +export function parseExpression(input: string, options?: ParseOptions): Expression; + +export interface ParseOptions { + /** + * By default, import and export declarations can only appear at a program's top level. + * Setting this option to true allows them anywhere where a statement is allowed. + */ + allowImportExportEverywhere?: boolean; + + /** + * By default, await use is not allowed outside of an async function. Set this to true to accept such code. + */ + allowAwaitOutsideFunction?: boolean; + + /** + * By default, a return statement at the top level raises an error. Set this to true to accept such code. + */ + allowReturnOutsideFunction?: boolean; + + allowSuperOutsideMethod?: boolean; + + /** + * Indicate the mode the code should be parsed in. Can be one of "script", "module", or "unambiguous". + * Defaults to "script". "unambiguous" will make @babel/parser attempt to guess, based on the presence of ES6 import or export + * statements. Files with ES6 imports and exports are considered "module" and are otherwise "script". + */ + sourceType?: "script" | "module" | "unambiguous"; + + /** + * Correlate output AST nodes with their source filename. Useful when + * generating code and source maps from the ASTs of multiple input files. + */ + sourceFilename?: string; + + /** + * By default, the first line of code parsed is treated as line 1. You can provide a line number to alternatively start with. Useful + * for integration with other source tools. + */ + startLine?: number; + + /** + * Array containing the plugins that you want to enable. + */ + plugins?: PluginList; + + strictMode?: boolean; + + /** + * Adds a `ranges` property to each node: `[node.start, node.end]` + */ + ranges?: boolean; + + /** + * Adds all parsed tokens to a `tokens` property on the `File` node + */ + tokens?: boolean; +} + +export type PluginList = Array; + +export type PluginName = + "asyncGenerators" | + "bigInt" | + "classPrivateMethods" | + "classPrivateProperties" | + "classProperties" | + "decorators" | + "doExpressions" | + "dynamicImport" | + "estree" | + "exportDefaultFrom" | + "exportNamespaceFrom" | + "flow" | + "flowComments" | + "functionBind" | + "functionSent" | + "importMeta" | + "jsx" | + "nullishCoalescingOperator" | + "numericSeparator" | + "objectRestSpread" | + "optionalCatchBinding" | + "optionalChaining" | + "pipelineOperator" | + "throwExpressions" | + "typescript"; + +export interface PluginOptions { + decorators?: { + decoratorsBeforeExport?: boolean; + }; + flow?: { + all?: boolean; + }; +} diff --git a/types/babel__parser/package.json b/types/babel__parser/package.json new file mode 100644 index 0000000000..c2ca8a8f9b --- /dev/null +++ b/types/babel__parser/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "@babel/types": "^7.0.0-beta.54" + } +} diff --git a/types/babel__parser/tsconfig.json b/types/babel__parser/tsconfig.json new file mode 100644 index 0000000000..53fd02ec18 --- /dev/null +++ b/types/babel__parser/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "@babel/parser": [ + "babel__parser" + ] + } + }, + "files": [ + "index.d.ts", + "babel__parser-tests.ts" + ] +} diff --git a/types/babel__parser/tslint.json b/types/babel__parser/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/babel__parser/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/babel__template/babel__template-tests.ts b/types/babel__template/babel__template-tests.ts new file mode 100644 index 0000000000..167cf4db2f --- /dev/null +++ b/types/babel__template/babel__template-tests.ts @@ -0,0 +1,34 @@ +import template from "@babel/template"; +import generate from "@babel/generator"; +import * as t from "@babel/types"; + +const buildRequire = template.statement(` + var IMPORT_NAME = require(SOURCE); +`); + +const ast1 = buildRequire({ + IMPORT_NAME: t.identifier("myModule"), + SOURCE: t.stringLiteral("my-module") +}); + +console.log(generate(ast1).code); + +const ast2 = template.ast(` + var myModule = require("my-module"); +`); + +const fn = template.statement` + var IMPORT_NAME = require('${"my-module"}'); +`; + +const ast3 = fn({ + IMPORT_NAME: t.identifier("myModule") +}); + +console.log(generate(ast3).code); + +declare const mod: string; + +const ast4 = template.ast` + var ${mod} = require("${name}"); +`; diff --git a/types/babel__template/index.d.ts b/types/babel__template/index.d.ts new file mode 100644 index 0000000000..5f3bc18bc3 --- /dev/null +++ b/types/babel__template/index.d.ts @@ -0,0 +1,72 @@ +// Type definitions for @babel/template 7.0 +// Project: https://github.com/babel/babel/tree/master/packages/babel-template +// Definitions by: Troy Gerwien +// Marvin Hagemeister +// Melvin Groenhoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { ParseOptions } from "@babel/parser"; +import { Expression, File, Program, Statement } from "@babel/types"; + +export interface TemplateBuilderOptions extends ParseOptions { + /** + * A set of placeholder names to automatically accept. Items in this list do not need to match the given placeholder pattern. + */ + placeholderWhitelist?: Set; + + /** + * A pattern to search for when looking for Identifier and StringLiteral nodes that should be considered placeholders. `false` will + * disable placeholder searching entirely, leaving only the `placeholderWhitelist` value to find placeholders. + */ + placeholderPattern?: RegExp | false; + + /** + * Set this to `true` to preserve any comments from the `code` parameter. + */ + preserveComments?: boolean; +} + +export interface TemplateBuilder { + /** + * Build a new builder, merging the given options with the previous ones. + */ + (opts: TemplateBuilderOptions): TemplateBuilder; + + /** + * Building from a string produces an AST builder function by default. + */ + (code: string, opts?: TemplateBuilderOptions): (arg?: PublicReplacements) => T; + + /** + * Building from a template literal produces an AST builder function by default. + */ + (tpl: TemplateStringsArray, ...args: any[]): (arg?: PublicReplacements) => T; + + // Allow users to explicitly create templates that produce ASTs, skipping the need for an intermediate function. + ast: { + (tpl: string, opts?: TemplateBuilderOptions): T; + (tpl: TemplateStringsArray, ...args: any[]): T; + }; +} + +export type PublicReplacements = { [index: string]: any; } | any[]; + +export const smart: TemplateBuilder; +export const statement: TemplateBuilder; +export const statements: TemplateBuilder; +export const expression: TemplateBuilder; +export const program: TemplateBuilder; + +type DefaultTemplateBuilder = typeof smart & { + smart: typeof smart; + statement: typeof statement; + statements: typeof statements; + expression: typeof expression; + program: typeof program; + ast: typeof smart.ast; +}; + +declare const templateBuilder: DefaultTemplateBuilder; + +export default templateBuilder; diff --git a/types/babel__template/package.json b/types/babel__template/package.json new file mode 100644 index 0000000000..c2ca8a8f9b --- /dev/null +++ b/types/babel__template/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "@babel/types": "^7.0.0-beta.54" + } +} diff --git a/types/babel__template/tsconfig.json b/types/babel__template/tsconfig.json new file mode 100644 index 0000000000..386236c02f --- /dev/null +++ b/types/babel__template/tsconfig.json @@ -0,0 +1,35 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "@babel/generator": [ + "babel__generator" + ], + "@babel/parser": [ + "babel__parser" + ], + "@babel/template": [ + "babel__template" + ] + } + }, + "files": [ + "index.d.ts", + "babel__template-tests.ts" + ] +} diff --git a/types/babel__template/tslint.json b/types/babel__template/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/babel__template/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/babel__traverse/babel__traverse-tests.ts b/types/babel__traverse/babel__traverse-tests.ts new file mode 100644 index 0000000000..2fc7b07a8a --- /dev/null +++ b/types/babel__traverse/babel__traverse-tests.ts @@ -0,0 +1,115 @@ +import { parse } from "@babel/parser"; +import traverse, { Visitor } from "@babel/traverse"; +import * as t from "@babel/types"; + +// Examples from: https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md +const MyVisitor: Visitor = { + Identifier: { + enter() { + console.log("Entered!"); + }, + exit() { + console.log("Exited!"); + } + } +}; + +const MyVisitor2: Visitor = { + Identifier(path) { + console.log("Visiting: " + path.node.name); + } +}; + +// Example from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-traverse +const code = `function square(n) { + return n * n; +}`; + +const ast = parse(code); + +traverse(ast, { + enter(path) { + const node = path.node; + if (t.isIdentifier(node) && node.name === "n") { + node.name = "x"; + } + } +}); + +// Examples from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#writing-your-first-babel-plugin + +const v1: Visitor = { + BinaryExpression(path) { + if (t.isIdentifier(path.node.left)) { + // ... + } + path.replaceWith( + t.binaryExpression("**", path.node.left, t.numericLiteral(2)) + ); + path.parentPath.replaceWith( + t.expressionStatement(t.stringLiteral("Anyway the wind blows, doesn't really matter to me, to me.")) + ); + path.parentPath.remove(); + }, + + Identifier(path) { + if (path.isReferencedIdentifier()) { + // ... + } + if (t.isQualifiedTypeIdentifier(path.node, path.parent)) { + // ... + } + }, + + ReturnStatement(path) { + path.replaceWithMultiple([ + t.expressionStatement(t.stringLiteral("Is this the real life?")), + t.expressionStatement(t.stringLiteral("Is this just fantasy?")), + t.expressionStatement(t.stringLiteral("(Enjoy singing the rest of the song in your head)")), + ]); + }, + + FunctionDeclaration(path, state) { + path.replaceWithSourceString(`function add(a, b) { + return a + b; + }`); + + path.insertBefore(t.expressionStatement(t.stringLiteral("Because I'm easy come, easy go."))); + path.insertAfter(t.expressionStatement(t.stringLiteral("A little high, little low."))); + path.remove(); + + if (path.scope.hasBinding("n")) { + // ... + } + if (path.scope.hasOwnBinding("n")) { + // ... + } + + const id1 = path.scope.generateUidIdentifier("uid"); + id1.type; + id1.name; + const id2 = path.scope.generateUidIdentifier("uid"); + id2.type; + id2.name; + + const id = path.scope.generateUidIdentifierBasedOnNode(path.node.id!); + path.remove(); + path.scope.parent.push({ id, init: path.node }); + + path.scope.rename("n", "x"); + path.scope.rename("n"); + } +}; + +// Binding.kind +const BindingKindTest: Visitor = { + Identifier(path) { + const kind = path.scope.getBinding("str")!.kind; + kind === 'module'; + kind === 'const'; + kind === 'let'; + kind === 'var'; + // The following should fail when uncommented + // kind === 'anythingElse'; + }, +}; diff --git a/types/babel__traverse/index.d.ts b/types/babel__traverse/index.d.ts new file mode 100644 index 0000000000..475ca9fb14 --- /dev/null +++ b/types/babel__traverse/index.d.ts @@ -0,0 +1,810 @@ +// Type definitions for @babel/traverse 7.0 +// Project: https://github.com/babel/babel/tree/master/packages/babel-traverse +// Definitions by: Troy Gerwien +// Marvin Hagemeister +// Ryan Petrich +// Melvin Groenhoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as t from "@babel/types"; + +export type Node = t.Node; + +export default function traverse(parent: Node | Node[], opts: TraverseOptions, scope: Scope, state: S, parentPath?: NodePath): void; +export default function traverse(parent: Node | Node[], opts: TraverseOptions, scope?: Scope, state?: any, parentPath?: NodePath): void; + +export interface TraverseOptions extends Visitor { + scope?: Scope; + noScope?: boolean; +} + +export class Scope { + constructor(path: NodePath, parentScope?: Scope); + path: NodePath; + block: Node; + parentBlock: Node; + parent: Scope; + hub: Hub; + bindings: { [name: string]: Binding; }; + + /** Traverse node with current scope and path. */ + traverse(node: Node | Node[], opts: TraverseOptions, state: S): void; + traverse(node: Node | Node[], opts?: TraverseOptions, state?: any): void; + + /** Generate a unique identifier and add it to the current scope. */ + generateDeclaredUidIdentifier(name?: string): t.Identifier; + + /** Generate a unique identifier. */ + generateUidIdentifier(name?: string): t.Identifier; + + /** Generate a unique `_id1` binding. */ + generateUid(name?: string): string; + + /** Generate a unique identifier based on a node. */ + generateUidIdentifierBasedOnNode(parent: Node, defaultName?: string): t.Identifier; + + /** + * Determine whether evaluating the specific input `node` is a consequenceless reference. ie. + * evaluating it wont result in potentially arbitrary code from being ran. The following are + * whitelisted and determined not to cause side effects: + * + * - `this` expressions + * - `super` expressions + * - Bound identifiers + */ + isStatic(node: Node): boolean; + + /** Possibly generate a memoised identifier if it is not static and has consequences. */ + maybeGenerateMemoised(node: Node, dontPush?: boolean): t.Identifier; + + checkBlockScopedCollisions(local: Node, kind: string, name: string, id: object): void; + + rename(oldName: string, newName?: string, block?: Node): void; + + dump(): void; + + toArray(node: Node, i?: number): Node; + + registerDeclaration(path: NodePath): void; + + buildUndefinedNode(): Node; + + registerConstantViolation(path: NodePath): void; + + registerBinding(kind: string, path: NodePath, bindingPath?: NodePath): void; + + addGlobal(node: Node): void; + + hasUid(name: string): boolean; + + hasGlobal(name: string): boolean; + + hasReference(name: string): boolean; + + isPure(node: Node, constantsOnly?: boolean): boolean; + + setData(key: string, val: any): any; + + getData(key: string): any; + + removeData(key: string): void; + + push(opts: any): void; + + getProgramParent(): Scope; + + getFunctionParent(): Scope; + + getBlockParent(): Scope; + + /** Walks the scope tree and gathers **all** bindings. */ + getAllBindings(...kinds: string[]): object; + + bindingIdentifierEquals(name: string, node: Node): boolean; + + getBinding(name: string): Binding | undefined; + + getOwnBinding(name: string): Binding | undefined; + + getBindingIdentifier(name: string): t.Identifier; + + getOwnBindingIdentifier(name: string): t.Identifier; + + hasOwnBinding(name: string): boolean; + + hasBinding(name: string, noGlobals?: boolean): boolean; + + parentHasBinding(name: string, noGlobals?: boolean): boolean; + + /** Move a binding of `name` to another `scope`. */ + moveBindingTo(name: string, scope: Scope): void; + + removeOwnBinding(name: string): void; + + removeBinding(name: string): void; +} + +export class Binding { + constructor(opts: { existing: Binding; identifier: t.Identifier; scope: Scope; path: NodePath; kind: "var" | "let" | "const"; }); + identifier: t.Identifier; + scope: Scope; + path: NodePath; + kind: "var" | "let" | "const" | "module"; + referenced: boolean; + references: number; + referencePaths: NodePath[]; + constant: boolean; + constantViolations: NodePath[]; +} + +export type Visitor = VisitNodeObject & { + [P in Node["type"]]?: VisitNode>; +}; + +export type VisitNode = VisitNodeFunction | VisitNodeObject; + +export type VisitNodeFunction = (this: T, path: NodePath

, state: any) => void; + +export interface VisitNodeObject { + enter?(path: NodePath, state: any): void; + exit?(path: NodePath, state: any): void; +} + +export class NodePath { + constructor(hub: Hub, parent: Node); + parent: Node; + hub: Hub; + contexts: TraversalContext[]; + data: object; + shouldSkip: boolean; + shouldStop: boolean; + removed: boolean; + state: any; + opts: object; + skipKeys: object; + parentPath: NodePath; + context: TraversalContext; + container: object | object[]; + listKey: string; + inList: boolean; + parentKey: string; + key: string | number; + node: T; + scope: Scope; + type: T extends undefined | null ? string | null : string; + typeAnnotation: object; + + getScope(scope: Scope): Scope; + + setData(key: string, val: any): any; + + getData(key: string, def?: any): any; + + buildCodeFrameError(msg: string, Error?: new (msg: string) => TError): TError; + + traverse(visitor: Visitor, state: T): void; + traverse(visitor: Visitor): void; + + set(key: string, node: Node): void; + + getPathLocation(): string; + + // Example: https://github.com/babel/babel/blob/63204ae51e020d84a5b246312f5eeb4d981ab952/packages/babel-traverse/src/path/modification.js#L83 + debug(buildMessage: () => string): void; + + // ------------------------- ancestry ------------------------- + /** + * Call the provided `callback` with the `NodePath`s of all the parents. + * When the `callback` returns a truthy value, we return that node path. + */ + findParent(callback: (path: NodePath) => boolean): NodePath; + + find(callback: (path: NodePath) => boolean): NodePath; + + /** Get the parent function of the current path. */ + getFunctionParent(): NodePath; + + /** Walk up the tree until we hit a parent node path in a list. */ + getStatementParent(): NodePath; + + /** + * Get the deepest common ancestor and then from it, get the earliest relationship path + * to that ancestor. + * + * Earliest is defined as being "before" all the other nodes in terms of list container + * position and visiting key. + */ + getEarliestCommonAncestorFrom(paths: NodePath[]): NodePath[]; + + /** Get the earliest path in the tree where the provided `paths` intersect. */ + getDeepestCommonAncestorFrom( + paths: NodePath[], + filter?: (deepest: Node, i: number, ancestries: NodePath[]) => NodePath + ): NodePath; + + /** + * Build an array of node paths containing the entire ancestry of the current node path. + * + * NOTE: The current node path is included in this. + */ + getAncestry(): NodePath[]; + + inType(...candidateTypes: string[]): boolean; + + // ------------------------- inference ------------------------- + /** Infer the type of the current `NodePath`. */ + getTypeAnnotation(): t.FlowType; + + isBaseType(baseName: string, soft?: boolean): boolean; + + couldBeBaseType(name: string): boolean; + + baseTypeStrictlyMatches(right: NodePath): boolean; + + isGenericType(genericName: string): boolean; + + // ------------------------- replacement ------------------------- + /** + * Replace a node with an array of multiple. This method performs the following steps: + * + * - Inherit the comments of first provided node with that of the current node. + * - Insert the provided nodes after the current node. + * - Remove the current node. + */ + replaceWithMultiple(nodes: Node[]): void; + + /** + * Parse a string as an expression and replace the current node with the result. + * + * NOTE: This is typically not a good idea to use. Building source strings when + * transforming ASTs is an antipattern and SHOULD NOT be encouraged. Even if it's + * easier to use, your transforms will be extremely brittle. + */ + replaceWithSourceString(replacement: any): void; + + /** Replace the current node with another. */ + replaceWith(replacement: Node | NodePath): void; + + /** + * This method takes an array of statements nodes and then explodes it + * into expressions. This method retains completion records which is + * extremely important to retain original semantics. + */ + replaceExpressionWithStatements(nodes: Node[]): Node; + + replaceInline(nodes: Node | Node[]): void; + + // ------------------------- evaluation ------------------------- + /** + * Walk the input `node` and statically evaluate if it's truthy. + * + * Returning `true` when we're sure that the expression will evaluate to a + * truthy value, `false` if we're sure that it will evaluate to a falsy + * value and `undefined` if we aren't sure. Because of this please do not + * rely on coercion when using this method and check with === if it's false. + */ + evaluateTruthy(): boolean; + + /** + * Walk the input `node` and statically evaluate it. + * + * Returns an object in the form `{ confident, value }`. `confident` indicates + * whether or not we had to drop out of evaluating the expression because of + * hitting an unknown node that we couldn't confidently find the value of. + * + * Example: + * + * t.evaluate(parse("5 + 5")) // { confident: true, value: 10 } + * t.evaluate(parse("!true")) // { confident: true, value: false } + * t.evaluate(parse("foo + foo")) // { confident: false, value: undefined } + */ + evaluate(): { confident: boolean; value: any }; + + // ------------------------- introspection ------------------------- + /** + * Match the current node if it matches the provided `pattern`. + * + * For example, given the match `React.createClass` it would match the + * parsed nodes of `React.createClass` and `React["createClass"]`. + */ + matchesPattern(pattern: string, allowPartial?: boolean): boolean; + + /** + * Check whether we have the input `key`. If the `key` references an array then we check + * if the array has any items, otherwise we just check if it's falsy. + */ + has(key: string): boolean; + + isStatic(): boolean; + + /** Alias of `has`. */ + is(key: string): boolean; + + /** Opposite of `has`. */ + isnt(key: string): boolean; + + /** Check whether the path node `key` strict equals `value`. */ + equals(key: string, value: any): boolean; + + /** + * Check the type against our stored internal type of the node. This is handy when a node has + * been removed yet we still internally know the type and need it to calculate node replacement. + */ + isNodeType(type: string): boolean; + + /** + * This checks whether or not we're in one of the following positions: + * + * for (KEY in right); + * for (KEY;;); + * + * This is because these spots allow VariableDeclarations AND normal expressions so we need + * to tell the path replacement that it's ok to replace this with an expression. + */ + canHaveVariableDeclarationOrExpression(): boolean; + + /** + * This checks whether we are swapping an arrow function's body between an + * expression and a block statement (or vice versa). + * + * This is because arrow functions may implicitly return an expression, which + * is the same as containing a block statement. + */ + canSwapBetweenExpressionAndStatement(replacement: Node): boolean; + + /** Check whether the current path references a completion record */ + isCompletionRecord(allowInsideFunction?: boolean): boolean; + + /** + * Check whether or not the current `key` allows either a single statement or block statement + * so we can explode it if necessary. + */ + isStatementOrBlock(): boolean; + + /** Check if the currently assigned path references the `importName` of `moduleSource`. */ + referencesImport(moduleSource: string, importName: string): boolean; + + /** Get the source code associated with this node. */ + getSource(): string; + + /** Check if the current path will maybe execute before another path */ + willIMaybeExecuteBefore(path: NodePath): boolean; + + // ------------------------- context ------------------------- + call(key: string): boolean; + + isBlacklisted(): boolean; + + visit(): boolean; + + skip(): void; + + skipKey(key: string): void; + + stop(): void; + + setScope(): void; + + setContext(context: TraversalContext): NodePath; + + popContext(): void; + + pushContext(context: TraversalContext): void; + + // ------------------------- removal ------------------------- + remove(): void; + + // ------------------------- modification ------------------------- + /** Insert the provided nodes before the current one. */ + insertBefore(nodes: Node | Node[]): any; + + /** + * Insert the provided nodes after the current one. When inserting nodes after an + * expression, ensure that the completion record is correct by pushing the current node. + */ + insertAfter(nodes: Node | Node[]): any; + + /** Update all sibling node paths after `fromIndex` by `incrementBy`. */ + updateSiblingKeys(fromIndex: number, incrementBy: number): void; + + /** Hoist the current node to the highest scope possible and return a UID referencing it. */ + hoist(scope: Scope): void; + + // ------------------------- family ------------------------- + getOpposite(): NodePath; + + getCompletionRecords(): NodePath[]; + + getSibling(key: string | number): NodePath; + getAllPrevSiblings(): NodePath[]; + getAllNextSiblings(): NodePath[]; + + get(key: K, context?: boolean | TraversalContext): + T[K] extends Array ? Array> : + T[K] extends Node | null | undefined ? NodePath : + never; + get(key: string, context?: boolean | TraversalContext): NodePath | NodePath[]; + + getBindingIdentifiers(duplicates?: boolean): Node[]; + + getOuterBindingIdentifiers(duplicates?: boolean): Node[]; + + // ------------------------- comments ------------------------- + /** Share comments amongst siblings. */ + shareCommentsWithSiblings(): void; + + addComment(type: string, content: string, line?: boolean): void; + + /** Give node `comments` of the specified `type`. */ + addComments(type: string, comments: any[]): void; + + // ------------------------- isXXX ------------------------- + isArrayExpression(opts?: object): this is NodePath; + isAssignmentExpression(opts?: object): this is NodePath; + isBinaryExpression(opts?: object): this is NodePath; + isDirective(opts?: object): this is NodePath; + isDirectiveLiteral(opts?: object): this is NodePath; + isBlockStatement(opts?: object): this is NodePath; + isBreakStatement(opts?: object): this is NodePath; + isCallExpression(opts?: object): this is NodePath; + isCatchClause(opts?: object): this is NodePath; + isConditionalExpression(opts?: object): this is NodePath; + isContinueStatement(opts?: object): this is NodePath; + isDebuggerStatement(opts?: object): this is NodePath; + isDoWhileStatement(opts?: object): this is NodePath; + isEmptyStatement(opts?: object): this is NodePath; + isExpressionStatement(opts?: object): this is NodePath; + isFile(opts?: object): this is NodePath; + isForInStatement(opts?: object): this is NodePath; + isForStatement(opts?: object): this is NodePath; + isFunctionDeclaration(opts?: object): this is NodePath; + isFunctionExpression(opts?: object): this is NodePath; + isIdentifier(opts?: object): this is NodePath; + isIfStatement(opts?: object): this is NodePath; + isLabeledStatement(opts?: object): this is NodePath; + isStringLiteral(opts?: object): this is NodePath; + isNumericLiteral(opts?: object): this is NodePath; + isNullLiteral(opts?: object): this is NodePath; + isBooleanLiteral(opts?: object): this is NodePath; + isRegExpLiteral(opts?: object): this is NodePath; + isLogicalExpression(opts?: object): this is NodePath; + isMemberExpression(opts?: object): this is NodePath; + isNewExpression(opts?: object): this is NodePath; + isProgram(opts?: object): this is NodePath; + isObjectExpression(opts?: object): this is NodePath; + isObjectMethod(opts?: object): this is NodePath; + isObjectProperty(opts?: object): this is NodePath; + isRestElement(opts?: object): this is NodePath; + isReturnStatement(opts?: object): this is NodePath; + isSequenceExpression(opts?: object): this is NodePath; + isSwitchCase(opts?: object): this is NodePath; + isSwitchStatement(opts?: object): this is NodePath; + isThisExpression(opts?: object): this is NodePath; + isThrowStatement(opts?: object): this is NodePath; + isTryStatement(opts?: object): this is NodePath; + isUnaryExpression(opts?: object): this is NodePath; + isUpdateExpression(opts?: object): this is NodePath; + isVariableDeclaration(opts?: object): this is NodePath; + isVariableDeclarator(opts?: object): this is NodePath; + isWhileStatement(opts?: object): this is NodePath; + isWithStatement(opts?: object): this is NodePath; + isAssignmentPattern(opts?: object): this is NodePath; + isArrayPattern(opts?: object): this is NodePath; + isArrowFunctionExpression(opts?: object): this is NodePath; + isClassBody(opts?: object): this is NodePath; + isClassDeclaration(opts?: object): this is NodePath; + isClassExpression(opts?: object): this is NodePath; + isExportAllDeclaration(opts?: object): this is NodePath; + isExportDefaultDeclaration(opts?: object): this is NodePath; + isExportNamedDeclaration(opts?: object): this is NodePath; + isExportSpecifier(opts?: object): this is NodePath; + isForOfStatement(opts?: object): this is NodePath; + isImportDeclaration(opts?: object): this is NodePath; + isImportDefaultSpecifier(opts?: object): this is NodePath; + isImportNamespaceSpecifier(opts?: object): this is NodePath; + isImportSpecifier(opts?: object): this is NodePath; + isMetaProperty(opts?: object): this is NodePath; + isClassMethod(opts?: object): this is NodePath; + isObjectPattern(opts?: object): this is NodePath; + isSpreadElement(opts?: object): this is NodePath; + isSuper(opts?: object): this is NodePath; + isTaggedTemplateExpression(opts?: object): this is NodePath; + isTemplateElement(opts?: object): this is NodePath; + isTemplateLiteral(opts?: object): this is NodePath; + isYieldExpression(opts?: object): this is NodePath; + isAnyTypeAnnotation(opts?: object): this is NodePath; + isArrayTypeAnnotation(opts?: object): this is NodePath; + isBooleanTypeAnnotation(opts?: object): this is NodePath; + isBooleanLiteralTypeAnnotation(opts?: object): this is NodePath; + isNullLiteralTypeAnnotation(opts?: object): this is NodePath; + isClassImplements(opts?: object): this is NodePath; + isClassProperty(opts?: object): this is NodePath; + isDeclareClass(opts?: object): this is NodePath; + isDeclareFunction(opts?: object): this is NodePath; + isDeclareInterface(opts?: object): this is NodePath; + isDeclareModule(opts?: object): this is NodePath; + isDeclareTypeAlias(opts?: object): this is NodePath; + isDeclareVariable(opts?: object): this is NodePath; + isFunctionTypeAnnotation(opts?: object): this is NodePath; + isFunctionTypeParam(opts?: object): this is NodePath; + isGenericTypeAnnotation(opts?: object): this is NodePath; + isInterfaceExtends(opts?: object): this is NodePath; + isInterfaceDeclaration(opts?: object): this is NodePath; + isIntersectionTypeAnnotation(opts?: object): this is NodePath; + isMixedTypeAnnotation(opts?: object): this is NodePath; + isNullableTypeAnnotation(opts?: object): this is NodePath; + isNumberTypeAnnotation(opts?: object): this is NodePath; + isStringLiteralTypeAnnotation(opts?: object): this is NodePath; + isStringTypeAnnotation(opts?: object): this is NodePath; + isThisTypeAnnotation(opts?: object): this is NodePath; + isTupleTypeAnnotation(opts?: object): this is NodePath; + isTypeofTypeAnnotation(opts?: object): this is NodePath; + isTypeAlias(opts?: object): this is NodePath; + isTypeAnnotation(opts?: object): this is NodePath; + isTypeCastExpression(opts?: object): this is NodePath; + isTypeParameterDeclaration(opts?: object): this is NodePath; + isTypeParameterInstantiation(opts?: object): this is NodePath; + isObjectTypeAnnotation(opts?: object): this is NodePath; + isObjectTypeCallProperty(opts?: object): this is NodePath; + isObjectTypeIndexer(opts?: object): this is NodePath; + isObjectTypeProperty(opts?: object): this is NodePath; + isQualifiedTypeIdentifier(opts?: object): this is NodePath; + isUnionTypeAnnotation(opts?: object): this is NodePath; + isVoidTypeAnnotation(opts?: object): this is NodePath; + isJSXAttribute(opts?: object): this is NodePath; + isJSXClosingElement(opts?: object): this is NodePath; + isJSXElement(opts?: object): this is NodePath; + isJSXEmptyExpression(opts?: object): this is NodePath; + isJSXExpressionContainer(opts?: object): this is NodePath; + isJSXIdentifier(opts?: object): this is NodePath; + isJSXMemberExpression(opts?: object): this is NodePath; + isJSXNamespacedName(opts?: object): this is NodePath; + isJSXOpeningElement(opts?: object): this is NodePath; + isJSXSpreadAttribute(opts?: object): this is NodePath; + isJSXText(opts?: object): this is NodePath; + isNoop(opts?: object): this is NodePath; + isParenthesizedExpression(opts?: object): this is NodePath; + isAwaitExpression(opts?: object): this is NodePath; + isBindExpression(opts?: object): this is NodePath; + isDecorator(opts?: object): this is NodePath; + isDoExpression(opts?: object): this is NodePath; + isExportDefaultSpecifier(opts?: object): this is NodePath; + isExportNamespaceSpecifier(opts?: object): this is NodePath; + isRestProperty(opts?: object): this is NodePath; + isSpreadProperty(opts?: object): this is NodePath; + isExpression(opts?: object): this is NodePath; + isBinary(opts?: object): this is NodePath; + isScopable(opts?: object): this is NodePath; + isBlockParent(opts?: object): this is NodePath; + isBlock(opts?: object): this is NodePath; + isStatement(opts?: object): this is NodePath; + isTerminatorless(opts?: object): this is NodePath; + isCompletionStatement(opts?: object): this is NodePath; + isConditional(opts?: object): this is NodePath; + isLoop(opts?: object): this is NodePath; + isWhile(opts?: object): this is NodePath; + isExpressionWrapper(opts?: object): this is NodePath; + isFor(opts?: object): this is NodePath; + isForXStatement(opts?: object): this is NodePath; + isFunction(opts?: object): this is NodePath; + isFunctionParent(opts?: object): this is NodePath; + isPureish(opts?: object): this is NodePath; + isDeclaration(opts?: object): this is NodePath; + isLVal(opts?: object): this is NodePath; + isLiteral(opts?: object): this is NodePath; + isImmutable(opts?: object): this is NodePath; + isUserWhitespacable(opts?: object): this is NodePath; + isMethod(opts?: object): this is NodePath; + isObjectMember(opts?: object): this is NodePath; + isProperty(opts?: object): this is NodePath; + isUnaryLike(opts?: object): this is NodePath; + isPattern(opts?: object): this is NodePath; + isClass(opts?: object): this is NodePath; + isModuleDeclaration(opts?: object): this is NodePath; + isExportDeclaration(opts?: object): this is NodePath; + isModuleSpecifier(opts?: object): this is NodePath; + isFlow(opts?: object): this is NodePath; + isFlowBaseAnnotation(opts?: object): this is NodePath; + isFlowDeclaration(opts?: object): this is NodePath; + isJSX(opts?: object): this is NodePath; + isNumberLiteral(opts?: object): this is NodePath; + isRegexLiteral(opts?: object): this is NodePath; + isReferencedIdentifier(opts?: object): this is NodePath; + isReferencedMemberExpression(opts?: object): this is NodePath; + isBindingIdentifier(opts?: object): this is NodePath; + isScope(opts?: object): this is NodePath; + isReferenced(opts?: object): boolean; + isBlockScoped(opts?: object): this is NodePath; + isVar(opts?: object): this is NodePath; + isUser(opts?: object): boolean; + isGenerated(opts?: object): boolean; + isPure(opts?: object): boolean; + + // ------------------------- assertXXX ------------------------- + assertArrayExpression(opts?: object): void; + assertAssignmentExpression(opts?: object): void; + assertBinaryExpression(opts?: object): void; + assertDirective(opts?: object): void; + assertDirectiveLiteral(opts?: object): void; + assertBlockStatement(opts?: object): void; + assertBreakStatement(opts?: object): void; + assertCallExpression(opts?: object): void; + assertCatchClause(opts?: object): void; + assertConditionalExpression(opts?: object): void; + assertContinueStatement(opts?: object): void; + assertDebuggerStatement(opts?: object): void; + assertDoWhileStatement(opts?: object): void; + assertEmptyStatement(opts?: object): void; + assertExpressionStatement(opts?: object): void; + assertFile(opts?: object): void; + assertForInStatement(opts?: object): void; + assertForStatement(opts?: object): void; + assertFunctionDeclaration(opts?: object): void; + assertFunctionExpression(opts?: object): void; + assertIdentifier(opts?: object): void; + assertIfStatement(opts?: object): void; + assertLabeledStatement(opts?: object): void; + assertStringLiteral(opts?: object): void; + assertNumericLiteral(opts?: object): void; + assertNullLiteral(opts?: object): void; + assertBooleanLiteral(opts?: object): void; + assertRegExpLiteral(opts?: object): void; + assertLogicalExpression(opts?: object): void; + assertMemberExpression(opts?: object): void; + assertNewExpression(opts?: object): void; + assertProgram(opts?: object): void; + assertObjectExpression(opts?: object): void; + assertObjectMethod(opts?: object): void; + assertObjectProperty(opts?: object): void; + assertRestElement(opts?: object): void; + assertReturnStatement(opts?: object): void; + assertSequenceExpression(opts?: object): void; + assertSwitchCase(opts?: object): void; + assertSwitchStatement(opts?: object): void; + assertThisExpression(opts?: object): void; + assertThrowStatement(opts?: object): void; + assertTryStatement(opts?: object): void; + assertUnaryExpression(opts?: object): void; + assertUpdateExpression(opts?: object): void; + assertVariableDeclaration(opts?: object): void; + assertVariableDeclarator(opts?: object): void; + assertWhileStatement(opts?: object): void; + assertWithStatement(opts?: object): void; + assertAssignmentPattern(opts?: object): void; + assertArrayPattern(opts?: object): void; + assertArrowFunctionExpression(opts?: object): void; + assertClassBody(opts?: object): void; + assertClassDeclaration(opts?: object): void; + assertClassExpression(opts?: object): void; + assertExportAllDeclaration(opts?: object): void; + assertExportDefaultDeclaration(opts?: object): void; + assertExportNamedDeclaration(opts?: object): void; + assertExportSpecifier(opts?: object): void; + assertForOfStatement(opts?: object): void; + assertImportDeclaration(opts?: object): void; + assertImportDefaultSpecifier(opts?: object): void; + assertImportNamespaceSpecifier(opts?: object): void; + assertImportSpecifier(opts?: object): void; + assertMetaProperty(opts?: object): void; + assertClassMethod(opts?: object): void; + assertObjectPattern(opts?: object): void; + assertSpreadElement(opts?: object): void; + assertSuper(opts?: object): void; + assertTaggedTemplateExpression(opts?: object): void; + assertTemplateElement(opts?: object): void; + assertTemplateLiteral(opts?: object): void; + assertYieldExpression(opts?: object): void; + assertAnyTypeAnnotation(opts?: object): void; + assertArrayTypeAnnotation(opts?: object): void; + assertBooleanTypeAnnotation(opts?: object): void; + assertBooleanLiteralTypeAnnotation(opts?: object): void; + assertNullLiteralTypeAnnotation(opts?: object): void; + assertClassImplements(opts?: object): void; + assertClassProperty(opts?: object): void; + assertDeclareClass(opts?: object): void; + assertDeclareFunction(opts?: object): void; + assertDeclareInterface(opts?: object): void; + assertDeclareModule(opts?: object): void; + assertDeclareTypeAlias(opts?: object): void; + assertDeclareVariable(opts?: object): void; + assertExistentialTypeParam(opts?: object): void; + assertFunctionTypeAnnotation(opts?: object): void; + assertFunctionTypeParam(opts?: object): void; + assertGenericTypeAnnotation(opts?: object): void; + assertInterfaceExtends(opts?: object): void; + assertInterfaceDeclaration(opts?: object): void; + assertIntersectionTypeAnnotation(opts?: object): void; + assertMixedTypeAnnotation(opts?: object): void; + assertNullableTypeAnnotation(opts?: object): void; + assertNumericLiteralTypeAnnotation(opts?: object): void; + assertNumberTypeAnnotation(opts?: object): void; + assertStringLiteralTypeAnnotation(opts?: object): void; + assertStringTypeAnnotation(opts?: object): void; + assertThisTypeAnnotation(opts?: object): void; + assertTupleTypeAnnotation(opts?: object): void; + assertTypeofTypeAnnotation(opts?: object): void; + assertTypeAlias(opts?: object): void; + assertTypeAnnotation(opts?: object): void; + assertTypeCastExpression(opts?: object): void; + assertTypeParameterDeclaration(opts?: object): void; + assertTypeParameterInstantiation(opts?: object): void; + assertObjectTypeAnnotation(opts?: object): void; + assertObjectTypeCallProperty(opts?: object): void; + assertObjectTypeIndexer(opts?: object): void; + assertObjectTypeProperty(opts?: object): void; + assertQualifiedTypeIdentifier(opts?: object): void; + assertUnionTypeAnnotation(opts?: object): void; + assertVoidTypeAnnotation(opts?: object): void; + assertJSXAttribute(opts?: object): void; + assertJSXClosingElement(opts?: object): void; + assertJSXElement(opts?: object): void; + assertJSXEmptyExpression(opts?: object): void; + assertJSXExpressionContainer(opts?: object): void; + assertJSXIdentifier(opts?: object): void; + assertJSXMemberExpression(opts?: object): void; + assertJSXNamespacedName(opts?: object): void; + assertJSXOpeningElement(opts?: object): void; + assertJSXSpreadAttribute(opts?: object): void; + assertJSXText(opts?: object): void; + assertNoop(opts?: object): void; + assertParenthesizedExpression(opts?: object): void; + assertAwaitExpression(opts?: object): void; + assertBindExpression(opts?: object): void; + assertDecorator(opts?: object): void; + assertDoExpression(opts?: object): void; + assertExportDefaultSpecifier(opts?: object): void; + assertExportNamespaceSpecifier(opts?: object): void; + assertRestProperty(opts?: object): void; + assertSpreadProperty(opts?: object): void; + assertExpression(opts?: object): void; + assertBinary(opts?: object): void; + assertScopable(opts?: object): void; + assertBlockParent(opts?: object): void; + assertBlock(opts?: object): void; + assertStatement(opts?: object): void; + assertTerminatorless(opts?: object): void; + assertCompletionStatement(opts?: object): void; + assertConditional(opts?: object): void; + assertLoop(opts?: object): void; + assertWhile(opts?: object): void; + assertExpressionWrapper(opts?: object): void; + assertFor(opts?: object): void; + assertForXStatement(opts?: object): void; + assertFunction(opts?: object): void; + assertFunctionParent(opts?: object): void; + assertPureish(opts?: object): void; + assertDeclaration(opts?: object): void; + assertLVal(opts?: object): void; + assertLiteral(opts?: object): void; + assertImmutable(opts?: object): void; + assertUserWhitespacable(opts?: object): void; + assertMethod(opts?: object): void; + assertObjectMember(opts?: object): void; + assertProperty(opts?: object): void; + assertUnaryLike(opts?: object): void; + assertPattern(opts?: object): void; + assertClass(opts?: object): void; + assertModuleDeclaration(opts?: object): void; + assertExportDeclaration(opts?: object): void; + assertModuleSpecifier(opts?: object): void; + assertFlow(opts?: object): void; + assertFlowBaseAnnotation(opts?: object): void; + assertFlowDeclaration(opts?: object): void; + assertJSX(opts?: object): void; + assertNumberLiteral(opts?: object): void; + assertRegexLiteral(opts?: object): void; +} + +export class Hub { + constructor(file: any, options: any); + file: any; + options: any; +} + +export interface TraversalContext { + parentPath: NodePath; + scope: Scope; + state: any; + opts: any; +} diff --git a/types/babel__traverse/package.json b/types/babel__traverse/package.json new file mode 100644 index 0000000000..c2ca8a8f9b --- /dev/null +++ b/types/babel__traverse/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "@babel/types": "^7.0.0-beta.54" + } +} diff --git a/types/babel__traverse/tsconfig.json b/types/babel__traverse/tsconfig.json new file mode 100644 index 0000000000..898675d222 --- /dev/null +++ b/types/babel__traverse/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "@babel/parser": [ + "babel__parser" + ], + "@babel/traverse": [ + "babel__traverse" + ] + } + }, + "files": [ + "index.d.ts", + "babel__traverse-tests.ts" + ] +} diff --git a/types/babel__traverse/tslint.json b/types/babel__traverse/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/babel__traverse/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/backbone.marionette/backbone.marionette-tests.ts b/types/backbone.marionette/backbone.marionette-tests.ts index c6400b2672..2b86849622 100644 --- a/types/backbone.marionette/backbone.marionette-tests.ts +++ b/types/backbone.marionette/backbone.marionette-tests.ts @@ -135,6 +135,15 @@ class MyView extends Marionette.View { } } +class MyOtherView extends MyView { + private readonly foo: string; + + constructor(model: MyModel) { + super(model); + this.foo = 'bar'; + } +} + class MainRegion extends Marionette.Region { constructor() { super(); @@ -185,10 +194,20 @@ class MyHtmlElRegion extends Marionette.Region { } } -class MyCollectionView extends Marionette.CollectionView { +class MyCollectionView extends Marionette.CollectionView { constructor() { super(); + + this.childView = (model: MyModel) => { + if (model.get('isFoo')) { + return MyView; + } + + return MyOtherView; + }; + this.childView = MyView; + this.childViewEvents = { render() { console.log('a childView has been rendered'); @@ -282,7 +301,7 @@ function CollectionViewTests() { cv.collection.add(new MyModel()); app.mainRegion.show(cv); cv.emptyView = MyView; - const view: Marionette.CollectionView = cv.destroy(); + const view: Marionette.CollectionView = cv.destroy(); } class MyController { diff --git a/types/backbone.marionette/index.d.ts b/types/backbone.marionette/index.d.ts index 0b717c9bb1..bacd045ba1 100644 --- a/types/backbone.marionette/index.d.ts +++ b/types/backbone.marionette/index.d.ts @@ -3,7 +3,8 @@ // Definitions by: Zeeshan Hamid , // Natan Vivo , // Sven Tschui , -// Volker Nauruhn +// Volker Nauruhn , +// Ard Timmerman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -1157,7 +1158,7 @@ export interface CollectionViewOptions< /** * Specify a child view to use. */ - childView?: (() => typeof Backbone.View) | typeof Backbone.View; + childView?: ((model: TModel) => typeof Backbone.View) | typeof Backbone.View; /** * Define options to pass to the childView constructor. @@ -1219,7 +1220,7 @@ export class CollectionView { new(...args: any[]): TView }) | { new(...args: any[]): TView }; + childView: ((model: TModel) => { new(...args: any[]): TView }) | { new(...args: any[]): TView }; /** * Define options to pass to the childView constructor. 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/bdfjs/bdfjs-tests.ts b/types/bdfjs/bdfjs-tests.ts new file mode 100644 index 0000000000..1f20259018 --- /dev/null +++ b/types/bdfjs/bdfjs-tests.ts @@ -0,0 +1,18 @@ +import { parse, draw, trim, Font, Bitmap } from "bdfjs"; + +parse(); // $ExpectError +parse(123); // $ExpectError +parse('abc'); // $ExpectType Font +parse('abc', { allprops: true, onlymeta: true }); // $ExpectType Font +const font: Font = parse(Buffer.from([1, 2, 3])); + +draw(); // $ExpectError +draw(123); // $ExpectError +draw(font); // $ExpectError +draw(font, 123); // $ExpectError +draw(font, 'abc', { kerningBias: 123 }); // $ExpectType Bitmap | undefined +const bitmap: Bitmap = draw(font, 'abc')!; + +trim(); // $ExpectError +trim(123); // $ExpectError +trim(bitmap); // $ExpectType Bitmap diff --git a/types/bdfjs/index.d.ts b/types/bdfjs/index.d.ts new file mode 100644 index 0000000000..c9ac5eaedd --- /dev/null +++ b/types/bdfjs/index.d.ts @@ -0,0 +1,108 @@ +// Type definitions for bdfjs 0.0 +// Project: https://github.com/zswang/bdfjs +// Definitions by: Olegs Jeremejevs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +// https://www.x.org/docs/BDF/bdf.pdf +// https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5005.BDF_Spec.pdf + +export interface ParseOptions { + allprops?: boolean; + onlymeta?: boolean; +} + +export interface BoundingBox { + width: number; + height: number; + x: number; + y: number; +} + +export interface Glyph { + bitmap: number[][]; + boundingBox: BoundingBox; + bytes: number[]; + char: string; + code: number; + deviceWidthX: number; + deviceWidthY: number; + name: string; + scalableWidthX: number; + scalableWidthY: number; +} + +export interface Properties { + defaultChar: number; + fontAscent: number; + fontDescent: number; + + addStyleName?: string; + averageWidth?: number; + capHeight?: number; + charsetEncoding?: string; + charsetRegistry?: string; + copyright?: string; + faceName?: string; + familyName?: string; + font?: string; + fontnameRegistry?: string; + fontVersion?: string; + foundry?: string; + notice?: string; + pixelSize?: number; + pointSize?: number; + resolutionX?: number; + resolutionY?: number; + setwidthName?: string; + slant?: string; + spacing?: string; + weightName?: string; + xHeight?: number; + + [key: string]: string | number | undefined; +} + +export interface Size { + points: number; + resolutionX: number; + resolutionY: number; +} + +export interface Meta { + boundingBox: BoundingBox; + name: string; + // The spec says that `properties` is optional, but then goes on to point out + // that without `defaultChar`, `fontAscent` and `fontDescent` it's not really + // a valid font, so I chose to not mark them as a maybe. + properties: Properties; + size: Size; + totalChars: number; + version: string; +} + +export interface Font { + meta: Meta; + glyphs: { [key: number]: Glyph }; // This is NOT a list +} + +export function parse(text: string | Buffer, options?: ParseOptions): Font; + +export interface DrawOptions { + kerningBias?: number; +} + +export interface Bitmap { + width: number; + height: number; + [row: number]: number[]; // Yep, this how the library does it, unfortunately +} + +export function draw( + font: Font, + text: string, + options?: DrawOptions +): Bitmap | undefined; + +export function trim(bitmap: Bitmap): Bitmap; diff --git a/types/bdfjs/tsconfig.json b/types/bdfjs/tsconfig.json new file mode 100644 index 0000000000..f1fe551e09 --- /dev/null +++ b/types/bdfjs/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", + "bdfjs-tests.ts" + ] +} diff --git a/types/bdfjs/tslint.json b/types/bdfjs/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/bdfjs/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bitcore-lib/bitcore-lib-tests.ts b/types/bitcore-lib/bitcore-lib-tests.ts index fb39c85fc1..99b64e6b78 100644 --- a/types/bitcore-lib/bitcore-lib-tests.ts +++ b/types/bitcore-lib/bitcore-lib-tests.ts @@ -2,7 +2,8 @@ import * as bitcore from 'bitcore-lib'; const transaction = new bitcore.Transaction({}); -const output: bitcore.Output = transaction.outputs[0]; +const output: bitcore.Transaction.Output = transaction.outputs[0]; +const input: bitcore.Transaction.Input = transaction.inputs[0]; const privateKey: bitcore.PrivateKey = new bitcore.PrivateKey('privateKey'); const publicKey: bitcore.PublicKey = privateKey.publicKey; @@ -24,4 +25,11 @@ const tx = new bitcore.Transaction() .from(utxo) .change('bitcoinAddress') .addData(Buffer.from('')) - .sign('bitcoinAddressPrivateKey'); + .sign('bitcoinAddressPrivateKey') + .enableRBF(); + +tx.verify(); + +new bitcore.Unit(2, 'BTC').toSatoshis(); + +bitcore.Unit.fromMilis(1000).toBTC(); diff --git a/types/bitcore-lib/index.d.ts b/types/bitcore-lib/index.d.ts index 0846b85c0d..d94beaca37 100644 --- a/types/bitcore-lib/index.d.ts +++ b/types/bitcore-lib/index.d.ts @@ -9,17 +9,30 @@ export namespace crypto { class BN { } + namespace ECDSA { function sign(message: Buffer, key: PrivateKey): Signature; function verify(hashbuf: Buffer, sig: Signature, pubkey: PublicKey, endian?: 'little'): boolean; } + namespace Hash { - function sha256(buffer: Buffer): Uint8Array; + function sha1(buffer: Buffer): Buffer; + function sha256(buffer: Buffer): Buffer; + function sha256sha256(buffer: Buffer): Buffer; + function sha256ripemd160(buffer: Buffer): Buffer; + function sha512(buffer: Buffer): Buffer; + function ripemd160(buffer: Buffer): Buffer; + + function sha256hmac(data: Buffer, key: Buffer): Buffer; + function sha512hmac(data: Buffer, key: Buffer): Buffer; } + namespace Random { function getRandomBuffer(size: number): Buffer; } + namespace Point {} + class Signature { static fromDER(sig: Buffer): Signature; static fromString(data: string): Signature; @@ -28,24 +41,6 @@ export namespace crypto { } } -export class Transaction { - inputs: Input[]; - outputs: Output[]; - readonly id: string; - readonly hash: string; - nid: string; - - constructor(serialized?: any); - - from(utxos: Transaction.UnspentOutput[]): Transaction; - to(address: Address | string, amount: number): Transaction; - change(address: Address | string): Transaction; - sign(privateKey: PrivateKey | string): Transaction; - applySignature(sig: crypto.Signature): Transaction; - addData(data: Buffer): this; - serialize(): string; -} - export namespace Transaction { class UnspentOutput { static fromObject(o: object): UnspentOutput; @@ -62,6 +57,62 @@ export namespace Transaction { toObject(): this; toString(): string; } + + class Output { + readonly script: Script; + readonly satoshis: number; + + constructor(data: object); + + setScript(script: Script | string | Buffer): this; + inspect(): string; + toObject(): object; + } + + class Input { + readonly prevTxId: Buffer; + readonly outputIndex: number; + readonly sequenceNumber: number; + readonly script: Script; + readonly output?: Output; + } +} + +export class Transaction { + inputs: Transaction.Input[]; + outputs: Transaction.Output[]; + readonly id: string; + readonly hash: string; + nid: string; + + constructor(serialized?: any); + + from(utxos: Transaction.UnspentOutput[]): this; + to(address: Address[] | Address | string, amount: number): this; + change(address: Address | string): this; + fee(amount: number): this; + feePerKb(amount: number): this; + sign(privateKey: PrivateKey | string): this; + applySignature(sig: crypto.Signature): this; + addInput(input: Transaction.Input): this; + addOutput(output: Transaction.Output): this; + addData(value: Buffer): this; + lockUntilDate(time: Date | number): this; + lockUntilBlockHeight(height: number): this; + + hasWitnesses(): boolean; + getFee(): number; + getChangeOutput(): Transaction.Output | null; + getLockTime(): Date | number; + + verify(): string | boolean; + isCoinbase(): boolean; + + enableRBF(): this; + isRBF(): boolean; + + inspect(): string; + serialize(): string; } export class Block { @@ -78,8 +129,16 @@ export class Block { export class PrivateKey { readonly publicKey: PublicKey; + readonly network: Networks.Network; - constructor(key: string); + toAddress(): Address; + toPublicKey(): PublicKey; + toString(): string; + toObject(): object; + toJSON(): object; + toWIF(): string; + + constructor(key?: string, network?: Networks.Network); } export class PublicKey { @@ -91,18 +150,107 @@ export class PublicKey { toDER(): Buffer; } -export interface Output { - readonly script: any; +export class HDPrivateKey { + readonly hdPublicKey: HDPublicKey; + + constructor(data?: string | Buffer | object); + + derive(arg: string | number, hardened?: boolean): HDPrivateKey; + deriveChild(arg: string | number, hardened?: boolean): HDPrivateKey; + deriveNonCompliantChild(arg: string | number, hardened?: boolean): HDPrivateKey; + + toString(): string; + toObject(): object; + toJSON(): object; +} + +export class HDPublicKey { + readonly xpubkey: Buffer; + readonly network: Networks.Network; + readonly depth: number; + readonly publicKey: PublicKey; + readonly fingerPrint: Buffer; + + constructor(arg: string | Buffer | object); + + derive(arg: string | number, hardened?: boolean): HDPublicKey; + deriveChild(arg: string | number, hardened?: boolean): HDPublicKey; + + toString(): string; } export namespace Script { const types: { DATA_OUT: string; }; + function buildMultisigOut(publicKeys: PublicKey[], threshold: number, opts: object): Script; + function buildWitnessMultisigOutFromScript(script: Script): Script; + function buildMultisigIn(pubkeys: PublicKey[], threshold: number, signatures: Buffer[], opts: object): Script; + function buildP2SHMultisigIn(pubkeys: PublicKey[], threshold: number, signatures: Buffer[], opts: object): Script; function buildPublicKeyHashOut(address: Address): Script; + function buildPublicKeyOut(pubkey: PublicKey): Script; + function buildDataOut(data: string | Buffer, encoding?: string): Script; + function buildScriptHashOut(script: Script): Script; + function buildPublicKeyIn(signature: crypto.Signature | Buffer, sigtype: number): Script; + function buildPublicKeyHashIn(publicKey: PublicKey, signature: crypto.Signature | Buffer, sigtype: number): Script; + + function fromAddress(address: string | Address): Script; + + function empty(): Script; } -export class Script { } +export class Script { + constructor(data: string | object); + + set(obj: object): this; + + toBuffer(): Buffer; + toASM(): string; + toString(): string; + toHex(): string; + + isPublicKeyHashOut(): boolean; + isPublicKeyHashIn(): boolean; + + getPublicKey(): Buffer; + getPublicKeyHash(): Buffer; + + isPublicKeyOut(): boolean; + isPublicKeyIn(): boolean; + + isScriptHashOut(): boolean; + isWitnessScriptHashOut(): boolean; + isWitnessPublicKeyHashOut(): boolean; + isWitnessProgram(): boolean; + isScriptHashIn(): boolean; + isMultisigOut(): boolean; + isMultisigIn(): boolean; + isDataOut(): boolean; + + getData(): Buffer; + isPushOnly(): boolean; + + classify(): string; + classifyInput(): string; + classifyOutput(): string; + + isStandard(): boolean; + + prepend(obj: any): this; + add(obj: any): this; + + hasCodeseparators(): boolean; + removeCodeseparators(): this; + + equals(script: Script): boolean; + + getAddressInfo(): Address | boolean; + findAndDelete(script: Script): this; + checkMinimalPush(i: number): boolean; + getSignatureOperationsCount(accurate: boolean): number; + + toAddress(): Address; +} export interface Util { readonly buffer: { @@ -125,6 +273,24 @@ export namespace Networks { function get(args: string | number | Network, keys: string | string[]): Network; } -export class Address {} +export class Address { + readonly hashBuffer: Buffer; + readonly network: Networks.Network; + readonly type: string; -export class Input {} + constructor(data: Buffer | Uint8Array | string | object, network?: Networks.Network, type?: string); +} + +export class Unit { + static fromBTC(amount: number): Unit; + static fromMilis(amount: number): Unit; + static fromBits(amount: number): Unit; + static fromSatoshis(amount: number): Unit; + + constructor(amount: number, unitPreference: string); + + toBTC(): number; + toMilis(): number; + toBits(): number; + toSatoshis(): number; +} diff --git a/types/blazy/blazy-tests.ts b/types/blazy/blazy-tests.ts index 835b0e6472..e3aedaabd4 100644 --- a/types/blazy/blazy-tests.ts +++ b/types/blazy/blazy-tests.ts @@ -38,7 +38,7 @@ var tester: BlazyInstance = new Blazy({ /* Functions tests */ tester.revalidate(); -var elements = document.getElementsByTagName('img'); +var elements = document.getElementsByTagName('img'); tester.load(elements, true); tester.destroy(); diff --git a/types/blazy/index.d.ts b/types/blazy/index.d.ts index 8a7183366d..661f651c0b 100644 --- a/types/blazy/index.d.ts +++ b/types/blazy/index.d.ts @@ -53,7 +53,7 @@ interface BlazyInstance { * Forces the given element(s) to load if not collapsed. If you also want to load a collapsed/hidden elements you can add true as the second parameter. * You can pass a single element or a list of elements. Tested with getElementById, getElementsByClassName, querySelectorAll, querySelector and jQuery selector. */ - load(elements: Element|Element[]|HTMLElement|HTMLElement[]|NodeList, force: boolean): void; + load(elements: Element|Element[]|HTMLElement|HTMLElement[]|HTMLCollection|NodeList, force: boolean): void; /** * Unbind events and resets image array. diff --git a/types/bloomfilter/bloomfilter-tests.ts b/types/bloomfilter/bloomfilter-tests.ts index 96ee0443b6..05f6c5210a 100644 --- a/types/bloomfilter/bloomfilter-tests.ts +++ b/types/bloomfilter/bloomfilter-tests.ts @@ -4,8 +4,14 @@ function test_bloomfilter() { const k = 2; const bloomFilter = new BloomFilter(m, k); - const array: Int32Array[] = bloomFilter.buckets; + const array: Int32Array = bloomFilter.buckets; const length: number = bloomFilter.buckets.length; bloomFilter.add('someString'); const test: boolean = bloomFilter.test('someString'); + + const buckets: Int32Array = bloomFilter.buckets; + const bloom2 = new BloomFilter(buckets, k); + + const a: Int32Array = new Int32Array(16); + a[3]; } diff --git a/types/bloomfilter/index.d.ts b/types/bloomfilter/index.d.ts index 00ed408c6d..980a96be55 100644 --- a/types/bloomfilter/index.d.ts +++ b/types/bloomfilter/index.d.ts @@ -1,14 +1,29 @@ -// Type definitions for BloomFilter 0.1 +// Type definitions for BloomFilter 0.0 // Project: https://github.com/jasondavies/bloomfilter.js // Definitions by: slawiko // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export class BloomFilter { - buckets: Int32Array[]; + buckets: Int32Array; - constructor(m: number, k: number); + /** + * Create a new empty bloom filter of size m with hashes k or + * provide buckets as a number[] or Int32Array to deserialize a bloom filter + * @param mOrBucketsArray number of bits (will be rounded up to nearest 32), or buckets + * to deserialize into a filled bloomfilter + * @param k number of hashes + */ + constructor(m: number | number[] | Int32Array, k: number); + /** + * Add a value to a bloom filter + * @param value + */ add(value: any): void; + /** + * Test whether a value exists in a bloom filter. (False positives are + * possible, false negatives are not.) + */ test(value: any): boolean; } 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..05ac5cc19c 100644 --- a/types/bluebird/bluebird-tests.ts +++ b/types/bluebird/bluebird-tests.ts @@ -7,13 +7,13 @@ import Promise = require("bluebird"); -let obj: object; -let bool: boolean; -let num: number; -let str: string; -let err: Error; -let x: any; -let f: (...args: any[]) => any; +let obj: object = {}; +let bool = false; +let num = 0; +let str = ''; +let err: Error = new Error(); +let x: any = 0; +let f: (...args: any[]) => any = () => {}; let asyncfunc: (...args: any[]) => Promise; let arr: any[]; let exp: RegExp; @@ -25,7 +25,6 @@ let numArr: number[]; let value: any; let reason: any; -let insanity: any; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -36,7 +35,10 @@ interface Bar { bar(): string; } interface Baz { - baz(): string; + baz(): string; +} +interface Qux { + qux: string; } // - - - - - - - - - - - - - - - - - @@ -61,11 +63,12 @@ interface StrBarArrMap { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -let foo: Foo; -let bar: Bar; -let baz: Baz; +let foo: Foo = { foo() { return 'foo'; } }; +let bar: Bar = { bar() { return 'bar'; } }; +let baz: Baz = { baz() { return 'baz'; } }; +let qux: Qux = { qux: 'quix' }; -let fooArr: Foo[]; +let fooArr: Foo[] = [foo]; let barArr: Bar[]; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -74,13 +77,14 @@ let numProm: Promise; let strProm: Promise; let anyProm: Promise; let boolProm: Promise; -let objProm: Promise; +let objProm: Promise = Promise.resolve(obj); let voidProm: Promise; -let fooProm: Promise; -let barProm: Promise; +let fooProm: Promise = Promise.resolve(foo); +let barProm: Promise = Promise.resolve(bar); let fooOrBarProm: Promise; -let bazProm: Promise; +let bazProm: Promise = Promise.resolve(baz); +let quxProm: Promise = Promise.resolve(qux); // - - - - - - - - - - - - - - - - - @@ -91,8 +95,8 @@ let boolThen: PromiseLike; let objThen: PromiseLike; let voidThen: PromiseLike; -let fooThen: PromiseLike; -let barThen: PromiseLike; +let fooThen: PromiseLike = fooProm; +let barThen: PromiseLike = barProm; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -100,7 +104,7 @@ let numArrProm: Promise; let strArrProm: Promise; let anyArrProm: Promise; -let fooArrProm: Promise; +let fooArrProm: Promise = Promise.resolve(fooArr); let barArrProm: Promise; // - - - - - - - - - - - - - - - - - @@ -109,7 +113,7 @@ let numArrThen: PromiseLike; let strArrThen: PromiseLike; let anyArrThen: PromiseLike; -let fooArrThen: PromiseLike; +let fooArrThen: PromiseLike = fooArrProm; let barArrThen: PromiseLike; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -127,23 +131,19 @@ let numThenArr: Array>; let strThenArr: Array>; let anyThenArr: Array>; -let fooThenArr: Array>; +let fooThenArr: Array> = [fooThen]; let barThenArr: Array>; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // booya! -let fooThenArrThen: PromiseLike>>; -let barThenArrThen: PromiseLike>>; +let fooThenArrThen: PromiseLike>> = Promise.resolve(fooThenArr); let fooResolver: Promise.Resolver; -let barResolver: Promise.Resolver; - let fooInspection: Promise.Inspection; let fooInspectionPromise: Promise>; let fooInspectionArrProm: Promise>>; -let barInspectionArrProm: Promise>>; let BlueBird: typeof Promise; @@ -192,19 +192,16 @@ fooProm = new Promise((resolve) => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -fooResolver.resolve(foo); +fooInspectionPromise = fooProm.reflect(); -fooResolver.reject(err); - -fooResolver.callback = (err: any, value: Foo) => {}; - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool = fooInspection.isFulfilled(); -bool = fooInspection.isRejected(); -bool = fooInspection.isPending(); -foo = fooInspection.value(); -x = fooInspection.reason(); +fooInspectionPromise.then(value => { + fooInspection = value; + bool = fooInspection.isFulfilled(); + bool = fooInspection.isRejected(); + bool = fooInspection.isPending(); + foo = fooInspection.value(); + x = fooInspection.reason(); +}); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -235,8 +232,7 @@ barProm = fooProm.then((value: Foo) => { }); barProm = barProm.then((value: Bar) => { if (value) return value; - let b: Bar; - return Promise.resolve(b); + return Promise.resolve(bar); }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -554,10 +550,13 @@ bool = fooProm.isResolved(); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -anyProm = fooProm.call("foo"); -anyProm = fooProm.call("foo", 1, 2, 3); +strProm = fooProm.call("foo"); +strProm = fooProm.call("foo", 1, 2, 3); -voidProm = fooProm.get("foo").then((method) => { str = method(); }); +// $ExpectType Bluebird +quxProm.call("qux"); + +strProm = fooProm.get("foo").then(method => method()); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -590,25 +589,37 @@ 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(); -barArrProm = fooProm.all(); -fooInspectionPromise = fooProm.reflect(); -barProm = fooProm.any(); -barArrProm = fooProm.some(num); -barProm = fooProm.race(); +// $ExpectType Bluebird +fooProm.all(); + +fooProm = fooArrProm.any(); + +// $ExpectType Bluebird +fooProm.any(); + +fooArrProm = fooArrProm.some(num); + +// $ExpectType Bluebird +fooProm.some(num); + +fooProm = fooArrProm.race(); + +// $ExpectType Bluebird +fooProm.race(); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -626,44 +637,42 @@ Promise.props(new Map>()).then(val => { propsMapValu // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Promise.all([fooProm, barProm]).then(result => { - result[0].foo(); - result[1].bar(); + foo = result[0]; + bar = result[1]; }); Promise.all([fooProm, fooProm]).then(result => { - result[0].foo(); - result[1].foo(); + foo = result[0]; + foo = result[1]; }); Promise.all([fooProm, barProm, bazProm]).then(result => { - result[0].foo(); - result[1].bar(); - result[2].baz(); + foo = result[0]; + bar = result[1]; + baz = result[2]; }); Promise.all([fooProm, barProm, fooProm]).then(result => { - result[0].foo(); - result[1].bar(); - result[2].foo(); + foo = result[0]; + bar = result[1]; + foo = result[2]; }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// 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 +680,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 +718,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) => 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); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -803,6 +812,12 @@ voidProm = Promise.reject(reason); fooResolver = Promise.defer(); +fooResolver.resolve(foo); + +fooResolver.reject(err); + +fooResolver.callback = (err: any, value: Foo) => {}; + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fooProm = Promise.cast(foo); @@ -867,11 +882,18 @@ obj = Promise.promisifyAll(obj, { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -const generator = function*(a: number, b: string) { return "string"; }; -const coroutine = Promise.coroutine(generator); -coroutine(5, "foo").then((x: string) => {}); +const generator1 = function*(a: number, b: string) { return "string"; }; +const coroutine1 = Promise.coroutine(generator1); +strProm = coroutine1(5, "foo"); -const coroutineCustomYield = Promise.coroutine(generator, { yieldHandler: (value) => "whatever" }); +const generator2 = function*(a: number, b: string) { + yield foo; + return bar; +}; +const coroutine2 = Promise.coroutine(generator2); +barProm = coroutine2(5, "foo"); + +const coroutineCustomYield = Promise.coroutine(generator1, { yieldHandler: (value) => "whatever" }); /* barProm = Promise.spawn(f); */ diff --git a/types/bluebird/index.d.ts b/types/bluebird/index.d.ts index 1e49e04f51..93dc18dfee 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,13 +36,20 @@ */ type CatchFilter = (new (...args: any[]) => E) | ((error: E) => boolean) | (object & E); +type IterableItem = R extends Iterable ? U : never; +type IterableOrNever = Extract>; +type Resolvable = R | PromiseLike; +type IterateFunction = (item: T, index: number, arrayLength: number) => Resolvable; declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** - * Create a new promise. The passed in function will receive functions `resolve` and `reject` as its arguments which can be called to seal the fate of the created promise. - * If promise cancellation is enabled, passed in function will receive one more function argument `onCancel` that allows to register an optional cancellation callback. + * Create a new promise. The passed in function will receive functions + * `resolve` and `reject` as its arguments which can be called to seal the fate of the created promise. + * + * If promise cancellation is enabled, passed in function will receive + * one more function argument `onCancel` that allows to register an optional cancellation callback. */ - constructor(callback: (resolve: (thenableOrResult?: R | PromiseLike) => void, reject: (error?: any) => void, onCancel?: (callback: () => void) => void) => void); + constructor(callback: (resolve: (thenableOrResult?: Resolvable) => void, reject: (error?: any) => void, onCancel?: (callback: () => void) => void) => void); /** * Promises/A+ `.then()`. Returns a new promise chained from this promise. @@ -50,10 +57,10 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * The new promise will be rejected or resolved depending on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise. */ // Based on PromiseLike.then, but returns a Bluebird instance. - then(onFulfill?: (value: R) => U | PromiseLike, onReject?: (error: any) => U | PromiseLike): Bluebird; // For simpler signature help. + then(onFulfill?: (value: R) => Resolvable, onReject?: (error: any) => Resolvable): Bluebird; // For simpler signature help. then( - onfulfilled?: ((value: R) => TResult1 | PromiseLike) | null, - onrejected?: ((reason: any) => TResult2 | PromiseLike) | null + onfulfilled?: ((value: R) => Resolvable) | null, + onrejected?: ((reason: any) => Resolvable) | null ): Bluebird; /** @@ -63,8 +70,8 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * * Alias `.caught();` for compatibility with earlier ECMAScript version. */ - catch(onReject: (error: any) => R | PromiseLike): Bluebird; - catch(onReject: ((error: any) => U | PromiseLike) | undefined | null): Bluebird; + catch(onReject: (error: any) => Resolvable): Bluebird; + catch(onReject: ((error: any) => Resolvable) | undefined | null): Bluebird; /** * This extends `.catch` to work more like catch-clauses in languages like Java or C#. @@ -85,7 +92,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { filter3: CatchFilter, filter4: CatchFilter, filter5: CatchFilter, - onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike, + onReject: (error: E1 | E2 | E3 | E4 | E5) => Resolvable, ): Bluebird; catch( filter1: CatchFilter, @@ -93,7 +100,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { filter3: CatchFilter, filter4: CatchFilter, filter5: CatchFilter, - onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike, + onReject: (error: E1 | E2 | E3 | E4 | E5) => Resolvable, ): Bluebird; catch( @@ -101,7 +108,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { filter2: CatchFilter, filter3: CatchFilter, filter4: CatchFilter, - onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike, + onReject: (error: E1 | E2 | E3 | E4) => Resolvable, ): Bluebird; catch( @@ -109,40 +116,40 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { filter2: CatchFilter, filter3: CatchFilter, filter4: CatchFilter, - onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, + onReject: (error: E1 | E2 | E3 | E4) => Resolvable, ): Bluebird; catch( filter1: CatchFilter, filter2: CatchFilter, filter3: CatchFilter, - onReject: (error: E1 | E2 | E3) => R | PromiseLike, + onReject: (error: E1 | E2 | E3) => Resolvable, ): Bluebird; catch( filter1: CatchFilter, filter2: CatchFilter, filter3: CatchFilter, - onReject: (error: E1 | E2 | E3) => U | PromiseLike, + onReject: (error: E1 | E2 | E3) => Resolvable, ): Bluebird; catch( filter1: CatchFilter, filter2: CatchFilter, - onReject: (error: E1 | E2) => R | PromiseLike, + onReject: (error: E1 | E2) => Resolvable, ): Bluebird; catch( filter1: CatchFilter, filter2: CatchFilter, - onReject: (error: E1 | E2) => U | PromiseLike, + onReject: (error: E1 | E2) => Resolvable, ): Bluebird; catch( filter1: CatchFilter, - onReject: (error: E1) => R | PromiseLike, + onReject: (error: E1) => Resolvable, ): Bluebird; catch( filter1: CatchFilter, - onReject: (error: E1) => U | PromiseLike, + onReject: (error: E1) => Resolvable, ): Bluebird; /** @@ -155,9 +162,10 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { caught: Bluebird["catch"]; /** - * Like `.catch` but instead of catching all types of exceptions, it only catches those that don't originate from thrown errors but rather from explicit rejections. + * Like `.catch` but instead of catching all types of exceptions, + * it only catches those that don't originate from thrown errors but rather from explicit rejections. */ - error(onReject: (reason: any) => U | PromiseLike): Bluebird; + error(onReject: (reason: any) => Resolvable): Bluebird; /** * Pass a handler that will be called regardless of this promise's fate. Returns a new promise chained from this promise. @@ -166,12 +174,13 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * * Alias `.lastly();` for compatibility with earlier ECMAScript version. */ - finally(handler: () => U | PromiseLike): Bluebird; + finally(handler: () => Resolvable): Bluebird; - lastly(handler: () => U | PromiseLike): Bluebird; + lastly: Bluebird["finally"]; /** - * Create a promise that follows this promise, but is bound to the given `thisArg` value. A bound promise will call its handlers with the bound value set to `this`. + * Create a promise that follows this promise, but is bound to the given `thisArg` value. + * A bound promise will call its handlers with the bound value set to `this`. * * Additionally promises derived from a bound promise will also be bound promises with the same `thisArg` binding as the original promise. */ @@ -180,47 +189,47 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Like `.then()`, but any unhandled rejection that ends up here will be thrown as an error. */ - done(onFulfilled?: (value: R) => U | PromiseLike, onRejected?: (error: any) => U | PromiseLike): void; + done(onFulfilled?: (value: R) => Resolvable, onRejected?: (error: any) => Resolvable): void; /** * Like `.finally()`, but not called for rejections. */ - tap(onFulFill: (value: R) => PromiseLike | U): Bluebird; + tap(onFulFill: (value: R) => Resolvable): Bluebird; /** * Like `.catch()` but rethrows the error */ - tapCatch(onReject: (error?: any) => U | PromiseLike): Bluebird; + tapCatch(onReject: (error?: any) => Resolvable): Bluebird; - tapCatch( + tapCatch( filter1: CatchFilter, filter2: CatchFilter, filter3: CatchFilter, filter4: CatchFilter, filter5: CatchFilter, - onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike, + onReject: (error: E1 | E2 | E3 | E4 | E5) => Resolvable, ): Bluebird; - tapCatch( + tapCatch( filter1: CatchFilter, filter2: CatchFilter, filter3: CatchFilter, filter4: CatchFilter, - onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, + onReject: (error: E1 | E2 | E3 | E4) => Resolvable, ): Bluebird; - tapCatch( + tapCatch( filter1: CatchFilter, filter2: CatchFilter, filter3: CatchFilter, - onReject: (error: E1 | E2 | E3) => U | PromiseLike, + onReject: (error: E1 | E2 | E3) => Resolvable, ): Bluebird; - tapCatch( + tapCatch( filter1: CatchFilter, filter2: CatchFilter, - onReject: (error: E1 | E2) => U | PromiseLike, + onReject: (error: E1 | E2) => Resolvable, ): Bluebird; - tapCatch( + tapCatch( filter1: CatchFilter, - onReject: (error: E1) => U | PromiseLike, + onReject: (error: E1) => Resolvable, ): Bluebird; /** @@ -241,7 +250,9 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * Register a node-style callback on this promise. * * When this promise is is either fulfilled or rejected, - * the node callback will be called back with the node.js convention where error reason is the first argument and success value is the second argument. + * the node callback will be called back with the node.js convention + * where error reason is the first argument and success value is the second argument. + * * The error argument will be `null` in case of success. * If the `callback` argument is not a function, this method does not do anything. */ @@ -305,7 +316,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * }); * */ - call(propertyName: keyof R, ...args: any[]): Bluebird; + call(propertyName: U, ...args: any[]): Bluebird any ? ReturnType : never>; /** * This is a convenience method for doing: @@ -453,66 +464,58 @@ 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>) => Resolvable): 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. */ - props(this: PromiseLike | V>>): Bluebird>; + props(this: PromiseLike>>): Bluebird>; props(this: PromiseLike>): Bluebird; /** * 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: IterateFunction, U>, 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) => Resolvable, 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: IterateFunction, boolean>, 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: IterateFunction, any>): 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: IterateFunction, U>): 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 @@ -534,27 +537,27 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * * Alias for `attempt();` for compatibility with earlier ECMAScript version. */ - static try(fn: () => R | PromiseLike): Bluebird; - static attempt(fn: () => R | PromiseLike): Bluebird; + static try(fn: () => Resolvable): Bluebird; + static attempt(fn: () => Resolvable): Bluebird; /** * Returns a new function that wraps the given function `fn`. * The new function will always return a promise that is fulfilled with the original functions return values or rejected with thrown exceptions from the original function. * This method is convenient when a function can sometimes return synchronously or throw synchronously. */ - static method(fn: () => R | PromiseLike): () => Bluebird; - static method(fn: (arg1: A1) => R | PromiseLike): (arg1: A1) => Bluebird; - static method(fn: (arg1: A1, arg2: A2) => R | PromiseLike): (arg1: A1, arg2: A2) => Bluebird; - static method(fn: (arg1: A1, arg2: A2, arg3: A3) => R | PromiseLike): (arg1: A1, arg2: A2, arg3: A3) => Bluebird; - static method(fn: (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => R | PromiseLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Bluebird; - static method(fn: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => R | PromiseLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Bluebird; - static method(fn: (...args: any[]) => R | PromiseLike): (...args: any[]) => Bluebird; + static method(fn: () => Resolvable): () => Bluebird; + static method(fn: (arg1: A1) => Resolvable): (arg1: A1) => Bluebird; + static method(fn: (arg1: A1, arg2: A2) => Resolvable): (arg1: A1, arg2: A2) => Bluebird; + static method(fn: (arg1: A1, arg2: A2, arg3: A3) => Resolvable): (arg1: A1, arg2: A2, arg3: A3) => Bluebird; + static method(fn: (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Resolvable): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Bluebird; + static method(fn: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Resolvable): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Bluebird; + static method(fn: (...args: any[]) => Resolvable): (...args: any[]) => Bluebird; /** * Create a promise that is resolved with the given `value`. If `value` is a thenable or promise, the returned promise will assume its state. */ static resolve(): Bluebird; - static resolve(value: R | PromiseLike): Bluebird; + static resolve(value: Resolvable): Bluebird; /** * Create a promise that is rejected with the given `reason`. @@ -562,9 +565,11 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { static reject(reason: any): Bluebird; /** + * @deprecated * Create a promise with undecided fate and return a `PromiseResolver` to control it. See resolution?: Promise(#promise-resolution). + * @see http://bluebirdjs.com/docs/deprecated-apis.html#promise-resolution */ - static defer(): Bluebird.Resolver; + static defer(): Bluebird.Resolver; // tslint:disable-line no-unnecessary-generics /** * Cast the given `value` to a trusted promise. @@ -572,7 +577,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * If `value` is already a trusted `Promise`, it is returned as is. If `value` is not a thenable, a fulfilled is: Promise returned with `value` as its fulfillment value. * If `value` is a thenable (Promise-like object, like those returned by jQuery's `$.ajax`), returns a trusted that: Promise assimilates the state of the thenable. */ - static cast(value: R | PromiseLike): Bluebird; + static cast(value: Resolvable): Bluebird; /** * Sugar for `Promise.resolve(undefined).bind(thisArg);`. See `.bind()`. @@ -597,7 +602,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * If value is a promise, the delay will start counting down when it is fulfilled and the returned * promise will be fulfilled with the fulfillment value of the value promise. */ - static delay(ms: number, value: R | PromiseLike): Bluebird; + static delay(ms: number, value: Resolvable): Bluebird; static delay(ms: number): Bluebird; /** @@ -651,9 +656,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Returns a promise that is resolved by a node style callback function. */ - static fromNode(resolver: (callback: (err: any, result?: any) => void) => void, options?: Bluebird.FromNodeOptions): Bluebird; static fromNode(resolver: (callback: (err: any, result?: T) => void) => void, options?: Bluebird.FromNodeOptions): Bluebird; - static fromCallback(resolver: (callback: (err: any, result?: any) => void) => void, options?: Bluebird.FromNodeOptions): Bluebird; static fromCallback(resolver: (callback: (err: any, result?: T) => void) => void, options?: Bluebird.FromNodeOptions): Bluebird; /** @@ -725,13 +728,13 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { */ // TODO enable more overloads // array with promises of different types - static all(values: [PromiseLike | T1, PromiseLike | T2, PromiseLike | T3, PromiseLike | T4, PromiseLike | T5]): Bluebird<[T1, T2, T3, T4, T5]>; - static all(values: [PromiseLike | T1, PromiseLike | T2, PromiseLike | T3, PromiseLike | T4]): Bluebird<[T1, T2, T3, T4]>; - static all(values: [PromiseLike | T1, PromiseLike | T2, PromiseLike | T3]): Bluebird<[T1, T2, T3]>; - static all(values: [PromiseLike | T1, PromiseLike | T2]): Bluebird<[T1, T2]>; - static all(values: [PromiseLike | T1]): Bluebird<[T1]>; + static all(values: [Resolvable, Resolvable, Resolvable, Resolvable, Resolvable]): Bluebird<[T1, T2, T3, T4, T5]>; + static all(values: [Resolvable, Resolvable, Resolvable, Resolvable]): Bluebird<[T1, T2, T3, T4]>; + static all(values: [Resolvable, Resolvable, Resolvable]): Bluebird<[T1, T2, T3]>; + static all(values: [Resolvable, Resolvable]): Bluebird<[T1, T2]>; + static all(values: [Resolvable]): Bluebird<[T1]>; // array with values - static all(values: PromiseLike | R>> | Iterable | R>): Bluebird; + static all(values: Resolvable>>): Bluebird; /** * Like ``Promise.all`` but for object properties instead of array items. Returns a promise that is fulfilled when all the properties of the object are fulfilled. @@ -745,7 +748,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * *The original object is not modified.* */ // map - static props(map: PromiseLike | V>> | Map | V>): Bluebird>; + static props(map: Resolvable>>): Bluebird>; // trusted promise for object static props(object: PromiseLike>): Bluebird; // tslint:disable-line:unified-signatures // object @@ -754,24 +757,27 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Like `Promise.some()`, with 1 as `count`. However, if the promise fulfills, the fulfillment value is not an array of 1 but the value directly. */ - static any(values: PromiseLike | R>> | Iterable | R>): Bluebird; + static any(values: Resolvable>>): Bluebird; /** - * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled or rejected as soon as a promise in the array is fulfilled or rejected with the respective rejection reason or fulfillment value. + * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is + * fulfilled or rejected as soon as a promise in the array is fulfilled or rejected with the respective rejection reason or fulfillment value. * * **Note** If you pass empty array or a sparse array with no values, or a promise/thenable for such, it will be forever pending. */ - static race(values: PromiseLike | R>> | Iterable | R>): Bluebird; + static race(values: Resolvable>>): Bluebird; /** * Initiate a competitive race between multiple promises or values (values will become immediately fulfilled promises). - * When `count` amount of promises have been fulfilled, the returned promise is fulfilled with an array that contains the fulfillment values of the winners in order of resolution. + * When `count` amount of promises have been fulfilled, the returned promise is fulfilled with an array that contains the fulfillment values of + * the winners in order of resolution. * - * If too many promises are rejected so that the promise can never become fulfilled, it will be immediately rejected with an array of rejection reasons in the order they were thrown in. + * If too many promises are rejected so that the promise can never become fulfilled, + * it will be immediately rejected with an array of rejection reasons in the order they were thrown in. * * *The original array is not modified.* */ - static some(values: PromiseLike | R>> | Iterable | R>, count: number): Bluebird; + static some(values: Resolvable>>, count: number): Bluebird; /** * Promise.join( @@ -784,42 +790,44 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * This behavior has been deprecated but is still supported partially - when the last argument is an immediate function value the new semantics will apply */ static join( - arg1: A1 | PromiseLike, - handler: (arg1: A1) => R | PromiseLike + arg1: Resolvable, + handler: (arg1: A1) => Resolvable ): Bluebird; static join( - arg1: A1 | PromiseLike, - arg2: A2 | PromiseLike, - handler: (arg1: A1, arg2: A2) => R | PromiseLike + arg1: Resolvable, + arg2: Resolvable, + handler: (arg1: A1, arg2: A2) => Resolvable ): Bluebird; static join( - arg1: A1 | PromiseLike, - arg2: A2 | PromiseLike, - arg3: A3 | PromiseLike, - handler: (arg1: A1, arg2: A2, arg3: A3) => R | PromiseLike + arg1: Resolvable, + arg2: Resolvable, + arg3: Resolvable, + handler: (arg1: A1, arg2: A2, arg3: A3) => Resolvable ): Bluebird; static join( - arg1: A1 | PromiseLike, - arg2: A2 | PromiseLike, - arg3: A3 | PromiseLike, - arg4: A4 | PromiseLike, - handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => R | PromiseLike + arg1: Resolvable, + arg2: Resolvable, + arg3: Resolvable, + arg4: Resolvable, + handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Resolvable ): Bluebird; static join( - arg1: A1 | PromiseLike, - arg2: A2 | PromiseLike, - arg3: A3 | PromiseLike, - arg4: A4 | PromiseLike, - arg5: A5 | PromiseLike, - handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => R | PromiseLike + arg1: Resolvable, + arg2: Resolvable, + arg3: Resolvable, + arg4: Resolvable, + arg5: Resolvable, + handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Resolvable ): Bluebird; // variadic array /** @deprecated use .all instead */ - static join(...values: Array>): Bluebird; + static join(...values: Array>): Bluebird; /** - * Map an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `mapper` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. + * Map an array, or a promise of an array, + * which contains a promises (or a mix of promises and values) with the given `mapper` function with the signature `(item, index, arrayLength)` + * where `item` is the resolved value of a respective promise in the input array. * If any promise in the input array is rejected the returned promise is rejected as well. * * If the `mapper` function returns promises or thenables, the returned promise will wait for all the mapped results to be resolved as well. @@ -827,28 +835,34 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * *The original array is not modified.* */ static map( - values: PromiseLike | R>> | Iterable | R>, - mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike, + values: Resolvable>>, + mapper: IterateFunction, options?: Bluebird.ConcurrencyOption ): Bluebird; /** - * Reduce an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `reducer` function with the signature `(total, current, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. + * Reduce an array, or a promise of an array, + * which contains a promises (or a mix of promises and values) with the given `reducer` function with the signature `(total, current, index, arrayLength)` + * where `item` is the resolved value of a respective promise in the input array. * If any promise in the input array is rejected the returned promise is rejected as well. * * If the reducer function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration. * - * *The original array is not modified. If no `initialValue` is given and the array doesn't contain at least 2 items, the callback will not be called and `undefined` is returned. + * *The original array is not modified. If no `initialValue` is given and the array doesn't contain at least 2 items, + * the callback will not be called and `undefined` is returned. + * * If `initialValue` is given and the array doesn't have at least 1 item, `initialValue` is returned.* */ static reduce( - values: PromiseLike | R>> | Iterable | R>, - reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike, + values: Resolvable>>, + reducer: (total: U, current: R, index: number, arrayLength: number) => Resolvable, initialValue?: U ): Bluebird; /** - * Filter an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `filterer` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. + * Filter an array, or a promise of an array, + * which contains a promises (or a mix of promises and values) with the given `filterer` function with the signature `(item, index, arrayLength)` + * where `item` is the resolved value of a respective promise in the input array. * If any promise in the input array is rejected the returned promise is rejected as well. * * The return values from the filtered functions are coerced to booleans, with the exception of promises and thenables which are awaited for their eventual result. @@ -856,25 +870,28 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * *The original array is not modified. */ static filter( - values: PromiseLike | R>> | Iterable | R>, - filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike, + values: Resolvable>>, + filterer: IterateFunction, option?: Bluebird.ConcurrencyOption ): Bluebird; /** - * Iterate over an array, or a promise of an array, which contains promises (or a mix of promises and values) with the given iterator function with the signature (item, index, value) where item is the resolved value of a respective promise in the input array. + * Iterate over an array, or a promise of an array, + * which contains promises (or a mix of promises and values) with the given iterator function with the signature `(item, index, value)` + * where item is the resolved value of a respective promise in the input array. * Iteration happens serially. If any promise in the input array is rejected the returned promise is rejected as well. * * Resolves to the original array unmodified, this method is meant to be used for side effects. * If the iterator function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration. */ - static each( - values: PromiseLike | R>> | Iterable | R>, - iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike + static each( + values: Resolvable>>, + iterator: IterateFunction ): Bluebird; /** - * Given an Iterable(arrays are Iterable), or a promise of an Iterable, which produces promises (or a mix of promises and values), iterate over all the values in the Iterable into an array and iterate over the array serially, in-order. + * Given an Iterable(arrays are Iterable), or a promise of an Iterable, which produces promises (or a mix of promises and values), + * iterate over all the values in the Iterable into an array and iterate over the array serially, in-order. * * Returns a promise for an array that contains the values returned by the iterator function in their respective positions. * The iterator won't be called for an item until its previous item, and the promise returned by the iterator for that item are fulfilled. @@ -883,8 +900,8 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * If any promise in the input array is rejected or any promise returned by the iterator function is rejected, the result will be rejected as well. */ static mapSeries( - values: PromiseLike | R>> | Iterable | R>, - iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike + values: Resolvable>>, + iterator: IterateFunction ): Bluebird; /** @@ -897,7 +914,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * The second argument passed to a disposer is the result promise of the using block, which you can * inspect synchronously. */ - disposer(disposeFn: (arg: R, promise: Bluebird) => void | PromiseLike): Bluebird.Disposer; + disposer(disposeFn: (arg: R, promise: Bluebird) => Resolvable): Bluebird.Disposer; /** * In conjunction with `.disposer`, using will make sure that no matter what, the specified disposer @@ -1033,7 +1050,7 @@ declare namespace Bluebird { /** @deprecated Use PromiseLike directly. */ type Thenable = PromiseLike; - type ResolvableProps = object & {[K in keyof T]: PromiseLike | T[K]}; + type ResolvableProps = object & {[K in keyof T]: Resolvable}; interface Resolver { /** @@ -1108,7 +1125,8 @@ declare namespace Bluebird { /** * This is relevant to browser environments with no module loader. * - * Release control of the Promise namespace to whatever it was before this library was loaded. Returns a reference to the library namespace so you can attach it to something else. + * Release control of the Promise namespace to whatever it was before this library was loaded. + * Returns a reference to the library namespace so you can attach it to something else. */ function noConflict(): typeof Bluebird; diff --git a/types/bluebird/tsconfig.json b/types/bluebird/tsconfig.json index 5ab3ff2494..4ff87506f9 100644 --- a/types/bluebird/tsconfig.json +++ b/types/bluebird/tsconfig.json @@ -10,7 +10,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -20,4 +20,4 @@ "noEmit": true, "forceConsistentCasingInFileNames": true } -} \ No newline at end of file +} diff --git a/types/bluebird/tslint.json b/types/bluebird/tslint.json index 6abaaba4e3..6bdbed5083 100644 --- a/types/bluebird/tslint.json +++ b/types/bluebird/tslint.json @@ -1,7 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "max-line-length": [true, 280], "no-unnecessary-generics": false, "prefer-const": false } 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 f0bbbea7f2..9a80afc654 100755 --- a/types/bootstrap/bootstrap-tests.ts +++ b/types/bootstrap/bootstrap-tests.ts @@ -1,3 +1,5 @@ +declare let aHtmlElement: HTMLElement; + // -------------------------------------------------------------------------------------- // Alert // -------------------------------------------------------------------------------------- @@ -78,7 +80,7 @@ $("#collapse").collapse({ }); $("#collapse").collapse({ - parent: document.body, + parent: aHtmlElement, }); $("#collapse").collapse({ @@ -122,11 +124,11 @@ $("#dropdown").dropdown({ }); $("#dropdown").dropdown({ - boundary: document.body, + boundary: aHtmlElement, }); $("#dropdown").dropdown({ - reference: document.body, + reference: aHtmlElement, }); // -------------------------------------------------------------------------------------- @@ -340,5 +342,5 @@ $("#tooltip").tooltip({ }); $("#tooltip").tooltip({ - boundary: document.body, + boundary: aHtmlElement, }); diff --git a/types/braft-editor/index.d.ts b/types/braft-editor/index.d.ts index 00d03d81d1..62f339a41b 100644 --- a/types/braft-editor/index.d.ts +++ b/types/braft-editor/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/margox/braft#readme // Definitions by: My Self // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from "react"; import { RawDraftContentState } from 'draft-js'; diff --git a/types/bro-fs/bro-fs-tests.ts b/types/bro-fs/bro-fs-tests.ts new file mode 100644 index 0000000000..75451a303a --- /dev/null +++ b/types/bro-fs/bro-fs-tests.ts @@ -0,0 +1,7 @@ +import * as fs from 'bro-fs'; + +fs.init({type: window.TEMPORARY, bytes: 5 * 1024 * 1024}) + .then(() => fs.mkdir('dir')) + .then(() => fs.writeFile('dir/file.txt', 'hello world')) + .then(() => fs.readFile('dir/file.txt', {type: 'Text'})) + .then(content => console.log(content)); // => "hello world" diff --git a/types/bro-fs/index.d.ts b/types/bro-fs/index.d.ts new file mode 100644 index 0000000000..e0d11cddbe --- /dev/null +++ b/types/bro-fs/index.d.ts @@ -0,0 +1,53 @@ +// Type definitions for bro-fs 0.4 +// Project: https://github.com/vitalets/bro-fs#readme +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export type TextType = 'Text' | 'BinaryString' | 'DataURL'; + +export interface FSOptions { + bytes?: number; + /** + * show request quota popup for PERSISTENT type + * (for Chrome extensions with `unlimitedStorage` permission it is useful to pass `options.requestQuota = false`) + */ + requestQuota?: boolean; + /** `window.PERSISTENT` | `window.TEMPORARY` */ + type?: number; +} + +export interface StatObject { + fullPath: string; + isDirectory: boolean; + isFile: boolean; + modificationTime: Date; + name: string; + size: number; +} + +export interface UsageObject { + grantedBytes: number; + usedBytes: number; +} + +export function appendFile(path: string | FileEntry, data: string | Blob | File | ArrayBuffer): Promise; +export function clear(): Promise; +export function copy(oldPath: string | FileEntry, newPath: string, options?: {create?: boolean}): Promise; +export function exists(path: string): Promise; +export function getEntry(path: FileEntry): Promise; +export function getRoot(): Promise; +export function getUrl(path: string | FileEntry): Promise; +export function init(options?: FSOptions): Promise; +export function isSupported(): boolean; +export function mkdir(path: string): Promise; +export function readdir(path: string | DirectoryEntry, options?: {deep?: boolean}): Promise; +export function readFile(path: string | FileEntry, options: {type: 'ArrayBuffer'}): Promise; +export function readFile(path: string | FileEntry, options?: {type?: TextType}): Promise; +export function rename(oldPath: string | FileEntry, newPath: string, options?: {create?: boolean}): Promise; +export function rmdir(path: string | DirectoryEntry): Promise; +export function stat(path: string | FileEntry): Promise; +export function unlink(path: string | FileEntry): Promise; +export function usage(): Promise; +export function writeFile(path: string, data: string | Blob | File | ArrayBuffer): Promise; diff --git a/types/storejs/tsconfig.json b/types/bro-fs/tsconfig.json similarity index 94% rename from types/storejs/tsconfig.json rename to types/bro-fs/tsconfig.json index df8e4268e3..d8a019ec81 100644 --- a/types/storejs/tsconfig.json +++ b/types/bro-fs/tsconfig.json @@ -19,6 +19,6 @@ }, "files": [ "index.d.ts", - "storejs-tests.ts" + "bro-fs-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/bro-fs/tslint.json b/types/bro-fs/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/bro-fs/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bson/index.d.ts b/types/bson/index.d.ts index 6bad691dcf..e6afab65a5 100644 --- a/types/bson/index.d.ts +++ b/types/bson/index.d.ts @@ -131,6 +131,8 @@ export class Binary { /** The underlying Buffer which stores the binary data. */ readonly buffer: Buffer; + /** Binary data subtype */ + readonly sub_type?: number; /** The length of the binary. */ length(): number; @@ -146,11 +148,16 @@ export class Binary { /** 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); + + readonly code: string | Function; + readonly scope?: any; + } /** @@ -180,6 +187,16 @@ export class Double { valueOf(): number; } +/** A class representation of the BSON Int32 type. */ +export class Int32 { + /** + * @param value The number we want to represent as an int32. + */ + constructor(value: number); + + valueOf(): number; +} + /** * Base class for Long and Timestamp. * In original js-node@1.0.x code 'Timestamp' is a 100% copy-paste of 'Long' @@ -315,6 +332,9 @@ export class Decimal128 { */ constructor(bytes: Buffer); + /** A buffer containing the raw Decimal128 bytes. */ + readonly bytes: Buffer; + toJSON(): string; toString(): string; } @@ -386,7 +406,12 @@ export { ObjectID as ObjectId }; /** A class representation of the BSON RegExp type. */ export class BSONRegExp { + constructor(pattern: string, options: string); + + readonly pattern: string; + readonly options: string; + } /** @@ -394,7 +419,12 @@ export class BSONRegExp { * @deprecated */ export class Symbol { + constructor(value: string); + + /** Access the wrapped string value. */ + valueOf(): string; + } /** A class representation of the BSON Timestamp type. */ diff --git a/types/bull/bull-tests.tsx b/types/bull/bull-tests.tsx index c2e0d3161f..a8c7f403a7 100644 --- a/types/bull/bull-tests.tsx +++ b/types/bull/bull-tests.tsx @@ -6,7 +6,10 @@ import Redis = require("ioredis"); import Queue = require("bull"); const videoQueue = new Queue('video transcoding', 'redis://127.0.0.1:6379'); -const audioQueue = new Queue('audio transcoding', {redis: {port: 6379, host: '127.0.0.1'}}); // Specify Redis connection using object +const audioQueue = new Queue('audio transcoding', { + redis: {port: 6379, host: '127.0.0.1'}, // Specify Redis connection using object + settings: {}, +}); const imageQueue: Queue.Queue<{ image: string }> = new Queue('image transcoding'); videoQueue.process((job, done) => { diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index cdef279acb..a11ae0257a 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -7,8 +7,10 @@ // Gabriel Terwesten // Oleg Repin // David Koblas +// Bond Akinmade +// Wuha Team // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as Redis from "ioredis"; import * as Promise from "bluebird"; @@ -82,6 +84,13 @@ declare namespace Bull { * Delay before processing next job in case of internal error */ retryProcessDelay?: number; + + /** + * Define a custom backoff strategy + */ + backoffStrategies?: { + [key: string]: (attemptsMade: number, err: typeof Error) => number; + }; } type DoneCallback = (error?: Error | null, value?: any) => void; @@ -142,6 +151,21 @@ declare namespace Bull { * Promotes a job that is currently "delayed" to the "waiting" state and executed as soon as possible. */ promote(): Promise; + + /** + * The lock id of the job + */ + lockKey(): string; + + /** + * Releases the lock on the job. Only locks owned by the queue instance can be released. + */ + releaseLock(): Promise; + + /** + * Takes a lock for this job so that no other queue worker can process it at the same time. + */ + takeLock(): Promise; } type JobStatus = 'completed' | 'waiting' | 'active' | 'delayed' | 'failed'; @@ -150,20 +174,15 @@ declare namespace Bull { /** * Backoff type, which can be either `fixed` or `exponential` */ - type: 'fixed' | 'exponential'; + type: string; /** * Backoff delay, in milliseconds */ - delay: number; + delay?: number; } interface RepeatOptions { - /** - * Cron pattern specifying when the job should execute - */ - cron: string; - /** * Timezone */ @@ -180,6 +199,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 +234,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 @@ -467,7 +500,7 @@ declare namespace Bull { * Returns a promise that will return the job instance associated with the jobId parameter. * If the specified job cannot be located, the promise callback parameter will be set to null. */ - getJob(jobId: JobId): Promise>; + getJob(jobId: JobId): Promise | null>; /** * Returns a promise that will return an array with the waiting jobs between start and end. @@ -509,7 +542,7 @@ declare namespace Bull { * Removes a given repeatable job. The RepeatOptions and JobId needs to be the same as the ones * used for the job when it was added. */ - removeRepeatable(repeat: RepeatOptions & { jobId?: JobId }): Promise; + removeRepeatable(repeat: (CronRepeatOptions | EveryRepeatOptions) & { jobId?: JobId }): Promise; /** * Removes a given repeatable job. The RepeatOptions and JobId needs to be the same as the ones @@ -517,7 +550,13 @@ declare namespace Bull { * * name: The name of the to be removed job */ - removeRepeatable(name: string, repeat: RepeatOptions & { jobId?: JobId }): Promise; + removeRepeatable(name: string, repeat: (CronRepeatOptions | EveryRepeatOptions) & { jobId?: JobId }): Promise; + + /** + * Returns a promise that will return an array of job instances of the given types. + * Optional parameters for range and ordering are provided. + */ + getJobs(types: string[], start?: number, end?: number, asc?: boolean): Promise; /** * Returns a promise that resolves with the job counts for the given queue. diff --git a/types/bull/tsconfig.json b/types/bull/tsconfig.json index 3ce6f08792..7dbd4e7b61 100644 --- a/types/bull/tsconfig.json +++ b/types/bull/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ 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/capture-console/capture-console-tests.ts b/types/capture-console/capture-console-tests.ts new file mode 100644 index 0000000000..45dd3a7130 --- /dev/null +++ b/types/capture-console/capture-console-tests.ts @@ -0,0 +1,53 @@ +import * as captureconsole from "capture-console"; + +captureconsole.capture(process.stdout, () => { }); // $ExpectType string[] +captureconsole.capture(process.stdout, {}, () => { }); // $ExpectType string[] +captureconsole.capture(process.stdout, { quiet: true }, () => { }); // $ExpectType string[] + +captureconsole.capture([process.stdout, process.stdin], () => { }); // $ExpectType string[] +captureconsole.capture([process.stdout, process.stdin], {}, () => { }); // $ExpectType string[] +captureconsole.capture([process.stdout, process.stdin], { quiet: true }, () => { }); // $ExpectType string[] + +captureconsole.captureStderr(() => { }); // $ExpectType string +captureconsole.captureStderr({}, () => { }); // $ExpectType string +captureconsole.captureStderr({ quiet: true }, () => { }); // $ExpectType string + +captureconsole.captureStdio(() => { }); // $ExpectType { stdout: string; stderr: string; } +captureconsole.captureStdio({}, () => { }); // $ExpectType { stdout: string; stderr: string; } +captureconsole.captureStdio({ quiet: true }, () => { }); // $ExpectType { stdout: string; stderr: string; } + +captureconsole.captureStdout(() => { }); // $ExpectType string +captureconsole.captureStdout({}, () => { }); // $ExpectType string +captureconsole.captureStdout({ quiet: true }, () => { }); // $ExpectType string + +captureconsole.hook(process.stdout, (string: string, encoding?: string, fd?: (error?: any) => void) => { }); // $ExpectType () => boolean +captureconsole.hook(process.stdout, {}, (string: string, encoding?: string, fd?: (error?: any) => void) => { }); // $ExpectType () => boolean +captureconsole.hook(process.stdout, { quiet: true }, (string: string, encoding?: string, fd?: (error?: any) => void) => { }); // $ExpectType () => boolean + +captureconsole.intercept(process.stdout, () => { }); // $ExpectType string[] +captureconsole.intercept(process.stdout, {}, () => { }); // $ExpectType string[] +captureconsole.intercept(process.stdout, { quiet: true }, () => { }); // $ExpectType string[] + +captureconsole.interceptStderr(() => { }); // $ExpectType string +captureconsole.interceptStderr({}, () => { }); // $ExpectType string +captureconsole.interceptStderr({ quiet: true }, () => { }); // $ExpectType string + +captureconsole.interceptStdio(() => { }); // $ExpectType { stdout: string; stderr: string; } +captureconsole.interceptStdio({}, () => { }); // $ExpectType { stdout: string; stderr: string; } +captureconsole.interceptStdio({ quiet: true }, () => { }); // $ExpectType { stdout: string; stderr: string; } + +captureconsole.interceptStdout(() => { }); // $ExpectType string +captureconsole.interceptStdout({}, () => { }); // $ExpectType string +captureconsole.interceptStdout({ quiet: true }, () => { }); // $ExpectType string + +captureconsole.startCapture(process.stdout, (string: string, encoding?: string, fd?: (error?: any) => void) => { }); // $ExpectType boolean +captureconsole.startCapture(process.stdout, {}, (string: string, encoding?: string, fd?: (error?: any) => void) => { }); // $ExpectType boolean +captureconsole.startCapture(process.stdout, { quiet: true }, (string: string, encoding?: string, fd?: (error?: any) => void) => { }); // $ExpectType boolean + +captureconsole.startIntercept(process.stdout, () => { }); // $ExpectType boolean +captureconsole.startIntercept(process.stdout, {}, () => { }); // $ExpectType boolean +captureconsole.startIntercept(process.stdout, { quiet: true }, () => { }); // $ExpectType boolean + +captureconsole.stopCapture(process.stdout); // $ExpectType boolean + +captureconsole.stopIntercept(process.stdout); // $ExpectType boolean diff --git a/types/capture-console/index.d.ts b/types/capture-console/index.d.ts new file mode 100644 index 0000000000..d3ebd914f9 --- /dev/null +++ b/types/capture-console/index.d.ts @@ -0,0 +1,190 @@ +// Type definitions for capture-console 1.0 +// Project: https://github.com/zackehh/capture-console +// Definitions by: Auston Zahrt +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +/** + * Options controlling behavior when capturing + */ +export interface CaptureOptions { + /** + * Option to silence the output going to the console + */ + quiet?: boolean; +} + +/** + * Executes the provided function with the output + * on the provided streams. + */ +export function capture( + streams: ReadonlyArray | NodeJS.WritableStream, + exec: () => void +): string[]; + +/** + * Executes the provided function with the output + * on the provided streams. Accepts options to silence + * the output going to the console. + */ +export function capture( + streams: ReadonlyArray | NodeJS.WritableStream, + opts: CaptureOptions, + exec: () => void +): string[]; + +/** + * Captures stderr for the provided execution scope. + */ +export function captureStderr(exec: () => void): string; + +/** + * Captures stderr for the provided execution scope. + */ +export function captureStderr(opts: CaptureOptions, exec: () => void): string; + +/** + * Captures stdout and stderr into an object for + * the provided execution scope. + */ +export function captureStdio(exec: () => void): { stdout: string; stderr: string; }; + +/** + * Captures stdout and stderr into an object for + * the provided execution scope. + */ +export function captureStdio(opts: CaptureOptions, exec: () => void): { stdout: string; stderr: string; }; + +/** + * Captures stdout for the provided execution scope. + */ +export function captureStdout(exec: () => void): string; + +/** + * Captures stdout for the provided execution scope. + */ +export function captureStdout(opts: CaptureOptions, exec: () => void): string; + +/** + * Listens to a provided stream, and executes the provided + * function for every write call. Accepts options to silence + * the output going to the console. + * + * Returns a function to call when you wish to stop listening + * to the call. + */ +export function hook( + stream: NodeJS.WritableStream, + exec: ( + string: string, + encoding?: string, + fd?: (error?: any) => void + ) => void +): () => boolean; + +/** + * Listens to a provided stream, and executes the provided + * function for every write call. Accepts options to silence + * the output going to the console. + * + * Returns a function to call when you wish to stop listening + * to the call. + */ +export function hook( + stream: NodeJS.WritableStream, + opts: CaptureOptions, + exec: ( + string: string, + encoding?: string, + fd?: (error?: any) => void + ) => void +): () => boolean; + +/** + * Delegate to #capture with a quiet passthrough. + */ +export function intercept(stream: NodeJS.WritableStream, exec: () => void): string[]; + +/** + * Delegate to #capture with a quiet passthrough. + */ +export function intercept(stream: NodeJS.WritableStream, opts: CaptureOptions, exec: () => void): string[]; + +/** + * Delegate to #captureStderr with a quiet passthrough. + */ +export function interceptStderr(exec: () => void): string; + +/** + * Delegate to #captureStderr with a quiet passthrough. + */ +export function interceptStderr(opts: CaptureOptions, exec: () => void): string; + +/** + * Delegate to #captureStdio with a quiet passthrough. + */ +export function interceptStdio(exec: () => void): { stdout: string; stderr: string; }; + +/** + * Delegate to #captureStdio with a quiet passthrough. + */ +export function interceptStdio(opts: CaptureOptions, exec: () => void): { stdout: string; stderr: string; }; + +/** + * Delegate to #captureStdout with a quiet passthrough. + */ +export function interceptStdout(exec: () => void): string; + +/** + * Delegate to #captureStdout with a quiet passthrough. + */ +export function interceptStdout(opts: CaptureOptions, exec: () => void): string; + +/** + * Starts a capture on the provided stream using the + * provided options and stream execution. + */ +export function startCapture( + stream: NodeJS.WritableStream, + exec: ( + string: string, + encoding?: string, + fd?: (error?: any) => void + ) => void +): boolean; + +/** + * Starts a capture on the provided stream using the + * provided options and stream execution. + */ +export function startCapture( + stream: NodeJS.WritableStream, + opts: CaptureOptions, + exec: ( + string: string, + encoding?: string, + fd?: (error?: any) => void + ) => void +): boolean; + +/** + * Delegate to #startCapture with a quiet passthrough. + */ +export function startIntercept(stream: NodeJS.WritableStream, exec: () => void): boolean; + +/** + * Delegate to #startCapture with a quiet passthrough. + */ +export function startIntercept(stream: NodeJS.WritableStream, opts: CaptureOptions, exec: () => void): boolean; + +/** + * Stops a capture on the provided stream. + */ +export function stopCapture(stream: NodeJS.WritableStream): boolean; + +/** + * Delegate to #stopCapture with a quiet passthrough. + */ +export function stopIntercept(stream: NodeJS.WritableStream): boolean; diff --git a/types/capture-console/tsconfig.json b/types/capture-console/tsconfig.json new file mode 100644 index 0000000000..01807d6e22 --- /dev/null +++ b/types/capture-console/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", + "capture-console-tests.ts" + ] +} \ No newline at end of file diff --git a/types/capture-console/tslint.json b/types/capture-console/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/capture-console/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/catbox-redis/catbox-redis-tests.ts b/types/catbox-redis/catbox-redis-tests.ts new file mode 100644 index 0000000000..d7fb5eb701 --- /dev/null +++ b/types/catbox-redis/catbox-redis-tests.ts @@ -0,0 +1,12 @@ +import * as CatbotRedis from 'catbox-redis'; + +const cache = new CatbotRedis({ + host: 'localhost', + partition: 'test', + port: 2018, +}); + +cache.get({ + segment: 'test', + id: 'test', +}); diff --git a/types/catbox-redis/index.d.ts b/types/catbox-redis/index.d.ts new file mode 100644 index 0000000000..a0d3590953 --- /dev/null +++ b/types/catbox-redis/index.d.ts @@ -0,0 +1,60 @@ +// Type definitions for catbox-redis 4.1 +// Project: https://github.com/hapijs/catbox-redis#readme +// Definitions by: Simon Schick +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +// tslint:disable-next-line +declare module 'catbox-redis' { + import { Redis } from 'ioredis'; + import { EnginePrototype, ClientOptions, Client } from 'catbox'; + namespace CatboxRedis { + interface CatboxRedisOptions extends ClientOptions { + /** + * Raw client. + */ + client?: Redis; + /** + * the Redis server URL (if url is provided, host, port, and socket are ignored) + */ + url?: string; + /** + * the Redis server hostname. + * Defaults to '127.0.0.1'. + */ + host?: string; + /** + * the Redis server port or unix domain socket path. + * Defaults to 6379. + */ + port?: number; + /** + * the unix socket string to connect to (if socket is provided, host and port are ignored) + */ + socket?: string; + /** + * the Redis authentication password when required. + */ + password?: string; + /** + * the Redis database. + */ + database?: string; + /** + * an array of redis sentinel addresses to connect to. + */ + sentinels?: Array<{ + host: string; + }>; + /** + * the name of the sentinel master. + * (Only needed when sentinels is specified) + */ + sentinelName?: string; + } + } + class CatboxRedis extends Client { + constructor(options: CatboxRedis.CatboxRedisOptions); + } + export = CatboxRedis; + } diff --git a/types/catbox-redis/tsconfig.json b/types/catbox-redis/tsconfig.json new file mode 100644 index 0000000000..2d31a4bc59 --- /dev/null +++ b/types/catbox-redis/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "catbox-redis-tests.ts" + ] +} diff --git a/types/catbox-redis/tslint.json b/types/catbox-redis/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/catbox-redis/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/catbox/index.d.ts b/types/catbox/index.d.ts index 6d51e48696..f6881b1aef 100644 --- a/types/catbox/index.d.ts +++ b/types/catbox/index.d.ts @@ -112,6 +112,9 @@ export interface CachedObject { export type CacheItem = any; export interface ClientOptions { + /** + * this will store items under keys that start with this value. + */ partition: string; } diff --git a/types/cesium/index.d.ts b/types/cesium/index.d.ts index 967c124bac..3ea9745ebd 100644 --- a/types/cesium/index.d.ts +++ b/types/cesium/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for cesium 1.46 +// Type definitions for cesium 1.47 // Project: http://cesiumjs.org // Definitions by: Aigars Zeiza // Harry Nicholls // Jared Szechy +// Radek Goláň jr. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -1934,15 +1935,15 @@ declare namespace Cesium { semiMinorAxis: Property; rotation: Property; show: Property; - material: MaterialProperty; + material: MaterialProperty | Color; height: Property; extrudedHeight: Property; granularity: Property; stRotation: Property; - fill: Property; - outline: Property; - outlineColor: Property; - outlineWidth: Property; + fill: boolean; + outline: boolean; + outlineColor: Color; + outlineWidth: number; numberOfVerticalLines: Property; constructor(options?: { semiMajorAxis?: number; @@ -1950,11 +1951,11 @@ declare namespace Cesium { height?: Property; extrudedHeight?: Property; show?: Property; - fill?: Property; - material?: MaterialProperty; - outline?: Property; - outlineColor?: Property; - outlineWidth?: Property; + fill?: boolean; + material?: MaterialProperty | Color + outline?: boolean; + outlineColor?: Color; + outlineWidth?: number; numberOfVerticalLines?: Property; rotation?: Property; stRotation?: Property; @@ -2206,11 +2207,11 @@ declare namespace Cesium { class LabelGraphics { definitionChanged: Event; text: Property; - font: Property; + font: string; style: Property; - fillColor: Property; - outlineColor: Property; - outlineWidth: Property; + fillColor: Color; + outlineColor: Color; + outlineWidth: number; horizontalOrigin: Property; verticalOrigin: Property; eyeOffset: Property; @@ -2221,11 +2222,11 @@ declare namespace Cesium { pixelOffsetScaleByDistance: Property; constructor(options?: { text?: Property; - font?: Property; + font?: string; style?: Property; - fillColor?: Property; - outlineColor?: Property; - outlineWidth?: Property; + fillColor?: Color; + outlineColor?: Color; + outlineWidth?: number; show?: Property; scale?: Property; horizontalOrigin?: Property; @@ -2361,16 +2362,16 @@ declare namespace Cesium { class PolygonGraphics { definitionChanged: Event; show: Property; - material: MaterialProperty; + material: MaterialProperty | Color; positions: Property; hierarchy: Property; height: Property; extrudedHeight: Property; granularity: Property; stRotation: Property; - fill: Property; + fill: boolean; outline: Property; - outlineColor: Property; + outlineColor: Color; outlineWidth: Property; perPositionHeight: Property; constructor(options?: { @@ -2378,10 +2379,10 @@ declare namespace Cesium { height?: number; extrudedHeight?: Property; show?: Property; - fill?: Property; - material?: MaterialProperty; + fill?: boolean; + material?: MaterialProperty | Color; outline?: boolean; - outlineColor?: Property; + outlineColor?: Color; outlineWidth?: number; stRotation?: Property; granularity?: Property; @@ -3592,7 +3593,7 @@ declare namespace Cesium { cull?: boolean; asynchronous?: boolean; debugShowBoundingVolume?: boolean; - shadows: ShadowMode + shadows?: ShadowMode }); destroy(): void; getGeometryInstanceAttributes(id: any): any; diff --git a/types/chai-datetime/chai-datetime-tests.ts b/types/chai-datetime/chai-datetime-tests.ts index 255d816b5a..f955e78e27 100644 --- a/types/chai-datetime/chai-datetime-tests.ts +++ b/types/chai-datetime/chai-datetime-tests.ts @@ -3,47 +3,65 @@ import chai = require('chai'); import chaiDateTime = require('chai-datetime'); chai.use(chaiDateTime); -var expect = chai.expect; -var assert = chai.assert; +const expect = chai.expect; +const assert = chai.assert; function test_equalTime(){ - var date: Date = new Date(2014, 1, 1); + const date: Date = new Date(2014, 1, 1); expect(date).to.equalTime(date); date.should.equalTime(date); assert.equalTime(date, date); } function test_beforeTime(){ - var date: Date = new Date(2014, 1, 1); + const date: Date = new Date(2014, 1, 1); expect(date).to.be.beforeTime(date); date.should.be.beforeTime(date); assert.beforeTime(date, date); } function test_afterTime(){ - var date: Date = new Date(2014, 1, 1); + const date: Date = new Date(2014, 1, 1); expect(date).to.be.afterTime(date); date.should.be.afterTime(date); assert.afterTime(date, date); } +function test_withinTime(){ + const date: Date = new Date(2014, 7, 1); + const fromDate: Date = new Date(2014, 1, 1); + const toDate: Date = new Date(2015, 1, 1); + expect(date).to.be.withinTime(fromDate, toDate); + date.should.be.withinTime(fromDate, toDate); + assert.withinTime(date, fromDate, toDate); +} + function test_equalDate(){ - var date: Date = new Date(2014, 1, 1); + const date: Date = new Date(2014, 1, 1); expect(date).to.equalDate(date); date.should.equalDate(date); assert.equalDate(date, date); } function test_beforeDate(){ - var date: Date = new Date(2014, 1, 1); + const date: Date = new Date(2014, 1, 1); expect(date).to.be.beforeDate(date); date.should.be.beforeDate(date); assert.beforeDate(date, date); } function test_afterDate(){ - var date: Date = new Date(2014, 1, 1); + const date: Date = new Date(2014, 1, 1); expect(date).to.be.afterDate(date); date.should.be.afterDate(date); assert.afterDate(date, date); } + +function test_withinDate(){ + const date: Date = new Date(2014, 7, 1); + const fromDate: Date = new Date(2014, 1, 1); + const toDate: Date = new Date(2015, 1, 1); + expect(date).to.be.withinDate(fromDate, toDate); + date.should.be.withinDate(fromDate, toDate); + assert.withinDate(date, fromDate, toDate); +} diff --git a/types/chai-datetime/index.d.ts b/types/chai-datetime/index.d.ts index 176d112dc0..be623a05d4 100644 --- a/types/chai-datetime/index.d.ts +++ b/types/chai-datetime/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for chai-datetime // Project: https://github.com/gaslight/chai-datetime.git -// Definitions by: Cliff Burger +// Definitions by: Cliff Burger , +// Matt Bishop // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -14,9 +15,11 @@ declare global { afterDate(date: Date): Assertion; beforeDate(date: Date): Assertion; equalDate(date: Date): Assertion; + withinDate(dateFrom: Date, dateTo: Date): Assertion; afterTime(date: Date): Assertion; beforeTime(date: Date): Assertion; equalTime(date: Date): Assertion; + withinTime(dateFrom: Date, dateTo: Date): Assertion; } interface Assert { @@ -26,12 +29,16 @@ declare global { notBeforeTime(val: Date, exp: Date, msg?: string): void; afterTime(val: Date, exp: Date, msg?: string): void; notAfterTime(val: Date, exp: Date, msg?: string): void; + withinTime(val: Date, expFrom: Date, expTo: Date, msg?: string): void; + notWithinTime(val: Date, expFrom: Date, expTo: Date, msg?: string): void; equalDate(val: Date, exp: Date, msg?: string): void; notEqualDate(val: Date, exp: Date, msg?: string): void; beforeDate(val: Date, exp: Date, msg?: string): void; notBeforeDate(val: Date, exp: Date, msg?: string): void; afterDate(val: Date, exp: Date, msg?: string): void; notAfterDate(val: Date, exp: Date, msg?: string): void; + withinDate(val: Date, expFrom: Date, expTo: Date, msg?: string): void; + notWithinDate(val: Date, expFrom: Date, expTo: Date, msg?: string): void; } } diff --git a/types/chai-enzyme/index.d.ts b/types/chai-enzyme/index.d.ts index 413f5ec545..783b7fce2f 100644 --- a/types/chai-enzyme/index.d.ts +++ b/types/chai-enzyme/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/producthunt/chai-enzyme // Definitions by: Alexey Svetliakov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// diff --git a/types/chai-roughly/chai-roughly-tests.ts b/types/chai-roughly/chai-roughly-tests.ts new file mode 100644 index 0000000000..20ef05e293 --- /dev/null +++ b/types/chai-roughly/chai-roughly-tests.ts @@ -0,0 +1,15 @@ +import chai = require('chai'); +import chaiOequal = require('chai-roughly'); + +chai.use(chaiOequal); + +import { + expect, + assert +} from 'chai'; + +expect(1.2).to.be.roughly().equal(1.1999999999); +expect(1.2).to.roughly().equal(1.1999999999); +expect(1.2).to.roughly(0.1).equal(1.1); +expect(1.2).to.roughly(0.1).deep.equal(1.1); +expect(1.2).to.roughly.equal(1.1999999999999999999); diff --git a/types/chai-roughly/index.d.ts b/types/chai-roughly/index.d.ts new file mode 100644 index 0000000000..c1f162ddb7 --- /dev/null +++ b/types/chai-roughly/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for chai-roughly 1.0 +// Project: https://github.com/Turbo87/chai-roughly#readme +// Definitions by: Tomasz Nguyen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + +declare global { + namespace Chai { + // For BDD APIs + interface Roughly extends Assertion { + (tolerance?: number): Assertion; + } + + interface Assertion extends LanguageChains, NumericComparison, TypeComparison { + roughly: Roughly; + } + + // For Assert APIs + interface Assert { + roughly: Roughly; + } + } +} + +declare function chaiRoughly(chai: any, utils: any): void; +declare namespace chaiRoughly { } +export = chaiRoughly; diff --git a/types/chai-roughly/tsconfig.json b/types/chai-roughly/tsconfig.json new file mode 100644 index 0000000000..7cca2313fc --- /dev/null +++ b/types/chai-roughly/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "chai-roughly-tests.ts" + ] +} diff --git a/types/chai-roughly/tslint.json b/types/chai-roughly/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/chai-roughly/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index 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 4f06584286..09230f6702 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -239,7 +239,7 @@ declare namespace Chart { type?: ChartType | string; data?: ChartData; options?: ChartOptions; - plugins?: PluginServiceRegistrationOptions; + plugins?: PluginServiceRegistrationOptions[]; } interface ChartData { @@ -584,7 +584,7 @@ declare namespace Chart { position?: string; ticks?: TickOptions; gridLines?: GridLineOptions; - barThickness?: number; + barThickness?: number | "flex"; maxBarThickness?: number; scaleLabel?: ScaleTitleOptions; time?: TimeScale; diff --git a/types/chrome-apps/index.d.ts b/types/chrome-apps/index.d.ts index a1713aa6f9..07437c787a 100644 --- a/types/chrome-apps/index.d.ts +++ b/types/chrome-apps/index.d.ts @@ -1,8 +1,8 @@ // Type definitions for Chrome packaged application development // Project: http://developer.chrome.com/apps/ -// Definitions by: Nikolai Ommundsen , Adam Lay , MIZUNE Pine , MIZUSHIMA Junki , Ingvar Stepanyan , Adam Pyle , Matthew Kimber , otiai10 , couven92 , RReverser , sreimer15 +// Definitions by: Nikolai Ommundsen , Adam Lay , MIZUNE Pine , MIZUSHIMA Junki , Ingconst Stepanyan , Adam Pyle , Matthew Kimber , otiai10 , couven92 , RReverser , sreimer15 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.8 /// @@ -12,25 +12,55 @@ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// declare namespace chrome { - //////////////////// - // Accessibility Features - //////////////////// + ////////////// + // INTERNAL // + ////////////// + + /** @deprecated Could be used, if e.g. deprecated recently */ + type deprecatedButUsable = any; + + /** @deprecated Should never be used, used to guide migrations. */ + type deprecated = never; + + // Not proper types, but used to give the programmer a hint // + /** + * Integer + */ + type integer = number; + /** + * Double + */ + type double = number; + + + //////////////////////////// + // Accessibility Features // + //////////////////////////// + /** + * @requires Important: This API works only on Chrome OS. + * @requires Permissions: + * 'accessibilityFeatures.read' (For read access) + * 'accessibilityFeatures.modify' (For modifications) + * Note that accessibilityFeatures.modify does not imply accessibilityFeatures.read permission. + * @since Available since Chrome 37. + * @description * Use the chrome.accessibilityFeatures API to manage Chrome's accessibility features. * This API relies on the ChromeSetting prototype of the type API for getting and setting individual accessibility features. * In order to get feature states the extension must request accessibilityFeatures.read permission. * For modifying feature state, the extension needs accessibilityFeatures.modify permission. * Note that accessibilityFeatures.modify does not imply accessibilityFeatures.read permission. - * Permissions: 'accessibilityFeatures.read' (For read access); 'accessibilityFeatures.modify' (For modifications; Note that accessibilityFeatures.modify does not imply accessibilityFeatures.read permission.) - * Important: This API works only on Chrome OS. - * @since Availability: Since Chrome 37. */ namespace accessibilityFeatures { interface AccessibilityFeaturesGetArg { - /** Optional. Whether to return the value that applies to the incognito session (default false). */ + /** Whether to return the value that applies to the incognito session (default false). */ incognito?: boolean; } + type LevelOfControl = + 'not_controllable' | 'controlled_by_other_extensions' | + 'controllable_by_this_extension' | 'controlled_by_this_extension'; + interface AccessibilityFeaturesCallbackArg { /** The value of the setting. */ value: any; @@ -41,11 +71,13 @@ declare namespace chrome { * • controllable_by_this_extension: can be controlled by this extension * • controlled_by_this_extension: controlled by this extension */ - levelOfControl: 'not_controllable' | 'controlled_by_other_extensions' | 'controllable_by_this_extension' | 'controlled_by_this_extension'; - /** Optional. Whether the effective value is specific to the incognito session. This property will only be present if the incognito property in the details parameter of get() was true. */ + levelOfControl: LevelOfControl; + /** Whether the effective value is specific to the incognito session. This property will only be present if the incognito property in the details parameter of get() was true. */ incognitoSpecific?: boolean; } + type Scope = 'regular' | 'regular_only' | 'incognito_persistent' | 'incognito_session_only'; + interface AccessibilityFeaturesSetArg { /** * The value of the setting. @@ -53,26 +85,24 @@ declare namespace chrome { */ value: any; /** - * Optional. - * The scope of the ChromeSetting. One of + * The scope of the ChromeSetting. One of * • regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere), * • regular_only: setting for the regular profile only (not inherited by the incognito profile), * • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences), * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences). */ - scope?: 'regular' | 'regular_only' | 'incognito_persistent' | 'incognito_session_only'; + scope?: Scope; } interface AccessibilityFeaturesClearArg { /** - * Optional. - * The scope of the ChromeSetting. One of + * The scope of the ChromeSetting. One of * • regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere), * • regular_only: setting for the regular profile only (not inherited by the incognito profile), * • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences), * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences). */ - scope?: 'regular' | 'regular_only' | 'incognito_persistent' | 'incognito_session_only'; + scope?: Scope; } interface AccessibilityFeaturesSetting { @@ -104,83 +134,85 @@ declare namespace chrome { /** * Spoken feedback (text-to-speech). The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. */ - export var spokenFeedback: AccessibilityFeaturesSetting; + const spokenFeedback: AccessibilityFeaturesSetting; /** * Enlarged cursor. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. */ - export var largeCursor: AccessibilityFeaturesSetting; + const largeCursor: AccessibilityFeaturesSetting; /** * Sticky modifier keys (like shift or alt). The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. */ - export var stickyKeys: AccessibilityFeaturesSetting; + const stickyKeys: AccessibilityFeaturesSetting; /** * High contrast rendering mode. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. */ - export var highContrast: AccessibilityFeaturesSetting; + const highContrast: AccessibilityFeaturesSetting; /** * Full screen magnification. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. */ - export var screenMagnifier: AccessibilityFeaturesSetting; + const screenMagnifier: AccessibilityFeaturesSetting; /** * Auto mouse click after mouse stops moving. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. */ - export var autoclick: AccessibilityFeaturesSetting; + const autoclick: AccessibilityFeaturesSetting; /** * Virtual on-screen keyboard. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. */ - export var virtualKeyboard: AccessibilityFeaturesSetting; + const virtualKeyboard: AccessibilityFeaturesSetting; /** * Caret highlighting. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. * @since Since Chrome 51. */ - export var caretHighlight: AccessibilityFeaturesSetting; + const caretHighlight: AccessibilityFeaturesSetting; /** * Cursor highlighting. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. * @since Since Chrome 51. */ - export var cursorHighlight: AccessibilityFeaturesSetting; + const cursorHighlight: AccessibilityFeaturesSetting; /** * Focus highlighting. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. * @since Since Chrome 51. */ - export var focusHighlight: AccessibilityFeaturesSetting; + const focusHighlight: AccessibilityFeaturesSetting; /** * Select-to-speak. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. * @since Since Chrome 51. */ - export var selectToSpeak: AccessibilityFeaturesSetting; + const selectToSpeak: AccessibilityFeaturesSetting; /** * Switch access. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. * @since Since Chrome 51. */ - export var switchAccess: AccessibilityFeaturesSetting; + const switchAccess: AccessibilityFeaturesSetting; /** * get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. * @since Since Chrome 42. */ - export var animationPolicy: AccessibilityFeaturesSetting; + const animationPolicy: AccessibilityFeaturesSetting; } - //////////////////// - // Alarms - //////////////////// + //////////// + // Alarms // + //////////// /** - * Use the chrome.alarms API to schedule code to run periodically or at a specified time in the future. - * Permissions: 'alarms' + * @requires Permissions: 'alarms' * @since Availability: Since Chrome 22. + * @description + * Use the chrome.alarms API to schedule code to run + * periodically or at a specified time in the future. */ namespace alarms { interface AlarmCreateInfo { - /** Optional. Length of time in minutes after which the onAlarm event should fire. */ + /** Length of time in minutes after which the onAlarm event should fire. */ delayInMinutes?: number; - /** Optional. If set, the onAlarm event should fire every periodInMinutes minutes after the initial event specified by when or delayInMinutes. If not set, the alarm will only fire once. */ + /** If set, the onAlarm event should fire every periodInMinutes minutes after the initial event specified by when or delayInMinutes. If not set, the alarm will only fire once. */ periodInMinutes?: number; - /** Optional. Time at which the alarm should fire, in milliseconds past the epoch (e.g. Date.now() + n). */ + /** Time at which the alarm should fire, in milliseconds past the epoch (e.g. Date.now() + n). */ when?: number; } interface Alarm { - /** Optional. If not null, the alarm is a repeating alarm and will fire again in periodInMinutes minutes. */ + /** If not null, the alarm is a repeating alarm and will fire again in periodInMinutes minutes. */ periodInMinutes?: number; /** Time at which this alarm was scheduled to fire, in milliseconds past the epoch (e.g. Date.now() + n). For performance reasons, the alarm may have been delayed an arbitrary amount beyond this. */ scheduledTime: number; @@ -198,7 +230,7 @@ declare namespace chrome { * To help you debug your app or extension, when you've loaded it unpacked, there's no limit to how often the alarm can fire. * @param alarmInfo Describes when the alarm should fire. The initial time must be specified by either when or delayInMinutes (but not both). If periodInMinutes is set, the alarm will repeat every periodInMinutes minutes after the initial event. If neither when or delayInMinutes is set for a repeating alarm, periodInMinutes is used as the default for delayInMinutes. */ - export function create(alarmInfo: AlarmCreateInfo): void; + function create(alarmInfo: AlarmCreateInfo): void; /** * Creates an alarm. Near the time(s) specified by alarmInfo, the onAlarm event is fired. * If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm. @@ -209,64 +241,92 @@ declare namespace chrome { * @param name Optional name to identify this alarm. Defaults to the empty string. * @param alarmInfo Describes when the alarm should fire. The initial time must be specified by either when or delayInMinutes (but not both). If periodInMinutes is set, the alarm will repeat every periodInMinutes minutes after the initial event. If neither when or delayInMinutes is set for a repeating alarm, periodInMinutes is used as the default for delayInMinutes. */ - export function create(name: string, alarmInfo: AlarmCreateInfo): void; + function create(name: string, alarmInfo: AlarmCreateInfo): void; /** * Gets an array of all the alarms. * @param callback The callback parameter should be a function that looks like this: * @example function(array of Alarm alarms) {...}; */ - export function getAll(callback: (alarms: Alarm[]) => void): void; + function getAll(callback: (alarms: Alarm[]) => void): void; /** * Clears all alarms. - * @param callback If you specify the callback parameter, it should be a function that looks like this: + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: * @example function(boolean wasCleared) {...}; */ - export function clearAll(callback?: (wasCleared: boolean) => void): void; + function clearAll(callback?: (wasCleared: boolean) => void): void; /** * Clears the alarm with the given name. * @param name The name of the alarm to clear. Defaults to the empty string. - * @param callback If you specify the callback parameter, it should be a function that looks like this: + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: * @example function(boolean wasCleared) {...}; */ - export function clear(name?: string, callback?: (wasCleared: boolean) => void): void; + function clear(name?: string, callback?: (wasCleared: boolean) => void): void; /** * Clears the alarm without a name. - * @param callback If you specify the callback parameter, it should be a function that looks like this: + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: * @example function(boolean wasCleared) {...}; */ - export function clear(callback: (wasCleared: boolean) => void): void; + function clear(callback: (wasCleared: boolean) => void): void; /** * Retrieves details about the specified alarm. * @param callback The callback parameter should be a function that looks like this: * @example function( Alarm alarm) {...}; */ - export function get(callback: (alarm: Alarm) => void): void; + function get(callback: (alarm: Alarm) => void): void; /** * Retrieves details about the specified alarm. * @param name The name of the alarm to get. Defaults to the empty string. * @param callback The callback parameter should be a function that looks like this: * @example function( Alarm alarm) {...}; */ - export function get(name: string, callback: (alarm: Alarm) => void): void; + function get(name: string, callback: (alarm: Alarm) => void): void; /** Fired when an alarm has elapsed. Useful for event pages. */ - export var onAlarm: AlarmEvent; + const onAlarm: AlarmEvent; } - //////////////////// - // App Runtime - //////////////////// - + ///////////////// + // App Runtime // + ///////////////// /** - * Use the chrome.app.runtime API to manage the app lifecycle. - * The app runtime manages app installation, controls the event page, and can shut down the app at anytime. * @since Availability: Since Chrome 24. + * @description + * Use the chrome.app.runtime API to manage the app lifecycle. + * The app runtime manages app installation, controls the event page, + * and can shut down the app at anytime. */ namespace app.runtime { - type LaunchSource = 'untracked' | 'app_launcher' | 'new_tab_page' | 'reload' | 'restart' | - 'load_and_launch' | 'command_line' | 'file_handler' | 'url_handler' | 'system_tray' | - 'about_page' | 'keyboard' | 'extensions_page' | 'management_api' | 'ephemeral_app' | - 'background' | 'kiosk' | 'chrome_internal' | 'test' | 'installed_notification' | 'context_menu'; + /** + * @todo TODO UNDOCUMENTED? + */ + enum PlayStoreStatus { + ENABLED = 'enabled', + AVAILABLE = 'available', + UNKNOWN = 'unknown' + } + enum LaunchSource { + ABOUT_PAGE = "about_page", + APP_LAUNCHER = "app_launcher", + BACKGROUND = "background", + CHROME_INTERNAL = "chrome_internal", + COMMAND_LINE = "command_line", + CONTEXT_MENU = "context_menu", + EPHEMERAL_APP = "ephemeral_app", + EXTENSIONS_PAGE = "extensions_page", + FILE_HANDLER = "file_handler", + INSTALLED_NOTIFICATION = "installed_notification", + KEYBOARD = "keyboard", + KIOSK = "kiosk", + LOAD_AND_LAUNCH = "load_and_launch", + MANAGEMENT_API = "management_api", + NEW_TAB_PAGE = "new_tab_page", + RELOAD = "reload", + RESTART = "restart", + SYSTEM_TRAY = "system_tray", + TEST = "test", + UNTRACKED = "untracked", + URL_HANDLER = "url_handler" + } interface EmbedRequest { /** @@ -285,6 +345,10 @@ declare namespace chrome { type actionType = 'new_note'; + const ActionType: { + NEW_NOTE: actionType + } + interface LaunchData { /** * The ID of the file or URL handler that the app is being invoked with. @@ -319,7 +383,7 @@ declare namespace chrome { /** * Contains data that specifies the ActionType this app was launched with. This is null if the app was not launched with a specific action intent. * ______________________________________________________________________________ - * | enum of 'new_note' | actionType | new_note | + * | type of 'new_note' | actionType | new_note | * | | | The user wants to quickly take a new note. | * |____________________|____________|____________________________________________| * @since Since Chrome 54. @@ -338,41 +402,36 @@ declare namespace chrome { type?: string; } - interface EmbedRequestedEvent extends chrome.events.Event<(request: EmbedRequest) => void> { } - - interface LaunchedEvent extends chrome.events.Event<(launchData: LaunchData) => void> { } - - interface RestartedEvent extends chrome.events.Event<() => void> { } - /** * Fired when an embedding app requests to embed this app. This event is only available on dev channel with the flag --enable-app-view. * @since Since Chrome 38. */ - export var onEmbedRequest: EmbedRequestedEvent; + const onEmbedRequest: chrome.events.Event<(request: EmbedRequest) => void>; /** * Fired when an app is launched from the launcher. */ - export var onLaunched: LaunchedEvent; + const onLaunched: chrome.events.Event<(launchData: LaunchData) => void>; /** * Fired at Chrome startup to apps that were running when Chrome last shut down, * or when apps have been requested to restart from their previous state for other reasons * (e.g. when the user revokes access to an app's retained files the runtime will restart the app). * In these situations if apps do not have an onRestarted handler they will be sent an onLaunched event instead. */ - export var onRestarted: RestartedEvent; + const onRestarted: chrome.events.Event<() => void>; } //////////////////// // App Window //////////////////// /** + * @since Availability: Since Chrome 24. + * @description * Use the chrome.app.window API to create windows. * Windows have an optional frame with title bar and size controls. * They are not associated with any Chrome browser windows. * See the Window State Sample for a demonstration of these options. - * @since Availability: Since Chrome 24. */ - namespace app.window { + namespace app { interface ContentBounds { left?: number; top?: number; @@ -448,7 +507,7 @@ declare namespace chrome { * For none, the -webkit-app-region CSS property can be used to apply draggability to the app's window. * -webkit-app-region: drag can be used to mark regions draggable. no-drag can be used to disable this style on nested elements. */ - type?: 'chrome'; + type: 'chrome'; /** * Allows the frame color to be set. Frame coloring is only available if the frame type is chrome. * @since Frame coloring is new in Chrome 36. @@ -468,6 +527,13 @@ declare namespace chrome { inactiveColor?: string; } + enum State { + NORMAL = 'normal', + FULLSCREEN = 'fullscreen', + MAXIMIZED = 'maximized', + MINIMIZED = 'minimized' + } + interface CreateWindowOptions { /** * Id to identify the window. @@ -545,7 +611,7 @@ declare namespace chrome { /** * The initial state of the window, allowing it to be created already fullscreen, maximized, or minimized. Defaults to 'normal'. */ - state?: 'normal' | 'fullscreen' | 'maximized' | 'minimized'; + state?: State; /** * If true, the window will be created in a hidden state. Call show() on the window to show it once it has been created. Defaults to false. */ @@ -578,7 +644,6 @@ declare namespace chrome { */ visibleOnAllWorkspaces?: boolean; } - interface AppWindow { /** Focus the window. */ focus: () => void; @@ -627,7 +692,7 @@ declare namespace chrome { hide: () => void; /** * @deprecated Deprecated since Chrome 36. Use innerBounds or outerBounds. - * @description Get the window's inner bounds as a ContentBounds object. + * Get the window's inner bounds as a ContentBounds object. */ getBounds: () => ContentBounds; /** @@ -676,52 +741,81 @@ declare namespace chrome { onRestored: WindowEvent; } interface WindowEvent extends chrome.events.Event<() => void> { } - /** - * The size and position of a window can be specified in a number of different ways. The most simple option is not specifying anything at all, in which case a default size and platform dependent position will be used. - * To set the position, size and constraints of the window, use the innerBounds or outerBounds properties. Inner bounds do not include window decorations. Outer bounds include the window's title bar and frame. Note that the padding between the inner and outer bounds is determined by the OS. Therefore setting the same property for both inner and outer bounds is considered an error (for example, setting both innerBounds.left and outerBounds.left). - * To automatically remember the positions of windows you can give them ids. If a window has an id, This id is used to remember the size and position of the window whenever it is moved or resized. This size and position is then used instead of the specified bounds on subsequent opening of a window with the same id. If you need to open a window with an id at a location other than the remembered default, you can create it hidden, move it to the desired location, then show it. - * - * @param url - * @param [options] - * @param [callback] Called in the creating window (parent) before the load event is called in the created window (child). The parent can set fields or functions on the child usable from onload. E.g. background.js: function(createdWindow) { createdWindow.contentWindow.foo = function () { }; }; window.js: window.onload = function () { foo(); } If you specify the callback parameter, it should be a function that looks like this: function(AppWindow createdWindow) {...}; - */ - export function create(url: string, options?: CreateWindowOptions, callback?: (created_window: AppWindow) => void): void; - /** - * Returns an AppWindow object for the current script context (ie JavaScript 'window' object). This can also be called on a handle to a script context for another page, for example: otherWindow.chrome.app.window.current(). - */ - export function current(): AppWindow; - /** - * Gets an AppWindow with the given id. If no window with the given id exists null is returned. This method is new in Chrome 33. - */ - export function get(id: string): AppWindow; - /** - * Gets an array of all currently created app windows. This method is new in Chrome 33. - */ - export function getAll(): AppWindow[]; - /** - * Whether the current platform supports windows being visible on all workspaces. - */ - export function canSetVisibleOnAllWorkspaces(): boolean; - } + interface WindowParams extends AppWindow { + id: string; + frameId?: integer; + existingWindow?: boolean; + [key: string]: any; + } + + interface ChromeAppWindow extends AppWindow { + /** + * The size and position of a window can be specified in a number of different ways. The most simple option is not specifying anything at all, in which case a default size and platform dependent position will be used. + * To set the position, size and constraints of the window, use the innerBounds or outerBounds properties. Inner bounds do not include window decorations. Outer bounds include the window's title bar and frame. Note that the padding between the inner and outer bounds is determined by the OS. Therefore setting the same property for both inner and outer bounds is considered an error (for example, setting both innerBounds.left and outerBounds.left). + * To automatically remember the positions of windows you can give them ids. If a window has an id, This id is used to remember the size and position of the window whenever it is moved or resized. This size and position is then used instead of the specified bounds on subsequent opening of a window with the same id. If you need to open a window with an id at a location other than the remembered default, you can create it hidden, move it to the desired location, then show it. + * + * @param url + * @param [options] + * @param [callback] Called in the creating window (parent) before the load event is called in the created window (child). The parent can set fields or functions on the child usable from onload. E.g. background.js: function(createdWindow) { createdWindow.contentWindow.foo = function () { }; }; window.js: window.onload = function () { foo(); } If you specify the callback parameter, it should be a function that looks like this: function(AppWindow createdWindow) {...}; + */ + create(url: string, options?: CreateWindowOptions, callback?: (created_window: AppWindow) => void): void; + /** + * Returns an AppWindow object for the current script context (ie JavaScript 'window' object). This can also be called on a handle to a script context for another page, for example: otherWindow.chrome.app.window.current(). + */ + current(): AppWindow; + /** + * Gets an AppWindow with the given id. If no window with the given id exists null is returned. This method is new in Chrome 33. + */ + get(id: string): AppWindow; + /** + * Gets an array of all currently created app windows. This method is new in Chrome 33. + */ + getAll(): AppWindow[]; + /** + * Whether the current platform supports windows being visible on all workspaces. + */ + canSetVisibleOnAllWorkspaces(): boolean; + + + /** + * Undocumented + * @todo TODO Find info + * definition app.window.initializeAppWindow(state: object) + * @internal + */ + initializeAppWindow(state: WindowParams): void; + } + const window: ChromeAppWindow; + } //////////////////// // Audio //////////////////// /** - * The chrome.audio API is provided to allow users to get information about and control the audio devices attached to the system. - * This API is currently only implemented for ChromeOS. * @since Since Chrome 59. + * @requires Permissions: 'audio' + * @description + * The chrome.audio API is provided to allow users to get information + * about and control the audio devices attached to the system. + * This API is currently only implemented for ChromeOS. */ namespace audio { - export type StreamType = 'INPUT' | 'OUTPUT'; + type StreamType = 'INPUT' | 'OUTPUT'; + type DeviceType = + 'HEADPHONE' | 'MIC' | 'USB' | + 'BLUETOOTH' | 'HDMI' | 'INTERNAL_SPEAKER' | + 'INTERNAL_MIC' | 'FRONT_MIC' | 'REAR_MIC' | + 'KEYBOARD_MIC' | 'HOTWORD' | 'LINEOUT' | + 'POST_MIX_LOOPBACK' | 'POST_DSP_LOOPBACK' | 'OTHER'; + interface AudioDeviceInfo { /** The unique identifier of the audio device. */ id: string; /** Stream type associated with this device. */ streamType: StreamType; /** Type of the device. */ - deviceType: 'HEADPHONE' | 'MIC' | 'USB' | 'BLUETOOTH' | 'HDMI' | 'INTERNAL_SPEAKER' | 'INTERNAL_MIC' | 'FRONT_MIC' | 'REAR_MIC' | 'KEYBOARD_MIC' | 'HOTWORD' | 'LINEOUT' | 'POST_MIX_LOOPBACK' | 'POST_DSP_LOOPBACK' | 'OTHER'; + deviceType: DeviceType; /** The user-friendly name (e.g. 'USB Microphone'). */ displayName: string; /** Device name. */ @@ -750,35 +844,24 @@ declare namespace chrome { * The audio device's desired sound level. Defaults to the device's current sound level. * If used with audio input device, represents audio device gain. * If used with audio output device, represents audio device volume. - * - * Type: integer */ - level?: number; + level?: integer; } + /** @todo TODO INTEGRATE */ interface OnLevelChangedEvent { - /** - * The callback parameter should be a function that looks like this: - * function(object event) {...}; - * @param {(event: { - * deviceId: string, - * level: number - * }) => void} callback - */ addListener(callback: (event: { deviceId: string, level: number }) => void): void; } + /** @todo TODO INTEGRATE */ interface OnMuteChangedEvent { - /** - * The callback parameter should be a function that looks like this: - * function(object event) {...}; - */ addListener(callback: (event: { streamType: StreamType[], isMuted: boolean }) => void): void; } + /** @todo TODO INTEGRATE */ interface OnDeviceListChangedEvent { /** * The callback parameter should be a function that looks like this: @@ -801,42 +884,44 @@ declare namespace chrome { isActive?: boolean; } /** - * @description Gets a list of audio devices filtered based on |filter|. + * Gets a list of audio devices filtered based on |filter|. */ - export function getDevices(filter: Filter, callback: (devices: AudioDeviceInfo[]) => void): void; - export function getDevices(callback: (devices: AudioDeviceInfo[]) => void): void; + function getDevices(filter: Filter, callback: (devices: AudioDeviceInfo[]) => void): void; + function getDevices(callback: (devices: AudioDeviceInfo[]) => void): void; /** Sets lists of active input and/or output devices. */ - export function setDevices(ids: DeviceIdLists[] | string[], callback: () => void): void; + function setDevices(ids: DeviceIdLists[] | string[], callback: () => void): void; /** Sets the properties for the input or output device. */ - export function setProperties(id: string, properties: SetDeviceProperties, callback: () => void): void; + function setProperties(id: string, properties: SetDeviceProperties, callback: () => void): void; /** - * @description Gets the system-wide mute state for the specified stream type. + * Gets the system-wide mute state for the specified stream type. * @param {StreamType} streamType Stream type for which mute state should be fetched. - * @param {(value: boolean) => {}} callback Callback reporting whether mute is set or not for specified stream type. + * @param {(value: boolean)=> void} callback Callback reporting whether mute is set or not for specified stream type. */ - export function getMute(streamType: StreamType, callback: (value: boolean) => void): void; + function getMute(streamType: StreamType, callback: (value: boolean) => void): void; /** - * @description Sets mute state for a stream type. The mute state will apply to all audio devices with the specified audio stream type. + * Sets mute state for a stream type. The mute state will apply to all audio devices with the specified audio stream type. * @param {StreamType} streamType Stream type for which mute state should be set. * @param {boolean} isMuted New mute value. - * @param {() => {}} [callback] If you specify the callback parameter, it should be a function that looks like this: function() {...}; + * @param {()=> void} [callback] If you specify the callback parameter, it should be a function that looks like this: function() {...}; */ - export function setMute(streamType: StreamType, isMuted: boolean, callback?: () => void): void; + function setMute(streamType: StreamType, isMuted: boolean, callback?: () => void): void; /** Fired when sound level changes for an active audio device. */ - export var onLevelChanged: OnLevelChangedEvent; + const onLevelChanged: OnLevelChangedEvent; /** Fired when the mute state of the audio input or output changes. Note that mute state is system-wide and the new value applies to every audio device with specified stream type. */ - export var onMuteChanged: OnMuteChangedEvent; + const onMuteChanged: OnMuteChangedEvent; /** Fired when audio devices change, either new devices being added, or existing devices being removed. */ - export var onDeviceListChanged: OnDeviceListChangedEvent; + const onDeviceListChanged: OnDeviceListChangedEvent; } - //////////////////// - // Bluetooth - //////////////////// + /////////////// + // Bluetooth // + /////////////// /** - * Use the chrome.bluetooth API to connect to a Bluetooth device. All functions report failures via chrome.runtime.lastError. - * Manifest: 'bluetooth': {...} * @since Chrome 37 + * @requires Manifest: 'bluetooth': {...} + * @description + * Use the chrome.bluetooth API to connect to a Bluetooth device. + * All functions report failures via chrome.runtime.lastError. */ namespace bluetooth { interface AdapterState { @@ -851,6 +936,14 @@ declare namespace chrome { /** Indicates whether or not the adapter is currently discovering. */ discovering: boolean; } + type DeviceType = + 'computer' | 'phone' | 'modem' | + 'audio' | 'carAudio' | 'video' | + 'peripheral' | 'joystick' | 'gamepad' | + 'keyboard' | 'mouse' | 'tablet' | 'keyboardMouseCombo'; + + type DeviceVendorIdSource = 'bluetooth' | 'usb'; + interface Device { /** The address of the device, in the format 'XX:XX:XX:XX:XX:XX'. */ address: string; @@ -859,7 +952,7 @@ declare namespace chrome { /** The class of the device, a bit-field defined by http://www.bluetooth.org/en-us/specification/assigned-numbers/baseband. */ deviceClass?: number; /** The Device ID record of the device, where available. */ - vendorIdSource?: 'bluetooth' | 'usb'; + vendorIdSource?: DeviceVendorIdSource; vendorId?: number; productId?: number; deviceId?: number; @@ -868,7 +961,7 @@ declare namespace chrome { * This is obtained from the |deviceClass| field and only represents a small fraction of the possible device types. * When in doubt you should use the |deviceClass| field directly. */ - type?: 'computer' | 'phone' | 'modem' | 'audio' | 'carAudio' | 'video' | 'peripheral' | 'joystick' | 'gamepad' | 'keyboard' | 'mouse' | 'tablet' | 'keyboardMouseCombo'; + type?: DeviceType; /** Indicates whether or not the device is paired with the system. */ paired?: boolean; /** Indicates whether the device is currently connected to the system. */ @@ -906,47 +999,67 @@ declare namespace chrome { addListener(callback: (event: T) => void): void; } + type DeviceFilterType = 'all' | 'known'; + /** * Some criteria to filter the list of returned bluetooth devices. If the filter is not set or set to {}, returned device list will contain all bluetooth devices. Right now this is only supported in ChromeOS, for other platforms, a full list is returned. */ interface DeviceFilter { /** Type of filter to apply to the device list. Default is all. */ - filterType?: 'all' | 'known'; + filterType?: DeviceFilterType; /** Maximum number of bluetoth devices to return. Default is 0 (no limit) if unspecified. */ limit?: number; } /** Get information about the Bluetooth adapter. */ - export function getAdapterState(callback: (adapterInfo: AdapterState) => void): void; + function getAdapterState(callback: (adapterInfo: AdapterState) => void): void; + /** Get information about a Bluetooth device known to the system. */ - export function getDevice(deviceAddress: string, callback: (deviceInfo: Device) => void): void; + function getDevice(deviceAddress: string, callback: (deviceInfo: Device) => void): void; + + /** + * Get a list of Bluetooth devices known to the system, including paired and recently discovered devices. + * @param callback Called when the search is completed. + */ + function getDevices(callback: (devices: Device[]) => void): void; + /** * Get a list of Bluetooth devices known to the system, including paired and recently discovered devices. * @param filter Since Chrome 67. Some criteria to filter the list of returned bluetooth devices. If the filter is not set or set to {}, returned device list will contain all bluetooth devices. Right now this is only supported in ChromeOS, for other platforms, a full list is returned. * @param callback Called when the search is completed. */ - export function getDevices(filter: DeviceFilter, callback: (deviceInfo: Device) => void): void; + function getDevices(filter: DeviceFilter, callback: (devices: Device[]) => void): void; + /** * Start discovery. Newly discovered devices will be returned via the onDeviceAdded event. Previously discovered devices already known to the adapter must be obtained using getDevices and will only be updated using the |onDeviceChanged| event if information about them changes. * Discovery will fail to start if this application has already called startDiscovery. Discovery can be resource intensive: stopDiscovery should be called as soon as possible. */ - export function startDiscovery(callback: () => void): void; + function startDiscovery(callback: () => void): void; + /** Stop discovery. */ - export function stopDiscovery(callback: () => void): void; + function stopDiscovery(callback: () => void): void; + /** Fired when the state of the Bluetooth adapter changes. */ - export var onAdapterStateChanged: BluetoothEvent; + const onAdapterStateChanged: BluetoothEvent; + /** Fired when information about a new Bluetooth device is available. */ - export var onDeviceAdded: BluetoothEvent; + const onDeviceAdded: BluetoothEvent; + /** Fired when information about a known Bluetooth device has changed. */ - export var onDeviceChanged: BluetoothEvent; + const onDeviceChanged: BluetoothEvent; + /** Fired when a Bluetooth device that was previously discovered has been out of range for long enough to be considered unavailable again, and when a paired device is removed. */ - export var onDeviceRemoved: BluetoothEvent; + const onDeviceRemoved: BluetoothEvent; } + /** - * The chrome.bluetoothLowEnergy API is used to communicate with Bluetooth Smart (Low Energy) devices using the Generic Attribute Profile (GATT). - * Manifest: 'bluetooth': {...} * @since Chrome 37 - * Important: This API works only on Chrome OS. - * Note: With Chrome 56, users can select nearby Bluetooth Low Energy devices to provide to web sites that use the Web Bluetooth API. + * @requires Manifest: 'bluetooth': {...} + * @requires Important: This API works only on Chrome OS. + * @requires Note: With Chrome 56, users can select nearby Bluetooth Low Energy devices to provide to web sites that use the Web Bluetooth API. + * @description + * The chrome.bluetoothLowEnergy API is used to communicate + * with Bluetooth Smart (Low Energy) devices using the + * Generic Attribute Profile (GATT). */ namespace bluetoothLowEnergy { interface Service { @@ -966,22 +1079,21 @@ declare namespace chrome { */ deviceAddress?: string; } - enum CharacteristicProperties { - 'broadcast', - 'read', - 'writeWithoutResponse', - 'write', - 'notify', - 'indicate', - 'authenticatedSignedWrites', - 'extendedProperties', - 'reliableWrite', - 'writableAuxiliaries', - 'encryptRead', - 'encryptWrite', - 'encryptAuthenticatedRead', - 'encryptAuthenticatedWrite' - } + type CharacteristicProperties = + 'broadcast' | + 'read' | + 'writeWithoutResponse' | + 'write' | + 'notify' | + 'indicate' | + 'authenticatedSignedWrites' | + 'extendedProperties' | + 'reliableWrite' | + 'writableAuxiliaries' | + 'encryptRead' | + 'encryptWrite' | + 'encryptAuthenticatedRead' | + 'encryptAuthenticatedWrite'; interface Characteristic { /** The UUID of the characteristic, e.g. 00002a37-0000-1000-8000-00805f9b34fb. */ uuid: string; @@ -994,14 +1106,14 @@ declare namespace chrome { /** The currently cached characteristic value. This value gets updated when the value of the characteristic is read or updated via a notification or indication. */ value?: ArrayBuffer; } - enum DescriptorPermissions { - 'read', - 'write', - 'encryptedRead', - 'encryptedWrite', - 'encryptedAuthenticatedRead', - 'encryptedAuthenticatedWrite' - } + type DescriptorPermissions = + 'read' | + 'write' | + 'encryptedRead' | + 'encryptedWrite' | + 'encryptedAuthenticatedRead' | + 'encryptedAuthenticatedWrite'; + interface Descriptor { /** The UUID of the characteristic descriptor, e.g. 00002902-0000-1000-8000-00805f9b34fb. */ uuid: string; @@ -1049,9 +1161,7 @@ declare namespace chrome { /** Optional flag for sending an indication instead of a notification. */ shouldIndicate: boolean; } - enum AdvertisementType { - 'broadcast', 'peripheral' - } + type AdvertisementType = 'broadcast' | 'peripheral'; interface Advertisement { /** Type of advertisement. */ type: AdvertisementType; @@ -1098,7 +1208,7 @@ declare namespace chrome { */ function getService(serviceId: string, callback: (result: Service) => void): void; /** - * @description Create a locally hosted GATT service. This service can be registered to be available on a local GATT server. This function is only available if the app has both the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. The peripheral permission may not be available to all apps. + * Create a locally hosted GATT service. This service can be registered to be available on a local GATT server. This function is only available if the app has both the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. The peripheral permission may not be available to all apps. * @since Since Chrome 52. * @param service The service to create. * @param callback Called with the created services's unique ID. @@ -1118,7 +1228,7 @@ declare namespace chrome { */ function getCharacteristic(characteristicId: string, callback: (result: Characteristic) => void): void; /** - * @description Create a locally hosted GATT characteristic. This characteristic must be hosted under a valid service. If the service ID is not valid, the lastError will be set. This function is only available if the app has both the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. The peripheral permission may not be available to all apps. + * Create a locally hosted GATT characteristic. This characteristic must be hosted under a valid service. If the service ID is not valid, the lastError will be set. This function is only available if the app has both the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. The peripheral permission may not be available to all apps. * @since Since Chrome 52. * @param characteristic The characteristic to create. * @param serviceId ID of the service to create this characteristic for. @@ -1226,7 +1336,7 @@ declare namespace chrome { * @param serviceId Unique ID of a created service. * @param callback Callback with the result of the register operation. */ - function registerService(serviceId: string, callback: () => void): void; + function registerService(serviceId: string, callback: (result: any) => void): void; /** * Unregister the given service with the local GATT server. * If the service ID is invalid, the lastError will be set. @@ -1237,7 +1347,7 @@ declare namespace chrome { * @param serviceId Unique ID of a current registered service. * @param callback Callback with the result of the register operation. */ - function unregisterService(serviceId: string, callback: () => void): void; + function unregisterService(serviceId: string, callback: (result: any) => void): void; /** * Remove the specified service, unregistering it if it was registered. * If the service ID is invalid, the lastError will be set. @@ -1286,7 +1396,7 @@ declare namespace chrome { /** * Set's the interval betweeen two consecutive advertisements. * Note: This is a best effort. - * The actual interval may vary non-trivially from the requested intervals. + * The actual interval may consty non-trivially from the requested intervals. * On some hardware, there is a minimum interval of 100ms. * The minimum and maximum values cannot exceed the the range allowed by the Bluetooth 4.2 specification. * @since Since Chrome 55. @@ -1302,16 +1412,16 @@ declare namespace chrome { */ function sendRequestResponse(response: IResponse): void; /** Fired whan a new GATT service has been discovered on a remote device. */ - var onServiceAdded: chrome.events.Event<(service: Service) => void>; + const onServiceAdded: chrome.events.Event<(service: Service) => void>; /** * Fired when the state of a remote GATT service changes. * This involves any characteristics and/or descriptors * that get added or removed from the service, as well as - * "ServiceChanged" notifications from the remote device. + * 'ServiceChanged' notifications from the remote device. */ - var onServiceChanged: chrome.events.Event<(service: Service) => void>; + const onServiceChanged: chrome.events.Event<(service: Service) => void>; /** Fired when a GATT service that was previously discovered on a remote device has been removed. */ - var onServiceRemoved: chrome.events.Event<(service: Service) => void>; + const onServiceRemoved: chrome.events.Event<(service: Service) => void>; /** * Fired when the value of a remote GATT characteristic changes, * either as a result of a read request, @@ -1319,14 +1429,14 @@ declare namespace chrome { * This event will only be sent if the app has enabled notifications * by calling startCharacteristicNotifications. */ - var onCharacteristicValueChanged: chrome.events.Event<(characteristic: Characteristic) => void>; + const onCharacteristicValueChanged: chrome.events.Event<(characteristic: Characteristic) => void>; /** * Fired when the value of a remote GATT characteristic descriptor changes, * usually as a result of a read request. * This event exists mostly for convenience and will always be sent after * a successful call to readDescriptorValue. */ - var onDescriptorValueChanged: chrome.events.Event<(descriptor: Descriptor) => void>; + const onDescriptorValueChanged: chrome.events.Event<(descriptor: Descriptor) => void>; /** * Fired when a connected central device requests to read the value of * a characteristic registered on the local GATT server. @@ -1336,7 +1446,7 @@ declare namespace chrome { * The peripheral permission may not be available to all apps. * @since Since Chrome 52. */ - var onCharacteristicReadRequest: chrome.events.Event<(characteristic: Characteristic) => void>; + const onCharacteristicReadRequest: chrome.events.Event<(characteristic: Characteristic) => void>; /** * Fired when a connected central device requests to write the value of * a characteristic registered on the local GATT server. @@ -1346,7 +1456,7 @@ declare namespace chrome { * The peripheral permission may not be available to all apps. * @since Since Chrome 52. */ - var onCharacteristicWriteRequest: chrome.events.Event<(characteristic: Characteristic) => void>; + const onCharacteristicWriteRequest: chrome.events.Event<(characteristic: Characteristic) => void>; /** * Fired when a connected central device requests to read the value of * a descriptor registered on the local GATT server. @@ -1356,7 +1466,7 @@ declare namespace chrome { * The peripheral permission may not be available to all apps. * @since Since Chrome 52. */ - var onDescriptorReadRequest: chrome.events.Event<(descriptor: Descriptor) => void>; + const onDescriptorReadRequest: chrome.events.Event<(descriptor: Descriptor) => void>; /** * Fired when a connected central device requests to write the value of * a descriptor registered on the local GATT server. @@ -1365,22 +1475,341 @@ declare namespace chrome { * and the bluetooth:peripheral permissions set to true. * The peripheral permission may not be available to all apps. */ - var onDescriptorWriteRequest: chrome.events.Event<(descriptor: Descriptor) => void>; - } - /** - * Use the chrome.bluetoothSocket API to send and receive data to Bluetooth devices using RFCOMM and L2CAP connections. - * @since Chrome 37 - * Manifest: 'bluetooth': {...} - * Important: This API works only on OS X, Windows and Chrome OS. - */ - namespace bluetoothSocket { - /* NOT IMPLEMENTED YET */ + const onDescriptorWriteRequest: chrome.events.Event<(descriptor: Descriptor) => void>; } - //////////////////// - // Browser - //////////////////// /** + * @since Chrome 37 + * @requires Manifest: 'bluetooth': {...} + * @requires Important: This API works only on OS X, Windows and Chrome OS. + * Use the chrome.bluetoothSocket API to send and receive data to Bluetooth devices using RFCOMM and L2CAP connections. + */ + namespace bluetoothSocket { + interface SocketProperties { + /** + * Flag indicating whether the socket is left open when + * the event page of the application is unloaded + * (see Manage App Lifecycle). The default value is false. + * When the application is loaded, any sockets previously + * opened with persistent=true can be fetched with $ref:getSockets. + */ + persistent?: boolean; + /** An application-defined string associated with the socket. */ + name?: string; + /** + * @default 4096 + * @description + * The size of the buffer used to receive data. + * */ + bufferSize?: integer; + } + interface ListenOptions { + /** + * The RFCOMM Channel used by listenUsingRfcomm. + * If specified, this channel must not be previously + * in use or the method call will fail. When not specified, + * an unused channel will be automatically allocated. + */ + channel?: integer; + /** + * The L2CAP PSM used by listenUsingL2cap. + * If specified, this PSM must not be previously + * in use or the method call with fail. When not specified, + * an unused PSM will be automatically allocated. + * */ + psm?: integer; + /** + * Length of the socket's listen queue. + * The default value depends on the operating system's host subsystem. + * */ + backlog?: number; + } + interface SocketInfo { + /** + * The socket identifier. + * */ + socketId: integer; + /** + * Flag indicating if the socket remains + * open when the event page of the application + * is unloaded (see SocketProperties.persistent). + * The default value is 'false'. + */ + persistent: boolean; + /** + * Application-defined string associated with the socket. + */ + name?: string; + /** + * The size of the buffer used to receive data. + * If no buffer size has been specified explictly, + * the value is not provided. + */ + bufferSize?: integer; + /** + * Flag indicating whether a connected socket + * blocks its peer from sending more data, or + * whether connection requests on a listening + * socket are dispatched through the onAccept + * event or queued up in the listen queue backlog. + * See setPaused. The default value is 'false'. + */ + paused: boolean; + /** + * Flag indicating whether the socket is connected to a remote peer. + */ + connected: boolean; + /** + * If the underlying socket is connected, + * contains the Bluetooth address of the device it is connected to. + */ + address?: string; + /** + * If the underlying socket is connected, + * contains information about the service + * UUID it is connected to, otherwise if + * the underlying socket is listening, + * contains information about the service + * UUID it is listening on. + */ + uuid?: string; + } + + interface CreateInfo { + /** + * The ID of the newly created socket. + * Note that socket IDs created from this + * API are not compatible with socket IDs + * created from other APIs, such as the + * sockets.tcp API. + */ + socketId: integer; + } + interface OnAcceptInfoData { + /** The server socket identifier. */ + socketId: integer; + /** + * The client socket identifier, i.e. the socket + * identifier of the newly established connection. + * This socket identifier should be used only with + * functions from the chrome.bluetoothSocket namespace. + * Note the client socket is initially paused and must + * be explictly un-paused by the application to start + * receiving data. + */ + clientSocketId: integer; + } + type OnAcceptErrorCode = + 'system_error' | + 'not_listening'; + interface OnAcceptErrorEventData { + /** The server socket identifier. */ + socketId: integer; + /** The error message */ + errorMessage: string; + /** + * An error code indicating what went wrong. + * + * system_error + * > A system error occurred and the connection may be unrecoverable. + * not_listening + * > The socket is not listening. + */ + error: OnAcceptErrorCode; + } + interface OnReceiveEventData { + /** The socket identifier. */ + socketId: integer; + /** The data received, with a maxium size of bufferSize. */ + data: ArrayBuffer; + } + type OnReceiveErrorCode = + 'disconnected' | + 'system_error' | + 'not_connected'; + interface OnReceiveErrorEventData { + /** The server socket identifier. */ + socketId: integer; + /** The error message */ + errorMessage: string; + /** + * An error code indicating what went wrong. + * + * disconnected + * > The connection was disconnected. + * system_error + * > A system error occurred and the connection may be unrecoverable. + * not_connected + * > The socket has not been connected. + */ + error: OnAcceptErrorCode; + } + interface OnAcceptEvent extends chrome.events.Event<(info: OnAcceptInfoData) => void> { } + interface OnAcceptErrorEvent extends chrome.events.Event<(info: OnAcceptErrorEventData) => void> { } + interface OnReceiveEvent extends chrome.events.Event<(info: OnReceiveEventData) => void> { } + interface OnReceiveErrorEvent extends chrome.events.Event<(info: OnReceiveErrorEventData) => void> { } + /** + * Creates a Bluetooth socket. + * @param callback Called when the socket has been created + * */ + function create(callback: (createInfo: CreateInfo) => void): void; + /** + * Creates a Bluetooth socket. + * @param properties The socket properties (optional) + * @param callback Called when the socket has been created + */ + function create(properties: SocketProperties, callback: (createInfo: CreateInfo) => void): void; + /** + * Updates the socket properties. + * @param socketId The socket identifier. + * @param properties The properties to update. + * @param [callback] Called when the properties are updated. + */ + function update(socketId: integer, properties: SocketProperties, callback?: () => void): void; + /** + * Enables or disables a connected socket from + * receiving messages from its peer, or a listening + * socket from accepting new connections. The default + * value is 'false'. Pausing a connected socket is + * typically used by an application to throttle data + * sent by its peer. When a connected socket is paused, + * no onReceiveevent is raised. When a socket is connected + * and un-paused, onReceive events are raised again when + * messages are received. When a listening socket is paused, + * new connections are accepted until its backlog is full + * then additional connection requests are refused. + * onAccept events are raised only when the socket is un-paused. + * + * @param socketId The socket identifier. + * @param paused Flag indicating whether a connected socket + * blocks its peer from sending more data, or + * whether connection requests on a listening + * socket are dispatched through the onAccept + * event or queued up in the listen queue backlog. + * See setPaused. The default value is 'false'. + * @param [callback] Callback from the setPaused method. + */ + function setPaused(socketId: integer, paused: boolean, callback?: () => void): void; + /** + * Listen for connections using the RFCOMM protocol. + * + * @param socketId The socket identifier. + * @param uuid Service UUID to listen on. + * @param callback Called when listen operation completes. + */ + function listenUsingRfcomm(socketId: integer, uuid: string, callback: () => void): void; + /** + * Listen for connections using the RFCOMM protocol. + * + * @param socketId The socket identifier. + * @param uuid Service UUID to listen on. + * @param options Optional additional options for the service. + * @param callback Called when listen operation completes. + */ + function listenUsingRfcomm(socketId: integer, uuid: string, options: ListenOptions, callback: () => void): void; + /** + * Listen for connections using the L2CAP protocol. + * + * @param socketId The socket identifier. + * @param uuid Service UUID to listen on. + * @param callback Called when listen operation completes. + */ + function listenUsingL2cap(socketId: integer, uuid: string, callback: () => void): void; + /** + * Listen for connections using the L2CAP protocol. + * + * @param socketId The socket identifier. + * @param uuid Service UUID to listen on. + * @param options Optional additional options for the service. + * @param callback Called when listen operation completes. + */ + function listenUsingL2cap(socketId: integer, uuid: string, options: ListenOptions, callback: () => void): void; + /** + * Connects the socket to a remote Bluetooth device. + * When the connect operation completes successfully, + * onReceive events are raised when data is received + * from the peer. If a network error occur while the + * runtime is receiving packets, a onReceiveError + * event is raised, at which point no more onReceive + * event will be raised for this socket until the + * setPaused(false) method is called. + * + * @param socketId The socket identifier. + * @param address The address of the Bluetooth device. + * @param uuid The UUID of the service to connect to. + * @param callback Called when the connect attempt is complete. + */ + function connect(socketId: integer, address: string, uuid: string, callback: () => void): void; + /** + * Disconnects the socket. The socket identifier remains valid. + * @param socketId The socket identifier. + * @param [callback] Called when the disconnect attempt is complete. + */ + function disconnect(socketId: integer, callback?: () => void): void; + /** + * Disconnects and destroys the socket. + * Each socket created should be closed after use. + * The socket id is no longer valid as soon at the + * function is called. However, the socket is guaranteed + * to be closed only when the callback is invoked. + * + * @param socketId The socket identifier. + * @param callback Called when the `close` operation completes + */ + function close(socketId: integer, callback: () => void): void; + /** + * Sends data on the given Bluetooth socket. + * @param socketId The socket identifier. + * @param data The data to send. + * @param [callback] Called with the number of bytes sent. + */ + function send(socketId: integer, data: ArrayBuffer, callback?: (bytesSent: number) => void): void; + /** + * Retrieves the state of the given socket. + * @param socketId The socket identifier. + * @param callback Called when the socket state is available. + * Callback returning object containing the socket information. + */ + function getInfo(socketId: integer, callback: (socketInfo: SocketInfo) => void): void; + /** + * Retrieves the list of currently opened sockets owned by the application. + * @param callback Called when the list of sockets is available. + * Returns an array of socket info. + */ + function getSockets(callback: (sockets: SocketInfo[]) => void): void; + /** + * Event raised when a connection has been established + * for a given socket. + */ + const onAccept: OnAcceptEvent; + /** + * Event raised when a network error occurred while the + * runtime was waiting for new connections on the given + * socket. Once this event is raised, the socket is set + * to paused and no more onAccept events are raised for + * this socket. + */ + const onAcceptError: OnAcceptErrorEvent; + /** + * Event raised when data has been received for a given socket. + */ + const onReceive: OnReceiveEvent; + /** + * Event raised when a network error occured while the runtime + * was waiting for data on the socket. Once this event is raised, + * the socket is set to paused and no more onReceive events are + * raised for this socket. + */ + const onReceiveError: OnReceiveErrorEvent; + } + + ///////////// + // Browser // + ///////////// + /** + * @since Availability: Since Chrome 42. + * @requires Permissions: 'browser' + * @description * Use the chrome.browser API to interact with the Chrome browser associated with * the current application and Chrome profile. */ @@ -1398,7 +1827,7 @@ declare namespace chrome { * @param callback Called when the tab was successfully * created, or failed to be created. If failed, runtime.lastError will be set. */ - export function openTab(options: Options, callback: () => void): void; + function openTab(options: Options, callback: () => void): void; /** * Opens a new tab in a browser window associated with the current application @@ -1406,24 +1835,77 @@ declare namespace chrome { * a new one is opened prior to creating the new tab. Since Chrome 42 only. * @param options Configures how the tab should be opened. */ - export function openTab(options: Options): void; + function openTab(options: Options): void; } - //////////////////// - // Commands - //////////////////// + /////////////// + // Clipboard // + /////////////// /** - * Use the commands API to add keyboard shortcuts that trigger actions in your extension, for example, an action to open the browser action or send a command to the extension. - * Availability: Since Chrome 25. - * Manifest: 'commands': {...} + * @requires(dev) **Dev** channel only. + * @requires Permissions: "clipboard" + * @description + * *This API is* **experimental**. *It is* **only** *available to Chrome users on the* **dev** *channel.* + * The chrome.clipboard API is provided to allow users to access data of the clipboard. + * This is a temporary solution for chromeos platform apps until open-web alternative is available. + * It will be deprecated once open-web solution is available. + * @see[Docs]{@link https://developer.chrome.com/apps/clipboard} + */ + namespace clipboard { + interface AdditionalItems { + /** Type of the additional data item. */ + type: 'textPlain' | 'textHtml'; + /** + * Content of the additional data item. + * Either the plain text string if *type* is "textPlain" or + * markup string if *type* is "textHtml". + * The data can not exceed 2MB. + */ + data: string; + } + /** + * **Dev channel only.** + * Sets image data to clipboard + * @param imageData The encoded image data. *Since Chrome 69. Warning: this is the current Beta channel.* + * @param type The type of image being passed. *Since Chrome 69. Warning: this is the current Beta channel.* + * @param [additionalItems] Additional data items for describing image data. + * The callback is called with chrome.runtime.lastError set to error code if there is an error. + * Requires clipboard and clipboardWrite permissions. + * *Since Chrome 69. Warning: this is the current Beta channel.* + * @param [callback] + */ + function setImageData(imageData: ArrayBuffer, type: 'png' | 'jpeg', additionalItems?: AdditionalItems, callback?: () => void): void; + + /** + * **Dev channel only.** + * Fired when clipboard data changes. + * Requires clipboard and clipboardRead permissions for adding listener to + * chrome.clipboard.onClipboardDataChanged event. After this event fires, the + * clipboard data is available by calling document.execCommand('paste'). + */ + const onClipboardDataChanged: chrome.events.Event<() => void>; + } + + ////////////// + // Commands // + ////////////// + /** + * @since Availability: Since Chrome 35. + * @requires Manifest: 'commands': {...} + * @description + * Use the commands API to add keyboard shortcuts that + * trigger actions in your app, for example, an + * action to open the browser action or send a command + * to the app. + * @see[Usage]{@link https://developer.chrome.com/apps/commands} */ namespace commands { interface Command { - /** Optional. The name of the Extension Command */ + /** The name of the Extension Command */ name?: string; - /** Optional. The Extension Command description */ + /** The Extension Command description */ description?: string; - /** Optional. The shortcut active for this command, or blank if not active. */ + /** The shortcut active for this command, or blank if not active. */ shortcut?: string; } @@ -1432,239 +1914,338 @@ declare namespace chrome { /** * Returns all the registered extension commands for this extension and their shortcut (if active). * @param callback Called to return the registered commands. - * If you specify the callback parameter, it should be a function that looks like this: - * function(array of Command commands) {...}; */ - export function getAll(callback: (commands: Command[]) => void): void; + function getAll(callback: (commands: Command[]) => void): void; /** Fired when a registered command is activated using a keyboard shortcut. */ - export var onCommand: CommandEvent; + const onCommand: CommandEvent; } - //////////////////// - // Context Menus - //////////////////// + /////////////////// + // Context Menus // + /////////////////// /** - * Use the chrome.contextMenus API to add items to Google Chrome's context menu. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages. - * Availability: Since Chrome 6. - * Permissions: 'contextMenus' + * @since Availability: Since Chrome 24. + * @requires Permissions: 'contextMenus' + * @description + * Use the chrome.contextMenus API to add items to Google Chrome's context menu. + * You can choose what types of objects your context menu additions apply to, + * such as images, hyperlinks, and pages. + * + * Context menu items can appear in any document (or frame within a document), + * even those with file:// or chrome:// URLs. To control which documents your + * items can appear in, specify the documentUrlPatterns field when you call the + * create() or update() method. + * + * You can create as many context menu items as you need, + * but if more than one from your app is visible at once, + * Google Chrome automatically collapses them into a single parent menu. */ namespace contextMenus { + /** + * @since Chrome 38. + * @default 6 + * @description + * The maximum number of top level extension items that + * can be added to an extension action context menu. + * Any items beyond this limit will be ignored. + */ + const ACTION_MENU_TOP_LEVEL_LIMIT: number; /** * The different contexts a menu can appear in. Specifying 'all' is equivalent to the combination of all other contexts except for 'launcher'. The 'launcher' context is only supported by apps and is used to add menu items to the context menu that appears when clicking on the app icon in the launcher/taskbar/dock/etc. Different platforms might put limitations on what is actually supported in a launcher context menu. **/ - export type ContextType = 'all' | 'page' | 'frame' | 'selection' | 'link' | 'editable' | 'image' | 'video' | 'audio' | 'launcher' | 'browser_action' | 'page_action'; + type ContextType = + 'all' | + 'page' | + 'frame' | + 'selection' | + 'link' | + 'editable' | + 'image' | + 'video' | + 'audio' | + 'launcher' | + 'browser_action' | + 'page_action'; /** * The type of menu item. **/ - export type ItemType = 'normal' | 'checkbox' | 'radio' | 'separator'; + type ItemType = + 'normal' | + 'checkbox' | + 'radio' | + 'separator'; + type MediaType = + 'image' | + 'video' | + 'audio'; interface OnClickData { /** - * Optional. - * @since Since Chrome 35. - * The text for the context selection, if any. - */ - selectionText?: string; - /** - * Optional. - * @since Since Chrome 35. - * A flag indicating the state of a checkbox or radio item after it is clicked. - */ - checked?: boolean; - /** - * @since Since Chrome 35. * The ID of the menu item that was clicked. - */ - menuItemId: any; - /** - * Optional. * @since Since Chrome 35. - * The URL of the frame of the element where the context menu was clicked, if it was in a frame. */ - frameUrl?: string; + menuItemId: integer | string; + /** + * The parent ID, if any, for the item clicked. * @since Since Chrome 35. - * A flag indicating whether the element is editable (text input, textarea, etc.). */ - editable: boolean; + parentMenuItemId?: integer | string; + /** - * Optional. + * One of 'image', 'video', or 'audio' if the context menu was + * activated on one of these types of elements. * @since Since Chrome 35. - * One of 'image', 'video', or 'audio' if the context menu was activated on one of these types of elements. */ - mediaType?: string; + mediaType?: MediaType; + /** - * Optional. - * @since Since Chrome 35. - * A flag indicating the state of a checkbox or radio item before it was clicked. - */ - wasChecked?: boolean; - /** - * @since Since Chrome 35. - * The URL of the page where the menu item was clicked. This property is not set if the click occured in a context where there is no current page, such as in a launcher context menu. - */ - pageUrl: string; - /** - * Optional. - * @since Since Chrome 35. * If the element is a link, the URL it points to. + * @since Since Chrome 35. */ linkUrl?: string; + /** - * Optional. - * @since Since Chrome 35. - * The parent ID, if any, for the item clicked. - */ - parentMenuItemId?: any; - /** - * Optional. - * @since Since Chrome 35. * Will be present for elements with a 'src' URL. + * @since Since Chrome 35. */ srcUrl?: string; + + /** + * The URL of the page where the menu item was clicked. + * This property is not set if the click occured in a + * context where there is no current page, such as in + * a launcher context menu. + * @since Since Chrome 35. + */ + pageUrl: string; + + /** + * The URL of the frame of the element where the context menu was clicked, + * if it was in a frame. + * @since Since Chrome 35. + */ + frameUrl?: string; + + /** + * The ID of the frame of the element where the context menu was clicked, + * if it was in a frame. + * @since Since Chrome 35. + */ + frameId?: integer; + + /** + * The text for the context selection, if any. + * @since Since Chrome 35. + */ + selectionText?: string; + + /** + * A flag indicating whether the element is editable (text input, textarea, etc.). + * @since Since Chrome 35. + */ + editable: boolean; + + /** + * A flag indicating the state of a checkbox or radio item before it was clicked. + * @since Since Chrome 35. + */ + wasChecked?: boolean; + + /** + * A flag indicating the state of a checkbox or radio item after it is clicked. + * @since Since Chrome 35. + */ + checked?: boolean; } interface CreateProperties { - /** Optional. Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see Match Patterns. */ - documentUrlPatterns?: string[]; - /** Optional. The initial state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items. */ - checked?: boolean; - /** Optional. The text to be displayed in the item; this is required unless type is 'separator'. When the context is 'selection', you can use %s within the string to show the selected text. For example, if this parameter's value is 'Translate '%s' to Pig Latin' and the user selects the word 'cool', the context menu item for the selection is 'Translate 'cool' to Pig Latin'. */ - title?: string; - /** Optional. List of contexts this menu item will appear in. Defaults to ['page'] if not specified. */ - contexts?: string[]; + /** The type of menu item. Defaults to 'normal' if not specified. */ + type?: ItemType; + /** - * Optional. - * Whether this context menu item is enabled or disabled. Defaults to true. - * @since Since Chrome 20. + * The unique ID to assign to this item. + * Mandatory for event pages. + * Cannot be the same as another ID for this extension. */ - enabled?: boolean; - /** Optional. Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags. */ - targetUrlPatterns?: string[]; + id?: string; + + /** + * The text to be displayed in the item; + * this is required unless type is 'separator'. + * When the context is 'selection', you can use + * %s within the string to show the selected text. + * For example, if this parameter's value is + * 'Translate '%s' to Pig Latin' and the user + * selects the word 'cool', the context menu + * item for the selection is 'Translate 'cool' + * to Pig Latin'. + **/ + title?: string; + + /** + * The initial state of a checkbox or radio item: + * true for selected and false for unselected. + * Only one radio item can be selected at a time + * in a given group of radio items. + **/ + checked?: boolean; + + /** + * List of contexts this menu item will appear in. + * Defaults to ['page'] if not specified. + **/ + contexts?: ContextType[]; + + /** + * Whether the item is visible in the menu. + * @since Since Chrome 62. + */ + visible?: boolean; + /** - * Optional. * A function that will be called back when the menu item is clicked. Event pages cannot use this; instead, they should register a listener for chrome.contextMenus.onClicked. * @param info Information sent when a context menu item is clicked. */ onclick?: (info: OnClickData) => void; - /** Optional. The ID of a parent menu item; this makes the item a child of a previously added item. */ - parentId?: any; - /** Optional. The type of menu item. Defaults to 'normal' if not specified. */ - type?: string; + + /** The ID of a parent menu item; this makes the item a child of a previously added item. */ + parentId?: integer | string; + /** - * Optional. - * @since Since Chrome 21. - * @description The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension. - */ - id?: string; + * Lets you restrict the item to apply only to documents whose URL + * matches one of the given patterns. (This applies to frames as well.) + * For details on the format of a pattern, see Match Patterns. + **/ + documentUrlPatterns?: string[]; + /** - * @description Whether the item is visible in the menu. - * @since Since Chrome 62 + * Similar to documentUrlPatterns, + * but lets you filter based on the src attribute + * of img/audio/video tags and the href of anchor tags. + **/ + targetUrlPatterns?: string[]; + + /** + * Whether this context menu item is enabled or disabled. + * @default true */ - visible?: boolean; + enabled?: boolean; } interface UpdateProperties { - documentUrlPatterns?: string[]; - checked?: boolean; + type?: ItemType; title?: string; - contexts?: string[]; + checked?: boolean; + contexts?: ContextType[]; /** - * @since Chrome 20 - **/ - enabled?: boolean; - targetUrlPatterns?: string[]; - onclick?: (info: OnClickData) => void; - /** Optional. Note: You cannot change an item to be a child of one of its own descendants. */ - parentId?: any; - type?: string; - /** - * @description Whether the item is visible or not. - * @since Since Chrome 62 + * Whether the item is visible in the menu. + * @since Chrome 62. */ visible?: boolean; + /** + * Information sent when a context menu item is clicked. + * @since Chrome 44 + */ + onclick?: (info: OnClickData) => void; + /** Note: You cannot change an item to be a child of one of its own descendants. */ + parentId?: integer | string; + documentUrlPatterns?: string[]; + targetUrlPatterns?: string[]; + enabled?: boolean; } interface MenuClickedEvent extends chrome.events.Event<(info: OnClickData) => void> { } /** - * Since Chrome 38. - * The maximum number of top level extension items that can be added to an extension action context menu. Any items beyond this limit will be ignored. + * Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in chrome.runtime.lastError). + * @param callback Called when the item has been created in the browser. If there were any problems creating the item, details will be available in chrome.runtime.lastError. */ - export var ACTION_MENU_TOP_LEVEL_LIMIT: number; + function create(createProperties: CreateProperties, callback?: () => void): void; + + /** + * Updates a previously created context menu item. + * @param id The ID of the item to update. + * @param updateProperties The properties to update. Accepts the same values as the create function. + * @param callback Called when the context menu has been updated. + */ + function update(id: integer | string, updateProperties: UpdateProperties, callback?: () => void): void; + + /** + * Removes a context menu item. + * @param menuItemId The ID of the context menu item to remove. + * @param callback Called when the context menu has been removed. + */ + function remove(menuItemId: integer | string, callback?: () => void): void; /** * Removes all context menu items added by this extension. * @param callback Called when removal is complete. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; */ - export function removeAll(callback?: () => void): void; - /** - * Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in chrome.runtime.lastError). - * @param callback Called when the item has been created in the browser. If there were any problems creating the item, details will be available in chrome.runtime.lastError. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; - */ - export function create(createProperties: CreateProperties, callback?: () => void): void; - /** - * Updates a previously created context menu item. - * @param id The ID of the item to update. - * @param updateProperties The properties to update. Accepts the same values as the create function. - * @param callback Called when the context menu has been updated. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; - */ - export function update(id: string, updateProperties: UpdateProperties, callback?: () => void): void; - /** - * Updates a previously created context menu item. - * @param id The ID of the item to update. - * @param updateProperties The properties to update. Accepts the same values as the create function. - * @param callback Called when the context menu has been updated. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; - */ - export function update(id: number, updateProperties: UpdateProperties, callback?: () => void): void; - /** - * Removes a context menu item. - * @param menuItemId The ID of the context menu item to remove. - * @param callback Called when the context menu has been removed. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; - */ - export function remove(menuItemId: string, callback?: () => void): void; - /** - * Removes a context menu item. - * @param menuItemId The ID of the context menu item to remove. - * @param callback Called when the context menu has been removed. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; - */ - export function remove(menuItemId: number, callback?: () => void): void; + function removeAll(callback?: () => void): void; - /** - * Since Chrome 21. - * Fired when a context menu item is clicked. - */ - export var onClicked: MenuClickedEvent; + /** Fired when a context menu item is clicked. */ + const onClicked: MenuClickedEvent; } //////////////////// - // Document Scan + // DesktopCapture // //////////////////// /** - * Use the chrome.documentScan API to discover and retrieve images from attached paper document scanners. - * Availability: Since Chrome 44. - * Permissions: 'documentScan' - * Important: This API works only on Chrome OS. + * Desktop Capture API that can be used to capture content of screen, + * individual windows or tabs. + * @since Availability: Since Chrome 34. + * @requires Permissions: "desktopCapture" + */ + namespace desktopCapture { + const DesktopCaptureSourceType: { + SCREEN: "screen", + WINDOW: "window", + TAB: "tab", + AUDIO: "audio" + } + + /** + * Shows desktop media picker UI with the specified set of sources. + * @param sources Set of sources that should be shown to the user. + * @param callback The callback parameter should be a function that looks like this: + * function(string streamId) {...}; + * Parameter streamId: An opaque string that can be passed to getUserMedia() API to generate media stream that corresponds to the source selected by the user. If user didn't select any source (i.e. canceled the prompt) then the callback is called with an empty streamId. The created streamId can be used only once and expires after a few seconds when it is not used. + */ + function chooseDesktopMedia + (sources: Array, callback: (streamId: string) => void): number; + /** + * Hides desktop media picker dialog shown by chooseDesktopMedia(). + * @param desktopMediaRequestId Id returned by chooseDesktopMedia() + */ + function cancelChooseDesktopMedia(desktopMediaRequestId: number): void; + } + + /////////////////// + // Document Scan // + /////////////////// + /** + * Use the chrome.documentScan API to discover and retrieve + * images from attached paper document scanners. + * + * The Document Scan API is designed to allow apps to view + * the content of paper documents on an attached document scanner. + * + * *Note: This API depends on OS features that may not be available* + * *depending on the underlying operating system. As of this writing only* + * *Chrome OS for certain USB-attached devices is known to successfully work.* + * + * @since Availability: Since Chrome 44. + * @requires Permissions: 'documentScan' + * @requires Important: This API works only on Chrome OS. */ namespace documentScan { interface DocumentScanOptions { - /** Optional. The MIME types that are accepted by the caller. */ + /** The MIME types that are accepted by the caller. */ mimeTypes?: string[]; - /** Optional. The number of scanned images allowed (defaults to 1). */ + /** The number of scanned images allowed (defaults to 1). */ maxImages?: number; } @@ -1679,72 +2260,101 @@ declare namespace chrome { * Performs a document scan. On success, the PNG data will be sent to the callback. * @param options Object containing scan parameters. * @param callback Called with the result and data from the scan. - * The callback parameter should be a function that looks like this: - * function(object result) {...}; */ - export function scan(options: DocumentScanOptions, callback: (result: DocumentScanCallbackArg) => void): void; + function scan(options: DocumentScanOptions, callback: (result: DocumentScanCallbackArg) => void): void; } - //////////////////// - // Events - //////////////////// + //////////// + // Events // + //////////// /** - * The chrome.events namespace contains common types used by APIs dispatching events to notify you when something interesting happens. - * Availability: Since Chrome 21. + * The chrome.events namespace contains common types used by APIs + * dispatching events to notify you when something interesting happens. + * + * An Event is an object that allows you to be notified when something interesting happens. + * Here's an example of using the chrome.alarms.onAlarm event to be notified whenever an alarm has elapsed: + * @example + * chrome.alarms.onAlarm.addListener(function(alarm) { + * appendToLog('alarms.onAlarm --' + * + ' name: ' + alarm.name + * + ' scheduledTime: ' + alarm.scheduledTime); + * }); + * @description + * As the example shows, you register for notification using addListener(). + * The argument to addListener() is always a function that you define to + * handle the event, but the parameters to the function depend on which + * event you're handling. Checking the documentation for alarms.onAlarm, + * you can see that the function has a single parameter: an alarms.Alarm + * object that has details about the elapsed alarm. + * @since Availability: Since Chrome 25. */ namespace events { - /** Filters URLs for various criteria. See event filtering. All criteria are case sensitive. */ + /** Filters URLs for constious criteria. See event filtering. All criteria are case sensitive. */ interface UrlFilter { - /** Optional. Matches if the scheme of the URL is equal to any of the schemes specified in the array. */ - schemes?: string[]; /** - * Optional. - * Since Chrome 23. - * Matches if the URL (without fragment identifier) matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax. + * Matches if the host name of the URL contains a specified string. + * To test whether a host name component has a prefix 'foo', + * use hostContains: '.foo'. This matches 'www.foobar.com' and + * 'foo.com', because an implicit dot is added at the beginning of + * the host name. Similarly, hostContains can be used to match + * against component suffix ('foo.') and to exactly match against + * components ('.foo.'). Suffix- and exact-matching for the last + * components need to be done separately using hostSuffix, because + * no implicit dot is added at the end of the host name. + **/ + hostContains?: string; + /** Matches if the host name of the URL is equal to a specified string. */ + hostEquals?: string; + /** Matches if the host name of the URL starts with a specified string. */ + hostPrefix?: string; + /** Matches if the host name of the URL ends with a specified string. */ + hostSuffix?: string; + /** Matches if the path segment of the URL contains a specified string. */ + pathContains?: string; + /** Matches if the path segment of the URL starts with a specified string. */ + pathEquals?: string; + /** Matches if the path segment of the URL ends with a specified string. */ + pathPrefix?: string; + /** Matches if the path segment of the URL is equal to a specified string. */ + pathSuffix?: string; + /** Matches if the query segment of the URL contains a specified string. */ + queryContains?: string; + /** Matches if the query segment of the URL is equal to a specified string. */ + queryEquals?: string; + /** Matches if the query segment of the URL starts with a specified string. */ + queryPrefix?: string; + /** Matches if the query segment of the URL ends with a specified string. */ + querySuffix?: string; + /** Matches if the URL (without fragment identifier) contains a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlContains?: string; + /** Matches if the URL (without fragment identifier) is equal to a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlEquals?: string; + /** Matches if the URL (without fragment identifier) matches a specified regular expression. + * Port numbers are stripped from the URL if they match the default port number. + * The regular expressions use the RE2 syntax. + * @see[RE2 syntax docs]{@link https://github.com/google/re2/blob/master/doc/syntax.txt} */ urlMatches?: string; - /** Optional. Matches if the path segment of the URL contains a specified string. */ - pathContains?: string; - /** Optional. Matches if the host name of the URL ends with a specified string. */ - hostSuffix?: string; - /** Optional. Matches if the host name of the URL starts with a specified string. */ - hostPrefix?: string; - /** Optional. Matches if the host name of the URL contains a specified string. To test whether a host name component has a prefix 'foo', use hostContains: '.foo'. This matches 'www.foobar.com' and 'foo.com', because an implicit dot is added at the beginning of the host name. Similarly, hostContains can be used to match against component suffix ('foo.') and to exactly match against components ('.foo.'). Suffix- and exact-matching for the last components need to be done separately using hostSuffix, because no implicit dot is added at the end of the host name. */ - hostContains?: string; - /** Optional. Matches if the URL (without fragment identifier) contains a specified string. Port numbers are stripped from the URL if they match the default port number. */ - urlContains?: string; - /** Optional. Matches if the query segment of the URL ends with a specified string. */ - querySuffix?: string; - /** Optional. Matches if the URL (without fragment identifier) starts with a specified string. Port numbers are stripped from the URL if they match the default port number. */ - urlPrefix?: string; - /** Optional. Matches if the host name of the URL is equal to a specified string. */ - hostEquals?: string; - /** Optional. Matches if the URL (without fragment identifier) is equal to a specified string. Port numbers are stripped from the URL if they match the default port number. */ - urlEquals?: string; - /** Optional. Matches if the query segment of the URL contains a specified string. */ - queryContains?: string; - /** Optional. Matches if the path segment of the URL starts with a specified string. */ - pathPrefix?: string; - /** Optional. Matches if the path segment of the URL is equal to a specified string. */ - pathEquals?: string; - /** Optional. Matches if the path segment of the URL ends with a specified string. */ - pathSuffix?: string; - /** Optional. Matches if the query segment of the URL is equal to a specified string. */ - queryEquals?: string; - /** Optional. Matches if the query segment of the URL starts with a specified string. */ - queryPrefix?: string; - /** Optional. Matches if the URL (without fragment identifier) ends with a specified string. Port numbers are stripped from the URL if they match the default port number. */ - urlSuffix?: string; - /** Optional. Matches if the port of the URL is contained in any of the specified port lists. For example [80, 443, [1000, 1200]] matches all requests on port 80, 443 and in the range 1000-1200. */ - ports?: any[]; /** - * Optional. - * Since Chrome 28. - * Matches if the URL without query segment and fragment identifier matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax. + * Matches if the URL without query segment and fragment identifier matches a specified regular expression. + * Port numbers are stripped from the URL if they match the default port number. + * The regular expressions use the RE2 syntax. + * @see[RE2 syntax docs]{@link https://github.com/google/re2/blob/master/doc/syntax.txt} + * @since Since Chrome 28. */ originAndPathMatches?: string; + /** Matches if the URL (without fragment identifier) starts with a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlPrefix?: string; + /** Matches if the URL (without fragment identifier) ends with a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlSuffix?: string; + /** Matches if the scheme of the URL is equal to any of the schemes specified in the array. */ + schemes?: string[]; + /** + * Matches if the port of the URL is contained in any of the specified port lists. + * For example [80, 443, [1000, 1200]] matches all requests on port 80, 443 and in the range 1000-1200. + */ + ports?: Array; } - /** An object which allows the addition and removal of listeners for a Chrome event. */ interface Event { /** @@ -1772,9 +2382,11 @@ declare namespace chrome { */ getRules(ruleIdentifiers: string[], callback: (rules: Rule[]) => void): void; /** - * @param callback Listener whose registration status shall be tested. + * Has this event this provided listener? + * @param listener Listener whose registration status shall be tested. + * @return If it has the provided listener */ - hasListener(callback: T): boolean; + hasListener(callback: T | Function): boolean; /** * Unregisters currently registered rules. * @param ruleIdentifiers If an array is passed, only rules with identifiers contained in this array are unregistered. @@ -1786,151 +2398,183 @@ declare namespace chrome { /** * Unregisters currently registered rules. * @param callback Called when rules were unregistered. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; */ removeRules(callback?: () => void): void; /** * Registers rules to handle events. * @param rules Rules to be registered. These do not replace previously registered rules. * @param callback Called with registered rules. - * If you specify the callback parameter, it should be a function that looks like this: - * function(array of Rule rules) {...}; * Parameter rules: Rules that were registered, the optional parameters are filled with values. */ addRules(rules: Rule[], callback?: (rules: Rule[]) => void): void; /** * Deregisters an event listener callback from an event. * @param callback Listener that shall be unregistered. - * The callback parameter should be a function that looks like this: - * function() {...}; */ removeListener(callback: T): void; + /** + * Has this event listeners? + */ hasListeners(): boolean; } /** Description of a declarative rule for handling events. */ interface Rule { - /** Optional. Optional priority of this rule. Defaults to 100. */ - priority?: number; - /** List of conditions that can trigger the actions. */ - conditions: any[]; - /** Optional. Optional identifier that allows referencing this rule. */ + /** Identifier that allows referencing this rule. */ id?: string; - /** List of actions that are triggered if one of the condtions is fulfilled. */ - actions: any[]; + /** - * Optional. - * Since Chrome 28. * Tags can be used to annotate rules and perform operations on sets of rules. + * @since Since Chrome 28. */ tags?: string[]; + + /** List of conditions that can trigger the actions. */ + conditions: any[]; + + /** List of actions that are triggered if one of the condtions is fulfilled. */ + actions: any[]; + + /** + * Optional priority of this rule. + * @default 100 + */ + priority?: integer; } } - //////////////////// - // Extension Types - //////////////////// + ///////////////////// + // Extension Types // + ///////////////////// /** * Primary for extensions, but also used in apps. * https://developer.chrome.com/extensions/extensionTypes#type-ImageDetails + * @since Chrome 39. **/ namespace extensionTypes { /** * The format of an image. **/ - export type ImageFormat = 'jpeg' | 'png'; + type ImageFormat = + 'jpeg' | + 'png'; /** * Details about the format and quality of an image. */ interface ImageDetails { - /** - * @description The format of the resulting image. Default is 'jpeg'. - * @type {ImageFormat} - * @memberof ImageDetails - */ + /** The format of the resulting image. Default is 'jpeg'. */ format?: ImageFormat; + /** - * @description When format is 'jpeg', controls the quality of the resulting image. This value is ignored for PNG images. As quality is decreased, the resulting image will have more visual artifacts, and the number of bytes needed to store it will decrease. - * @type {number} - * @memberof ImageDetails + * When format is 'jpeg', controls the quality of the resulting image. + * This value is ignored for PNG images. As quality is decreased, + * the resulting image will have more visual artifacts, + * and the number of bytes needed to store it will decrease. */ quality?: number; } /** * The soonest that the JavaScript or CSS will be injected into the tab. **/ - export type RunAt = 'document_start' | 'document_end' | 'document_idle'; + type RunAt = + 'document_start' | + 'document_end' | + 'document_idle'; /** * The origin of injected CSS. **/ - export type CSSOrigin = 'author' | 'user'; + type CSSOrigin = + 'author' | + 'user'; /** - * @description Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time. - * @interface InjectDetails + * Internal interfaces, not to be used directly + * @private + * @internal */ - interface InjectDetails { + namespace _internal_ { + /** + * Partial, use these interfaces instead: + * @see InjectCodeDetails + * @see InjectFileDetails + */ + interface InjectDetailsBase { + /** + * If allFrames is true, implies that the JavaScript or CSS should be + * injected into all frames of current page. By default, it's false + * and is only injected into the top frame. If true and frameId is set, + * then the code is inserted in the selected frame and all of its child frames. + */ + allFrames?: boolean; + /** + * The frame where the script or CSS should be injected. Defaults to 0 (the top-level frame). + * @see[frame ref]{@link https://developer.chrome.com/apps/webNavigation#frame_ids} + * @since Since Chrome 50. + */ + frameId?: number; + /** + * If matchAboutBlank is true, then the code is also injected in about:blank + * and about:srcdoc frames if your extension has access to its parent document. + * Code cannot be inserted in top-level about:-frames. By default it is false. + */ + matchAboutBlank?: boolean; + /** + * The soonest that the JavaScript or CSS will be injected into the tab. + * @default 'document_idle' + */ + runAt: RunAt; + /** + * The origin of the CSS to inject. + * This may only be specified for CSS, not JavaScript. + * @default 'author' + * @since Since Chrome 66. + */ + cssOrigin: CSSOrigin; + } + } + + interface InjectFileDetails extends _internal_.InjectDetailsBase { + /** JavaScript or CSS file to inject. */ + file: string; + } + + interface InjectCodeDetails extends _internal_.InjectDetailsBase { /** * JavaScript or CSS code to inject. - * Warning: - * Be careful using the code parameter. Incorrect use of it may open your extension to cross site scripting attacks. - * @type {string} - * @memberof InjectDetails + * **Warning** + * Be careful using the code parameter. + * Incorrect use of it may open your app + * to cross site scripting attacks. + * @see[More information]{https://en.wikipedia.org/wiki/Cross-site_scripting} */ - code?: string; - /** - * @description JavaScript or CSS file to inject. - * @type {string} - * @memberof InjectDetails - */ - file?: string; - /** - * @description If allFrames is true, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's false and is only injected into the top frame. If true and frameId is set, then the code is inserted in the selected frame and all of its child frames. - * @type {boolean} - * @memberof InjectDetails - */ - allFrames?: boolean; - /** - * @description The frame where the script or CSS should be injected. Defaults to 0 (the top-level frame). - * @since Since Chrome 50. - * @type {number} - * @memberof InjectDetails - */ - frameId?: number; - /** - * @description If matchAboutBlank is true, then the code is also injected in about:blank and about:srcdoc frames if your extension has access to its parent document. Code cannot be inserted in top-level about:-frames. By default it is false. - * @type {boolean} - * @memberof InjectDetails - */ - matchAboutBlank?: boolean; - /** - * @description The soonest that the JavaScript or CSS will be injected into the tab. Defaults to 'document_idle'. - * @type {RunAt} - * @memberof InjectDetails - */ - runAt: RunAt; - /** - * @description The origin of the CSS to inject. This may only be specified for CSS, not JavaScript. Defaults to 'author'. - * @since Since Chrome 66. - * @type {CSSOrigin} - * @memberof InjectDetails - */ - cssOrigin: CSSOrigin; + code: string; } } - //////////////////// - // FileSystem - //////////////////// + //////////////// + // FileSystem // + //////////////// /** * Use the chrome.fileSystem API to create, read, navigate, and write to the user's local file system. * With this API, Chrome Apps can read and write to a user-selected location. * For example, a text editor app can use the API to read and write local documents. * All failures are notified via chrome.runtime.lastError. + * @since Availability: Since Chrome 24. + * @requires Permissions: + * 'fileSystem' + * {'fileSystem': ['write']} + * {'fileSystem': ['write', 'retainEntries', 'directory']} */ namespace fileSystem { - + type ChildChangeType = + 'created' | + 'removed' | + 'changed'; + type ChooseEntryOptionsTypes = + 'openFile' | + 'openWritableFile' | + 'saveFile' | + 'openDirectory'; interface AcceptOptions { /** * This is the optional text description for this option. @@ -1943,7 +2587,7 @@ declare namespace chrome { */ mimeTypes?: string[]; /** - * Extensions to accept, e.g. 'jpg' | 'gif' | 'crx'. + * Extensions to accept, e.g. 'jpg', 'gif', 'crx'. */ extensions?: string[]; } @@ -1952,16 +2596,26 @@ declare namespace chrome { /** * Type of the prompt to show. The default is 'openFile'. * openFile - * - Prompts the user to open an existing file and returns a FileEntry on success. From Chrome 31 onwards, the FileEntry will be writable if the application has the 'write' permission under 'fileSystem'; otherwise, the FileEntry will be read-only. + * - Prompts the user to open an existing file and returns a FileEntry on success. + * From Chrome 31 onwards, the FileEntry will be writable if the application has + * the 'write' permission under 'fileSystem'; otherwise, the FileEntry will be read-only. * openWritableFile - * - Prompts the user to open an existing file and returns a writable FileEntry on success. Calls using this type will fail with a runtime error if the application doesn't have the 'write' permission under 'fileSystem'. + * - Prompts the user to open an existing file and returns a writable FileEntry on success. + * Calls using this type will fail with a runtime error if the application doesn't have the + * 'write' permission under 'fileSystem'. * saveFile - * - Prompts the user to open an existing file or a new file and returns a writable FileEntry on success. Calls using this type will fail with a runtime error if the application doesn't have the 'write' permission under 'fileSystem'. + * - Prompts the user to open an existing file or a new file and returns a writable FileEntry + * on success. Calls using this type will fail with a runtime error if the application doesn't + * have the 'write' permission under 'fileSystem'. * openDirectory - * - Prompts the user to open a directory and returns a DirectoryEntry on success. Calls using this type will fail with a runtime error if the application doesn't have the 'directory' permission under 'fileSystem'. If the application has the 'write' permission under 'fileSystem', the returned DirectoryEntry will be writable; otherwise it will be read-only. New in Chrome 31. + * - Prompts the user to open a directory and returns a DirectoryEntry on success. Calls using + * this type will fail with a runtime error if the application doesn't have the 'directory' + * permission under 'fileSystem'. If the application has the 'write' permission under + * 'fileSystem', the returned DirectoryEntry will be writable; otherwise it will be read-only. + * New in Chrome 31. */ - type?: 'openFile' | 'openWritableFile' | 'saveFile' | 'openDirectory'; - /** The suggested file name that will be presented to the user as the default name to read or write. This is optional. */ + type?: ChooseEntryOptionsTypes; + /** The suggested file name that will be presented to the user as the default name to read or write. */ suggestedName?: string; /** The optional list of accept options for this file opener. Each option will be presented as a unique group to the end-user. */ accepts?: AcceptOptions[]; @@ -1972,17 +2626,23 @@ declare namespace chrome { acceptsAllTypes?: boolean; /** * Whether to accept multiple files. This is only supported for openFile and openWritableFile. - * The callback to chooseEntry will be called with a list of entries if this is set to true. Otherwise it will be called with a single Entry. + * The callback to chooseEntry will be called with a list of entries if this is set to true. + * Otherwise it will be called with a single Entry. + * @since Chrome 30. */ acceptsMultiple?: boolean; } - type ChildChangeType = 'created' | 'removed' | 'changed'; - + /** + * @since Chrome 44. + */ interface Volume { /** The ID of the requested volume. */ volumeId: string; - /** Whether the requested file system should be writable. The default is read-only. */ + /** + * Whether the requested file system should be writable. The default is read-only. + * @default false + **/ writable?: boolean; } @@ -1990,33 +2650,37 @@ declare namespace chrome { * Get the display path of an Entry object. * The display path is based on the full path of the file or directory on the local file system, but may be made more readable for display purposes. */ - export function getDisplayPath(entry: Entry, callback: (displayPath: string) => void): void; + function getDisplayPath(entry: Entry, callback: (displayPath: string) => void): void; /** * Get a writable Entry from another Entry. This call will fail with a runtime error if the application does not have the 'write' permission under 'fileSystem'. * If entry is a DirectoryEntry, this call will fail if the application does not have the 'directory' permission under 'fileSystem'. */ - export function getWritableEntry(entry: Entry, callback: (entry: Entry) => void): void; + function getWritableEntry(entry: Entry, callback: (entry: Entry) => void): void; /** Gets whether this Entry is writable or not. */ - export function isWritableEntry(entry: Entry, callback: (isWritable: boolean) => void): void; + function isWritableEntry(entry: Entry, callback: (isWritable: boolean) => void): void; /** Ask the user to choose a file or directory. */ - export function chooseEntry(callback: (entry: Entry) => void): void; + function chooseEntry(callback: (entry: Entry) => void): void; /** Ask the user to choose a file or directory. */ - export function chooseEntry(callback: (fileEntries: FileEntry[]) => void): void; + function chooseEntry(callback: (fileEntries: FileEntry[]) => void): void; /** Ask the user to choose a file or directory. */ - export function chooseEntry(options: ChooseEntryOptions, callback: (entry: Entry) => void): void; + function chooseEntry(options: ChooseEntryOptions, callback: (entry: Entry) => void): void; /** Ask the user to choose a file or directory. */ - export function chooseEntry(options: ChooseEntryOptions, callback: (fileEntries: FileEntry[]) => void): void; + function chooseEntry(options: ChooseEntryOptions, callback: (fileEntries: FileEntry[]) => void): void; /** Returns the file entry with the given id if it can be restored. This call will fail with a runtime error otherwise. */ - export function restoreEntry(id: string, callback: (entry: Entry) => void): void; - /** Returns whether the app has permission to restore the entry with the given id. */ - export function isRestorable(id: string, callback: (isRestorable: boolean) => void): void; + function restoreEntry(id: string, callback: (entry: Entry) => void): void; + /** + * Returns whether the app has permission to restore the entry with the given id. + * @since Chrome 29. + **/ + function isRestorable(id: string, callback: (isRestorable: boolean) => void): void; /** * Returns an id that can be passed to restoreEntry to regain access to a given file entry. * Only the 500 most recently used entries are retained, where calls to retainEntry and restoreEntry count as use. * If the app has the 'retainEntries' permission under 'fileSystem', entries are retained indefinitely. * Otherwise, entries are retained only while the app is running and across restarts. + * @since Chrome 29. * */ - export function retainEntry(entry: Entry): string; + function retainEntry(entry: Entry): string; /** * Requests access to a file system for a volume represented by options.volumeId. * If options.writable is set to true, then the file system will be writable. @@ -2025,16 +2689,22 @@ declare namespace chrome { * Available to kiosk apps running in kiosk session only. * For manual-launch kiosk mode, a confirmation dialog will be shown on top of the active app window. * In case of an error, fileSystem will be undefined, and chrome.runtime.lastError will be set. + * @since Chrome 44. */ - export function requestFileSystem(options: Volume, callback: (fileSystem: FileSystem) => void): void; + function requestFileSystem(options: Volume, callback: (fileSystem: FileSystem) => void): void; /** * Returns a list of volumes available for requestFileSystem(). * The 'fileSystem': {'requestFileSystem'} manifest permission is required. * Available to kiosk apps running in the kiosk session only. * In case of an error, volumes will be undefined, and chrome.runtime.lastError will be set. + * @since Chrome 44. */ - export function getVolumeList(callback: (volumes: Volume[]) => void): void; - export var onVolumeListChanged: chrome.events.Event<(object: Volume[]) => void>; + function getVolumeList(callback: (volumes: Volume[]) => void): void; + /** + * Called when a list of available volumes is changed. + * @since Chrome 44. + */ + const onVolumeListChanged: chrome.events.Event<(object: Volume[]) => void>; } @@ -2042,76 +2712,161 @@ declare namespace chrome { // File System Provider //////////////////// /** - * Use the chrome.fileSystemProvider API to create file systems, that can be accessible from the file manager on Chrome OS. - * Availability: Since Chrome 40. - * Permissions: 'fileSystemProvider' - * Important: This API works only on Chrome OS. + * Use the chrome.fileSystemProvider API to create file systems, + * that can be accessible from the file manager on Chrome OS. + * @since Availability: Since Chrome 40. + * @requires Permissions: 'fileSystemProvider' + * @requires Important: This API works only on Chrome OS. + * @requires Manifest: + * Requires an section in addition to the permission. + * The file_system_provider section must be declared as follows: + * **configurable (boolean)** - optional + * Whether configuring via onConfigureRequested is supported. By default: false. + * **multiple_mounts (boolean)** - optional + * Whether multiple (more than one) mounted file systems are supported. By default: false. + * **watchable (boolean)** - optional + * Whether setting watchers and notifying about changes is supported. By default: false. + * **source (type of 'file', 'device', or 'network') - required** + * Source of data for mounted file systems. + * @description + * Files app uses above information in order to render related UI elements approprietly. + * For example, if configurable is set to true, then a menu item for configuring volumes + * will be rendered. Similarly, if multiple_mounts is set to true, then Files app will + * allow to add more than one mount points from the UI. If watchable is false, then a + * refresh button will be rendered. Note, that if possible you should add support for + * watchers, so changes on the file system can be reflected immediately and automatically. + * @see[More information]{@link https://developer.chrome.com/apps/fileSystemProvider} */ namespace fileSystemProvider { - interface OpenedFileInfo { - /** A request ID to be be used by consecutive read/write and close requests. */ - openRequestId: number; - /** The path of the opened file. */ - filePath: string; - /** Whether the file was opened for reading or writing. */ - mode: string; - } - - interface FileWatchersInfo { - /** The path of the entry being observed. */ - entryPath: string; - /** Whether watching should include all child entries recursively. It can be true for directories only. */ - recursive: boolean; - /** Optional. Tag used by the last notification for the watcher. */ - lastTag?: string; - } + /** + * Error codes used by providing extensions in response to requests + * as well as in case of errors when calling methods of the API. + * For success, 'OK' must be used. + * */ + type ProviderError = + 'OK' | + 'FAILED' | + 'IN_USE' | + 'EXISTS' | + 'NOT_FOUND' | + 'ACCESS_DENIED' | + 'TOO_MANY_OPENED' | + 'NO_MEMORY' | + 'NO_SPACE' | + 'NOT_A_DIRECTORY' | + 'INVALID_OPERATION' | + 'SECURITY' | + 'ABORT' | + 'NOT_A_FILE' | + 'NOT_EMPTY' | + 'INVALID_URL' | + 'IO'; + /** Mode of opening a file. Used by onOpenFileRequested. */ + type OpenFileMode = + 'READ' | + 'WRITE'; + /** Type of a change detected on the observed directory. */ + type ChangeType = + 'CHANGED' | + 'DELETED'; + /** + * List of common actions. 'SHARE' is for sharing files with others. + * 'SAVE_FOR_OFFLINE' for pinning (saving for offline access). + * 'OFFLINE_NOT_NECESSARY' for notifying that the file doesn't + * need to be stored for offline access anymore. + * Used by onGetActionsRequested and onExecuteActionRequested. + */ + type CommonActionId = + 'SAVE_FOR_OFFLINE' | + 'OFFLINE_NOT_NECESSARY' | + 'SHARE'; interface EntryMetadata { - /** True if it is a directory. */ - isDirectory: boolean; - /** Name of this entry (not full path name). Must not contain '/'. For root it must be empty. */ - name: string; - /** File size in bytes. */ - size: number; + /** True if it is a directory. Must be provided if requested in options */ + isDirectory?: boolean; + /** + * Name of this entry (not full path name). + * Must not contain '/'. + * For root it must be empty. + * Must be provided if requested in options. + **/ + name?: string; + /** File size in bytes. Must be provided if requested in options. */ + size?: double; /** The last modified time of this entry. */ - modificationTime: any; - /** Optional. Mime type for the entry. */ + modificationTime?: Date; + /** Mime type for the entry. */ mimeType?: string; - /** Optional. Thumbnail image as a data URI in either PNG, JPEG or WEBP format, at most 32 KB in size. Optional, but can be provided only when explicitly requested by the onGetMetadataRequested event. */ + /** + * Thumbnail image as a data URI in either PNG, JPEG or WEBP format, at most 32 KB in size. + * Optional, but can be provided only when explicitly requested + * by the onGetMetadataRequested event. + */ thumbnail?: string; } interface FileSystemInfo { /** The identifier of the file system. */ fileSystemId: string; + /** A human-readable name for the file system. */ displayName: string; - /** Whether the file system supports operations which may change contents of the file system (such as creating, deleting or writing to files). */ + + /** + * Whether the file system supports operations which may + * change contents of the file system (such as creating, deleting or writing to files). + */ writable: boolean; + /** * The maximum number of files that can be opened at once. If 0, then not limited. * @since Since Chrome 42. */ - openedFilesLimit: number; + openedFilesLimit: integer; + /** * List of currently opened files. * @since Since Chrome 42. */ openedFiles: OpenedFileInfo[]; + /** - * Optional. - * Whether the file system supports the tag field for observing directories. - * @since Since Chrome 45. Warning: this is the current Beta channel. + * Whether the file system supports the tag field for observing directories. + * @since Since Chrome 45. */ supportsNotifyTag?: boolean; + /** * List of watchers. - * @since Since Chrome 45. Warning: this is the current Beta channel. + * @since Since Chrome 45. */ watchers: FileWatchersInfo[]; } - /** @since Since Chrome 45. Warning: this is the current Beta channel. */ + interface OpenedFileInfo { + /** A request ID to be be used by consecutive read/write and close requests. */ + openRequestId: integer; + /** The path of the opened file. */ + filePath: string; + /** Whether the file was opened for reading or writing. */ + mode: OpenFileMode; + } + + interface FileWatchersInfo { + /** The path of the entry being observed. */ + entryPath: string; + + /** + * Whether watching should include all child entries recursively. + * It can be true for directories only. + */ + recursive: boolean; + + /** Tag used by the last notification for the watcher. */ + lastTag?: string; + } + + /** @since Since Chrome 45. */ interface GetActionsRequestedOptions { /** The identifier of the file system related to this operation. */ fileSystemId: string; @@ -2121,15 +2876,14 @@ declare namespace chrome { entryPath: string; } - /** @since Since Chrome 45. Warning: this is the current Beta channel. */ interface Action { /** The identifier of the action. Any string or CommonActionId for common actions. */ - id: string; - /** Optional. The title of the action. It may be ignored for common actions. */ + id: CommonActionId | string; + /** The title of the action. It may be ignored for common actions. */ title?: string; } - /** @since Since Chrome 45. Warning: this is the current Beta channel. */ + /** @since Since Chrome 45. */ interface ExecuteActionRequestedOptions { /** The identifier of the file system related to this operation. */ fileSystemId: string; @@ -2146,20 +2900,27 @@ declare namespace chrome { fileSystemId: string; /** A human-readable name for the file system. */ displayName: string; - /** Optional. Whether the file system supports operations which may change contents of the file system (such as creating, deleting or writing to files). */ + /** + * Whether the file system supports operations which may change contents + * of the file system (such as creating, deleting or writing to files). + */ writable?: boolean; /** - * Optional. - * The maximum number of files that can be opened at once. If not specified, or 0, then not limited. + * The maximum number of files that can be opened at once. If not specified, or 0, then not limited. * @since Since Chrome 41. */ - openedFilesLimit?: number; + openedFilesLimit?: integer; /** - * Optional. - * Whether the file system supports the tag field for observed directories. - * @since Since Chrome 45. Warning: this is the current Beta channel. + * Whether the file system supports the tag field for observed directories. + * @since Since Chrome 45. */ supportsNotifyTag?: boolean; + /** + * Whether the framework should resume the file system at the next sign-in session. + * @default true + * @since Since Chrome 64. + */ + persistent?: boolean; } interface UnmountOptions { @@ -2171,7 +2932,7 @@ declare namespace chrome { /** The path of the changed entry. */ entryPath: string; /** The type of the change which happened to the entry. */ - changeType: string; + changeType: ChangeType; } interface NotificationOptions { @@ -2181,241 +2942,543 @@ declare namespace chrome { observedPath: string; /** Mode of the observed entry. */ recursive: boolean; - /** The type of the change which happened to the observed entry. If it is DELETED, then the observed entry will be automatically removed from the list of observed entries. */ - changeType: string; - /** Optional. List of changes to entries within the observed directory (including the entry itself) */ + /** + * The type of the change which happened to the observed entry. + * If it is DELETED, then the observed entry will be automatically + * removed from the list of observed entries. + */ + changeType: ChangeType; + /** List of changes to entries within the observed directory (including the entry itself) */ changes?: NotificationChange[]; - /** Optional. Tag for the notification. Required if the file system was mounted with the supportsNotifyTag option. Note, that this flag is necessary to provide notifications about changes which changed even when the system was shutdown. */ + /** + * Tag for the notification. + * Required if the file system was mounted with the supportsNotifyTag option. + * Note, that this flag is necessary to provide notifications about changes + * which changed even when the system was shutdown. + */ tag?: string; } + /** + * Internal interfaces, not for use + * @private + * @internal + */ + namespace _internal_ { + /** + * @private + * @internal + */ + interface RequestedEventOptions { + /** The identifier of the file system related to this operation. */ + fileSystemId: string; + /** The unique identifier of this request. */ + requestId: integer; + } - interface RequestedEventOptions { - /** The identifier of the file system related to this operation. */ - fileSystemId: string; - /** The unique identifier of this request. */ - requestId: number; + /** + * @private + * @internal + */ + interface EntryPathRequestedEventOptions extends RequestedEventOptions { + /** The path of the entry to which this operation is related to. */ + entryPath: string; + } + + /** + * @private + * @internal + */ + interface FilePathRequestedEventOptions extends RequestedEventOptions { + /** The path of the entry for the operation */ + filePath: string; + } } - - interface EntryPathRequestedEventOptions extends RequestedEventOptions { - /** The path of the entry to which this operation is related to. */ - entryPath: string; + interface UnmountRequestedEventOptions extends _internal_.RequestedEventOptions { } - - interface MetadataRequestedEventOptions extends EntryPathRequestedEventOptions { - /** Set to true if the thumbnail is requested. */ + interface MetadataRequestedEventOptions extends _internal_.EntryPathRequestedEventOptions { + /** + * Set to true if is_directory value is requested + * @since Chrome 49. + */ + isDirectory: boolean; + /** + * Set to true if is_directory value is requested. + * @since Chrome 49. + */ + name: boolean; + /** + * Set to true if size value is requested. + * @since Chrome 49. + */ + size: boolean; + /** + * Set to true if modificationTime value is requested + * @since Chrome 49. + */ + modificationTime: boolean; + /** + * Set to true if mimeType value is requested. + * @since Chrome 49. + */ + mimeType: boolean; + /** + * Set to true if the thumbnail is requested. + */ thumbnail: boolean; } - - interface DirectoryPathRequestedEventOptions extends RequestedEventOptions { + interface GetActionsRequestedEventOptions extends _internal_.RequestedEventOptions { + /** The path of the entry to which this operation is related to. */ + entryPaths: string[]; + } + interface ReadDirectoryRequestedEventOptions extends _internal_.RequestedEventOptions { /** The path of the directory which is to be operated on. */ directoryPath: string; + /** + * Set to true if is_directory value is requested + * @since Chrome 49. + */ + isDirectory: boolean; + /** + * Set to true if is_directory value is requested. + * @since Chrome 49. + */ + name: boolean; + /** + * Set to true if size value is requested. + * @since Chrome 49. + */ + size: boolean; + /** + * Set to true if modificationTime value is requested + * @since Chrome 49. + */ + modificationTime: boolean; + /** + * Set to true if mimeType value is requested. + * @since Chrome 49. + */ + mimeType: boolean; + /** + * Set to true if the thumbnail is requested. + */ + thumbnail: boolean; } - - interface FilePathRequestedEventOptions extends RequestedEventOptions { - /** The path of the entry for the operation */ - filePath: string; - } - - interface OpenFileRequestedEventOptions extends FilePathRequestedEventOptions { + interface OpenFileRequestedEventOptions extends _internal_.FilePathRequestedEventOptions { /** Whether the file will be used for reading or writing. */ - mode: string; + mode: OpenFileMode; } - - interface OpenedFileRequestedEventOptions extends RequestedEventOptions { + interface CloseFileRequestedEventOptions extends _internal_.RequestedEventOptions { /** A request ID used to open the file. */ - openRequestId: number; + openRequestId: integer; } - - interface OpenedFileOffsetRequestedEventOptions extends OpenedFileRequestedEventOptions { + interface ReadFileRequestedEventOptions extends _internal_.RequestedEventOptions { + /** A request ID used to open the file. */ + openRequestId: integer; /** Position in the file (in bytes) to start reading from. */ - offset: number; + offset: double; /** Number of bytes to be returned. */ - length: number; + length: double; } - - interface DirectoryPathRecursiveRequestedEventOptions extends DirectoryPathRequestedEventOptions { + interface CreateDirectoryRequestedEventOptions extends _internal_.RequestedEventOptions { + /** The path of the directory which is to be operated on. */ + directoryPath: string; /** Whether the operation is recursive (for directories only). */ recursive: boolean; } - - interface EntryPathRecursiveRequestedEventOptions extends EntryPathRequestedEventOptions { + interface DeleteEntryRequestedEventOptions extends _internal_.EntryPathRequestedEventOptions { /** Whether the operation is recursive (for directories only). */ recursive: boolean; } - - interface SourceTargetPathRequestedEventOptions extends RequestedEventOptions { + interface CreateFileRequestedEventOptions extends _internal_.FilePathRequestedEventOptions { + } + interface CopyEntryRequestedEventOptions extends _internal_.RequestedEventOptions { /** The source path for the operation. */ sourcePath: string; /** The destination path for the operation. */ targetPath: string; } - - interface FilePathLengthRequestedEventOptions extends FilePathRequestedEventOptions { - /** Number of bytes to be retained after the operation completes. */ - length: number; + interface MoveEntryRequestedEventOptions extends CopyEntryRequestedEventOptions { } - - interface OpenedFileIoRequestedEventOptions extends OpenedFileRequestedEventOptions { + interface TruncateRequestedEventOptions extends _internal_.FilePathRequestedEventOptions { + /** Number of bytes to be retained after the operation completes. */ + length: double; + } + interface WriteFileRequestedEventOptions extends _internal_.RequestedEventOptions { + /** A request ID used to open the file. */ + openRequestId: integer; /** Position in the file (in bytes) to start operating from. */ offset: number; /** Buffer of bytes to be operated on the file. */ data: ArrayBuffer; } - - interface OperationRequestedEventOptions extends RequestedEventOptions { + interface AbortRequestedEventOptions extends _internal_.RequestedEventOptions { /** An ID of the request to which this operation is related. */ - operationRequestId: number; + operationRequestId: integer; + } + interface ConfigureRequestedEventOptions extends _internal_.RequestedEventOptions { + } + interface WatcherRequestedEventOptions extends _internal_.EntryPathRequestedEventOptions { + /** + * Mode of the watcher. + * Whether observing should include all child entries recursively. + * It can be true for directories only. + */ + recursive: boolean; + } + interface ExecuteActionRequestedEventOptions extends GetActionsRequestedEventOptions { + /** The identifier of the action to be executed. */ + actionId: string; } - interface RequestedEvent extends chrome.events.Event<(options: RequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - interface MetadataRequestedEvent extends chrome.events.Event<(options: MetadataRequestedEventOptions, successCallback: (metadata: EntryMetadata) => void, errorCallback: (error: string) => void) => void> { } - - interface DirectoryPathRequestedEvent extends chrome.events.Event<(options: DirectoryPathRequestedEventOptions, successCallback: (entries: EntryMetadata[], hasMore: boolean) => void, errorCallback: (error: string) => void) => void> { } - - interface OpenFileRequestedEvent extends chrome.events.Event<(options: OpenFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - - interface OpenedFileRequestedEvent extends chrome.events.Event<(options: OpenedFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - - interface OpenedFileOffsetRequestedEvent extends chrome.events.Event<(options: OpenedFileOffsetRequestedEventOptions, successCallback: (data: ArrayBuffer, hasMore: boolean) => void, errorCallback: (error: string) => void) => void> { } - - interface DirectoryPathRecursiveRequestedEvent extends chrome.events.Event<(options: DirectoryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - - interface EntryPathRecursiveRequestedEvent extends chrome.events.Event<(options: EntryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - - interface FilePathRequestedEvent extends chrome.events.Event<(options: FilePathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - - interface SourceTargetPathRequestedEvent extends chrome.events.Event<(options: SourceTargetPathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - - interface FilePathLengthRequestedEvent extends chrome.events.Event<(options: FilePathLengthRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - - interface OpenedFileIoRequestedEvent extends chrome.events.Event<(options: OpenedFileIoRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - - interface OperationRequestedEvent extends chrome.events.Event<(options: OperationRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - - interface OptionlessRequestedEvent extends chrome.events.Event<(successCallback: Function, errorCallback: (error: string) => void) => void> { } + ///\/\/|\/\/\\\ + /// METHODS \\\ + ///\/\/|\/\/\\\ /** - * Mounts a file system with the given fileSystemId and displayName. displayName will be shown in the left panel of Files.app. displayName can contain any characters including '/', but cannot be an empty string. displayName must be descriptive but doesn't have to be unique. The fileSystemId must not be an empty string. + * Mounts a file system with the given fileSystemId and displayName. + * displayName will be shown in the left panel of the Files app. + * displayName can contain any characters including '/', but cannot be an empty string. + * displayName must be descriptive but doesn't have to be unique. + * The fileSystemId must not be an empty string. + * * Depending on the type of the file system being mounted, the source option must be set appropriately. + * * In case of an error, runtime.lastError will be set with a corresponding error code. + * * @param callback A generic result callback to indicate success or failure. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; */ - export function mount(options: MountOptions, callback?: () => void): void; + function mount(options: MountOptions, callback?: () => void): void; + /** - * Unmounts a file system with the given fileSystemId. It must be called after onUnmountRequested is invoked. Also, the providing extension can decide to perform unmounting if not requested (eg. in case of lost connection, or a file error). + * Unmounts a file system with the given fileSystemId. + * It must be called after onUnmountRequested is invoked. + * Also, the providing extension can decide to perform unmounting if not requested + * (eg. in case of lost connection, or a file error). + * * In case of an error, runtime.lastError will be set with a corresponding error code. + * * @param callback A generic result callback to indicate success or failure. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; */ - export function unmount(options: UnmountOptions, callback?: () => void): void; + function unmount(options: UnmountOptions, callback?: () => void): void; + /** * Returns all file systems mounted by the extension. * @param callback Callback to receive the result of getAll function. - * The callback parameter should be a function that looks like this: - * function(array of FileSystemInfo fileSystems) {...}; */ - export function getAll(callback: (fileSystems: FileSystemInfo[]) => void): void; + function getAll(callback: (fileSystems: FileSystemInfo[]) => void): void; + /** * Returns information about a file system with the passed fileSystemId. * @since Since Chrome 42. * @param callback Callback to receive the result of get function. - * The callback parameter should be a function that looks like this: - * function(FileSystemInfo fileSystem) {...}; */ - export function get(fileSystemId: string, callback: (fileSystem: FileSystemInfo) => void): void; + function get(fileSystemId: string, callback: (fileSystem: FileSystemInfo) => void): void; + /** - * Notifies about changes in the watched directory at observedPath in recursive mode. If the file system is mounted with supportsNofityTag, then tag must be provided, and all changes since the last notification always reported, even if the system was shutdown. The last tag can be obtained with getAll. + * Notifies about changes in the watched directory at observedPath in recursive mode. + * If the file system is mounted with supportsNofityTag, then tag must be provided, + * and all changes since the last notification always reported, even if the system was shutdown. + * The last tag can be obtained with getAll. + * * To use, the file_system_provider.notify manifest option must be set to true. - * Value of tag can be any string which is unique per call, so it's possible to identify the last registered notification. Eg. if the providing extension starts after a reboot, and the last registered notification's tag is equal to '123', then it should call notify for all changes which happened since the change tagged as '123'. It cannot be an empty string. - * Not all providers are able to provide a tag, but if the file system has a changelog, then the tag can be eg. a change number, or a revision number. - * Note that if a parent directory is removed, then all descendant entries are also removed, and if they are watched, then the API must be notified about the fact. Also, if a directory is renamed, then all descendant entries are in fact removed, as there is no entry under their original paths anymore. + * + * Value of tag can be any string which is unique per call, + * so it's possible to identify the last registered notification. + * Eg. if the providing extension starts after a reboot, + * and the last registered notification's tag is equal to '123', + * then it should call notify for all changes which happened since + * the change tagged as '123'. It cannot be an empty string. + * + * Not all providers are able to provide a tag, but if the file system has a changelog, + * then the tag can be eg. a change number, or a revision number. + * + * Note that if a parent directory is removed, then all descendant entries are also removed, + * and if they are watched, then the API must be notified about the fact. + * Also, if a directory is renamed, then all descendant entries are in fact removed, + * as there is no entry under their original paths anymore. + * * In case of an error, runtime.lastError will be set will a corresponding error code. + * * @param callback A generic result callback to indicate success or failure. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * @since Since Chrome 45. */ - export function notify(options: NotificationOptions, callback: () => void): void; + function notify(options: NotificationOptions, callback: () => void): void; + + ///\/\/\/\/\\\ + /// EVENTS \\\ + ///\/\/\/\/\\\ + + /** + * Raised when unmounting for the file system with the fileSystemId identifier is requested. + * In the response, the unmount API method must be called together with successCallback. + * If unmounting is not possible (eg. due to a pending operation), then errorCallback must be called. + */ + const onUnmountRequested: chrome.events.Event<( + options: UnmountRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when metadata of a file or a directory at entryPath is requested. + * The metadata must be returned with the successCallback call. + * In case of an error, errorCallback must be called. + */ + const onGetMetadataRequested: chrome.events.Event<( + options: MetadataRequestedEventOptions, + successCallback: (metadata: EntryMetadata) => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when a list of actions for a set of files or directories at entryPaths is requested. + * All of the returned actions must be applicable to each entry. + * If there are no such actions, an empty array should be returned. + * The actions must be returned with the successCallback call. + * In case of an error, errorCallback must be called. + * @since Since Chrome 48. + **/ + const onGetActionsRequested: chrome.events.Event<( + options: GetActionsRequestedEventOptions, + successCallback: (actions: Action[]) => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when contents of a directory at directoryPath are requested. + * The results must be returned in chunks by calling the successCallback several times. + * In case of an error, errorCallback must be called. + */ + const onReadDirectoryRequested: chrome.events.Event<( + options: ReadDirectoryRequestedEventOptions, + successCallback: (entries: EntryMetadata[], hasMore: boolean) => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when opening a file at filePath is requested. + * If the file does not exist, then the operation must fail. + * Maximum number of files opened at once can be specified with MountOptions. + */ + const onOpenFileRequested: chrome.events.Event<( + options: OpenFileRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when opening a file previously opened + * with openRequestId is requested to be closed. + */ + const onCloseFileRequested: chrome.events.Event<( + options: CloseFileRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void> + + /** + * Raised when reading contents of a file opened previously with openRequestId is requested. + * The results must be returned in chunks by calling successCallback several times. + * In case of an error, errorCallback must be called. + */ + const onReadFileRequested: chrome.events.Event<( + options: ReadFileRequestedEventOptions, + successCallback: (data: ArrayBuffer, hasMore: boolean) => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when creating a directory is requested. + * The operation must fail with the EXISTS error if the target directory already exists. + * If recursive is true, then all of the missing directories on the directory path must be created. + */ + const onCreateDirectoryRequested: chrome.events.Event<( + options: CreateDirectoryRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when deleting an entry is requested. + * If recursive is true, and the entry is a directory, + * then all of the entries inside must be recursively deleted as well. + */ + const onDeleteEntryRequested: chrome.events.Event<( + options: DeleteEntryRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when creating a file is requested. + * If the file already exists, then errorCallback must be called with the 'EXISTS' error code. + */ + const onCreateFileRequested: chrome.events.Event<( + options: CreateFileRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when copying an entry (recursively if a directory) is requested. + * If an error occurs, then errorCallback must be called. + */ + const onCopyEntryRequested: chrome.events.Event<( + options: CopyEntryRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when moving an entry (recursively if a directory) is requested. + * If an error occurs, then errorCallback must be called. + */ + const onMoveEntryRequested: chrome.events.Event<( + options: MoveEntryRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when truncating a file to a desired length is requested. + * If an error occurs, then errorCallback must be called. + */ + const onTruncateRequested: chrome.events.Event<( + options: TruncateRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; - /** Raised when unmounting for the file system with the fileSystemId identifier is requested. In the response, the unmount API method must be called together with successCallback. If unmounting is not possible (eg. due to a pending operation), then errorCallback must be called. */ - export var onUnmountRequested: RequestedEvent; - /** Raised when metadata of a file or a directory at entryPath is requested. The metadata must be returned with the successCallback call. In case of an error, errorCallback must be called. */ - export var onGetMetadataRequested: MetadataRequestedEvent; - /** Raised when contents of a directory at directoryPath are requested. The results must be returned in chunks by calling the successCallback several times. In case of an error, errorCallback must be called. */ - export var onReadDirectoryRequested: DirectoryPathRequestedEvent; - /** Raised when opening a file at filePath is requested. If the file does not exist, then the operation must fail. Maximum number of files opened at once can be specified with MountOptions. */ - export var onOpenFileRequested: OpenFileRequestedEvent; - /** Raised when opening a file previously opened with openRequestId is requested to be closed. */ - export var onCloseFileRequested: OpenedFileRequestedEvent; - /** Raised when reading contents of a file opened previously with openRequestId is requested. The results must be returned in chunks by calling successCallback several times. In case of an error, errorCallback must be called. */ - export var onReadFileRequested: OpenedFileOffsetRequestedEvent; - /** Raised when creating a directory is requested. The operation must fail with the EXISTS error if the target directory already exists. If recursive is true, then all of the missing directories on the directory path must be created. */ - export var onCreateDirectoryRequested: DirectoryPathRecursiveRequestedEvent; - /** Raised when deleting an entry is requested. If recursive is true, and the entry is a directory, then all of the entries inside must be recursively deleted as well. */ - export var onDeleteEntryRequested: EntryPathRecursiveRequestedEvent; - /** Raised when creating a file is requested. If the file already exists, then errorCallback must be called with the 'EXISTS' error code. */ - export var onCreateFileRequested: FilePathRequestedEvent; - /** Raised when copying an entry (recursively if a directory) is requested. If an error occurs, then errorCallback must be called. */ - export var onCopyEntryRequested: SourceTargetPathRequestedEvent; - /** Raised when moving an entry (recursively if a directory) is requested. If an error occurs, then errorCallback must be called. */ - export var onMoveEntryRequested: SourceTargetPathRequestedEvent; - /** Raised when truncating a file to a desired length is requested. If an error occurs, then errorCallback must be called. */ - export var onTruncateRequested: FilePathLengthRequestedEvent; /** Raised when writing contents to a file opened previously with openRequestId is requested. */ - export var onWriteFileRequested: OpenedFileIoRequestedEvent; - /** Raised when aborting an operation with operationRequestId is requested. The operation executed with operationRequestId must be immediately stopped and successCallback of this abort request executed. If aborting fails, then errorCallback must be called. Note, that callbacks of the aborted operation must not be called, as they will be ignored. Despite calling errorCallback, the request may be forcibly aborted. */ - export var onAbortRequested: OperationRequestedEvent; + const onWriteFileRequested: chrome.events.Event<( + options: WriteFileRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + /** - * Raised when showing a configuration dialog for fileSystemId is requested. If it's handled, the file_system_provider.configurable manfiest option must be set to true. + * Raised when aborting an operation with operationRequestId is requested. + * The operation executed with operationRequestId must be immediately stopped + * and successCallback of this abort request executed. If aborting fails, + * then errorCallback must be called. Note, that callbacks of the aborted + * operation must not be called, as they will be ignored. Despite calling + * errorCallback, the request may be forcibly aborted. + */ + const onAbortRequested: chrome.events.Event<( + options: AbortRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when showing a configuration dialog for fileSystemId is requested. + * If it's handled, the file_system_provider.configurable manfiest option must be set to true. * @since Since Chrome 44. */ - export var onConfigureRequested: RequestedEvent; + const onConfigureRequested: chrome.events.Event<( + options: ConfigureRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + /** - * Raised when showing a dialog for mounting a new file system is requested. If the extension/app is a file handler, then this event shouldn't be handled. Instead app.runtime.onLaunched should be handled in order to mount new file systems when a file is opened. For multiple mounts, the file_system_provider.multiple_mounts manifest option must be set to true. + * Raised when showing a dialog for mounting a new file system is requested. + * If the extension/app is a file handler, then this event shouldn't be handled. + * Instead app.runtime.onLaunched should be handled in order to mount new file systems when a file is opened. + * For multiple mounts, the file_system_provider.multiple_mounts manifest option must be set to true. * @since Since Chrome 44. */ - export var onMountRequested: OptionlessRequestedEvent; + const onMountRequested: chrome.events.Event<( + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + /** - * Raised when setting a new directory watcher is requested. If an error occurs, then errorCallback must be called. - * @since Since Chrome 45. Warning: this is the current Beta channel. + * Raised when setting a new directory watcher is requested. + * If an error occurs, then errorCallback must be called. + * @since Since Chrome 45. */ - export var onAddWatcherRequested: EntryPathRecursiveRequestedEvent; + const onAddWatcherRequested: chrome.events.Event<( + options: WatcherRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + /** - * Raised when the watcher should be removed. If an error occurs, then errorCallback must be called. - * @since Since Chrome 45. Warning: this is the current Beta channel. + * Raised when the watcher should be removed. + * If an error occurs, then errorCallback must be called. + * @since Since Chrome 45. */ - export var onRemoveWatcherRequested: EntryPathRecursiveRequestedEvent; + const onRemoveWatcherRequested: chrome.events.Event<( + options: WatcherRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when executing an action for a set of files or directories is\ requested. + * After the action is completed, successCallback must be called. + * On error, errorCallback must be called. + * @since Since Chrome 48. + */ + const onExecuteActionRequested: chrome.events.Event<( + options: ExecuteActionRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; } - //////////////////// - // Google Cloud Messaging - //////////////////// + //////////////////////////// + // Google Cloud Messaging // + //////////////////////////// /** - * Use chrome.gcm to enable apps and extensions to send and receive messages through the Google Cloud Messaging Service. - * Availability: Since Chrome 35. - * Permissions: 'gcm' + * Use chrome.gcm to enable apps and extensions to send and receive + * messages through the Google Cloud Messaging Service. + * @deprecated + * As of April 10, 2018, Google has deprecated GCM. + * The GCM server and client APIs are deprecated and will be removed as soon as April 11, 2019. + * Migrate GCM apps to Firebase Cloud Messaging (FCM), + * which inherits the reliable and scalable GCM infrastructure, + * plus many new features. See the migration guide to learn more. + * @see[Migration guide]{@link https://developers.google.com/cloud-messaging/android/android-migrate-fcm} + * @see[GCM Imlementation guide]{@link https://developers.google.com/cloud-messaging/chrome/client} + * @since Availability: Since Chrome 35. + * @requires Permissions: 'gcm' */ namespace gcm { + /** + * The maximum size (in bytes) of all key/value pairs in a message. + * @default 4096 + */ + const MAX_MESSAGE_SIZE: integer; + interface IGCMData { 'collapse_key'?: never; 'goog'?: never; 'goog.'?: never; + 'GOOG'?: never; + 'GOOG.'?: never; 'google'?: never; 'GOOGLE'?: never; [key: string]: any; } + interface OutgoingMessage { /** The ID of the server to send the message to as assigned by Google API Console. */ destinationId: string; /** The ID of the message. It must be unique for each message in scope of the applications. See the Cloud Messaging documentation for advice for picking and handling an ID. */ messageId: string; - /** Optional. Time-to-live of the message in seconds. If it is not possible to send the message within that time, an onSendError event will be raised. A time-to-live of 0 indicates that the message should be sent immediately or fail if it's not possible. The maximum and a default value of time-to-live is 86400 seconds (1 day). */ - timeToLive?: number; + /** Time-to-live of the message in seconds. If it is not possible to send the message within that time, an onSendError event will be raised. A time-to-live of 0 indicates that the message should be sent immediately or fail if it's not possible. The maximum and a default value of time-to-live is 86400 seconds (1 day). */ + timeToLive?: integer; /** - * @description Message data to send to the server. Case-insensitive goog. and google, as well as case-sensitive collapse_key are disallowed as key prefixes. Sum of all key/value pairs should not exceed gcm.MAX_MESSAGE_SIZE. + * Message data to send to the server. + * + * Case-insensitive goog. and google, + * as well as case-sensitive collapse_key + * are disallowed as key prefixes. + * + * Sum of all key/value pairs should not exceed gcm.MAX_MESSAGE_SIZE. **/ data: IGCMData; } @@ -2439,21 +3502,12 @@ declare namespace chrome { interface GcmError { /** The error message describing the problem. */ errorMessage: string; - /** Optional. The ID of the message with this error, if error is related to a specific message. */ + /** The ID of the message with this error, if error is related to a specific message. */ messageId?: string; /** Additional details related to the error, when available. */ detail: Object; } - interface MessageReceptionEvent extends chrome.events.Event<(message: IncomingMessage) => void> { } - - interface MessageDeletionEvent extends chrome.events.Event<() => void> { } - - interface GcmErrorEvent extends chrome.events.Event<(error: GcmError) => void> { } - - /** The maximum size (in bytes) of all key/value pairs in a message. Default: 4096 */ - export var MAX_MESSAGE_SIZE: number; - /** * Registers the application with GCM. The registration ID will be returned by the callback. If register is called again with the same list of senderIds, the same registration ID will be returned. * @param senderIds A list of server IDs that are allowed to send messages to the application. It should contain at least one and no more than 100 sender IDs. @@ -2462,14 +3516,14 @@ declare namespace chrome { * function(string registrationId) {...}; * Parameter registrationId: A registration ID assigned to the application by the GCM. */ - export function register(senderIds: string[], callback: (registrationId: string) => void): void; + function register(senderIds: string[], callback: (registrationId: string) => void): void; /** * Unregisters the application from GCM. * @param callback A function called after the unregistration completes. Unregistration was successful if runtime.lastError is not set. * The callback parameter should be a function that looks like this: * function() {...}; */ - export function unregister(callback: () => void): void; + function unregister(callback: () => void): void; /** * Sends a message according to its contents. * @param message A message to send to the other party via GCM. @@ -2478,46 +3532,440 @@ declare namespace chrome { * function(string messageId) {...}; * Parameter messageId: The ID of the message that the callback was issued for. */ - export function send(message: OutgoingMessage, callback: (messageId: string) => void): void; + function send(message: OutgoingMessage, callback: (messageId: string) => void): void; /** Fired when a message is received through GCM. */ - export var onMessage: MessageReceptionEvent; + const onMessage: chrome.events.Event<(message: IncomingMessage) => void>; /** Fired when a GCM server had to delete messages sent by an app server to the application. See Messages deleted event section of Cloud Messaging documentation for details on handling this event. */ - export var onMessagesDeleted: MessageDeletionEvent; + const onMessagesDeleted: chrome.events.Event<() => void>; /** Fired when it was not possible to send a message to the GCM server. */ - export var onSendError: GcmErrorEvent; + const onSendError: chrome.events.Event<(error: GcmError) => void>; } - //////////////////// - // HID - //////////////////// + ///////// + // HID // + ///////// /** - * Use the chrome.hid API to interact with connected HID devices. This API provides access to HID operations from within the context of an app. Using this API, apps can function as drivers for hardware devices. Errors generated by this API are reported by setting runtime.lastError and executing the function's regular callback. The callback's regular parameters will be undefined in this case. - * @since Chrome 38 + * Use the chrome.hid API to interact with connected HID devices. + * This API provides access to HID operations from within the context of an app. + * Using this API, apps can function as drivers for hardware devices. + * Errors generated by this API are reported by setting runtime.lastError + * and executing the function's regular callback. The callback's regular + * parameters will be undefined in this case. + * + * @requires Permissions: 'hid' + * @since Available since Chrome 38. */ namespace hid { - /** NOT YET IMPLEMENTED */ + interface Collection { + /** HID usage page identifier. */ + usagePage: integer; + /** Page-defined usage identifier. */ + usage: integer; + /** Report IDs which belong to the collection and to its children. */ + reportIds: integer[]; + } + interface HidDeviceInfo { + /** Opaque device ID. */ + deviceId: integer; + /** Vendor ID. */ + vendorId: integer; + /** Product ID. */ + productId: integer; + /** + * The product name read from the device, if available. + * @since Chrome 46 + * */ + productName: string; + /** + * The serial number read from the device, if available. + * @since Chrome 46 + */ + serialNumber: string; + /** + * Top-level collections from this device's report descriptors. + */ + collections: Collection[]; + /** Top-level collection's maximum input report size. */ + maxInputReportSize: integer; + /** Top-level collection's maximum output report size. */ + maxOutputReportSize: integer; + /** Top-level collection's maximum feature report size. */ + maxFeatureReportSize: integer; + /** + * Raw device report descriptor (not available on Windows). + * @since Chrome 42 + * */ + reportDescriptor: ArrayBuffer; + } + /** @since Chrome 39. */ + interface DeviceFilter { + /** Device vendor ID. */ + vendorId?: integer; + /** Device product ID, only checked only if the vendor ID matches. */ + productId?: integer; + /** HID usage page identifier. */ + usagePage?: integer; + /** HID usage identifier, checked only if the HID usage page matches. */ + usage?: integer; + } + interface DeviceOptions { + /** + * Equivalent to setting DeviceFilter.vendorId. + * @deprecated Deprecated since Chrome 39 + */ + vendorId?: chrome.deprecated; + /** + * Equivalent to setting DeviceFilter.productId. + * @deprecated Deprecated since Chrome 39. + */ + productId?: chrome.deprecated; + /** + * A device matching any given filter will be returned. + * An empty filter list will return all devices the app has permission for. + * @since Chrome 39 + */ + filters?: DeviceFilter[]; + } + interface UserSelectedDevicePickerOptions { + /** + * Allow the user to select multiple devices. + */ + multiple?: boolean; + /** + * Filter the list of devices presented to the user. + * If multiple filters are provided devices matching any filter will be displayed. + */ + filters?: DeviceFilter[]; + } + + /** + * Enumerate connected HID devices. + * @param options The properties to search for on target devices. + * @param callback + */ + function getDevices(options: DeviceOptions, callback: (devices: HidDeviceInfo[]) => void): void; + + /** + * @requires(dev) **Dev channel only!** + * @see[Learn more]{@link https://developer.chrome.com/apps/api_index#dev_apis} + * @description + * Presents a device picker to the user and returns + * HidDeviceInfo objects for the devices selected. If the user + * cancels the picker devices will be empty. A user gesture is + * required for the dialog to display. Without a user gesture, + * the callback will run as though the user cancelled. If multiple + * filters are provided devices matching any filter will be displayed. + * @param callback Invoked with a list of chosen Devices. + */ + function getUserSelectedDevices(callback: (devices: HidDeviceInfo) => void): void; + + /** + * @since Since Chrome 45. + * @requires(dev) **Dev channel only!** + * @see[Learn more]{@link https://developer.chrome.com/apps/api_index#dev_apis} + * Presents a device picker to the user and returns + * HidDeviceInfo objects for the devices selected. If the user + * cancels the picker devices will be empty. A user gesture is + * required for the dialog to display. Without a user gesture, + * the callback will run as though the user cancelled. If multiple + * filters are provided devices matching any filter will be displayed. + * @param options Configuration of the device picker dialog box. + * @param callback Invoked with a list of chosen Devices. + */ + function getUserSelectedDevices(options: UserSelectedDevicePickerOptions, callback: (devices: HidDeviceInfo) => void): void; + + /** + * Open a connection to an HID device for communication. + * @param deviceId The HidDeviceInfo.deviceId of the device to open. + * @param callback The callback function returns an object, containing the connectionId. + * The connectionId is the opaque ID used to identify this connection in all other functions. + */ + function connect(deviceId: number, callback: (connection: { connectionId: number }) => void): void; + + /** + * Disconnect from a device. + * Invoking operations on a device after calling this is safe but has no effect. + * @param connectionId The connectionId returned by connect. + * @param [callback] + */ + function disconnect(connectionId: integer, callback?: () => void): void; + + /** + * Receive the next input report from the device. + * @param connectionId The connectionId returned by connect. + * @param callback The callback will return these parameters: + * * reportId - The report ID or 0 if none. + * * data - The report data, the report ID prefix (if present) is removed. + */ + function receive(connectionId: integer, callback: (reportId: integer, data: ArrayBuffer) => void): void; + + /** + * Send an output report to the device. + * Note: Do not include a report ID prefix in data. It will be added if necessary. + * @param connectionId The connectionId returned by connect. + * @param reportId reportId - The report ID or 0 if none. + * @param data The report data. + * @param callback + */ + function send(connectionId: integer, reportId: integer, data: ArrayBuffer, callback: () => void): void; + + /** + * Request a feature report from the device. + * @param connectionId The connectionId returned by connect. + * @param reportId The report ID, or 0 if none. + * @param callback Will provide `data` which contain the report data, including a report ID prefix if one is sent by the device. + */ + function receiveFeatureReport(connectionId: integer, reportId: integer, callback: (data: ArrayBuffer) => void): void; + + /** + * Send a feature report to the device. + * Note: Do not include a report ID prefix in data. It will be added if necessary. + * @param connectionId The connectionId returned by connect. + * @param reportId The report ID to use, or 0 if none. + * @param data The report data. + * @param callback + */ + function sendFeatureReport(connectionId: integer, reportId: integer, data: ArrayBuffer, callback: () => void): void; + + /** + * Event generated when a device is added to the system. + * Events are only broadcast to apps and extensions that + * have permission to access the device. Permission may + * have been granted at install time or when the user + * accepted an optional permission. + * @since Chrome 41. + * @see[permissions.request]{@link https://developer.chrome.com/apps/permissions#method-request} + */ + const onDeviceAdded: chrome.events.Event<(device: HidDeviceInfo) => void>; + + /** + * Event generated when a device is removed from the system. + * The callback will contain the deviceId property of the device passed to onDeviceAdded. + * @since Chrome 41. + * @see[See onDeviceAdded for which events are delivered]{@link https://developer.chrome.com/apps/hid#event-onDeviceAdded}. + */ + const onDeviceRemoved: chrome.events.Event<(deviceId: integer) => void>; } - //////////////////// - // i18n - //////////////////// + ///////////////////////////////// + // i18n - Internationalization // + ///////////////////////////////// /** - * Use the chrome.i18n infrastructure to implement internationalization across your whole app or extension. - * @since Chrome 5. + * Use the chrome.i18n infrastructure to implement internationalization across your whole app. + * Content scripts: Fully supported. + * @see[Docs]{@link https://developer.chrome.com/apps/i18n} + * @since Chrome 25. */ namespace i18n { + /** + * An ISO language code such as en or fr. + * For a complete list of languages supported by this method, see kLanguageInfoTable. + * For an unknown language, und will be returned, + * which means that [percentage] of the text is unknown to CLD + * @since Chrome 47. + */ + type LanguageCode = kLanguageInfoTable | 'und'; + /** + * @see[Source]{@link https://github.com/chromium/chromium/blob/master/ui/base/l10n/l10n_util.cc} + */ + type kLanguageInfoTable = + 'af' | // Afrikaans + 'am' | // Amharic + 'an' | // Aragonese + 'ar' | // Arabic + 'ast' | // Asturian + 'az' | // Azerbaijani + 'be' | // Belarusian + 'bg' | // Bulgarian + 'bh' | // Bihari + 'bn' | // Bengali + 'br' | // Breton + 'bs' | // Bosnian + 'ca' | // Catalan + 'ceb' | // Cebuano + 'ckb' | // Kurdish (Arabci), Sorani + 'co' | // Corsican + 'cs' | // Czech + 'cy' | // Welsh + 'da' | // Danish + 'de' | // German + 'de-AT' | // German (Austria) + 'de-CH' | // German (Switzerland) + 'de-DE' | // German (Germany) + 'de-LI' | // German (Liechtenstein) + 'el' | // Greek + 'en' | // English + 'en-AU' | // English (Australia) + 'en-CA' | // English (Canada) + 'en-GB' | // English (UK) + 'en-IN' | // English (India) + 'en-NZ' | // English (New Zealand) + 'en-US' | // English (US) + 'en-ZA' | // English (South Africa) + 'eo' | // Esperanto + // TODO(jungshik) : Do we want to list all es-Foo for Latin-American + // Spanish speaking countries? + 'es' | // Spanish + 'es-419' | // Spanish (Latin America) + 'es-AR' | // Spanish (Argentina) + 'es-CL' | // Spanish (Chile) + 'es-CO' | // Spanish (Colombia) + 'es-CR' | // Spanish (Costa Rica) + 'es-ES' | // Spanish (Spain) + 'es-HN' | // Spanish (Honduras) + 'es-MX' | // Spanish (Mexico) + 'es-PE' | // Spanish (Peru) + 'es-US' | // Spanish (US) + 'es-UY' | // Spanish (Uruguay) + 'es-VE' | // Spanish (Venezuela) + 'et' | // Estonian + 'eu' | // Basque + 'fa' | // Persian + 'fi' | // Finnish + 'fil' | // Filipino + 'fo' | // Faroese + 'fr' | // French + 'fr-CA' | // French (Canada) + 'fr-CH' | // French (Switzerland) + 'fr-FR' | // French (France) + 'fy' | // Frisian + 'ga' | // Irish + 'gd' | // Scots Gaelic + 'gl' | // Galician + 'gn' | // Guarani + 'gu' | // Gujarati + 'ha' | // Hausa + 'haw' | // Hawaiian + 'he' | // Hebrew + 'hi' | // Hindi + 'hmn' | // Hmong + 'hr' | // Croatian + 'ht' | // Haitian Creole + 'hu' | // Hungarian + 'hy' | // Armenian + 'ia' | // Interlingua + 'id' | // Indonesian + 'ig' | // Igbo + 'is' | // Icelandic + 'it' | // Italian + 'it-CH' | // Italian (Switzerland) + 'it-IT' | // Italian (Italy) + 'ja' | // Japanese + 'jv' | // Javanese + 'ka' | // Georgian + 'kk' | // Kazakh + 'km' | // Cambodian + 'kn' | // Kannada + 'ko' | // Korean + 'ku' | // Kurdish + 'ky' | // Kyrgyz + 'la' | // Latin + 'lb' | // Luxembourgish + 'ln' | // Lingala + 'lo' | // Laothian + 'lt' | // Lithuanian + 'lv' | // Latvian + 'mg' | // Malagasy + 'mi' | // Maori + 'mk' | // Macedonian + 'ml' | // Malayalam + 'mn' | // Mongolian + 'mo' | // Moldavian + 'mr' | // Marathi + 'ms' | // Malay + 'mt' | // Maltese + 'my' | // Burmese + 'nb' | // Norwegian (Bokmal) + 'ne' | // Nepali + 'nl' | // Dutch + 'nn' | // Norwegian (Nynorsk) + 'no' | // Norwegian + 'ny' | // Nyanja + 'oc' | // Occitan + 'om' | // Oromo + 'or' | // Oriya + 'pa' | // Punjabi + 'pl' | // Polish + 'ps' | // Pashto + 'pt' | // Portuguese (pt-BR and pt-PT are used) + 'pt-BR' | // Portuguese (Brazil) + 'pt-PT' | // Portuguese (Portugal) + 'qu' | // Quechua + 'rm' | // Romansh + 'ro' | // Romanian + 'ru' | // Russian + 'sd' | // Sindhi + 'sh' | // Serbo-Croatian + 'si' | // Sinhalese + 'sk' | // Slovak + 'sl' | // Slovenian + 'sm' | // Samoan + 'sn' | // Shona + 'so' | // Somali + 'sq' | // Albanian + 'sr' | // Serbian + 'st' | // Sesotho + 'su' | // Sundanese + 'sv' | // Swedish + 'sw' | // Swahili + 'ta' | // Tamil + 'te' | // Telugu + 'tg' | // Tajik + 'th' | // Thai + 'ti' | // Tigrinya + 'tk' | // Turkmen + 'to' | // Tonga + 'tr' | // Turkish + 'tt' | // Tatar + 'tw' | // Twi + 'ug' | // Uighur + 'uk' | // Ukrainian + 'ur' | // Urdu + 'uz' | // Uzbek + 'vi' | // Vietnamese + 'wa' | // Walloon + 'xh' | // Xhosa + 'yi' | // Yiddish + 'yo' | // Yoruba + 'zh' | // Chinese + 'zh-CN' | // Chinese (China) + 'zh-HK' | // Chinese (Hong Kong) + 'zh-TW' | // Chinese (Taiwan) + 'zu' | // Zulu + // Aliases: + 'ar_001' | + 'en_001' | + 'en_150' | + 'zh_hans_cn' | + 'zh_hant_hk' | + 'zh_hant_mo' | + 'zh_hans_sg' | + 'zh_hant_tw'; + + /** Allow array of strings with length 1 to 9 */ + type StringSubstitutions = + [string] | + [string, string] | + [string, string, string] | + [string, string, string, string] | + [string, string, string, string, string] | + [string, string, string, string, string, string] | + [string, string, string, string, string, string, string] | + [string, string, string, string, string, string, string, string] | + [string, string, string, string, string, string, string, string, string]; + /** Holds detected ISO language code and its percentage in the input string */ interface DetectedLanguage { /** - * @description An ISO language code such as 'en' or 'fr'. - * @description For a complete list of languages supported by this method: + * An ISO language code such as 'en' or 'fr'. + * For a complete list of languages supported by this method: * @see [kLanguageInfoTable]{@link https://src.chromium.org/viewvc/chrome/trunk/src/third_party/cld/languages/internal/languages.cc}. - * @description For an unknown language, 'und' will be returned, which means that [percentage] of the text is unknown to CLD */ - language: string; + * For an unknown language, 'und' will be returned, which means that [percentage] of the text is unknown to CLD */ + language: kLanguageInfoTable; /** The percentage of the detected language */ - percentage: number; + percentage: integer; } /** Holds detected language reliability and array of DetectedLanguage */ @@ -2525,60 +3973,75 @@ declare namespace chrome { /** CLD detected language reliability */ isReliable: boolean; - /** Array of detectedLanguage */ + /** Array of DetectedLanguage */ languages: DetectedLanguage[]; } /** - * Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use i18n.getUILanguage. - * @param callback The callback parameter should be a function that looks like this: - * function(array of string languages) {...}; - * Parameter languages: Array of the accept languages of the browser, such as en-US,en,zh-CN + * Gets the accept-languages of the browser. + * This is different from the locale used by the browser; + * to get the locale, use i18n.getUILanguage. */ - export function getAcceptLanguages(callback: (languages: string[]) => void): void; + function getAcceptLanguages(callback: (languages: LanguageCode[]) => void): void; /** - * Gets the localized string for the specified message. If the message is missing, this method returns an empty string (''). If the format of the getMessage() call is wrong — for example, messageName is not a string or the substitutions array has more than 9 elements — this method returns undefined. + * Gets the localized string for the specified message. + * If the message is missing, this method returns an empty string (''). + * If the format of the getMessage() call is wrong — for example, + * messageName is not a string or the substitutions array has + * more than 9 elements — this method returns undefined. + * * @param messageName The name of the message, as specified in the messages.json file. - * @param substitutions Optional. Up to 9 substitution strings, if the message requires any. + * @param substitutions Up to 9 substitution strings, if the message requires any. */ - export function getMessage(messageName: string, substitutions?: any): string | undefined; + function getMessage(messageName: string, substitutions?: StringSubstitutions): string | undefined; /** - * Gets the browser UI language of the browser. This is different from i18n.getAcceptLanguages which returns the preferred user languages. + * Gets the browser UI language of the browser. + * This is different from i18n.getAcceptLanguages which returns the preferred user languages. * @since Chrome 35. */ - export function getUILanguage(): string; + function getUILanguage(): string; - /** Detects the language of the provided text using CLD. + /** + * Detects the language of the provided text using CLD. * @param text User input string to be translated. - * @param callback The callback parameter should be a function that looks like this: function(object result) {...}; + * @param callback + * @since Chrome 47. */ - export function detectLanguage(text: string, callback: (result: LanguageDetectionResult) => void): void; + function detectLanguage(text: string, callback: (result: LanguageDetectionResult) => void): void; } - //////////////////// - // Identity - //////////////////// + ////////////// + // Identity // + ////////////// /** * Use the chrome.identity API to get OAuth2 access tokens. - * Permissions: 'identity' + * @requires Permissions: 'identity' + * @see[Identity User]{@link https://developer.chrome.com/apps/app_identity} * @since Chrome 29. */ namespace identity { /** @since Chrome 32. */ interface AccountInfo { - /** A unique identifier for the account. This ID will not change for the lifetime of the account. */ + /** + * A unique identifier for the account. + * This ID will not change for the lifetime of the account. + */ id: string; } interface TokenDetails { /** - * Optional. - * Fetching a token may require the user to sign-in to Chrome, or approve the application's requested scopes. If the interactive flag is true, getAuthToken will prompt the user as necessary. When the flag is false or omitted, getAuthToken will return failure any time a prompt would be required. + * Fetching a token may require the user to sign-in to Chrome, + * or approve the application's requested scopes. + * If the interactive flag is true, getAuthToken will prompt the user as necessary. + * When the flag is false or omitted, getAuthToken will return failure any time + * a prompt would be required. */ interactive?: boolean; /** * Optional. - * The account ID whose token should be returned. If not specified, the primary account for the profile will be used. + * The account ID whose token should be returned. + * If not specified, the primary account for the profile will be used. * account is only supported when the 'enable-new-profile-management' flag is set. * @since Chrome 37. */ @@ -2593,9 +4056,17 @@ declare namespace chrome { } interface UserInfo { - /** An email address for the user account signed into the current profile. Empty if the user is not signed in or the identity.email manifest permission is not specified. */ + /** + * An email address for the user account signed into the current profile. + * Empty if the user is not signed in or the identity.email manifest permission is not specified. + */ email: string; - /** A unique identifier for the account. This ID will not change for the lifetime of the account. Empty if the user is not signed in or (in M41+) the identity.email manifest permission is not specified. */ + /** + * A unique identifier for the account. + * This ID will not change for the lifetime of the account. + * Empty if the user is not signed in or (in M41+) the identity.email + * manifest permission is not specified. + */ id: string; } @@ -2605,7 +4076,9 @@ declare namespace chrome { } interface WebAuthFlowOptions { - /** The URL that initiates the auth flow. */ + /** + * The URL that initiates the auth flow. + */ url: string; /** * Optional. @@ -2616,75 +4089,97 @@ declare namespace chrome { interactive?: boolean; } - interface SignInChangeEvent extends chrome.events.Event<(account: AccountInfo, signedIn: boolean) => void> { } - /** + * @requires(dev) **Dev channel only.** + * @description * Retrieves a list of AccountInfo objects describing the accounts present on the profile. * getAccounts is only supported on dev channel. - * Dev channel only. */ - export function getAccounts(callback: (accounts: AccountInfo[]) => void): void; + function getAccounts(callback: (accounts: AccountInfo[]) => void): void; + /** - * Gets an OAuth2 access token using the client ID and scopes specified in the oauth2 section of manifest.json. - * The Identity API caches access tokens in memory, so it's ok to call getAuthToken non-interactively any time a token is required. The token cache automatically handles expiration. - * For a good user experience it is important interactive token requests are initiated by UI in your app explaining what the authorization is for. Failing to do this will cause your users to get authorization requests, or Chrome sign in screens if they are not signed in, with with no context. In particular, do not use getAuthToken interactively when your app is first launched. + * Gets an OAuth2 access token using the client ID and + * scopes specified in the oauth2 section of manifest.json. + * + * The Identity API caches access tokens in memory, + * so it's ok to call getAuthToken non-interactively any time a token is required. + * The token cache automatically handles expiration. + * + * For a good user experience it is important interactive token requests are initiated by + * UI in your app explaining what the authorization is for. Failing to do this will cause + * your users to get authorization requests, or Chrome sign in screens if they are not + * signed in, with with no context. In particular, do not use getAuthToken interactively + * when your app is first launched. + * * @param details Token options. - * @param callback Called with an OAuth2 access token as specified by the manifest, or undefined if there was an error. - * If you specify the callback parameter, it should be a function that looks like this: - * function(string token) {...}; + * @param [callback] Called with an OAuth2 access token as specified by the manifest, + * or undefined if there was an error. */ - export function getAuthToken(details: TokenDetails, callback?: (token: string) => void): void; + function getAuthToken(details: TokenDetails, callback?: (token: string) => void): void; + /** * Retrieves email address and obfuscated gaia id of the user signed into a profile. - * This API is different from identity.getAccounts in two ways. The information returned is available offline, and it only applies to the primary account for the profile. + * This API is different from identity.getAccounts in two ways. + * The information returned is available offline, and it only applies to the primary account for the profile. * @since Chrome 37. */ - export function getProfileUserInfo(callback: (userInfo: UserInfo) => void): void; + function getProfileUserInfo(callback: (userInfo: UserInfo) => void): void; + /** * Removes an OAuth2 access token from the Identity API's token cache. - * If an access token is discovered to be invalid, it should be passed to removeCachedAuthToken to remove it from the cache. The app may then retrieve a fresh token with getAuthToken. + * If an access token is discovered to be invalid, + * it should be passed to removeCachedAuthToken to remove it from the cache. + * The app may then retrieve a fresh token with getAuthToken. * @param details Token information. * @param callback Called when the token has been removed from the cache. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; */ - export function removeCachedAuthToken(details: TokenInformation, callback?: () => void): void; + function removeCachedAuthToken(details: TokenInformation, callback?: () => void): void; + /** * Starts an auth flow at the specified URL. - * This method enables auth flows with non-Google identity providers by launching a web view and navigating it to the first URL in the provider's auth flow. When the provider redirects to a URL matching the pattern https://.chromiumapp.org/*, the window will close, and the final redirect URL will be passed to the callback function. - * For a good user experience it is important interactive auth flows are initiated by UI in your app explaining what the authorization is for. Failing to do this will cause your users to get authorization requests with no context. In particular, do not launch an interactive auth flow when your app is first launched. + * This method enables auth flows with non-Google identity providers by launching + * a web view and navigating it to the first URL in the provider's auth flow. + * When the provider redirects to a URL matching the pattern https://.chromiumapp.org/*, + * the window will close, and the final redirect URL will be passed to the callback function. + * For a good user experience it is important interactive auth flows are initiated by UI in + * your app explaining what the authorization is for. Failing to do this will cause your + * users to get authorization requests with no context. + * In particular, do not launch an interactive auth flow when your app is first launched. * @param details WebAuth flow options. * @param callback Called with the URL redirected back to your application. * The callback parameter should be a function that looks like this: * function(string responseUrl) {...}; */ - export function launchWebAuthFlow(details: WebAuthFlowOptions, callback: (responseUrl?: string) => void): void; + function launchWebAuthFlow(details: WebAuthFlowOptions, callback: (responseUrl?: string) => void): void; + /** * Generates a redirect URL to be used in launchWebAuthFlow. * The generated URLs match the pattern https://.chromiumapp.org/*. * @since Chrome 33. - * @param path Optional. The path appended to the end of the generated URL. + * @param path The path appended to the end of the generated URL. */ - export function getRedirectURL(path?: string): string; + function getRedirectURL(path?: string): string; /** * Fired when signin state changes for an account on the user's profile. * @since Chrome 33. */ - export var onSignInChanged: SignInChangeEvent; + const onSignInChanged: chrome.events.Event<(account: AccountInfo, signedIn: boolean) => void>; } - //////////////////// - // Idle - //////////////////// + ////////// + // Idle // + ////////// /** * Use the chrome.idle API to detect when the machine's idle state changes. - * Permissions: 'idle' - * @since Chrome 6. + * @requires Permissions: 'idle' + * @since Chrome 25. */ namespace idle { - interface IdleStateChangedEvent extends chrome.events.Event<(newState: string) => void> { } - + type IdleState = + 'active' | + 'idle' | + 'locked'; /** * Returns 'locked' if the system is locked, 'idle' if the user has not generated any input for a specified number of seconds, or 'active' otherwise. * @param detectionIntervalInSeconds The system is considered idle if detectionIntervalInSeconds seconds have elapsed since the last user input detected. @@ -2692,88 +4187,481 @@ declare namespace chrome { * @param callback The callback parameter should be a function that looks like this: * function( IdleState newState) {...}; */ - export function queryState(detectionIntervalInSeconds: number, callback: (newState: string) => void): void; + function queryState(detectionIntervalInSeconds: integer, callback: (newState: IdleState) => void): void; /** - * Sets the interval, in seconds, used to determine when the system is in an idle state for onStateChanged events. The default interval is 60 seconds. + * Sets the interval, in seconds, used to determine when the system is in an idle state for + * onStateChanged events. + * The default interval is 60 seconds. * @since Chrome 25. * @param intervalInSeconds Threshold, in seconds, used to determine when the system is in an idle state. */ - export function setDetectionInterval(intervalInSeconds: number): void; + function setDetectionInterval(intervalInSeconds: integer): void; - /** Fired when the system changes to an active, idle or locked state. The event fires with 'locked' if the screen is locked or the screensaver activates, 'idle' if the system is unlocked and the user has not generated any input for a specified number of seconds, and 'active' when the user generates input on an idle system. */ - export var onStateChanged: IdleStateChangedEvent; + /** + * Fired when the system changes to an active, idle or locked state. + * The event fires with 'locked' if the screen is locked or the screensaver activates, + * 'idle' if the system is unlocked and the user has not generated any input for a + * specified number of seconds, and 'active' when the user generates input on an idle system. + */ + const onStateChanged: chrome.events.Event<(newState: IdleState) => void>; } - //////////////////// - // InstanceID - //////////////////// + //////////////// + // InstanceID // + //////////////// /** * Use chrome.instanceID to access the Instance ID service. + * @requires Permissions: 'gcm' * @since Chrome 46 */ namespace instanceID { - /** NOT YET IMPLEMENTED */ + interface TokenParams { + /** + * Identifies the entity that is authorized to access resources associated with this Instance ID. + * It can be a project ID from Google developer console. + */ + authorizedEntity: string; + /** + * Identifies authorized actions that the authorized entity can take. + * E.g. for sending GCM messages, GCM scope should be used. + */ + scope: string; + /** + * Allows including a small number of string key/value pairs that will + * be associated with the token and may be used in processing the request. + */ + options?: { [key: string]: string }; + } + interface DeleteTokenParams { + /** + * The authorized entity that is used to obtain the token. + */ + authorizedEntity: string; + /** + * The scope that is used to obtain the token. + */ + scope: string; + } + /** + * Retrieves an identifier for the app instance. + * The instance ID will be returned by the callback. + * The same ID will be returned as long as the application + * identity has not been revoked or expired. + * @param callback Function called when the retrieval completes. + * It should check runtime.lastError for error when instanceID is empty. + * Will be provided with instanceID: An Instance ID assigned to the app instance. + */ + function getID(callback: (instanceId: string) => void): void; + /** + * Retrieves the time when the InstanceID has been generated. + * The creation time will be returned by the callback. + * @param callback Function called when the retrieval completes. + * It should check runtime.lastError for error when creationTime is zero. + * Provides `creationTime` (double) + * > The time when the Instance ID has been generated, represented in milliseconds since the epoch. + */ + function getCreationTime(callback: (creationTime: number) => void): void; + /** + * Return a token that allows the authorized entity to access the service defined by scope. + * @param getTokenParams Parameters for getToken. + * @param callback Function called when the retrieval completes. It should check runtime.lastError for error when token is empty. + */ + function getToken(getTokenParams: TokenParams, callback: (token: string) => void): void; + /** + * Revokes a granted token. + * @param deleteTokenParams Parameters for deleteToken. + * @param callback Function called when the token deletion completes. + * The token was revoked successfully if runtime.lastError is not set. + */ + function deleteToken(deleteTokenParams: DeleteTokenParams, callback: () => void): void; + /** + * Fired when all the granted tokens need to be refreshed. + * @param callback Function called when the deletion completes. + * The instance identifier was revoked successfully if runtime.lastError is not set. + */ + function deleteID(callback: () => void): void; + /** Fired when all the granted tokens need to be refreshed. */ + const onTokenRefresh: chrome.events.Event<() => void>; + } + + //////////////// + // Management // + //////////////// + /** + * The chrome.management API provides ways to manage the list of extensions/apps + * that are installed and running. It is particularly useful for extensions that + * override the built-in New Tab page. + * @requires Permissions: "management" + */ + namespace management { + /** Information about an installed extension, app, or theme. */ + interface ExtensionInfo { + /** + * Optional. + * A reason the item is disabled. + * @since Chrome 17. + */ + disabledReason?: string; + /** Optional. The launch url (only present for apps). */ + appLaunchUrl?: string; + /** + * The description of this extension, app, or theme. + * @since Chrome 9. + */ + description: string; + /** + * Returns a list of API based permissions. + * @since Chrome 9. + */ + permissions: string[]; + /** + * Optional. + * A list of icon information. Note that this just reflects what was declared in the manifest, and the actual image at that url may be larger or smaller than what was declared, so you might consider using explicit width and height attributes on img tags referencing these images. See the manifest documentation on icons for more details. + */ + icons?: IconInfo[]; + /** + * Returns a list of host based permissions. + * @since Chrome 9. + */ + hostPermissions: string[]; + /** Whether it is currently enabled or disabled. */ + enabled: boolean; + /** + * Optional. + * The URL of the homepage of this extension, app, or theme. + * @since Chrome 11. + */ + homepageUrl?: string; + /** + * Whether this extension can be disabled or uninstalled by the user. + * @since Chrome 12. + */ + mayDisable: boolean; + /** + * How the extension was installed. + * @since Chrome 22. + */ + installType: string; + /** The version of this extension, app, or theme. */ + version: string; + /** The extension's unique identifier. */ + id: string; + /** + * Whether the extension, app, or theme declares that it supports offline. + * @since Chrome 15. + */ + offlineEnabled: boolean; + /** + * Optional. + * The update URL of this extension, app, or theme. + * @since Chrome 16. + */ + updateUrl?: string; + /** + * The type of this extension, app, or theme. + * @since Chrome 23. + */ + type: 'packaged_app' | string; + /** The url for the item's options page, if it has one. */ + optionsUrl: string; + /** The name of this extension, app, or theme. */ + name: string; + /** + * A short version of the name of this extension, app, or theme. + * @since Chrome 31. + */ + shortName: string; + /** + * True if this is an app. + * @deprecated since Chrome 33. Please use management.ExtensionInfo.type. + */ + isApp: boolean; + /** + * Optional. + * The app launch type (only present for apps). + * @since Chrome 37. + */ + launchType?: string; + /** + * Optional. + * The currently available launch types (only present for apps). + * @since Chrome 37. + */ + availableLaunchTypes?: string[]; + } + + /** Information about an icon belonging to an extension, app, or theme. */ + interface IconInfo { + /** The URL for this icon image. To display a grayscale version of the icon (to indicate that an extension is disabled, for example), append ?grayscale=true to the URL. */ + url: string; + /** A number representing the width and height of the icon. Likely values include (but are not limited to) 128, 48, 24, and 16. */ + size: number; + } + + interface UninstallOptions { + /** + * Optional. + * Whether or not a confirm-uninstall dialog should prompt the user. Defaults to false for self uninstalls. If an extension uninstalls another extension, this parameter is ignored and the dialog is always shown. + */ + showConfirmDialog?: boolean; + } + + interface ManagementDisabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> { } + + interface ManagementUninstalledEvent extends chrome.events.Event<(id: string) => void> { } + + interface ManagementInstalledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> { } + + interface ManagementEnabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> { } + + /** + * Enables or disables an app or extension. + * @param id This should be the id from an item of management.ExtensionInfo. + * @param enabled Whether this item should be enabled or disabled. + * @param [callback] + */ + function setEnabled(id: string, enabled: boolean, callback?: () => void): void; + /** + * Returns a list of permission warnings for the given extension id. + * @since Chrome 15. + * @param id The ID of an already installed extension. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function(array of string permissionWarnings) {...}; + */ + function getPermissionWarningsById(id: string, callback?: (permissionWarnings: string[]) => void): void; + /** + * Returns information about the installed extension, app, or theme that has the given ID. + * @param id The ID from an item of management.ExtensionInfo. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionInfo result) {...}; + */ + function get(id: string, callback?: (result: ExtensionInfo) => void): void; + /** + * Returns a list of information about installed extensions and apps. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function(array of ExtensionInfo result) {...}; + */ + function getAll(callback?: (result: ExtensionInfo[]) => void): void; + /** + * Returns a list of permission warnings for the given extension manifest string. + * Note: This function can be used without requesting the 'management' permission in the manifest. + * @param manifestStr Extension manifest JSON string. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function(array of string permissionWarnings) {...}; + */ + function getPermissionWarningsByManifest(manifestStr: string, callback?: (permissionWarnings: string[]) => void): void; + /** + * Launches an application. + * @param id The extension id of the application. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + function launchApp(id: string, callback?: () => void): void; + /** + * Uninstalls a currently installed app or extension. + * @since Chrome 21. + * @param id This should be the id from an item of management.ExtensionInfo. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + function uninstall(id: string, options?: UninstallOptions, callback?: () => void): void; + /** + * Uninstalls a currently installed app or extension. + * @deprecated since Chrome 21. The options parameter was added to this function. + * @param id This should be the id from an item of management.ExtensionInfo. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + function uninstall(id: string, callback?: () => void): void; + /** + * Returns information about the calling extension, app, or theme. Note: This function can be used without requesting the 'management' permission in the manifest. + * @since Chrome 39. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionInfo result) {...}; + */ + function getSelf(callback?: (result: ExtensionInfo) => void): void; + /** + * Uninstalls the calling extension. + * Note: This function can be used without requesting the 'management' permission in the manifest. + * @since Chrome 26. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + function uninstallSelf(options?: UninstallOptions, callback?: () => void): void; + /** + * Uninstalls the calling extension. + * Note: This function can be used without requesting the 'management' permission in the manifest. + * @since Chrome 26. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + function uninstallSelf(callback?: () => void): void; + /** + * Display options to create shortcuts for an app. On Mac, only packaged app shortcuts can be created. + * @since Chrome 37. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + function createAppShortcut(id: string, callback?: () => void): void; + /** + * Set the launch type of an app. + * @since Chrome 37. + * @param id This should be the id from an app item of management.ExtensionInfo. + * @param launchType The target launch type. Always check and make sure this launch type is in ExtensionInfo.availableLaunchTypes, because the available launch types vary on different platforms and configurations. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + function setLaunchType(id: string, launchType: string, callback?: () => void): void; + /** + * Generate an app for a URL. Returns the generated bookmark app. + * @since Chrome 37. + * @param url The URL of a web page. The scheme of the URL can only be "http" or "https". + * @param title The title of the generated app. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionInfo result) {...}; + */ + function generateAppForLink(url: string, title: string, callback?: (result: ExtensionInfo) => void): void; + + /** Fired when an app or extension has been disabled. */ + var onDisabled: ManagementDisabledEvent; + /** Fired when an app or extension has been uninstalled. */ + var onUninstalled: ManagementUninstalledEvent; + /** Fired when an app or extension has been installed. */ + var onInstalled: ManagementInstalledEvent; + /** Fired when an app or extension has been enabled. */ + var onEnabled: ManagementEnabledEvent; } //////////////////// // mDNS //////////////////// /** - * Use the chrome.mdns API to discover services over mDNS. This comprises a subset of the features of the NSD spec: http://www.w3.org/TR/discovery-api/ + * Use the chrome.mdns API to discover services over mDNS. + * This comprises a subset of the features of the NSD spec: + * @see[NSD Spec]{@link http://www.w3.org/TR/discovery-api/} + * @requires Permissions: 'mdns' * @since Chrome 31 */ namespace mdns { - /** NOT YET IMPLEMENTED */ + interface Service { + /** The service name of an mDNS advertised service, .. */ + serviceName: string; + /** The host:port pair of an mDNS advertised service. */ + serviceHostPort: string; + /** The IP address of an mDNS advertised service. */ + ipAddress: string; + /** Metadata for an mDNS advertised service. */ + serviceData: string[]; + } + /** + * The maximum number of service instances that will be + * included in onServiceList events. If more instances + * are available, they may be truncated from the + * onServiceList event. + * @default 2048 + * @since Chrome 44. + */ + const MAX_SERVICE_INSTANCES_PER_EVENT: number; + /** + * Immediately issues a multicast DNS query for all service types. + * |callback| is invoked immediately. + * At a later time, queries will be sent, + * and any service events will be fired. + * @since Chrome 45. + * @param callback Callback invoked after ForceDiscovery() has started. + */ + function forceDiscovery(callback: () => void): void; + /** + * Event fired to inform clients of the current complete + * set of known available services. Clients should only + * need to store the list from the most recent event. + * The service type that the extension is interested in + * discovering should be specified as the event filter + * with the 'serviceType' key. Not specifying an event + * filter will not start any discovery listeners. + */ + const onServiceList: chrome.events.Event<(services: Service[]) => void>; + } //////////////////// // Media Galleries //////////////////// + /** + * Use the chrome.mediaGalleries API to access media files (audio, images, video) + * from the user's local disks (with the user's consent). + * @since Available since Chrome 24. + * @requires Permissions: {'mediaGalleries': ['accessType1' | 'accessType2', ...]} + * {'mediaGalleries': ['accessType1' | 'accessType2', ..., 'allAutoDetected']} + * @see[More information]{@link https://developer.chrome.com/apps/mediaGalleries} + */ namespace mediaGalleries { + type Interactive = + 'no' | + 'yes' | + 'if_needed'; interface MediaFileSystemsOptions { - interactive?: 'no' | 'yes' | 'if_needed'; + /** + * Whether to prompt the user for permission to additional media galleries before returning + * the permitted set. Default is silent. If the value 'yes' is passed, or if the application + * has not been granted access to any media galleries and the value 'if_needed' is passed, + * then the media gallery configuration dialog will be displayed. + * + * **no** + * Do not act interactively. + * **yes** + * Ask the user to manage permitted media galleries. + * **if_needed** + * Ask the user to manage permitted galleries only if the return set would otherwise be empty. + */ + interactive?: Interactive; } - interface MediaFileSystemMetadata { + /** The name of the file system. */ name: string; + /** A unique and persistent id for the media gallery. */ galleryId: string; + /** If the media gallery is on a removable device, a unique id for the device while the device is online. */ deviceId?: string; + /** True if the media gallery is on a removable device. */ isRemovable: boolean; + /** True if the device the media gallery is on was detected as a media device. i.e. a PTP or MTP device, or a DCIM directory is present. */ isMediaDevice: boolean; + /** True if the device is currently available. */ isAvailable: boolean; } + type MetadataOptionsType = + 'all' | + 'mimeTypeAndTags' | + 'mimeTypeOnly'; + interface MetadataOptions { - metadataType: 'all' | 'mimeTypeAndTags' | 'mimeTypeOnly'; + metadataType: MetadataOptionsType; } interface RawTag { + /** + * Describes format of container or codec of stream, i.e. 'mp3' | 'h264'. + */ type: string; + /** + * An unfiltered string->string dictionary of tags for the stream. + */ tags: { [name: string]: string; }; } interface Metadata { - // The browser sniffed mime type. + /** The browser sniffed mime type. */ mimeType: string; - // Defined for images and video. In pixels. - height?: number; - width?: number; - // Defined for images only. - xResolution?: number; - yResolution?: number; - // Defined for audio and video. In seconds. - duration?: number; - // Defined for images and video. In degrees. - rotation?: number; - // Defined for images only. - cameraMake?: string; - cameraModel?: string; - exposureTimeSeconds?: number; - flashFired?: boolean; - fNumber?: number; - focalLengthMm?: number; - isoEquivalent?: number; - // Defined for audio and video only. + /** Defined for images and video. In pixels. */ + height?: integer; + width?: integer; + /** Defined for audio and video. In seconds. */ + duration?: integer; + /** Defined for images and video. In degrees. */ + rotation?: integer; + /** Defined for audio and video only. */ album?: string; artist?: string; comment?: string; @@ -2783,9 +4671,16 @@ declare namespace chrome { language?: string; title?: string; track?: number; - // All the metadata in the media file. For formats with multiple streams, stream order will be preserved. Container metadata is the first element. + /** + * All the metadata in the media file. + * For formats with multiple streams, stream order will be preserved. + * Container metadata is the first element. + */ rawTags: RawTag[]; - // The images embedded in the media file's metadata. This is most often used for album art or video thumbnails. + /** + * The images embedded in the media file's metadata. + * This is most often used for album art or video thumbnails. + */ attachedImages: Blob[]; } @@ -2794,167 +4689,793 @@ declare namespace chrome { success: boolean; } + type GalleryChangedType = + 'contents_changed' | + 'watch_dropped'; + interface GalleryChangedEventArgs { - type: 'contents_changed' | 'watch_dropped'; + type: GalleryChangedType; galleryId: string; } + type ScanProgressType = + 'start' | + 'cancel' | + 'finish' | + 'error'; + interface ScanProgressEventArgs { - // The type of progress event, i.e. start, finish, etc. - type: 'start' | 'cancel' | 'finish' | 'error'; - // The number of Galleries found. - galleryCount?: number; - // Appoximate number of media files found; some file types can be either audio or video and are included in both counts. - audioCount?: number; - imageCount?: number; - videoCount?: number; + /** The type of progress event, i.e. start, finish, etc. */ + type: ScanProgressType; + /** The number of Galleries found. */ + galleryCount?: integer; + /** + * Appoximate number of media files found; + * some file types can be either audio or video + * and are included in both counts. + */ + audioCount?: integer; + imageCount?: integer; + videoCount?: integer; } - export function getMediaFileSystems(callback: (mediaFileSystems: FileSystem[]) => void): void; - export function getMediaFileSystems(options: MediaFileSystemsOptions, callback: (mediaFileSystems: FileSystem[]) => void): void; - export function addUserSelectedFolder(callback: (mediaFileSystems: FileSystem[], selectedFileSystemName: string) => void): void; - export function dropPermissionForMediaFileSystem(galleryId: string, callback?: () => void): void; - export function startMediaScan(): void; - export function cancelMediaScan(): void; - export function addScanResults(callback: (mediaFileSystems: FileSystem[]) => void): void; - export function getMediaFileSystemMetadata(mediaFileSystem: FileSystem): MediaFileSystemMetadata; - export function getAllMediaFileSystemMetadata(callback: (metadatas: MediaFileSystemMetadata[]) => void): void; - export function getMetadata(mediaFile: Blob, callback: (metadata: Metadata) => void): void; - export function getMetadata(mediaFile: Blob, options: MetadataOptions, callback: (metadata: Metadata) => void): void; - export function addGalleryWatch(galleryId: string, callback: (result: GalleryWatchResult) => void): void; - export function removeGalleryWatch(galleryId: string): void; - export function getAllGalleryWatch(callback: (galleryIds: string[]) => void): void; - export function removeAllGalleryWatch(): void; - - export var onGalleryChanged: chrome.events.Event<(args: GalleryChangedEventArgs) => void>; - export var onScanProgress: chrome.events.Event<(args: ScanProgressEventArgs) => void>; + /** + * Get the media galleries configured in this user agent. + * If none are configured or available, the callback will receive an empty array. + */ + function getMediaFileSystems(callback: (mediaFileSystems: FileSystem[]) => void): void; + /** + * Get the media galleries configured in this user agent. + * If none are configured or available, the callback will receive an empty array. + */ + function getMediaFileSystems(options: MediaFileSystemsOptions, callback: (mediaFileSystems: FileSystem[]) => void): void; + /** + * Present a directory picker to the user and add the selected directory as a gallery. + * If the user cancels the picker, selectedFileSystemName will be empty. + * A user gesture is required for the dialog to display. + * Without a user gesture, the callback will run as though the user canceled. + * @since Since Chrome 34. + */ + function addUserSelectedFolder(callback: (mediaFileSystems: FileSystem[], selectedFileSystemName: string) => void): void; + /** + * @deprecated Deprecated since Chrome 51. The user can manually drop access to galleries via the permissions dialog. + * @description Give up access to a given media gallery. + */ + function dropPermissionForMediaFileSystem(galleryId: string, callback?: () => void): void; + /** + * @deprecated Deprecated since Chrome 51. The mediaGalleries API no longer supports scanning. + * @description + * Start a scan of the user's hard disks for directories containing media. + * The scan may take a long time so progress and completion is communicated by events. + * No permission is granted as a result of the scan, see addScanResults. + */ + function startMediaScan(): void; + /** + * @deprecated Deprecated since Chrome 51. The mediaGalleries API no longer supports scanning. + * @description + * Cancel any pending media scan. + * Well behaved apps should provide a way for the user to cancel scans they start. + */ + function cancelMediaScan(): void; + /** + * @deprecated Deprecated since Chrome 51. The mediaGalleries API no longer supports scanning. + * @description + * Show the user the scan results and let them add any or all of them as galleries. + * This should be used after the 'finish' onScanProgress() event has happened. + * All galleries the app has access to are returned, not just the newly added galleries. + */ + function addScanResults(callback: (mediaFileSystems: FileSystem[]) => void): void; + /** + * Get metadata about a specific media file system + * @since Since Chrome 26. + */ + function getMediaFileSystemMetadata(mediaFileSystem: FileSystem): MediaFileSystemMetadata; + /** + * @deprecated Deprecated since Chrome 51. Use getMediaFileSystemMetadata instead + * Get metadata for all available media galleries. + */ + function getAllMediaFileSystemMetadata(callback: (metadatas: MediaFileSystemMetadata[]) => void): void; + /** + * Gets the media-specific metadata for a media file. + * This should work for files in media galleries as well as other DOM filesystems. + * @since Chrome 38. + */ + function getMetadata(mediaFile: Blob, callback: (metadata: Metadata) => void): void; + /** + * Gets the media-specific metadata for a media file. + * This should work for files in media galleries as well as other DOM filesystems. + * @since Chrome 38. + */ + function getMetadata(mediaFile: Blob, options: MetadataOptions, callback: (metadata: Metadata) => void): void; + /** + * Adds a gallery watch for the gallery with the specified gallery ID. + * The given callback is then fired with a success or failure result. + * @since Chrome 39. + */ + function addGalleryWatch(galleryId: string, callback: (result: GalleryWatchResult) => void): void; + /** + * Removes a gallery watch for the gallery with the specified gallery ID. + * @since Chrome 39. + */ + function removeGalleryWatch(galleryId: string): void; + /** + * @deprecated Deprecated since Chrome 51. Applications should store their own gallery watches as they are added. + * Notifies which galleries are being watched via the given callback. + */ + function getAllGalleryWatch(callback: (galleryIds: string[]) => void): void; + /** + * @deprecated Deprecated since Chrome 51. Use removeGalleryWatch instead. + * Removes all gallery watches. + */ + function removeAllGalleryWatch(): void; + /** + * Fired when a media gallery is changed or a gallery watch is dropped + * @since Since Chrome 38. + */ + const onGalleryChanged: chrome.events.Event<(args: GalleryChangedEventArgs) => void>; + /** + * @deprecated Deprecated since Chrome 51. The mediaGalleries API no longer supports scanning. + * The pending media scan has changed state. See details for more information. + */ + const onScanProgress: chrome.events.Event<(args: ScanProgressEventArgs) => void>; } //////////////////////////////////// // Open Network Configuration (ONC) //////////////////////////////////// /** - * The chrome.networking.onc API is used for configuring network connections (Cellular, Ethernet, VPN, WiFi or WiMAX). This API is available in Chrome OS kiosk sessions. - * Network connection configurations are specified following Open Network Configuration (ONC) specification. - * NOTE: Most dictionary properties and enum values use UpperCamelCase to match the ONC specification instead of the JavaScript lowerCamelCase convention. + * @requires(CrOS kiosk mode) This API is available in Chrome OS kiosk sessions. + * @requires Permissions: 'networking.onc' + * @since Since Chrome 59 + * @description + * The chrome.networking.onc API is used for configuring network connections + * (Cellular, Ethernet, VPN, WiFi or WiMAX). + * Network connection configurations are specified following + * @see[Open Network Configuration (ONC) specification.]{@link https://chromium.googlesource.com/chromium/src/+/master/components/onc/docs/onc_spec.md} + * @description + * **NOTE** + * Most dictionary properties and type values use UpperCamelCase to match + * the ONC specification instead of the JavaScript lowerCamelCase convention. */ namespace networking.onc { - export type ActivationStateType = 'Activated' | 'Activating' | 'NotActivated' | 'PartiallyActivated'; - export type CaptivePortalStatus = 'Unknown' | 'Offline' | 'Online' | 'Portal' | 'ProxyAuthRequired'; - export type ConnectionStateType = 'Connected' | 'Connecting' | 'NotConnected'; - export type IPConfigType = 'DHCP' | 'Static'; - export type NetworkType = 'All' | 'Cellular' | 'Ethernet' | 'VPN' | 'Wireless' | 'WiFi' | 'WiMAX'; - export type ProxySettingsType = 'Direct' | 'Manual' | 'PAC' | 'WPAD'; - interface ManagedBoolean { - /** - * @description The active value currently used by the network configuration manager (e.g. Shill). - * @type {boolean} - * @memberof ManagedBoolean - */ - Active?: boolean, - /** - * @description The source from which the effective property value was determined. - * @type {string} - * @memberof ManagedBoolean - */ - Effective?: string, - /** - * @description The property value provided by the user policy. - * @type {boolean} - * @memberof ManagedBoolean - */ - UserPolicy?: boolean, - /** - * @description The property value provided by the device policy. - * @type {boolean} - * @memberof ManagedBoolean - */ - DevicePolicy?: boolean, - /** - * @description The property value set by the logged in user. Only provided if |UserEditable| is true. - * @type {boolean} - * @memberof ManagedBoolean - */ - UserSettings?: boolean, - /** - * @description The value set for all users of the device. Only provided if |DeviceEditiable| is true. - * @type {boolean} - * @memberof ManagedBoolean - */ - SharedSettings?: boolean, - /** - * @description Whether a UserPolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false. - * @type {boolean} - * @memberof ManagedBoolean - */ - UserEditable?: boolean, - /** - * @description Whether a DevicePolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false. - * @type {boolean} - * @memberof ManagedBoolean - */ - DeviceEditable?: boolean + type ActivationStateType = 'Activated' | 'Activating' | 'NotActivated' | 'PartiallyActivated'; + type CaptivePortalStatus = 'Unknown' | 'Offline' | 'Online' | 'Portal' | 'ProxyAuthRequired'; + type ConnectionStateType = 'Connected' | 'Connecting' | 'NotConnected' + type IPConfigType = 'DHCP' | 'Static' + type NetworkType = 'All' | 'Cellular' | 'Ethernet' | 'VPN' | 'Wireless' | 'WiFi' | 'WiMAX' + type ProxySettingsType = 'Direct' | 'Manual' | 'PAC' | 'WPAD'; + /** + * Partial classes for internal use + * @internal + * @private + */ + namespace _internal_ { + type ObjectFunction = 'unknown' | 'getter' | 'setter'; + interface NetworkConfigBase< + M extends ManagedObject = 'unmanaged', + IF extends InterfaceType = 'full', + OF extends ObjectFunction = 'unknown'> { + /** For cellular networks, cellular network properties. */ + Cellular?: IF extends 'partial' ? CellularBase : CellularProperties; + /** For Ethernet networks, the Ethernet network properties. */ + Ethernet?: IF extends 'partial' ? { Authentication: string; } : EthernetProperties; + /** The network GUID. */ + GUID?: string; + /** The network's IP address configuration type. */ + IPAddressConfigType?: M extends 'managed' ? ManagedIPConfigType : IPConfigType; + /** A user friendly network name. */ + Name?: M extends 'managed' ? ManagedDOMString : string; + /** The IP configuration type for the name servers used by the network. */ + NameServersConfigType?: M extends 'managed' ? ManagedIPConfigType : IPConfigType; + /** The network priority. */ + Priority?: M extends 'managed' ? ManagedLong : integer; + /** The network type. */ + Type?: NetworkType; + /** For VPN networks, the network VPN properties. */ + VPN?: IF extends 'partial' ? { Type: string; } : VPNProperties; + /** For WiFi networks, the network WiFi properties. */ + WiFi?: IF extends 'partial' ? WiFiPropertiesBase : WiFiProperties; + /** For WiMAX networks, the network WiMAX properties. */ + WiMAX?: IF extends 'partial' ? { SignalStrength?: integer } : WiMAXProperties; + } } - interface ManagedLong { + interface ManagedType { + /** The active value currently used by the network configuration manager (e.g. Shill). */ + Active?: T; + /** The source from which the effective property value was determined. */ + Effective?: string; + /** The property value provided by the user policy. */ + UserPolicy?: T; + /** The property value provided by the device policy. */ + DevicePolicy?: T; + /** The property value set by the logged in user. Only provided if *UserEditable* is true. */ + UserSetting?: T; + /** The value set for all users of the device. Only provided if *DeviceEditiable* is true. */ + SharedSetting?: T; /** - * @description The active value currently used by the network configuration manager (e.g. Shill). - * @type {number} - * @memberof ManagedLong + * Whether a UserPolicy for the property exists and allows the property + * to be edited (i.e. the policy set recommended property value). + * @default false */ - Active?: number, + UserEditable?: boolean; /** - * @description The source from which the effective property value was determined. - * @type {string} - * @memberof ManagedLong + * Whether a DevicePolicy for the property exists and allows the property + * to be edited (i.e. the policy set recommended property value). + * @default false */ - Effective?: string, - /** - * @description The property value provided by the user policy. - * @type {number} - * @memberof ManagedLong - */ - UserPolicy?: number, - /** - * @description The property value provided by the device policy. - * @type {number} - * @memberof ManagedLong - */ - DevicePolicy?: number, - /** - * @description The property value set by the logged in user. Only provided if |UserEditable| is true. - * @type {number} - * @memberof ManagedLong - */ - UserSettings?: number, - /** - * @description The value set for all users of the device. Only provided if |DeviceEditiable| is true. - * @type {number} - * @memberof ManagedLong - */ - SharedSettings?: number, - /** - * @description Whether a UserPolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false. - * @type {boolean} - * @memberof ManagedLong - */ - UserEditable?: boolean, - /** - * @description Whether a DevicePolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false. - * @type {boolean} - * @memberof ManagedLong - */ - DeviceEditable?: boolean + DeviceEditable?: boolean; } + interface ManagedBoolean extends ManagedType { } + interface ManagedLong extends ManagedType { } + interface ManagedDOMString extends ManagedType { } + interface ManagedDOMStringList extends ManagedType { } + interface ManagedIPConfigType extends ManagedType { } + + interface CellularProviderProperties { + /** The operator name. */ + Name: string; + /** Cellular network ID as a simple concatenation of the network's MCC (Mobile Country Code) and MNC (Mobile Network Code). */ + Code: string; + /** The two-letter country code. */ + Country?: string; + } + interface IssuerSubjectPattern { + /** If set, the value against which to match the certificate subject's common name. */ + CommonName?: string; + /** If set, the value against which to match the certificate subject's common location. */ + Locality?: string; + /** + * If set, the value against which to match the certificate subject's organizations. + * At least one organization should match the value. + */ + Organization?: string; + /** + * If set, the value against which to match the certificate subject's organizational units. + * At least one organizational unit should match the value. + */ + OrganizationalUnit?: string; + } + interface CertPattern { + /** + * List of URIs to which the user can be directed in case + * no certificates that match this pattern are found. + */ + EnrollmentURI?: string[]; + /** + * If set, pattern against which X.509 issuer settings should be matched. + */ + Issuer?: IssuerSubjectPattern; + /** + * List of certificate issuer CA certificates. + * A certificate must be signed by one of them in order to match this pattern. + */ + IssuerCARef?: string[]; + /** + * If set, pattern against which X.509 subject settings should be matched. + */ + IssuerSubjectPattern?: IssuerSubjectPattern; + } + type ClientCertType = 'Ref' | 'Pattern'; + interface EAPProperties { + AnonymousIdentity?: string; + ClientCertPattern?: CertPattern; + /** @since Chrome 60. */ + ClientCertPKCS11Id?: string; + ClientCertRef?: string; + ClientCertType?: ClientCertType; + Identity?: string; + Inner?: string; + /** The outer EAP type. Required by ONC, but may not be provided when translating from Shill. */ + Outer?: string; + Password?: string; + SaveCredentials?: boolean; + ServerCAPEMs?: string[]; + ServerCARefs?: string[]; + /** @since Chrome 60. */ + SubjectMatch?: ManagedDOMString; + UseProactiveKeyCaching?: boolean; + UseSytemCAs?: boolean; + } + interface FoundNetworkProperties { + /** Network availability. */ + Status: string; + /** Network ID. */ + NetworkId: string; + /** Access technology used by the network. */ + Technology: string; + /** The network operator's short-format name. */ + ShortName?: string; + /** The network operator's long-format name. */ + LongName?: string; + } + type IPConfigurationType = 'IPv4' | 'IPv6'; + interface IPConfigProperties { + /** Gateway address used for the IP configuration. */ + Gateway?: S; + /** The IP address for a connection. Can be IPv4 or IPv6 address, depending on value of Type. */ + IPAddress?: S; + /** Array of addresses used for name servers. */ + NameServers?: SL; + /** The routing prefix. */ + RoutingPrefix?: L; + /** The IP configuration type. Can be IPv4 or IPv6. */ + Type?: M extends 'managed' ? ManagedType : IPConfigurationType; + /** The URL for WEb Proxy Auto-Discovery, as reported over DHCP. */ + WebProxyAutoDiscoveryUrl?: S; + } + interface PaymentPortalPost { + /** The HTTP method to use for the payment portal. */ + Method: 'POST'; + /** The post data to send to the payment portal. */ + PostData?: string; + /** The payment portal URL. */ + Url?: string; + } + interface PaymentPortal { + /** The HTTP method to use for the payment portal. */ + Method: string; + /** The payment portal URL. */ + Url?: string; + } + interface ProxyLocation { + /** The proxy IP address host. */ + Host?: string; + /** The port to use for the proxy */ + Port?: integer; + } + interface ManagedProxyLocation { + /** The proxy IP address host. */ + Host?: ManagedDOMString; + /** The port to use for the proxy */ + Port?: ManagedLong; + } + interface ManualProxySettings { + /** Settings for HTTP proxy. */ + HTTPProxy?: P; + /** Settings for secure HTTP proxy. */ + SecureHTTPProxy?: P; + /** Settings for FTP proxy. */ + FTPProxy?: P; + /** Settings for SOCKS proxy. */ + SOCKS?: P; + } + interface ProxySettings { + /** The type of proxy settings. */ + Type: M extends 'managed' ? ManagedType : ProxySettingsType; + /** Manual proxy settings - used only for *Manual* proxy settings. */ + Manual?: ManualProxySettings; + /** Domains and hosts for which manual proxy settings are excluded. */ + ExcludeDomains?: SL; + /** URL for proxy auto-configuration file. */ + PAC?: S; + } + interface SIMLockStatus { + /** The status of SIM lock - possible values are 'sim-pin', 'sim-puk' and ''. */ + LockType: 'sim-pin' | 'sim-puk' | ''; + /** Whether SIM lock is enabled. */ + LockEnabled: boolean; + /** Number of PIN lock tries allowed before PUK is required to unlock the SIM. */ + RetriesLeft?: integer; + } + interface ThirdPartyVPNProperties { + /** ID of the third-party VPN provider extension. */ + ExtensionID: string; + /** The VPN provider name. */ + ProviderName?: string; + } + interface ManagedThirdPartyVPNProperties { + /** ID of the third-party VPN provider extension. */ + ExtensionID: ManagedDOMString; + /** The VPN provider name. */ + ProviderName?: string; + } + interface CellularBase { + /** Carrier account activation state. */ + ActivationState?: ActivationStateType; + /** If the modem is registered on a network, the network technology currently in use. */ + NetworkTechnology?: string; + /** The roaming state of the cellular modem on the current network. */ + RoamingState?: string; + /** Whether a SIM card is present. */ + SIMPresent?: boolean; + /** The current network signal strength. */ + SignalStrength?: integer; + } + interface CellularProperties extends CellularBase { + /** Whether the cellular network should be connected automatically (when in range). */ + AutoConnect?: M extends 'managed' ? ManagedBoolean : boolean; + /** The cellular network activation type. */ + ActivationType?: string; + /** Whether roaming is allowed for the network. */ + AllowRoaming?: boolean; + /** The name of the carrier for which the cellular device is configured. */ + Carrier?: M extends 'managed' ? ManagedDOMString : string; + /** Cellular device technology family - CDMA or GSM. */ + Family?: 'CDMA' | 'GSM'; + /** The firmware revision loaded in the cellular modem. */ + FirmwareRevision?: string; + /** The list of networks found during the most recent network scan. */ + FoundNetworks?: FoundNetworkProperties[]; + /** The cellular modem hardware revision. */ + HardwareRevision?: string; + /** Information about the operator that issued the SIM card currently installed in the modem. */ + HomeProvider?: CellularProviderProperties; + /** The cellular modem manufacturer. */ + MAnufacturer?: string; + /** The cellular modem model ID. */ + ModelID?: string; + /** Online payment portal a user can use to sign-up for or modify a mobile data plan. */ + PaymentPortal?: PaymentPortal | PaymentPortalPost; + /** The revision of the Preferred Roaming List loaded in the modem. */ + PRLVersion?: integer; + /** + * @since Chrome 63. + * True when a cellular network scan is in progress. + */ + Scanning?: boolean; + /** Information about the operator on whose network the modem is currently registered. */ + ServingOperator?: CellularProviderProperties; + /** The state of SIM lock for GSM family networks. */ + SIMLockStatus?: SIMLockStatus; + /** Whether the cellular network supports scanning. */ + SupportNetworkScan?: boolean; + /** A list of supported carriers. */ + SupportedCarriers?: string[]; + } + type EthernetAuthenticationType = 'None' | '8021X'; + interface EthernetProperties { + /** Whether the Ethernet network should be connected automatically. */ + AutoConnect?: M extends 'managed' ? ManagedBoolean : boolean; + /** The authentication used by the Ethernet network. Possible values are None and 8021X. */ + Authentication?: M extends 'managed' ? ManagedType : EthernetAuthenticationType; + /** Network's EAP settings. Required for 8021X authentication. */ + EAP?: EAPProperties; + } + interface VPNProperties { + /** Whether the VPN network should be connected automatically. */ + AutoConnect?: B; + /** The VPN host. */ + Host?: S; + /** + * The VPN type. + * This cannot be an enum because of 'L2TP-IPSec'. + * This is optional for NetworkConfigProperties which is passed to + * *setProperties* which may be used to set only specific properties. + */ + Type?: S; + } + interface WiFiPropertiesBase { + /** The BSSID of the associated access point.. */ + BSSID?: string; + /** + * The WiFi service operating frequency in MHz. + * For connected networks, the current frequency on which the network is connected. + * Otherwise, the frequency of the best available BSS. + */ + Frequency?: integer; + /** HEX-encoded copy of the network SSID. */ + HexSSID?: S; + /** The network security type. */ + Security?: S; + /** The network SSID. */ + SSID?: S; + /** The network signal strength. */ + SignalStrength?: integer; + } + interface WiFiProperties + extends WiFiPropertiesBase { + /** + * Whether ARP polling of default gateway is allowed. + * @default true + */ + AllowGatewayARPPolling?: B; + /** Whether the WiFi network should be connected automatically when in range. */ + AutoConnect?: B; + /** The network EAP properties. Required for WEP-8021X and WPA-EAP networks. */ + EAP?: EAPProperties; + /** Contains all operating frequency recently seen for the WiFi network. */ + FrequencyList?: integer[]; + /** Whether the network SSID will be broadcast. */ + HiddenSSID?: B; + /** Signal-to-noise value (in dB) below which roaming to a new network should be attempted. */ + RoamTreshold?: L; + /** + * @since Chrome 66. + * The passphrase for WEP/WPA/WPA2 connections. + * *This property can only be set!* + */ + Passphrase?: OF extends 'setter' ? string : never; + } + interface WiMAXProperties { + /** Whether the network should be connected automatically. */ + AutoConnect?: B; + /** The network EAP properties. */ + EAP?: EAPProperties; + /** The network signal strength. */ + SignalStrength?: integer; + } + type ManagedObject = 'managed' | 'unmanaged'; + type InterfaceType = 'partial' | 'full'; + + interface NetworkConfigProperties + extends _internal_.NetworkConfigBase<'unmanaged', 'full', OF> { } + + interface NetworkProperties< + M extends ManagedObject = 'unmanaged', + IF extends InterfaceType = 'full'> extends _internal_.NetworkConfigBase { + /** Whether the network is connectable. */ + Connectable?: boolean; + /** The network's current connection state. */ + ConnectionState?: ConnectionStateType; + /** The last recorded network error state. */ + ErrorState?: string; + /** The network's IP configuration. */ + IPConfigs?: IPConfigProperties[]; + /** The network's MAC address. */ + MacAddress?: string; + /** The network's proxy settings. */ + ProxySettings?: ProxySettings; + /** + * For a connected network, whether the network connectivity to the Internet is limited, + * e.g. if the network is behind a portal, or a cellular network is not activated. + */ + RestrictedConnectivity?: boolean; + /** The network's static IP configuration. */ + StaticIPConfig?: IPConfigProperties; + /** IP configuration that was received from the DHCP server before applying static IP configuration. */ + SavedIPConfig?: IPConfigProperties; + /** + * Indicates whether and how the network is configured. + * 'None' conflicts with extension code generation, + * so we must use a string for 'Source' instead of a SourceType enum. + */ + Source?: 'Device' | 'DevicePolicy' | 'User' | 'UserPolicy' | 'None'; + } + interface ManagedProperties extends NetworkProperties<'managed'> { } + interface NetworkStateProperties extends NetworkProperties<'unmanaged', 'partial'> { } + + /** Describes which networks to return. */ + interface Filter { + /** The type of networks to return. */ + networkType: NetworkType; + /** + * If true, only include visible (physically connected or in-range) networks. + * @default false + */ + visible?: boolean; + /** + * If true, only include configured (saved) networks. + * @default false + */ + configured?: boolean; + /** + * Maximum number of networks to return. + * Use 0 for no limit + * @default 1000 if unspecified. + * */ + limit?: integer; + } + + /* The current state of the device. */ + type DeviceState = 'Uninitialized' | 'Disabled' | 'Enabling' | 'Enabled' | 'Prohibited'; + + /** A list of devices and their state. */ + interface DeviceStates { + /** Set if the device is enabled. True if the device is currently scanning. */ + Scanning?: boolean; + /** The SIM lock status if Type = Cellular and SIMPresent = True. */ + SIMLockStatus?: SIMLockStatus; + /** Set to the SIM present state if the device type is Cellular. */ + SIMPresent?: boolean; + /** + * The current state of the device. + * + * **Uninitialized** + * - Device is available but not initialized. + * **Disabled** + * - Device is initialized but not enabled. + * **Enabling** + * - Enabled state has been requested but has not completed. + * **Enabled** + * - Device is enabled. + * **Prohibited** + * - Device is prohibited. + */ + State: DeviceState; + /** The network type associated with the device (Cellular, Ethernet, WiFi, or WiMAX). */ + Type: NetworkType; + } + + interface GlobalPolicy { + /** + * If true, only policy networks may auto connect. + * @default false + */ + AllowOnlyPolicyNetworksToAutoconnect?: boolean; + /** + * If true, only policy networks may be connected to + * and no new networks may be added or configured. + * @default false + */ + AllowOnlyPolicyNetworksToConnect?: boolean; + /** + * List of blacklisted networks. + * Connections to blacklisted networks are prohibited. + * Networks can be whitelisted again by specifying an explicit network configuration. + * @default [] + */ + BlacklistedHexSSIDs?: string[]; + } + + /** + * Gets all the properties of the network with id *networkGuid*. + * Includes all properties of the network (read-only and read/write values). + * @param networkGuid The GUID of the network to get properties for. + * @param callback Called with the network properties when received. + */ + function getProperties(networkGuid: string, callback: (result: NetworkProperties) => void): void; + /** + * Gets the merged properties of the network with id networkGuid from the sources: + * User settings, shared settings, user policy, device policy and the currently active settings. + * @param networkGuid The GUID of the network to get properties for. + * @param callback Called with the managed network properties when received. + */ + function getManagedProperties(networkGuid: string, callback: (result: ManagedProperties) => void): void; + /** + * Gets the cached read-only properties of the network with id *networkGuid*. + * This is meant to be a higher performance function than *getProperties*, + * which requires a round trip to query the networking subsystem. + * The following properties are returned for all networks: + * GUID, Type, Name, WiFi.Security. + * Additional properties are provided for visible networks: + * ConnectionState, ErrorState, WiFi.SignalStrength, + * Cellular.NetworkTechnology, Cellular.ActivationState, Cellular.RoamingState. + * @param networkGuid The GUID of the network to get properties for. + * @param callback Called immediately with the network state properties. + */ + function getState(networkGuid: string, callback: (result: NetworkStateProperties) => void): void; + /** + * Sets the properties of the network with id *networkGuid*. + * This is only valid for configured networks (Source != None). + * Unconfigured visible networks should use **createNetwork** instead. + * **In kiosk sessions, calling this method on a shared network will fail.** + * @param networkGuid The GUID of the network to set properties for. + * @param properties The properties to set. + * @param [callback] Called when the operation has completed. + */ + function setProperties(networkGuid: string, properties: NetworkConfigProperties<'setter'>, callback?: () => void): void; + /** + * Creates a new network configuration from properties. + * If a matching configured network already exists, this will fail. + * Otherwise returns the GUID of the new network. + * @param shared If true, share this network configuration with other users. + * Note: This option is exposed only to Chrome's Web UI. + * When called by apps, false is the only allowed value. + * @param properties The properties to configure the new network with. + * @param [callback] Called with the GUID for the new network configuration once the network has been created. + */ + function createNetwork(shared: false, properties: NetworkConfigProperties<'setter'>, callback?: () => void): void; + /** + * Forgets a network configuration by clearing any configured properties for the network with GUID networkGuid. + * This may also include any other networks with matching identifiers (e.g. WiFi SSID and Security). + * If no such configuration exists, an error will be set and the operation will fail. + * **In kiosk sessions, this method will not be able to forget shared network configurations.** + * @param networkGuid The GUID of the network to forget. + * @param [callback] Called when the operation has completed. + */ + function forgetNetwork(networkGuid: string, callback?: () => void): void; + /** + * Returns a list of network objects with the same properties provided by *getState*. + * A filter is provided to specify the type of networks returned and to limit the number of networks. + * Networks are ordered by the system based on their priority, with connected or connecting networks listed first. + * @param callback Called with a dictionary of networks and their state properties when received. + */ + function getNetworks(filter: Filter, callback: (result: NetworkStateProperties[]) => void): void; + /** + * Returns states of available networking devices. + * @param callback Called with a list of devices and their state. + */ + function getDeviceStates(callback: (result: DeviceStates[]) => void): void; + /** + * Enables any devices matching the specified network type. + * Note, the type might represent multiple network types (e.g. 'Wireless'). + * @param networkType The type of network to enable. + */ + function enableNetworkType(networkType: NetworkType): void; + /** + * Disables any devices matching the specified network type. + * Note, the type might represent multiple network types (e.g. 'Wireless'). + * @param networkType The type of network to disable. + */ + function disableNetworkType(networkType: NetworkType): void; + /** + * Requests that the networking subsystem scan for new networks and update the list returned by *getVisibleNetworks*. + * This is only a request: the network subsystem can choose to ignore it. + * If the list is updated, then the *onNetworkListChanged* event will be fired. + */ + function requestNetworkScan(): void; + /** + * Requests that the networking subsystem scan for new networks and update the list returned by *getVisibleNetworks*. + * This is only a request: the network subsystem can choose to ignore it. + * If the list is updated, then the *onNetworkListChanged* event will be fired. + * @param networkType If provided, requests a scan specific to the type. For Cellular a mobile network scan will be requested if supported. + * @since Chrome 63. + */ + function requestNetworkScan(networkType: NetworkType): void; + /** + * @description Starts a connection to the network with networkGuid. + * @param networkGuid The GUID of the network to connect to. + * @param [callback] Creates a new network configuration from properties. + * If a matching configured network already exists, this will fail. + * Otherwise returns the GUID of the new network. + */ + function startConnect(networkGuid: string, callback?: () => void): void; + /** + * @description Starts a disconnect from the network with networkGuid. + * @param networkGuid The GUID of the network to connect to. + * @param [callback] Called when the disconnect request has been sent. See note for *startConnect*. + */ + function startDisconnect(networkGuid: string, callback?: () => void): void; + /** + * Returns captive portal status for the network matching 'networkGuid'. + * @param networkGuid The GUID of the network to get captive portal status for. + * @param callback A callback function that returns the results of the query for network captive portal status. + */ + function getCaptivePortalStatus(networkGuid: string, callback: (result: CaptivePortalStatus) => void): void; + /** + * Gets the global policy properties. + * These properties are not expected to change during a session. + */ + function getGlobalPolicy(callback: (result: GlobalPolicy) => void): void; + + // + // EVENTS + // + + /** + * Fired when the properties change on any of the networks. + * Sends a list of GUIDs for networks whose properties have changed. + */ + const onNetworksChanged: chrome.events.Event<(changes: string[]) => void>; + /** + * Fired when the list of networks has changed. Sends a complete list of GUIDs for all the current networks. + */ + const onNetworkListChanged: chrome.events.Event<(changes: string[]) => void>; + /** + * Fired when the list of devices has changed or any device state properties have changed. + */ + const onDeviceStateListChanged: chrome.events.Event<() => void>; + /** + * Fired when a portal detection for a network completes. + * Sends the GUID of the network and the corresponding captive portal status. + */ + const onPortalDetectionCompleted: chrome.events.Event<(networkGuid: string, status: CaptivePortalStatus) => void>; } - //////////////////// - // Notifications - // https://developer.chrome.com/extensions/notifications - //////////////////// + /////////////////// + // Notifications // + /////////////////// /** - * Use the chrome.notifications API to create rich notifications using templates and show these notifications to users in the system tray. - * Permissions: 'notifications' + * Use the chrome.notifications API to create rich notifications using + * templates and show these notifications to users in the system tray. + * @requires Permissions: 'notifications' * @since Chrome 28. + * @see[Docs]{@link https://developer.chrome.com/extensions/notifications} */ namespace notifications { interface ButtonOptions { @@ -2970,7 +5491,7 @@ declare namespace chrome { } interface NotificationOptions { - /** Optional. Which type of notification to display. Required for notifications.create method. */ + /** Which type of notification to display. Required for notifications.create method. */ type?: string; /** * Optional. @@ -2978,9 +5499,9 @@ declare namespace chrome { * URLs can be a data URL, a blob URL, or a URL relative to a resource within this extension's .crx file Required for notifications.create method. */ iconUrl?: string; - /** Optional. Title of the notification (e.g. sender name for email). Required for notifications.create method. */ + /** Title of the notification (e.g. sender name for email). Required for notifications.create method. */ title?: string; - /** Optional. Main notification content. Required for notifications.create method. */ + /** Main notification content. Required for notifications.create method. */ message?: string; /** * Optional. @@ -2988,13 +5509,13 @@ declare namespace chrome { * @since Chrome 31. */ contextMessage?: string; - /** Optional. Priority ranges from -2 to 2. -2 is lowest priority. 2 is highest. Zero is default. */ + /** Priority ranges from -2 to 2. -2 is lowest priority. 2 is highest. Zero is default. */ priority?: number; - /** Optional. A timestamp associated with the notification, in milliseconds past the epoch (e.g. Date.now() + n). */ + /** A timestamp associated with the notification, in milliseconds past the epoch (e.g. Date.now() + n). */ eventTime?: number; - /** Optional. Text and icons for up to two notification action buttons. */ + /** Text and icons for up to two notification action buttons. */ buttons?: ButtonOptions[]; - /** Optional. Items for multi-item notifications. */ + /** Items for multi-item notifications. */ items?: ItemOptions[]; /** * Optional. @@ -3014,7 +5535,7 @@ declare namespace chrome { * @since Chrome 38. */ appIconMaskUrl?: string; - /** Optional. A URL to the image thumbnail for image-type notifications. URLs have the same restrictions as iconUrl. */ + /** A URL to the image thumbnail for image-type notifications. URLs have the same restrictions as iconUrl. */ imageUrl?: string; /** * Indicates that the notification should remain visible on screen until the user activates or dismisses the notification. @@ -3035,21 +5556,21 @@ declare namespace chrome { interface NotificationShowSettingsEvent extends chrome.events.Event<() => void> { } /** The notification closed, either by the system or by user action. */ - export var onClosed: NotificationClosedEvent; + const onClosed: NotificationClosedEvent; /** The user clicked in a non-button area of the notification. */ - export var onClicked: NotificationClickedEvent; + const onClicked: NotificationClickedEvent; /** The user pressed a button in the notification. */ - export var onButtonClicked: NotificationButtonClickedEvent; + const onButtonClicked: NotificationButtonClickedEvent; /** * The user changes the permission level. * @since Chrome 32. */ - export var onPermissionLevelChanged: NotificationPermissionLevelChangedEvent; + const onPermissionLevelChanged: NotificationPermissionLevelChangedEvent; /** * The user clicked on a link for the app's notification settings. * @since Chrome 32. */ - export var onShowSettings: NotificationShowSettingsEvent; + const onShowSettings: NotificationShowSettingsEvent; /** * Creates and displays a notification. @@ -3061,7 +5582,7 @@ declare namespace chrome { * If you specify the callback parameter, it should be a function that looks like this: * function(string notificationId) {...}; */ - export function create(notificationId: string, options: NotificationOptions, callback?: (notificationId: string) => void): void; + function create(notificationId: string, options: NotificationOptions, callback?: (notificationId: string) => void): void; /** * Creates and displays a notification. * @param notificationId Identifier of the notification. If not set or empty, an ID will automatically be generated. If it matches an existing notification, this method first clears that notification before proceeding with the create operation. @@ -3072,7 +5593,7 @@ declare namespace chrome { * If you specify the callback parameter, it should be a function that looks like this: * function(string notificationId) {...}; */ - export function create(options: NotificationOptions, callback?: (notificationId: string) => void): void; + function create(options: NotificationOptions, callback?: (notificationId: string) => void): void; /** * Updates an existing notification. * @param notificationId The id of the notification to be updated. This is returned by notifications.create method. @@ -3082,7 +5603,7 @@ declare namespace chrome { * If you specify the callback parameter, it should be a function that looks like this: * function(boolean wasUpdated) {...}; */ - export function update(notificationId: string, options: NotificationOptions, callback?: (wasUpdated: boolean) => void): void; + function update(notificationId: string, options: NotificationOptions, callback?: (wasUpdated: boolean) => void): void; /** * Clears the specified notification. * @param notificationId The id of the notification to be cleared. This is returned by notifications.create method. @@ -3091,7 +5612,7 @@ declare namespace chrome { * If you specify the callback parameter, it should be a function that looks like this: * function(boolean wasCleared) {...}; */ - export function clear(notificationId: string, callback?: (wasCleared: boolean) => void): void; + function clear(notificationId: string, callback?: (wasCleared: boolean) => void): void; /** * Retrieves all the notifications. * @since Chrome 29. @@ -3099,7 +5620,7 @@ declare namespace chrome { * The callback parameter should be a function that looks like this: * function(object notifications) {...}; */ - export function getAll(callback: (notifications: Object) => void): void; + function getAll(callback: (notifications: Object) => void): void; /** * Retrieves whether the user has enabled notifications from this app or extension. * @since Chrome 32. @@ -3107,7 +5628,7 @@ declare namespace chrome { * The callback parameter should be a function that looks like this: * function( PermissionLevel level) {...}; */ - export function getPermissionLevel(callback: (level: string) => void): void; + function getPermissionLevel(callback: (level: string) => void): void; } //////////////////// @@ -3155,33 +5676,33 @@ declare namespace chrome { * function(boolean result) {...}; * Parameter result: True if the extension has the specified permissions. */ - export function contains(permissions: Permissions, callback: (result: boolean) => void): void; + function contains(permissions: Permissions, callback: (result: boolean) => void): void; /** * Gets the extension's current set of permissions. * @param callback The callback parameter should be a function that looks like this: * function( Permissions permissions) {...}; * Parameter permissions: The extension's active permissions. */ - export function getAll(callback: (permissions: Permissions) => void): void; + function getAll(callback: (permissions: Permissions) => void): void; /** * Requests access to the specified permissions. These permissions must be defined in the optional_permissions field of the manifest. If there are any problems requesting the permissions, runtime.lastError will be set. - * @param callback If you specify the callback parameter, it should be a function that looks like this: + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: * function(boolean granted) {...}; * Parameter granted: True if the user granted the specified permissions. */ - export function request(permissions: Permissions, callback?: (granted: boolean) => void): void; + function request(permissions: Permissions, callback?: (granted: boolean) => void): void; /** * Removes access to the specified permissions. If there are any problems removing the permissions, runtime.lastError will be set. - * @param callback If you specify the callback parameter, it should be a function that looks like this: + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: * function(boolean removed) {...}; * Parameter removed: True if the permissions were removed. */ - export function remove(permissions: Permissions, callback?: (removed: boolean) => void): void; + function remove(permissions: Permissions, callback?: (removed: boolean) => void): void; /** Fired when access to permissions has been removed from the extension. */ - export var onRemoved: PermissionsRemovedEvent; + const onRemoved: PermissionsRemovedEvent; /** Fired when the extension acquires new permissions. */ - export var onAdded: PermissionsAddedEvent; + const onAdded: PermissionsAddedEvent; } //////////////////// @@ -3194,9 +5715,9 @@ declare namespace chrome { */ namespace power { /** Requests that power management be temporarily disabled. |level| describes the degree to which power management should be disabled. If a request previously made by the same app is still active, it will be replaced by the new request. */ - export function requestKeepAwake(level: string): void; + function requestKeepAwake(level: string): void; /** Releases a request previously made via requestKeepAwake(). */ - export function releaseKeepAwake(): void; + function releaseKeepAwake(): void; } //////////////////// @@ -3213,7 +5734,7 @@ declare namespace chrome { id: string; /** Printer's human readable name. */ name: string; - /** Optional. Printer's human readable description. */ + /** Printer's human readable description. */ description?: string; } @@ -3235,26 +5756,18 @@ declare namespace chrome { document: Blob; } - interface PrinterRequestedEvent extends chrome.events.Event<(resultCallback: (printerInfo: PrinterInfo[]) => void) => void> { } - - interface PrinterInfoRequestedEvent extends chrome.events.Event<(device: any, resultCallback: (printerInfo?: PrinterInfo) => void) => void> { } - - interface CapabilityRequestedEvent extends chrome.events.Event<(printerId: string, resultCallback: (capabilities: PrinterCapabilities) => void) => void> { } - - interface PrintRequestedEvent extends chrome.events.Event<(printJob: PrintJob, resultCallback: (result: string) => void) => void> { } - /** Event fired when print manager requests printers provided by extensions. */ - export var onGetPrintersRequested: PrinterRequestedEvent; + const onGetPrintersRequested: chrome.events.Event<(resultCallback: (printerInfo: PrinterInfo[]) => void) => void>; /** * Event fired when print manager requests information about a USB device that may be a printer. * Note: An application should not rely on this event being fired more than once per device. If a connected device is supported it should be returned in the onGetPrintersRequested event. * @since Chrome 45. */ - export var onGetUsbPrinterInfoRequested: PrinterInfoRequestedEvent; + const onGetUsbPrinterInfoRequested: chrome.events.Event<(device: any, resultCallback: (printerInfo?: PrinterInfo) => void) => void>; /** Event fired when print manager requests printer capabilities. */ - export var onGetCapabilityRequested: CapabilityRequestedEvent; + const onGetCapabilityRequested: chrome.events.Event<(printerId: string, resultCallback: (capabilities: PrinterCapabilities) => void) => void>; /** Event fired when print manager requests printing. */ - export var onPrintRequested: PrintRequestedEvent; + const onPrintRequested: chrome.events.Event<(printJob: PrintJob, resultCallback: (result: string) => void) => void>; } //////////////////// @@ -3266,12 +5779,12 @@ declare namespace chrome { */ namespace runtime { /** This will be defined during an API method callback if there was an error */ - export var lastError: LastError | undefined; + const lastError: LastError | undefined; /** The ID of the extension/app. */ - export var id: string; + const id: string; interface LastError { - /** Optional. Details about the error which occurred. */ + /** Details about the error which occurred. */ message?: string; } @@ -3362,9 +5875,9 @@ declare namespace chrome { */ sender?: MessageSender; /** An object which allows the addition and removal of listeners for a Chrome event. */ - onDisconnect: PortDisconnectEvent; + onDisconnect: chrome.events.Event<(port: Port) => void>; /** An object which allows the addition and removal of listeners for a Chrome event. */ - onMessage: PortMessageEvent; + onMessage: chrome.events.Event<(message: any, port: Port) => void>; name: string; } @@ -3378,22 +5891,6 @@ declare namespace chrome { version: string; } - interface PortDisconnectEvent extends chrome.events.Event<(port: Port) => void> { } - - interface PortMessageEvent extends chrome.events.Event<(message: any, port: Port) => void> { } - - interface ExtensionMessageEvent extends chrome.events.Event<(message: any, sender: MessageSender, sendResponse: (response: any) => void) => void> { } - - interface ExtensionConnectEvent extends chrome.events.Event<(port: Port) => void> { } - - interface RuntimeInstalledEvent extends chrome.events.Event<(details: InstalledDetails) => void> { } - - interface RuntimeEvent extends chrome.events.Event<() => void> { } - - interface RuntimeRestartRequiredEvent extends chrome.events.Event<(reason: string) => void> { } - - interface RuntimeUpdateAvailableEvent extends chrome.events.Event<(details: UpdateAvailableDetails) => void> { } - interface ManifestIcons { [size: number]: string; } @@ -3422,6 +5919,63 @@ declare namespace chrome { is_default?: boolean; } + type Permissions = + 'alarms' | + 'audio' | + 'audioCapture' | + 'background' | + 'browser' | + 'certificateProvider' | + 'clipboard' | + 'clipboardRead' | + 'clipboardWrite' | + 'contextMenus' | + 'desktopCapture' | + 'diagnostics' | + 'displaySource' | + 'dns' | + 'documentScan' | + 'enterprise.deviceAttributes' | + 'enterprise.platformKeys' | + 'experimental' | + 'fileBrowserHandler' | + 'fileSystem' | + 'gcm' | + 'geolocation' | + 'hid' | + 'identity' | + 'idle' | + 'mdns' | + 'mediaGalleries' | + 'nativeMessaging' | + 'networking.config' | + 'networking.onc' | + 'notifications' | + 'platformKeys' | + 'pointerLock' | + 'power' | + 'printerProvider' | + 'proxy' | + 'serial' | + 'signedInDevices' | + 'socket' | + 'storage' | + 'syncFileSystem' | + 'system.cpu' | + 'system.display' | + 'system.memory' | + 'system.network' | + 'system.powerSource' | + 'system.storage' | + 'tts' | + 'unlimitedStorage' | + 'usb' | + 'videoCapture' | + 'virtualKeyboard' | + 'vpnProvider' | + 'wallpaper' | + 'webview'; + interface Manifest { /** Required */ app: { @@ -3546,6 +6100,15 @@ declare namespace chrome { pages: string[]; content_security_policy?: string; }; + /** + * The short_name (maximum of 12 characters recommended) is + * a short version of the app's name. It is an optional field + * and if not specified, the name will be used, though it will + * likely be truncated. The short name is typically used where + * there is insufficient space to display the full name, such as: + * - App launcher + * - New Tab page + */ short_name?: string; signature?: any; sockets?: { @@ -3560,7 +6123,7 @@ declare namespace chrome { managed_schema: string }; system_indicator?: any; - update_url?: string; + // update_url?: string; // Listed but deprecated since Chrome 33 - leaving it here so it's not added again url_handlers?: { [name: string]: { matches: string[]; @@ -3590,48 +6153,60 @@ declare namespace chrome { * Attempts to connect to connect listeners within an extension/app (such as the background page), or other extensions/apps. This is useful for content scripts connecting to their extension processes, inter-app/extension communication, and web messaging. Note that this does not connect to any listeners in a content script. Extensions may connect to content scripts embedded in tabs via tabs.connect. * @since Chrome 26. */ - export function connect(connectInfo?: ConnectInfo): Port; + function connect(connectInfo?: ConnectInfo): Port; /** * Attempts to connect to connect listeners within an extension/app (such as the background page), or other extensions/apps. This is useful for content scripts connecting to their extension processes, inter-app/extension communication, and web messaging. Note that this does not connect to any listeners in a content script. Extensions may connect to content scripts embedded in tabs via tabs.connect. * @since Chrome 26. * @param extensionId Optional. * The ID of the extension or app to connect to. If omitted, a connection will be attempted with your own extension. Required if sending messages from a web page for web messaging. */ - export function connect(extensionId: string, connectInfo?: ConnectInfo): Port; + function connect(extensionId: string, connectInfo?: ConnectInfo): Port; /** * Connects to a native application in the host machine. * @since Chrome 28. * @param application The name of the registered application to connect to. */ - export function connectNative(application: string): Port; - /** Retrieves the JavaScript 'window' object for the background page running inside the current extension/app. If the background page is an event page, the system will ensure it is loaded before calling the callback. If there is no background page, an error is set. */ - export function getBackgroundPage(callback: (backgroundPage?: Window) => void): void; + function connectNative(application: string): Port; + /** - * Returns details about the app or extension from the manifest. The object returned is a serialization of the full manifest file. + * Retrieves the JavaScript 'window' object for the background page running inside the current extension/app. + * If the background page is an event page, the system will ensure it is loaded before calling the callback. + * If there is no background page, an error is set. + */ + function getBackgroundPage(callback: (backgroundPage?: Window) => void): void; + + /** + * Returns details about the app or extension from the manifest. + * The object returned is a serialization of the full manifest file. * @returns The manifest details. */ - export function getManifest(): Manifest; + function getManifest(): Manifest; + /** * Returns a DirectoryEntry for the package directory. * @since Chrome 29. */ - export function getPackageDirectoryEntry(callback: (directoryEntry: DirectoryEntry) => void): void; + function getPackageDirectoryEntry(callback: (directoryEntry: DirectoryEntry) => void): void; + /** * Returns information about the current platform. * @since Chrome 29. * @param callback Called with results */ - export function getPlatformInfo(callback: (platformInfo: PlatformInfo) => void): void; + function getPlatformInfo(callback: (platformInfo: PlatformInfo) => void): void; + /** * Converts a relative path within an app/extension install directory to a fully-qualified URL. * @param path A path to a resource within an app/extension expressed relative to its install directory. */ - export function getURL(path: string): string; + function getURL(path: string): string; + /** * Reloads the app or extension. * @since Chrome 25. */ - export function reload(): void; + function reload(): void; + /** * Requests an update check for this app/extension. * @since Chrome 25. @@ -3639,26 +6214,30 @@ declare namespace chrome { * Parameter status: Result of the update check. One of: 'throttled', 'no_update', or 'update_available' * Optional parameter details: If an update is available, this contains more information about the available update. */ - export function requestUpdateCheck(callback: (status: string, details?: UpdateCheckDetails) => void): void; + function requestUpdateCheck(callback: (status: string, details?: UpdateCheckDetails) => void): void; + /** * Restart the ChromeOS device when the app runs in kiosk mode. Otherwise, it's no-op. * @since Chrome 32. */ - export function restart(): void; + function restart(): void; + /** * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage. * @since Chrome 26. * @param responseCallback Optional * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. */ - export function sendMessage(message: any, responseCallback?: (response: any) => void): void; + function sendMessage(message: any, responseCallback?: (response: any) => void): void; + /** * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage. * @since Chrome 32. * @param responseCallback Optional * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. */ - export function sendMessage(message: any, options: MessageOptions, responseCallback?: (response: any) => void): void; + function sendMessage(message: any, options: MessageOptions, responseCallback?: (response: any) => void): void; + /** * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage. * @since Chrome 26. @@ -3666,7 +6245,8 @@ declare namespace chrome { * @param responseCallback Optional * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. */ - export function sendMessage(extensionId: string, message: any, responseCallback?: (response: any) => void): void; + function sendMessage(extensionId: string, message: any, responseCallback?: (response: any) => void): void; + /** * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage. * @since Chrome 32. @@ -3674,7 +6254,8 @@ declare namespace chrome { * @param responseCallback Optional * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. */ - export function sendMessage(extensionId: string, message: any, options: MessageOptions, responseCallback?: (response: any) => void): void; + function sendMessage(extensionId: string, message: any, options: MessageOptions, responseCallback?: (response: any) => void): void; + /** * Send a single message to a native application. * @since Chrome 28. @@ -3683,7 +6264,8 @@ declare namespace chrome { * @param responseCallback Optional. * Parameter response: The response message sent by the native messaging host. If an error occurs while connecting to the native messaging host, the callback will be called with no arguments and runtime.lastError will be set to the error message. */ - export function sendNativeMessage(application: string, message: Object, responseCallback?: (response: any) => void): void; + function sendNativeMessage(application: string, message: Object, responseCallback?: (response: any) => void): void; + /** * Sets the URL to be visited upon uninstallation. This may be used to clean up server-side data, do analytics, and implement surveys. Maximum 255 characters. * @since Chrome 41. @@ -3691,73 +6273,82 @@ declare namespace chrome { * URL to be opened after the extension is uninstalled. This URL must have an http: or https: scheme. Set an empty string to not open a new tab upon uninstallation. * @param callback Called when the uninstall URL is set. If the given URL is invalid, runtime.lastError will be set. */ - export function setUninstallURL(url: string, callback?: () => void): void; + function setUninstallURL(url: string, callback?: () => void): void; + /** * Open your Extension's options page, if possible. * The precise behavior may depend on your manifest's options_ui or options_page key, or what Chrome happens to support at the time. For example, the page may be opened in a new tab, within chrome://extensions, within an App, or it may just focus an open options page. It will never cause the caller page to reload. * If your Extension does not declare an options page, or Chrome failed to create one for some other reason, the callback will set lastError. * @since Chrome 42. */ - export function openOptionsPage(callback?: () => void): void; + function openOptionsPage(callback?: () => void): void; + + + interface ExtensionMessageEvent extends chrome.events.Event<(message: any, sender: MessageSender, sendResponse: (response: any) => void) => void> { } + + interface ExtensionConnectEvent extends chrome.events.Event<(port: Port) => void> { } + + interface RuntimeEvent extends chrome.events.Event<() => void> { } /** * Fired when a connection is made from either an extension process or a content script. * @since Chrome 26. */ - export var onConnect: ExtensionConnectEvent; + const onConnect: ExtensionConnectEvent; /** * Fired when a connection is made from another extension. * @since Chrome 26. */ - export var onConnectExternal: ExtensionConnectEvent; + const onConnectExternal: ExtensionConnectEvent; /** Sent to the event page just before it is unloaded. This gives the extension opportunity to do some clean up. Note that since the page is unloading, any asynchronous operations started while handling this event are not guaranteed to complete. If more activity for the event page occurs before it gets unloaded the onSuspendCanceled event will be sent and the page won't be unloaded. */ - export var onSuspend: RuntimeEvent; + const onSuspend: RuntimeEvent; /** * Fired when a profile that has this extension installed first starts up. This event is not fired when an incognito profile is started, even if this extension is operating in 'split' incognito mode. * @since Chrome 23. */ - export var onStartup: RuntimeEvent; + const onStartup: RuntimeEvent; /** Fired when the extension is first installed, when the extension is updated to a new version, and when Chrome is updated to a new version. */ - export var onInstalled: RuntimeInstalledEvent; + const onInstalled: chrome.events.Event<(details: InstalledDetails) => void>; /** Sent after onSuspend to indicate that the app won't be unloaded after all. */ - export var onSuspendCanceled: RuntimeEvent; + const onSuspendCanceled: RuntimeEvent; /** * Fired when a message is sent from either an extension process or a content script. * @since Chrome 26. */ - export var onMessage: ExtensionMessageEvent; + const onMessage: ExtensionMessageEvent; /** * Fired when a message is sent from another extension/app. Cannot be used in a content script. * @since Chrome 26. */ - export var onMessageExternal: ExtensionMessageEvent; + const onMessageExternal: ExtensionMessageEvent; /** * Fired when an app or the device that it runs on needs to be restarted. The app should close all its windows at its earliest convenient time to let the restart to happen. If the app does nothing, a restart will be enforced after a 24-hour grace period has passed. Currently, this event is only fired for Chrome OS kiosk apps. * @since Chrome 29. */ - export var onRestartRequired: RuntimeRestartRequiredEvent; + const onRestartRequired: chrome.events.Event<(reason: string) => void>; /** * Fired when an update is available, but isn't installed immediately because the app is currently running. If you do nothing, the update will be installed the next time the background page gets unloaded, if you want it to be installed sooner you can explicitly call chrome.runtime.reload(). If your extension is using a persistent background page, the background page of course never gets unloaded, so unless you call chrome.runtime.reload() manually in response to this event the update will not get installed until the next time chrome itself restarts. If no handlers are listening for this event, and your extension has a persistent background page, it behaves as if chrome.runtime.reload() is called in response to this event. * @since Chrome 25. */ - export var onUpdateAvailable: RuntimeUpdateAvailableEvent; + const onUpdateAvailable: chrome.events.Event<(details: UpdateAvailableDetails) => void>; /** * @deprecated since Chrome 33. Please use chrome.runtime.onRestartRequired. * Fired when a Chrome update is available, but isn't installed immediately because a browser restart is required. */ - export var onBrowserUpdateAvailable: RuntimeEvent; + const onBrowserUpdateAvailable: RuntimeEvent; } //////////////////// // Serial //////////////////// /** - * Use the chrome.serial API to read from and write to a device connected to a serial port. + * Use the chrome.socket API to send and receive data over the network using TCP and UDP connections. + * @deprecated Note: Starting with Chrome 33, + * this API is deprecated in favor of the + * sockets.udp, sockets.tcp and sockets.tcpServer APIs. * @since Chrome 23 */ - namespace serial { - /** NOT YET IMPLEMENTED */ - } + const serial: chrome.deprecated; //////////////////// // Socket @@ -3802,21 +6393,21 @@ declare namespace chrome { address: string; } - export function create(type: string, options?: Object, callback?: (createInfo: CreateInfo) => void): void; - export function destroy(socketId: number): void; - export function connect(socketId: number, hostname: string, port: number, callback: (result: number) => void): void; - export function bind(socketId: number, address: string, port: number, callback: (result: number) => void): void; - export function disconnect(socketId: number): void; - export function read(socketId: number, bufferSize?: number, callback?: (readInfo: ReadInfo) => void): void; - export function write(socketId: number, data: ArrayBuffer, callback?: (writeInfo: WriteInfo) => void): void; - export function recvFrom(socketId: number, bufferSize?: number, callback?: (recvFromInfo: RecvFromInfo) => void): void; - export function sendTo(socketId: number, data: ArrayBuffer, address: string, port: number, callback?: (writeInfo: WriteInfo) => void): void; - export function listen(socketId: number, address: string, port: number, backlog?: number, callback?: (result: number) => void): void; - export function accept(socketId: number, callback?: (acceptInfo: AcceptInfo) => void): void; - export function setKeepAlive(socketId: number, enable: boolean, delay?: number, callback?: (result: boolean) => void): void; - export function setNoDelay(socketId: number, noDelay: boolean, callback?: (result: boolean) => void): void; - export function getInfo(socketId: number, callback: (result: SocketInfo) => void): void; - export function getNetworkList(callback: (result: NetworkInterface[]) => void): void; + function create(type: string, options?: Object, callback?: (createInfo: CreateInfo) => void): void; + function destroy(socketId: number): void; + function connect(socketId: number, hostname: string, port: number, callback: (result: number) => void): void; + function bind(socketId: number, address: string, port: number, callback: (result: number) => void): void; + function disconnect(socketId: number): void; + function read(socketId: number, bufferSize?: number, callback?: (readInfo: ReadInfo) => void): void; + function write(socketId: number, data: ArrayBuffer, callback?: (writeInfo: WriteInfo) => void): void; + function recvFrom(socketId: number, bufferSize?: number, callback?: (recvFromInfo: RecvFromInfo) => void): void; + function sendTo(socketId: number, data: ArrayBuffer, address: string, port: number, callback?: (writeInfo: WriteInfo) => void): void; + function listen(socketId: number, address: string, port: number, backlog?: number, callback?: (result: number) => void): void; + function accept(socketId: number, callback?: (acceptInfo: AcceptInfo) => void): void; + function setKeepAlive(socketId: number, enable: boolean, delay?: number, callback?: (result: boolean) => void): void; + function setNoDelay(socketId: number, noDelay: boolean, callback?: (result: boolean) => void): void; + function getInfo(socketId: number, callback: (result: SocketInfo) => void): void; + function getNetworkList(callback: (result: NetworkInterface[]) => void): void; } namespace sockets.tcp { @@ -3858,28 +6449,28 @@ declare namespace chrome { peerPort?: number; } - export function create(callback: (createInfo: CreateInfo) => void): void; - export function create(properties: SocketProperties, callback: (createInfo: CreateInfo) => void): void; + function create(callback: (createInfo: CreateInfo) => void): void; + function create(properties: SocketProperties, callback: (createInfo: CreateInfo) => void): void; - export function update(socketId: number, properties: SocketProperties, callback?: () => void): void; - export function setPaused(socketId: number, paused: boolean, callback?: () => void): void; + function update(socketId: number, properties: SocketProperties, callback?: () => void): void; + function setPaused(socketId: number, paused: boolean, callback?: () => void): void; - export function setKeepAlive(socketId: number, + function setKeepAlive(socketId: number, enable: boolean, callback: (result: number) => void): void; - export function setKeepAlive(socketId: number, + function setKeepAlive(socketId: number, enable: boolean, delay: number, callback: (result: number) => void): void; - export function setNoDelay(socketId: number, noDelay: boolean, callback: (result: number) => void): void; - export function connect(socketId: number, + function setNoDelay(socketId: number, noDelay: boolean, callback: (result: number) => void): void; + function connect(socketId: number, peerAddress: string, peerPort: number, callback: (result: number) => void): void; - export function disconnect(socketId: number, callback?: () => void): void; - export function send(socketId: number, data: ArrayBuffer, callback: (sendInfo: SendInfo) => void): void; - export function close(socketId: number, callback?: () => void): void; - export function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void; - export function getSockets(callback: (socketInfos: SocketInfo[]) => void): void; + function disconnect(socketId: number, callback?: () => void): void; + function send(socketId: number, data: ArrayBuffer, callback: (sendInfo: SendInfo) => void): void; + function close(socketId: number, callback?: () => void): void; + function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void; + function getSockets(callback: (socketInfos: SocketInfo[]) => void): void; - export var onReceive: chrome.events.Event<(args: ReceiveEventArgs) => void>; - export var onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => void>; + const onReceive: chrome.events.Event<(args: ReceiveEventArgs) => void>; + const onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => void>; } /** @@ -3960,7 +6551,7 @@ declare namespace chrome { * @see https://developer.chrome.com/apps/sockets_tcpServer#method-create * @param callback Called when the socket has been created. */ - export function create(callback: (createInfo: CreateInfo) => void): void; + function create(callback: (createInfo: CreateInfo) => void): void; /** * Creates a TCP server socket. @@ -3969,7 +6560,7 @@ declare namespace chrome { * @param properties The socket properties. * @param callback Called when the socket has been created. */ - export function create(properties: SocketProperties, callback: (createInfo: CreateInfo) => void): void; + function create(properties: SocketProperties, callback: (createInfo: CreateInfo) => void): void; /** * Updates the socket properties. @@ -3979,7 +6570,7 @@ declare namespace chrome { * @param properties The properties to update. * @param callback Called when the properties are updated. */ - export function update(socketId: number, properties: SocketProperties, callback?: () => void): void; + function update(socketId: number, properties: SocketProperties, callback?: () => void): void; /** * Enables or disables a listening socket from accepting new connections. @@ -3990,7 +6581,7 @@ declare namespace chrome { * @see https://developer.chrome.com/apps/sockets_tcpServer#method-setPaused * @param callback Callback from the setPaused method. */ - export function setPaused(socketId: number, paused: boolean, callback?: () => void): void; + function setPaused(socketId: number, paused: boolean, callback?: () => void): void; /** * Listens for connections on the specified port and address. If the @@ -4007,7 +6598,7 @@ declare namespace chrome { * ensures a reasonable queue length for most applications. * @param callback Called when listen operation completes. */ - export function listen(socketId: number, address: string, port: number, backlog: number, callback: (result: number) => void): void; + function listen(socketId: number, address: string, port: number, backlog: number, callback: (result: number) => void): void; /** * Listens for connections on the specified port and address. If the @@ -4021,7 +6612,7 @@ declare namespace chrome { * be found by calling getInfo. * @param callback Called when listen operation completes. */ - export function listen(socketId: number, address: string, port: number, callback: (result: number) => void): void; + function listen(socketId: number, address: string, port: number, callback: (result: number) => void): void; /** * Disconnects the listening socket, i.e. stops accepting new connections @@ -4033,7 +6624,7 @@ declare namespace chrome { * @param socketId The socket identifier. * @param callback Called when the disconnect attempt is complete. */ - export function disconnect(socketId: number, callback?: () => void): void; + function disconnect(socketId: number, callback?: () => void): void; /** * Disconnects and destroys the socket. Each socket created should be closed @@ -4045,7 +6636,7 @@ declare namespace chrome { * @param socketId The socket identifier. * @param callback Called when the close operation completes. */ - export function close(socketId: number, callback?: () => void): void; + function close(socketId: number, callback?: () => void): void; /** * Retrieves the state of the given socket. @@ -4054,7 +6645,7 @@ declare namespace chrome { * @param socketId The socket identifier. * @param callback Called when the socket state is available. */ - export function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void; + function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void; /** * Retrieves the list of currently opened sockets owned by the application. @@ -4062,14 +6653,14 @@ declare namespace chrome { * @see https://developer.chrome.com/apps/sockets_tcpServer#method-getSockets * @param callback Called when the list of sockets is available. */ - export function getSockets(callback: (socketInfos: SocketInfo[]) => void): void; + function getSockets(callback: (socketInfos: SocketInfo[]) => void): void; /** * Event raised when a connection has been made to the server socket. * * @see https://developer.chrome.com/apps/sockets_tcpServer#event-onAccept */ - export var onAccept: chrome.events.Event<(args: AcceptEventArgs) => void>; + const onAccept: chrome.events.Event<(args: AcceptEventArgs) => void>; /** * Event raised when a network error occured while the runtime was waiting @@ -4079,7 +6670,7 @@ declare namespace chrome { * * @see https://developer.chrome.com/apps/sockets_tcpServer#event-onAcceptError */ - export var onAcceptError: chrome.events.Event<(args: AcceptErrorEventArgs) => void>; + const onAcceptError: chrome.events.Event<(args: AcceptErrorEventArgs) => void>; } /** @@ -4129,7 +6720,7 @@ declare namespace chrome { name?: string; /** - * The size of the buffer used to receive data. If the buffer is too + * The size of the buffer used to Receive data. If the buffer is too * small to receive the UDP packet, data is lost. The default value is * 4096. */ @@ -4181,7 +6772,7 @@ declare namespace chrome { * @see https://developer.chrome.com/apps/sockets_udp#method-create * @param createInfo.socketId The ID of the newly created socket. */ - export function create(callback: (createInfo: CreateInfo) => void): void; + function create(callback: (createInfo: CreateInfo) => void): void; /** * Creates a UDP socket with the given properties. @@ -4190,7 +6781,7 @@ declare namespace chrome { * @param properties The socket properties. * @param createInfo.socketId The ID of the newly created socket. */ - export function create(properties: SocketProperties, callback: (createInfo: CreateInfo) => void): void; + function create(properties: SocketProperties, callback: (createInfo: CreateInfo) => void): void; /** * Updates the socket properties. @@ -4200,7 +6791,7 @@ declare namespace chrome { * @param properties The properties to update. * @param callback Called when the properties are updated. */ - export function update(socketId: number, properties: SocketProperties, callback?: () => void): void; + function update(socketId: number, properties: SocketProperties, callback?: () => void): void; /** * Pauses or unpauses a socket. A paused socket is blocked from firing @@ -4212,7 +6803,7 @@ declare namespace chrome { * @param callback Called when the socket has been successfully paused or * unpaused. */ - export function setPaused(socketId: number, paused: boolean, callback?: () => void): void; + function setPaused(socketId: number, paused: boolean, callback?: () => void): void; /** * Binds the local address and port for the socket. For a client socket, it @@ -4231,7 +6822,7 @@ declare namespace chrome { * port. * @param callback Called when the bind operation completes. */ - export function bind(socketId: number, address: string, port: number, callback: (result: number) => void): void; + function bind(socketId: number, address: string, port: number, callback: (result: number) => void): void; /** * Sends data on the given socket to the given address and port. The socket @@ -4244,7 +6835,7 @@ declare namespace chrome { * @param port The port of the remote machine. * @param callback Called when the send operation completes. */ - export function send(socketId: number, data: ArrayBuffer, address: string, port: number, callback: (sendInfo: SendInfo) => void): void; + function send(socketId: number, data: ArrayBuffer, address: string, port: number, callback: (sendInfo: SendInfo) => void): void; /** * Closes the socket and releases the address/port the socket is bound to. @@ -4256,7 +6847,7 @@ declare namespace chrome { * @param socketId The socket ID. * @param callback Called when the close operation completes. */ - export function close(socketId: number, callback?: () => void): void; + function close(socketId: number, callback?: () => void): void; /** * Retrieves the state of the given socket. @@ -4265,7 +6856,7 @@ declare namespace chrome { * @param socketId The socket ID. * @param callback Called when the socket state is available. */ - export function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void; + function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void; /** * Retrieves the list of currently opened sockets owned by the application. @@ -4273,7 +6864,7 @@ declare namespace chrome { * @see https://developer.chrome.com/apps/sockets_udp#method-getSockets * @param callback Called when the list of sockets is available. */ - export function getSockets(callback: (socketInfos: SocketInfo[]) => void): void; + function getSockets(callback: (socketInfos: SocketInfo[]) => void): void; /** * Joins the multicast group and starts to receive packets from that group. @@ -4284,7 +6875,7 @@ declare namespace chrome { * @param address The group address to join. Domain names are not supported. * @param callback Called when the joinGroup operation completes. */ - export function joinGroup(socketId: number, address: string, callback: (result: number) => void): void; + function joinGroup(socketId: number, address: string, callback: (result: number) => void): void; /** * Leaves the multicast group previously joined using joinGroup. This is @@ -4301,7 +6892,7 @@ declare namespace chrome { * supported. * @param callback Called when the leaveGroup operation completes. */ - export function leaveGroup(socketId: number, address: string, callback: (result: number) => void): void; + function leaveGroup(socketId: number, address: string, callback: (result: number) => void): void; /** * Sets the time-to-live of multicast packets sent to the multicast group. @@ -4313,7 +6904,7 @@ declare namespace chrome { * @param ttl The time-to-live value. * @param callback Called when the configuration operation completes. */ - export function setMulticastTimeToLive(socketId: number, ttl: number, callback: (result: number) => void): void; + function setMulticastTimeToLive(socketId: number, ttl: number, callback: (result: number) => void): void; /** * Sets whether multicast packets sent from the host to the multicast group @@ -4324,7 +6915,7 @@ declare namespace chrome { * when there is more than one application on the same host joined to the * same multicast group while having different settings on multicast * loopback mode. On Windows, the applications with loopback off will not - * RECEIVE the loopback packets; while on Unix-like systems, the + * receive the loopback packets; while on Unix-like systems, the * applications with loopback off will not SEND the loopback packets to * other applications on the same host. * @see MSDN: http://goo.gl/6vqbj @@ -4336,7 +6927,7 @@ declare namespace chrome { * @param enabled Indicate whether to enable loopback mode. * @param callback Called when the configuration operation completes. */ - export function setMulticastLoopbackMode(socketId: number, enabled: boolean, callback: (result: number) => void): void; + function setMulticastLoopbackMode(socketId: number, enabled: boolean, callback: (result: number) => void): void; /** * Gets the multicast group addresses the socket is currently joined to. @@ -4345,7 +6936,7 @@ declare namespace chrome { * @param socketId The socket ID. * @param callback Called with an array of strings of the result. */ - export function getJoinedGroups(socketId: number, callback: (groups: string[]) => void): void; + function getJoinedGroups(socketId: number, callback: (groups: string[]) => void): void; /** * Enables or disables broadcast packets on this socket. @@ -4356,14 +6947,14 @@ declare namespace chrome { * @param enabled true to enable broadcast packets, false to disable them. * @param callback Callback from the setBroadcast method. */ - export function setBroadcast(socketId: number, enabled: boolean, callback?: (result: number) => void): void; + function setBroadcast(socketId: number, enabled: boolean, callback?: (result: number) => void): void; /** * Event raised when a UDP packet has been received for the given socket. * * @see https://developer.chrome.com/apps/sockets_udp#event-onReceive */ - export var onReceive: chrome.events.Event<(args: ReceiveEventArgs) => void>; + const onReceive: chrome.events.Event<(args: ReceiveEventArgs) => void>; /** * Event raised when a network error occured while the runtime was waiting @@ -4373,7 +6964,7 @@ declare namespace chrome { * * @see https://developer.chrome.com/apps/sockets_udp#event-onReceiveError */ - export var onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => void>; + const onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => void>; } //////////////////// @@ -4437,9 +7028,9 @@ declare namespace chrome { } interface StorageChange { - /** Optional. The new value of the item, if there is a new value. */ + /** The new value of the item, if there is a new value. */ newValue?: any; - /** Optional. The old value of the item, if there was an old value. */ + /** The old value of the item, if there was an old value. */ oldValue?: any; } @@ -4473,29 +7064,163 @@ declare namespace chrome { interface StorageChangedEvent extends chrome.events.Event<(changes: { [key: string]: StorageChange }, areaName: string) => void> { } /** Items in the local storage area are local to each machine. */ - export var local: LocalStorageArea; + const local: LocalStorageArea; /** Items in the sync storage area are synced using Chrome Sync. */ - export var sync: SyncStorageArea; + const sync: SyncStorageArea; /** * Items in the managed storage area are set by the domain administrator, and are read-only for the extension; trying to modify this namespace results in an error. * @since Chrome 33. */ - export var managed: StorageArea; + const managed: StorageArea; /** Fired when one or more items change. */ - export var onChanged: StorageChangedEvent; + const onChanged: StorageChangedEvent; } //////////////////// // SyncFileSystem //////////////////// /** - * Use the chrome.syncFileSystem API to save and synchronize data on Google Drive. This API is NOT for accessing arbitrary user docs stored in Google Drive. It provides app-specific syncable storage for offline and caching usage so that the same data can be available across different clients. Read Manage Data for more on using this API. + * Use the chrome.syncFileSystem API to save and synchronize data on Google Drive. + * This API is NOT for accessing arbitrary user docs stored in Google Drive. + * It provides app-specific syncable storage for offline and caching usage so that + * the same data can be available across different clients. Read Manage Data for + * more on using this API. + * + * @requires[Permissions: 'syncFileSystem'] + * @see[Learn more: Manage Data]{@link https://developer.chrome.com/apps/app_storage} * @since Chrome 27 */ namespace syncFileSystem { - /** NOT YET IMPLEMENTED */ + /** + * 'initializing' + * - The sync service is being initialized (e.g. restoring data from the database, checking connectivity and authenticating to the service etc). + * 'running' + * - The sync service is up and running. + * 'authentication_required' + * - The sync service is not synchronizing files because the remote service needs to be authenticated by the user to proceed. + * 'temporary_unavailable' + * - The sync service is not synchronizing files because the remote service is (temporarily) unavailable due to some recoverable errors, e.g. network is offline, the remote service is down or not reachable etc. More details should be given by |description| parameter in OnServiceInfoUpdated (which could contain service-specific details). + * 'disabled' + * - The sync service is disabled and the content will never sync. (E.g. this could happen when the user has no account on the remote service or the sync service has had an unrecoverable error.) + */ + type ServiceStatus = + 'initializing' | + 'running' | + 'authentication_required' | + 'temporary_unavailable' | + 'disabled'; + /** + * 'synced' + * - Not conflicting and has no pending local changes. + * 'pending' + * - Has one or more pending local changes that haven't been synchronized. + * 'conflicting' + * - File conflicts with remote version and must be resolved manually. + */ + type FileStatus = + 'synced' | + 'pending' | + 'conflicting'; + type ConflictResolutionPolicy = + 'last_write_win' | + 'manual' + + type Action = + 'added' | + 'updated' | + 'deleted' + + type Direction = + 'local_to_remote' | + 'remote_to_local'; + + interface FileStatusInfo { + /** One of the Entry's originally given to getFileStatuses. */ + fileEntry: Entry; + /** Status value */ + status: FileStatus; + /** Optional error that is only returned if there was a problem retrieving the FileStatus for the given file. */ + error?: string; + } + interface FileStatusChangedDetail { + /** + * fileEntry for the target file whose status has changed. + * Contains name and path information of synchronized file. + * On file deletion, fileEntry information will still be + * available but file will no longer exist. + */ + fileEntry: Entry; + /** + * Resulting file status after onFileStatusChanged event. + * The status value can be 'synced', 'pending' or 'conflicting'. + */ + status: FileStatus; + /** + * Sync action taken to fire onFileStatusChanged event. + * The action value can be 'added', 'updated' or 'deleted'. + * Only applies if status is 'synced'. + */ + action?: Action; + /** + * Sync direction for the onFileStatusChanged event. + * Sync direction value can be 'local_to_remote' or + * 'remote_to_local'. Only applies if status is 'synced'. + */ + direction?: Direction; + } + /** + * Returns a syncable filesystem backed by Google Drive. + * The returned DOMFileSystem instance can be operated on + * in the same way as the Temporary and Persistant file systems + * @see[More information]{@link http://dev.w3.org/2009/dap/file-system/file-dir-sys.html} + * @description + * Calling this multiple times from the same app will return the same handle to the same file system. + * Note this call can fail. + * For example, if the user is not signed in to Chrome + * or if there is no network operation. To handle these + * errors it is important chrome.runtime.lastError is + * checked in the callback. + * @param callback A callback type for requestFileSystem. + */ + function requestFileSystem(callback: (fileSystem: FileSystem) => void): void; + /** + * Sets the default conflict resolution policy for the 'syncable' file storage + * for the app. By default it is set to 'last_write_win'. When conflict resolution + * policy is set to 'last_write_win' conflicts for existing files are automatically + * resolved next time the file is updated. |callback| can be optionally given to + * know if the request has succeeded or not. + * @param policy Policy + * @param [callback] A generic result callback to indicate success or failure. + */ + function setConflictResolutionPolicy(policy: ConflictResolutionPolicy, callback?: () => void): void; + /** Gets the current conflict resolution policy. */ + function getConflictResolutionPolicy(callback: (policy: ConflictResolutionPolicy) => void): void; + /** + * Returns the current usage and quota in bytes for the 'syncable' file storage for the app. + * @param fileSystem + * @param callback + */ + function getUsageAndQuota(fileSystem: FileSystem, callback: (info: { usageBytes: number, quotaBytes: number }) => void): void; + /** + * Returns the FileStatus for the given fileEntry. + * Note that 'conflicting' state only happens when + * the service's conflict resolution policy is set to 'manual'. + * */ + function getFileStatus(fileEntry: Entry, callback: (status: FileStatus) => void): void; + /** Returns each FileStatus for the given fileEntry array. Typically called with the result from dirReader.readEntries(). */ + function getFileStatuses(fileEntries: Entry[], callback: (status: FileStatusInfo[]) => void): void; + /** + * Returns the current sync backend status. + * @since Chrome 31. + * @param callback + */ + function getServiceStatus(callback: (status: ServiceStatus) => void): void; + /** Fired when an error or other status change has happened in the sync backend (for example, when the sync is temporarily disabled due to network or authentication error). */ + const onServiceStatusChanged: chrome.events.Event<(detail: { state: ServiceStatus, description: string }) => void>; + /** Fired when a file has been updated by the background sync service. */ + const onFileStatusChanged: chrome.events.Event<(detail: FileStatusChangedDetail) => void>; } @@ -4541,7 +7266,7 @@ declare namespace chrome { } /** Queries basic CPU information of the system. */ - export function getInfo(callback: (info: CpuInfo) => void): void; + function getInfo(callback: (info: CpuInfo) => void): void; } //////////////////// @@ -4589,7 +7314,7 @@ declare namespace chrome { * @since Chrome 57 */ interface TouchCalibrationPair { - /** The coordinates of the display point. */ + /** The coordinates of the display point. */ displayPoint: Point; /** The coordinates of the touch point corresponding to the display point. */ touchPoint: Point; @@ -4624,6 +7349,8 @@ declare namespace chrome { isSelected: boolean; } + type DisplayPosition = 'top' | 'right' | 'bottom' | 'left'; + /** * @since Chrome 53 */ @@ -4633,13 +7360,13 @@ declare namespace chrome { /** The unique identifier of the parent display. Empty if this is the root. */ parentId: string; /** The layout position of this display relative to the parent. This will be ignored for the root. */ - position: 'top' | 'right' | 'bottom' | 'left'; + position: DisplayPosition; /** The offset of the display along the connected edge. 0 indicates that the topmost or leftmost corners are aligned. */ offset: number; } /** - * @description The pairs of point used to calibrate the display. + * The pairs of point used to calibrate the display. * @export * @interface TouchCalibrationPairs */ @@ -4655,13 +7382,13 @@ declare namespace chrome { } /** - * @description Representation of info data to be used in chrome.system.display.setDisplayProperties() + * Representation of info data to be used in chrome.system.display.setDisplayProperties() * @export * @interface DisplayPropertiesInfo */ interface DisplayPropertiesInfo { /** - * @description Chrome OS only. If set to true, changes the display mode to unified desktop (see enableUnifiedDesktop for details). If set to false, unified desktop mode will be disabled. This is only valid for the primary display. If provided, mirroringSourceId must not be provided and other properties may not apply. This is has no effect if not provided. + * Chrome OS only. If set to true, changes the display mode to unified desktop (see enableUnifiedDesktop for details). If set to false, unified desktop mode will be disabled. This is only valid for the primary display. If provided, mirroringSourceId must not be provided and other properties may not apply. This is has no effect if not provided. * @since Chrome 59 * */ isUnified?: boolean; @@ -4688,20 +7415,20 @@ declare namespace chrome { /** * @since Chrome 52 - * @description If set, updates the display mode to the mode matching this value. + * If set, updates the display mode to the mode matching this value. */ displayMode?: DisplayMode; } /** - * @description Options affecting how the information is returned. + * Options affecting how the information is returned. * @since Chrome 59 * @export * @interface DisplayInfoFlags */ interface DisplayInfoFlags { /** - * @description If set to true, only a single DisplayUnitInfo will be returned by getInfo when in unified desktop mode (see enableUnifiedDesktop). Defaults to false. + * If set to true, only a single DisplayUnitInfo will be returned by getInfo when in unified desktop mode (see enableUnifiedDesktop). Defaults to false. * @type {boolean} * @memberof DisplayInfoFlags */ @@ -4753,7 +7480,7 @@ declare namespace chrome { } /** - * @description Fired when anything changes to the display configuration. + * Fired when anything changes to the display configuration. * @export * @interface DisplayChangedEvent * @extends {chrome.events.Event<() => void>} @@ -4761,123 +7488,123 @@ declare namespace chrome { interface DisplayChangedEvent extends chrome.events.Event<() => void> { } /** - * @description Requests the information for all attached display devices. + * Requests the information for all attached display devices. * @export * @param {(info: DisplayInfo[]) => void} callback The callback to invoke with the results. */ - export function getInfo(callback: (info: DisplayInfo[]) => void): void; + function getInfo(callback: (info: DisplayInfo[]) => void): void; /** - * @description Requests the information for all attached display devices. + * Requests the information for all attached display devices. * @export * @since Chrome 59 * @param {DisplayInfoFlags} [flags] Options affecting how the information is returned. * @param {(info: DisplayInfo[]) => void} callback The callback to invoke with the results. */ - export function getInfo(flags: DisplayInfoFlags, callback: (info: DisplayInfo[]) => void): void; + function getInfo(flags: DisplayInfoFlags, callback: (info: DisplayInfo[]) => void): void; /** - * @description Requests the layout info for all displays. NOTE: This is only available to Chrome OS Kiosk apps and Web UI. + * Requests the layout info for all displays. NOTE: This is only available to Chrome OS Kiosk apps and Web UI. * @since Chrome 53 * @export * @param {(layouts: DisplayLayout[]) => void} callback The callback to invoke with the results. */ - export function getDisplayLayout(callback: (layouts: DisplayLayout[]) => void): void; + function getDisplayLayout(callback: (layouts: DisplayLayout[]) => void): void; /** - * @description Updates the properties for the display specified by |id|, according to the information provided in |info|. On failure, runtime.lastError will be set. NOTE: This is only available to Chrome OS Kiosk apps and Web UI. + * Updates the properties for the display specified by |id|, according to the information provided in |info|. On failure, runtime.lastError will be set. NOTE: This is only available to Chrome OS Kiosk apps and Web UI. * @export * @param {string} id The display's unique identifier. * @param {DisplayPropertiesInfo} info The information about display properties that should be changed. A property will be changed only if a new value for it is specified in |info|. * @param {() => void} [callback] Empty function called when the function finishes. To find out whether the function succeeded, runtime.lastError should be queried. */ - export function setDisplayProperties(id: string, info: DisplayPropertiesInfo, callback?: () => void): void; + function setDisplayProperties(id: string, info: DisplayPropertiesInfo, callback?: () => void): void; /** - * @description Set the layout for all displays. Any display not included will use the default layout. If a layout would overlap or be otherwise invalid it will be adjusted to a valid layout. After layout is resolved, an onDisplayChanged event will be triggered. NOTE: This is only available to Chrome OS Kiosk apps and Web UI. + * Set the layout for all displays. Any display not included will use the default layout. If a layout would overlap or be otherwise invalid it will be adjusted to a valid layout. After layout is resolved, an onDisplayChanged event will be triggered. NOTE: This is only available to Chrome OS Kiosk apps and Web UI. * @since Chrome 53 * @export * @param {DisplayLayout[]} layouts The layout information, required for all displays except the primary display. * @param {() => void} callback Empty function called when the function finishes. To find out whether the function succeeded, runtime.lastError should be queried. */ - export function setDisplayLayout(layouts: DisplayLayout[], callback?: () => void): void; + function setDisplayLayout(layouts: DisplayLayout[], callback?: () => void): void; /** - * @description Enables/disables the unified desktop feature. Note that this simply enables the feature, but will not change the actual desktop mode. (That is, if the desktop is in mirror mode, it will stay in mirror mode) NOTE: This is only available to Chrome OS Kiosk apps and Web UI. + * Enables/disables the unified desktop feature. Note that this simply enables the feature, but will not change the actual desktop mode. (That is, if the desktop is in mirror mode, it will stay in mirror mode) NOTE: This is only available to Chrome OS Kiosk apps and Web UI. * @since Chrome 46 * @export * @param {boolean} enabled True if unified desktop should be enabled. */ - export function enableUnifiedDesktop(enabled: boolean): void; + function enableUnifiedDesktop(enabled: boolean): void; /** - * @description Starts overscan calibration for a display. This will show an overlay on the screen indicating the current overscan insets. If overscan calibration for display |id| is in progress this will reset calibration. + * Starts overscan calibration for a display. This will show an overlay on the screen indicating the current overscan insets. If overscan calibration for display |id| is in progress this will reset calibration. * @since Chrome 53 * @export * @param {string} id The display's unique identifier. */ - export function overscanCalibrationStart(id: string): void; + function overscanCalibrationStart(id: string): void; /** - * @description Adjusts the current overscan insets for a display. Typically this should etiher move the display along an axis (e.g. left+right have the same value) or scale it along an axis (e.g. top+bottom have opposite values). Each Adjust call is cumulative with previous calls since Start. + * Adjusts the current overscan insets for a display. Typically this should etiher move the display along an axis (e.g. left+right have the same value) or scale it along an axis (e.g. top+bottom have opposite values). Each Adjust call is cumulative with previous calls since Start. * @since Chrome 53 * @export * @param {string} id The display's unique identifier. * @param {Insets} delta The amount to change the overscan insets. */ - export function overscanCalibrationAdjust(id: string, delta: Insets): void; + function overscanCalibrationAdjust(id: string, delta: Insets): void; /** - * @description Resets the overscan insets for a display to the last saved value (i.e before Start was called). + * Resets the overscan insets for a display to the last saved value (i.e before Start was called). * @since Chrome 53 * @export * @param {string} id The display's unique identifier. */ - export function overscanCalibrationReset(id: string): void; + function overscanCalibrationReset(id: string): void; /** - * @description Complete overscan adjustments for a display by saving the current values and hiding the overlay. + * Complete overscan adjustments for a display by saving the current values and hiding the overlay. * @since Chrome 53 * @export * @param {string} id The display's unique identifier. */ - export function overscanCalibrationComplete(id: string): void; + function overscanCalibrationComplete(id: string): void; /** - * @description Displays the native touch calibration UX for the display with |id| as display id. This will show an overlay on the screen with required instructions on how to proceed. The callback will be invoked in case of successful calibraion only. If the calibration fails, this will throw an error. + * Displays the native touch calibration UX for the display with |id| as display id. This will show an overlay on the screen with required instructions on how to proceed. The callback will be invoked in case of successful calibraion only. If the calibration fails, this will throw an error. * @since Chrome 57 * @export * @param {string} id The display's unique identifier. * @param {(success) => void} callback Optional callback to inform the caller that the touch calibration has ended. The argument of the callback informs if the calibration was a success or not. */ - export function showNativeTouchCalibration(id: string, callback: (success: boolean) => void): void; + function showNativeTouchCalibration(id: string, callback: (success: boolean) => void): void; /** - * @description Starts custom touch calibration for a display. This should be called when using a custom UX for collecting calibration data. If another touch calibration is already in progress this will throw an error. + * Starts custom touch calibration for a display. This should be called when using a custom UX for collecting calibration data. If another touch calibration is already in progress this will throw an error. * @since Chrome 57 * @export * @param {string} id The display's unique identifier. */ - export function startCustomTouchCalibration(id: string): void; + function startCustomTouchCalibration(id: string): void; /** - * @description Sets the touch calibration pairs for a display. These |pairs| would be used to calibrate the touch screen for display with |id| called in startCustomTouchCalibration(). Always call |startCustomTouchCalibration| before calling this method. If another touch calibration is already in progress this will throw an error. + * Sets the touch calibration pairs for a display. These |pairs| would be used to calibrate the touch screen for display with |id| called in startCustomTouchCalibration(). Always call |startCustomTouchCalibration| before calling this method. If another touch calibration is already in progress this will throw an error. * @since Chrome 57 * @export * @param {TouchCalibrationPairs} pairs The pairs of point used to calibrate the display. * @param {Bounds} bounds Bounds of the display when the touch calibration was performed. |bounds.left| and |bounds.top| values are ignored. */ - export function completeCustomTouchCalibration(pairs: TouchCalibrationPairs, bounds: Bounds): void; + function completeCustomTouchCalibration(pairs: TouchCalibrationPairs, bounds: Bounds): void; /** - * @description Resets the touch calibration for the display and brings it back to its default state by clearing any touch calibration data associated with the display. + * Resets the touch calibration for the display and brings it back to its default state by clearing any touch calibration data associated with the display. * @since Chrome 57 * @export * @param {string} id The display's unique identifier. */ - export function clearTouchCalibration(id: string): void; + function clearTouchCalibration(id: string): void; /** - * @description Fired when anything changes to the display configuration. + * Fired when anything changes to the display configuration. * @export */ - export var onDisplayChanged: DisplayChangedEvent; + const onDisplayChanged: DisplayChangedEvent; } //////////////////// @@ -4897,7 +7624,7 @@ declare namespace chrome { } /** Get physical memory information. */ - export function getInfo(callback: (info: MemoryInfo) => void): void; + function getInfo(callback: (info: MemoryInfo) => void): void; } //////////////////// @@ -4910,7 +7637,7 @@ declare namespace chrome { prefixLength: number; } - export function getNetworkInterfaces(callback: (networkInterfaces: NetworkInterface[]) => void): void; + function getNetworkInterfaces(callback: (networkInterfaces: NetworkInterface[]) => void): void; } //////////////////// @@ -4950,23 +7677,23 @@ declare namespace chrome { interface SystemStorageDetachedEvent extends chrome.events.Event<(id: string) => void> { } /** Get the storage information from the system. The argument passed to the callback is an array of StorageUnitInfo objects. */ - export function getInfo(callback: (info: StorageUnitInfo[]) => void): void; + function getInfo(callback: (info: StorageUnitInfo[]) => void): void; /** * Ejects a removable storage device. * @param callback * Parameter result: success: The ejection command is successful -- the application can prompt the user to remove the device; in_use: The device is in use by another application. The ejection did not succeed; the user should not remove the device until the other application is done with the device; no_such_device: There is no such device known. failure: The ejection command failed. */ - export function ejectDevice(id: string, callback: (result: string) => void): void; + function ejectDevice(id: string, callback: (result: string) => void): void; /** * Get the available capacity of a specified |id| storage device. The |id| is the transient device ID from StorageUnitInfo. * @since Dev channel only. */ - export function getAvailableCapacity(id: string, callback: (info: StorageCapacityInfo) => void): void; + function getAvailableCapacity(id: string, callback: (info: StorageCapacityInfo) => void): void; /** Fired when a new removable storage is attached to the system. */ - export var onAttached: SystemStorageAttachedEvent; + const onAttached: SystemStorageAttachedEvent; /** Fired when a removable storage is detached from the system. */ - export var onDetached: SystemStorageDetachedEvent; + const onDetached: SystemStorageDetachedEvent; } //////////////////// @@ -4980,9 +7707,9 @@ declare namespace chrome { namespace tts { /** An event from the TTS engine to communicate the status of an utterance. */ interface TtsEvent { - /** Optional. The index of the current character in the utterance. */ + /** The index of the current character in the utterance. */ charIndex?: number; - /** Optional. The error description, if the event type is 'error'. */ + /** The error description, if the event type is 'error'. */ errorMessage?: string; /** * The type can be 'start' as soon as speech has started, 'word' when a word boundary is reached, 'sentence' when a sentence boundary is reached, 'marker' when an SSML mark element is reached, 'end' when the end of the utterance is reached, 'interrupted' when the utterance is stopped or interrupted before reaching the end, 'cancelled' when it's removed from the queue before ever being synthesized, or 'error' when any other error occurs. When pausing speech, a 'pause' event is fired if a particular utterance is paused in the middle, and 'resume' if an utterance resumes speech. Note that pause and resume events may not fire if speech is paused in-between utterances. @@ -4993,14 +7720,14 @@ declare namespace chrome { /** A description of a voice available for speech synthesis. */ interface TtsVoice { - /** Optional. The language that this voice supports, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */ + /** The language that this voice supports, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */ lang?: string; /** - * Optional. This voice's gender. + * This voice's gender. * One of: 'male', or 'female' */ gender?: string; - /** Optional. The name of the voice. */ + /** The name of the voice. */ voiceName?: string; /** The ID of the extension providing this voice. */ extensionsId?: string; @@ -5014,7 +7741,7 @@ declare namespace chrome { } interface SpeakOptions { - /** Optional. Speaking volume between 0 and 1 inclusive, with 0 being lowest and 1 being highest, with a default of 1.0. */ + /** Speaking volume between 0 and 1 inclusive, with 0 being lowest and 1 being highest, with a default of 1.0. */ volume?: number; /** * Optional. @@ -5027,7 +7754,7 @@ declare namespace chrome { */ rate?: number; /** - * Optional. This function is called with events that occur in the process of speaking the utterance. + * This function is called with events that occur in the process of speaking the utterance. * @param event The update event from the text-to-speech engine indicating the status of this utterance. */ onEvent?: (event: TtsEvent) => void; @@ -5036,52 +7763,52 @@ declare namespace chrome { * Speaking pitch between 0 and 2 inclusive, with 0 being lowest and 2 being highest. 1.0 corresponds to a voice's default pitch. */ pitch?: number; - /** Optional. The language to be used for synthesis, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */ + /** The language to be used for synthesis, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */ lang?: string; - /** Optional. The name of the voice to use for synthesis. If empty, uses any available voice. */ + /** The name of the voice to use for synthesis. If empty, uses any available voice. */ voiceName?: string; - /** Optional. The extension ID of the speech engine to use, if known. */ + /** The extension ID of the speech engine to use, if known. */ extensionId?: string; /** - * Optional. Gender of voice for synthesized speech. + * Gender of voice for synthesized speech. * One of: 'male', or 'female' */ gender?: string; - /** Optional. The TTS event types the voice must support. */ + /** The TTS event types the voice must support. */ requiredEventTypes?: string[]; - /** Optional. The TTS event types that you are interested in listening to. If missing, all event types may be sent. */ + /** The TTS event types that you are interested in listening to. If missing, all event types may be sent. */ desiredEventTypes?: string[]; } /** Checks whether the engine is currently speaking. On Mac OS X, the result is true whenever the system speech engine is speaking, even if the speech wasn't initiated by Chrome. */ - export function isSpeaking(callback?: (speaking: boolean) => void): void; + function isSpeaking(callback?: (speaking: boolean) => void): void; /** Stops any current speech and flushes the queue of any pending utterances. In addition, if speech was paused, it will now be un-paused for the next call to speak. */ - export function stop(): void; + function stop(): void; /** Gets an array of all available voices. */ - export function getVoices(callback?: (voices: TtsVoice[]) => void): void; + function getVoices(callback?: (voices: TtsVoice[]) => void): void; /** * Speaks text using a text-to-speech engine. * @param utterance The text to speak, either plain text or a complete, well-formed SSML document. Speech engines that do not support SSML will strip away the tags and speak the text. The maximum length of the text is 32,768 characters. - * @param callback Optional. Called right away, before speech finishes. Check chrome.runtime.lastError to make sure there were no errors. Use options.onEvent to get more detailed feedback. + * @param callback Called right away, before speech finishes. Check chrome.runtime.lastError to make sure there were no errors. Use options.onEvent to get more detailed feedback. */ - export function speak(utterance: string, callback?: Function): void; + function speak(utterance: string, callback?: Function): void; /** * Speaks text using a text-to-speech engine. * @param utterance The text to speak, either plain text or a complete, well-formed SSML document. Speech engines that do not support SSML will strip away the tags and speak the text. The maximum length of the text is 32,768 characters. - * @param options Optional. The speech options. - * @param callback Optional. Called right away, before speech finishes. Check chrome.runtime.lastError to make sure there were no errors. Use options.onEvent to get more detailed feedback. + * @param options The speech options. + * @param callback Called right away, before speech finishes. Check chrome.runtime.lastError to make sure there were no errors. Use options.onEvent to get more detailed feedback. */ - export function speak(utterance: string, options: SpeakOptions, callback?: Function): void; + function speak(utterance: string, options: SpeakOptions, callback?: Function): void; /** * Pauses speech synthesis, potentially in the middle of an utterance. A call to resume or stop will un-pause speech. * @since Chrome 29. */ - export function pause(): void; + function pause(): void; /** * If speech was paused, resumes speaking where it left off. * @since Chrome 29. */ - export function resume(): void; + function resume(): void; } //////////////////// @@ -5122,14 +7849,14 @@ declare namespace chrome { } interface ChromeSettingGetDetails { - /** Optional. Whether to return the value that applies to the incognito session (default false). */ + /** Whether to return the value that applies to the incognito session (default false). */ incognito?: boolean; } /** * @param details Details of the currently effective value. */ - export type DetailsCallback = (details: ChromeSettingGetResultDetails) => void; + type DetailsCallback = (details: ChromeSettingGetResultDetails) => void; interface ChromeSettingGetResultDetails { /** @@ -5157,7 +7884,7 @@ declare namespace chrome { /** * Sets the value of a setting. * @param details Which setting to change. - * @param callback Optional. Called at the completion of the set operation. + * @param callback Called at the completion of the set operation. */ set(details: ChromeSettingSetDetails, callback?: Function): void; /** @@ -5168,7 +7895,7 @@ declare namespace chrome { /** * Clears the setting, restoring any default value. * @param details Which setting to clear. - * @param callback Optional. Called at the completion of the clear operation. + * @param callback Called at the completion of the clear operation. */ clear(details: ChromeSettingClearDetails, callback?: Function): void; /** Fired after the setting changes. */ @@ -5197,13 +7924,17 @@ declare namespace chrome { productId: number } + type EndpointType = 'control' | 'interrupt' | 'isochronous' | 'bulk'; + type EndpointSyncType = 'asynchronous' | 'adaptive' | 'synchronous'; + type EndpointUsage = 'data' | 'feedback' | 'explicitFeedback'; + interface EndpointDescriptor { address: number, - type: 'control' | 'interrupt' | 'isochronous' | 'bulk', + type: EndpointType, direction: Direction, maximumPacketSize: number, - synchronization?: 'asynchronous' | 'adaptive' | 'synchronous', - usage?: 'data' | 'feedback' | 'explicitFeedback', + synchronization?: EndpointSyncType, + usage?: EndpointUsage, pollingInterval?: number, extra_data: ArrayBuffer } @@ -5251,10 +7982,14 @@ declare namespace chrome { interfaceProtocol?: number } + type TransferRecipient = 'device' | 'interface' | 'endpoint' | 'other'; + + type TransferRequestType = 'standard' | 'class' | 'vendor' | 'reserved'; + interface TransferInfo { direction: Direction; - recipient: 'device' | 'interface' | 'endpoint' | 'other'; - requestType: 'standard' | 'class' | 'vendor' | 'reserved'; + recipient: TransferRecipient; + requestType: TransferRequestType; request: number; value: number; index: number; @@ -5265,27 +8000,27 @@ declare namespace chrome { interface DeviceEvent extends chrome.events.Event<(device: Device) => void> { } - export var onDeviceAdded: DeviceEvent; - export var onDeviceRemoved: DeviceEvent; + const onDeviceAdded: DeviceEvent; + const onDeviceRemoved: DeviceEvent; - export function getDevices(options: { vendorId?: number, productId?: number, filters?: DeviceFilter[] }, callback: (devices: Device[]) => void): void; - export function getUserSelectedDevices(options: { multiple?: boolean, filters?: DeviceFilter[] }, callback: (devices: Device[]) => void): void; - export function getConfigurations(device: Device, callback: (configs: ConfigDescriptor[]) => void): void; - export function requestAccess(device: Device, interfaceId: number, callback: (success: boolean) => void): void; - export function openDevice(device: Device, callback: (handle: ConnectionHandle) => void): void; - export function findDevices(options: { vendorId: number, productId: number, interfaceId?: number }, callback: (handles: ConnectionHandle[]) => void): void; - export function closeDevice(handle: ConnectionHandle, callback?: () => void): void; - export function setConfiguration(handle: ConnectionHandle, configurationValue: number, callback: () => void): void; - export function getConfiguration(handle: ConnectionHandle, callback: (config: ConfigDescriptor) => void): void; - export function listInterfaces(handle: ConnectionHandle, callback: (descriptors: InterfaceDescriptor[]) => void): void; - export function claimInterface(handle: ConnectionHandle, interfaceNumber: number, callback: () => void): void; - export function releaseInterface(handle: ConnectionHandle, interfaceNumber: number, callback: () => void): void; - export function setInterfaceAlternateSetting(handle: ConnectionHandle, interfaceNumber: number, alternateSetting: number, callback: () => void): void; - export function controlTransfer(handle: ConnectionHandle, transferInfo: TransferInfo, callback: (info: TransferResultInfo) => void): void; - export function bulkTransfer(handle: ConnectionHandle, transferInfo: GenericTransferInfo, callback: (info: TransferResultInfo) => void): void; - export function interruptTransfer(handle: ConnectionHandle, transferInfo: GenericTransferInfo, callback: (info: TransferResultInfo) => void): void; - export function isochronousTransfer(handle: ConnectionHandle, transferInfo: { transferInfo: GenericTransferInfo, packets: number, packetLength: number }, callback: (info: TransferResultInfo) => void): void; - export function resetDevice(handle: ConnectionHandle, callback: (success: boolean) => void): void; + function getDevices(options: { vendorId?: number, productId?: number, filters?: DeviceFilter[] }, callback: (devices: Device[]) => void): void; + function getUserSelectedDevices(options: { multiple?: boolean, filters?: DeviceFilter[] }, callback: (devices: Device[]) => void): void; + function getConfigurations(device: Device, callback: (configs: ConfigDescriptor[]) => void): void; + function requestAccess(device: Device, interfaceId: number, callback: (success: boolean) => void): void; + function openDevice(device: Device, callback: (handle: ConnectionHandle) => void): void; + function findDevices(options: { vendorId: number, productId: number, interfaceId?: number }, callback: (handles: ConnectionHandle[]) => void): void; + function closeDevice(handle: ConnectionHandle, callback?: () => void): void; + function setConfiguration(handle: ConnectionHandle, configurationValue: number, callback: () => void): void; + function getConfiguration(handle: ConnectionHandle, callback: (config: ConfigDescriptor) => void): void; + function listInterfaces(handle: ConnectionHandle, callback: (descriptors: InterfaceDescriptor[]) => void): void; + function claimInterface(handle: ConnectionHandle, interfaceNumber: number, callback: () => void): void; + function releaseInterface(handle: ConnectionHandle, interfaceNumber: number, callback: () => void): void; + function setInterfaceAlternateSetting(handle: ConnectionHandle, interfaceNumber: number, alternateSetting: number, callback: () => void): void; + function controlTransfer(handle: ConnectionHandle, transferInfo: TransferInfo, callback: (info: TransferResultInfo) => void): void; + function bulkTransfer(handle: ConnectionHandle, transferInfo: GenericTransferInfo, callback: (info: TransferResultInfo) => void): void; + function interruptTransfer(handle: ConnectionHandle, transferInfo: GenericTransferInfo, callback: (info: TransferResultInfo) => void): void; + function isochronousTransfer(handle: ConnectionHandle, transferInfo: { transferInfo: GenericTransferInfo, packets: number, packetLength: number }, callback: (info: TransferResultInfo) => void): void; + function resetDevice(handle: ConnectionHandle, callback: (success: boolean) => void): void; } @@ -5302,9 +8037,9 @@ declare namespace chrome { interface VpnSessionParameters { /** IP address for the VPN interface in CIDR notation. IPv4 is currently the only supported mode. */ address: string; - /** Optional. Broadcast address for the VPN interface. (default: deduced from IP address and mask) */ + /** Broadcast address for the VPN interface. (default: deduced from IP address and mask) */ broadcastAddress?: string; - /** Optional. MTU setting for the VPN interface. (default: 1500 bytes) */ + /** MTU setting for the VPN interface. (default: 1500 bytes) */ mtu?: string; /** * Exclude network traffic to the list of IP blocks in CIDR notation from the tunnel. This can be used to bypass traffic to and from the VPN server. When many rules match a destination, the rule with the longest matching prefix wins. Entries that correspond to the same CIDR block are treated as duplicates. Such duplicates in the collated (exclusionList + inclusionList) list are eliminated and the exact duplicate entry that will be eliminated is undefined. @@ -5314,7 +8049,7 @@ declare namespace chrome { * Include network traffic to the list of IP blocks in CIDR notation to the tunnel. This parameter can be used to set up a split tunnel. By default no traffic is directed to the tunnel. Adding the entry '0.0.0.0/0' to this list gets all the user traffic redirected to the tunnel. When many rules match a destination, the rule with the longest matching prefix wins. Entries that correspond to the same CIDR block are treated as duplicates. Such duplicates in the collated (exclusionList + inclusionList) list are eliminated and the exact duplicate entry that will be eliminated is undefined. */ inclusionList: string[]; - /** Optional. A list of search domains. (default: no search domain) */ + /** A list of search domains. (default: no search domain) */ domainSearch?: string[]; /** A list of IPs for the DNS servers. */ dnsServer: string[]; @@ -5336,135 +8071,123 @@ declare namespace chrome { * @param callback Called when the configuration is created or if there is an error. * Parameter id: A unique ID for the created configuration, empty string on failure. */ - export function createConfig(name: string, callback: (id: string) => void): void; + function createConfig(name: string, callback: (id: string) => void): void; /** * Destroys a VPN configuration created by the extension. * @param id ID of the VPN configuration to destroy. - * @param callback Optional. Called when the configuration is destroyed or if there is an error. + * @param callback Called when the configuration is destroyed or if there is an error. */ - export function destroyConfig(id: string, callback?: Function): void; + function destroyConfig(id: string, callback?: Function): void; /** * Sets the parameters for the VPN session. This should be called immediately after 'connected' is received from the platform. This will succeed only when the VPN session is owned by the extension. * @param parameters The parameters for the VPN session. * @param callback Called when the parameters are set or if there is an error. */ - export function setParameters(parameters: VpnSessionParameters, callback: Function): void; + function setParameters(parameters: VpnSessionParameters, callback: Function): void; /** * Sends an IP packet through the tunnel created for the VPN session. This will succeed only when the VPN session is owned by the extension. * @param data The IP packet to be sent to the platform. - * @param callback Optional. Called when the packet is sent or if there is an error. + * @param callback Called when the packet is sent or if there is an error. */ - export function sendPacket(data: ArrayBuffer, callback?: Function): void; + function sendPacket(data: ArrayBuffer, callback?: Function): void; /** * Notifies the VPN session state to the platform. This will succeed only when the VPN session is owned by the extension. * @param state The VPN session state of the VPN client. * connected: VPN connection was successful. * failure: VPN connection failed. - * @param callback Optional. Called when the notification is complete or if there is an error. + * @param callback Called when the notification is complete or if there is an error. */ - export function notifyConnectionStateChanged(state: string, callback?: Function): void; + function notifyConnectionStateChanged(state: string, callback?: Function): void; /** Triggered when a message is received from the platform for a VPN configuration owned by the extension. */ - export var onPlatformMessage: VpnPlatformMessageEvent; + const onPlatformMessage: VpnPlatformMessageEvent; /** Triggered when an IP packet is received via the tunnel for the VPN session owned by the extension. */ - export var onPacketReceived: VpnPacketReceptionEvent; + const onPacketReceived: VpnPacketReceptionEvent; /** Triggered when a configuration created by the extension is removed by the platform. */ - export var onConfigRemoved: VpnConfigRemovalEvent; + const onConfigRemoved: VpnConfigRemovalEvent; /** Triggered when a configuration is created by the platform for the extension. */ - export var onConfigCreated: VpnConfigCreationEvent; + const onConfigCreated: VpnConfigCreationEvent; /** Triggered when there is a UI event for the extension. UI events are signals from the platform that indicate to the app that a UI dialog needs to be shown to the user. */ - export var onUIEvent: VpnUiEvent; + const onUIEvent: VpnUiEvent; } - //////////////////// - // Wallpaper - //////////////////// + /////////////// + // Wallpaper // + /////////////// /** * Use the chrome.wallpaper API to change the ChromeOS wallpaper. - * Permissions: 'wallpaper' - * Important: This API works only on Chrome OS. + * @requires Permissions: 'wallpaper' + * @requires Important: This API works only on Chrome OS. * @since Chrome 43. */ namespace wallpaper { + type WallpaperLayout = + 'STRETCH' | + 'CENTER' | + 'CENTER_CROPPED'; interface WallpaperDetails { - /** Optional. The jpeg or png encoded wallpaper image. */ + /** The jpeg or png encoded wallpaper image. */ data?: any; - /** Optional. The URL of the wallpaper to be set. */ + /** The URL of the wallpaper to be set. */ url?: string; - /** - * The supported wallpaper layouts. - * One of: 'STRETCH', 'CENTER', or 'CENTER_CROPPED' - */ - layout: string; + /** The supported wallpaper layouts. */ + layout: WallpaperLayout; /** The file name of the saved wallpaper. */ filename: string; - /** Optional. True if a 128x60 thumbnail should be generated. */ + /** True if a 128x60 thumbnail should be generated. */ thumbnail?: boolean; } /** * Sets wallpaper to the image at url or wallpaperData with the specified layout - * @param callback - * Optional parameter thumbnail: The jpeg encoded wallpaper thumbnail. It is generated by resizing the wallpaper to 128x60. + * @param callback Contains the optional parameter thumbnail: The jpeg encoded wallpaper thumbnail. It is generated by resizing the wallpaper to 128x60. */ - export function setWallpaper(details: WallpaperDetails, callback: (thumbnail: any) => void): void; + function setWallpaper(details: WallpaperDetails, callback: (thumbnail?: string) => void): void; } - /////////////////// - // Webview Tag - /////////////////// + ///////////////// + // Webview Tag // + ///////////////// /** - * Use the webview tag to actively load live content from the web over the network and embed it in your Chrome App. Your app can control the appearance of the webview and interact with the web content, initiate navigations in an embedded web page, react to error events that happen within it, and more (see Usage). + * Use the webview tag to actively load live content from the web over the network and embed it in your Chrome App. + * Your app can control the appearance of the *webview* and interact with the web content, initiate navigations in + * an embedded web page, react to error events that happen within it. */ namespace webview { - /** Options that determine what data should be cleared by `clearData`. */ + /** Options that determine what data should be cleared by *clearData`* */ interface ClearDataOptions { - /** Clear data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the getTime method of the JavaScript Date object). If absent, defaults to 0 (which would remove all browsing data). */ + /** + * Clear data accumulated on or after this date, + * represented in milliseconds since the epoch + * (accessible via the getTime method of the JavaScript *Date* object). + * If absent, defaults to *0* (which would remove all browsing data). + **/ since?: number; } interface WindowEvent extends chrome.events.Event<() => void> { } interface ConsoleEvent extends Event { - /** - * @description The severity level of the log message. Ranges from 0 to 4. - * @type {number} - * @memberof ConsoleEvent - */ + /** The severity level of the log message. Ranges from 0 to 4. */ level: number; - /** - * @description The logged message contents. - * @type {string} - * @memberof ConsoleEvent - */ + /** The logged message contents.*/ message: string; - /** - * @description The line number of the message source. - * @type {number} - * @memberof ConsoleEvent - */ + /** The line number of the message source.*/ line: number; - /** - * @description A string identifying the resource which logged the message. - * @type {string} - * @memberof ConsoleEvent - */ + /** A string identifying the resource which logged the message. */ sourceId: string; } + type ExitEventReason = + 'normal' | + 'abnormal' | + 'crash' | + 'kill'; interface ExitEvent extends Event { - /** - * @description Chrome's internal ID of the process that exited. - * @type {number} - * @memberof ExitEvent - */ + /** Chrome's internal ID of the process that exited. */ processID: number; - /** - * @description String indicating the reason for the exit. - * @type {string} - * @memberof ExitEvent - */ - reason: 'normal' | 'abnormal' | 'crash' | 'kill'; + /** String indicating the reason for the exit. */ + reason: ExitEventReason; } /** Description of a declarative rule for handling events. */ @@ -5473,47 +8196,44 @@ declare namespace chrome { priority?: number; /** List of conditions that can trigger the actions. */ conditions: any[]; - /** Optional. Optional identifier that allows referencing this rule. */ + /** Optional identifier that allows referencing this rule. */ id?: string; /** List of actions that are triggered if one of the condtions is fulfilled. */ actions: any[]; /** - * @description Tags can be used to annotate rules and perform operations on sets of rules.¨ + * Tags can be used to annotate rules and perform operations on sets of rules.¨ * @since Chrome 28 - * @type {string[]} - * @memberof Rule */ tags?: string[]; } /** - * @description Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time. - * @export - * @interface InjectDetails + * Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time. */ interface InjectDetails { /** - * @description JavaScript or CSS code to inject.

Warning:
Be careful using the code parameter. Incorrect use of it may open your app to cross site scripting attacks. - * @type {string} - * @memberof InjectDetails + * JavaScript or CSS code to inject. + * + * **Warning** + * Be careful using the *code* parameter. + * Incorrect use of it may open your app to + * cross site scripting attacks. + * @see[More information]{@link https://en.wikipedia.org/wiki/Cross-site_scripting} */ code?: string, /** - * @description JavaScript or CSS file to inject. - * @type {string} - * @memberof InjectDetails + * JavaScript or CSS file to inject. */ file?: string } /** - * @description WebView element from html + * WebView element from html */ - interface HTMLWebViewElement extends Element { - /** - * This sets the guest content's window.name object. - */ + interface HTMLWebViewElement extends HTMLElement { + /** This sets the guest content's window.name object.**/ name: string; + /** * Returns the visible URL. Mirrors the logic in the browser's omnibox: either returning a pending new navigation if initiated by the embedder page, or the last committed navigation. Writing to this attribute initiates top-level navigation. * Assigning src its own value will reload the current page. @@ -5521,28 +8241,45 @@ declare namespace chrome { * The src attribute can also accept data URLs, such as 'data:text/plain,Hello, world!'. */ src: string; + /** - * Storage partition ID used by the webview tag. If the storage partition ID starts with persist: (partition='persist:googlepluswidgets'), the webview will use a persistent storage partition available to all guests in the app with the same storage partition ID. If the ID is unset or if there is no 'persist': prefix, the webview will use an in-memory storage partition. This value can only be modified before the first navigation, since the storage partition of an active renderer process cannot change. Subsequent attempts to modify the value will fail with a DOM exception. By assigning the same partition ID, multiple webviews can share the same storage partition. + * Storage partition ID used by the webview tag. + * If the storage partition ID starts with persist: (partition='persist:googlepluswidgets'), + * the webview will use a persistent storage partition available to all guests in the app with the same storage partition ID. + * If the ID is unset or if there is no 'persist': prefix, the webview will use an in-memory storage partition. + * his value can only be modified before the first navigation, since the storage partition of an active renderer process cannot change. + * Subsequent attempts to modify the value will fail with a DOM exception. + * By assigning the same partition ID, multiple webviews can share the same storage partition. */ partition?: string; + /** - * If present, portions of the embedder could be visible through the webview, where the contents are transparent. Without allowtransparency enabled, no part of the embedder will be shown through the webview, even if elements exist that are specified as transparent. + * If present, portions of the embedder could be visible through the webview, + * where the contents are transparent. Without allowtransparency enabled, + * no part of the embedder will be shown through the webview, + * even if elements exist that are specified as transparent. * This does not affect transparency within the contents of the webview itself. */ allowtransparency?: boolean; + /** * If 'on', the webview container will automatically resize within the bounds specified by the attributes minwidth, minheight, maxwidth, and maxheight. * These constraints do not impact the webview UNLESS autosize is enabled. * When autosize is enabled, the webview container size cannot be less than the minimum values or greater than the maximum. */ autosize?: 'on'; + /** * Object reference which can be used to post messages into the guest page. */ contentWindow: ContentWindow; + /** Interface which provides access to webRequest events on the guest page. */ request: WebRequestEventInterface; - /** Similar to chrome's ContextMenus API, but applies to webview instead of browser. Use the webview.contextMenus API to add items to webview's context menu. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages. */ + + /** Similar to chrome's ContextMenus API, but applies to webview instead of browser. + * Use the webview.contextMenus API to add items to webview's context menu. + * You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages. */ contextMenus: webview.ContextMenus; /** * Fired when the guest window attempts to close itself. @@ -5553,7 +8290,7 @@ declare namespace chrome { * Fired when the guest window logs a console message. * The following example code forwards all log messages to the embedder's console without regard for log level or other properties. */ - addEventListener(type: 'consolemessage', listener: (this: HTMLWebViewElement, ev: IConsoleMessage) => void, useCapture?: boolean): void; + addEventListener(type: 'consolemessage', listener: (this: HTMLWebViewElement, ev: ConsoleMessage) => void, useCapture?: boolean): void; /** * Fired when the guest window fires a load event, i.e., when a new document is loaded. This does not include page navigation within the current document or asynchronous resource loads. * The following example code modifies the default font size of the guest's body element after the page loads: @@ -5568,33 +8305,33 @@ declare namespace chrome { * Handling this event will block the guest process until each event listener returns or the dialog object becomes unreachable (if preventDefault() was called.) * The default behavior is to cancel the dialog. */ - addEventListener(type: 'dialog', listener: (this: HTMLWebViewElement, ev: IDialog) => void, useCapture?: boolean): void; + addEventListener(type: 'dialog', listener: (this: HTMLWebViewElement, ev: Dialog) => void, useCapture?: boolean): void; /** * Fired when the process rendering the guest web content has exited. */ - addEventListener(type: 'exit', listener: (this: HTMLWebViewElement, ev: IExit) => void, useCapture?: boolean): void; + addEventListener(type: 'exit', listener: (this: HTMLWebViewElement, ev: Exit) => void, useCapture?: boolean): void; /** * Fired when new find results are available for an active find request. This might happen multiple times for a single find request as matches are found. */ - addEventListener(type: 'findupdate', listener: (this: HTMLWebViewElement, ev: IFindupdate) => void, useCapture?: boolean): void; + addEventListener(type: 'findupdate', listener: (this: HTMLWebViewElement, ev: FindUpdate) => void, useCapture?: boolean): void; /** * Fired when a top-level load has aborted without committing. An error message will be printed to the console unless the event is default-prevented. * Note: When a resource load is aborted, a loadabort event will eventually be followed by a loadstop event, even if all committed loads since the last loadstop event (if any) were aborted. * Note: When the load of either an about URL or a JavaScript URL is aborted, loadabort will be fired and then the webview will be navigated to 'about:blank'. */ - addEventListener(type: 'loadabort', listener: (this: HTMLWebViewElement, ev: ILoadabort) => void, useCapture?: boolean): void; + addEventListener(type: 'loadabort', listener: (this: HTMLWebViewElement, ev: LoadAbort) => void, useCapture?: boolean): void; /** * Fired when a load has committed. This includes navigation within the current document as well as subframe document-level loads, but does not include asynchronous resource loads. */ - addEventListener(type: 'loadcommit', listener: (this: HTMLWebViewElement, ev: ILoadcommit) => void, useCapture?: boolean): void; + addEventListener(type: 'loadcommit', listener: (this: HTMLWebViewElement, ev: LoadCommit) => void, useCapture?: boolean): void; /** * Fired when a top-level load request has redirected to a different URL. */ - addEventListener(type: 'loadredirect', listener: (this: HTMLWebViewElement, ev: ILoadredirect) => void, useCapture?: boolean): void; + addEventListener(type: 'loadredirect', listener: (this: HTMLWebViewElement, ev: LoadRedirect) => void, useCapture?: boolean): void; /** * Fired when a load has begun. */ - addEventListener(type: 'loadstart', listener: (this: HTMLWebViewElement, ev: ILoadstart) => void, useCapture?: boolean): void; + addEventListener(type: 'loadstart', listener: (this: HTMLWebViewElement, ev: LoadStart) => void, useCapture?: boolean): void; /** * Fired when all frame-level loads in a guest page (including all its subframes) have completed. * This includes navigation within the current document as well as subframe document-level loads, but does not include asynchronous resource loads. @@ -5608,12 +8345,12 @@ declare namespace chrome { * The following example code will create and navigate a new webview in the embedder for each requested new window: * @example * webview.addEventListener('newwindow', function(e) { - * var newWebview = document.createElement('webview'); + * const newWebview = document.createElement('webview'); * document.body.appendChild(newWebview); * e.window.attach(newWebview); * }); */ - addEventListener(type: 'newwindow', listener: (this: HTMLWebViewElement, ev: INewwindow) => void, useCapture?: boolean): void; + addEventListener(type: 'newwindow', listener: (this: HTMLWebViewElement, ev: NewWindow) => void, useCapture?: boolean): void; /** * Fired when the guest page needs to request special permission from the embedder. * The following example code will grant the guest page access to the webkitGetUserMedia API. @@ -5625,40 +8362,40 @@ declare namespace chrome { * } * }); */ - addEventListener(type: 'permissionrequest', listener: (this: HTMLWebViewElement, ev: IPermissionrequest) => void, useCapture?: boolean): void; + addEventListener(type: 'permissionrequest', listener: (this: HTMLWebViewElement, ev: PermissionRequest) => void, useCapture?: boolean): void; /** Fired when the process rendering the guest web content has become responsive again after being unresponsive. */ - addEventListener(type: 'response', listener: (this: HTMLWebViewElement, ev: IResponsive) => void, useCapture?: boolean): void; + addEventListener(type: 'response', listener: (this: HTMLWebViewElement, ev: ProcessResponsive) => void, useCapture?: boolean): void; /** Fired when the embedded web content has been resized via autosize. Only fires if autosize is enabled. */ - addEventListener(type: 'sizechanged', listener: (this: HTMLWebViewElement, ev: ISizechanged) => void, useCapture?: boolean): void; + addEventListener(type: 'sizechanged', listener: (this: HTMLWebViewElement, ev: SizeChanged) => void, useCapture?: boolean): void; /** Fired when the process rendering the guest web content has become unresponsive. This event will be generated once with a matching responsive event if the guest begins to respond again. */ - addEventListener(type: 'unresponsive', listener: (this: HTMLWebViewElement, ev: IUnresponsive) => void, useCapture?: boolean): void; + addEventListener(type: 'unresponsive', listener: (this: HTMLWebViewElement, ev: ProcessUnresponsive) => void, useCapture?: boolean): void; /** Fired when the page's zoom changes. */ - addEventListener(type: 'zoomchange', listener: (this: HTMLWebViewElement, ev: IZoomchange) => void, useCapture?: boolean): void; + addEventListener(type: 'zoomchange', listener: (this: HTMLWebViewElement, ev: ZoomChange) => void, useCapture?: boolean): void; /** - * @description Queries audio state. - */ + * Queries audio state. + **/ getAudioState(callback: (audible: boolean) => void): void; /** - * @description Sets audio mute state of the webview. - * @param {boolean} mute Mute audio value + * Sets audio mute state of the webview. + * @param mute Mute audio value */ setAudioMuted(mute: boolean): void; /** - * @description Queries whether audio is muted. + * Queries whether audio is muted. */ isAudioMuted(callback: (muted: boolean) => void): void; /** - * @description Captures the visible region of the webview. - * @param {(dataUrl: string) => void} callback A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display. + * Captures the visible region of the webview. + * @param callback A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display. */ captureVisibleRegion(callback: (dataUrl: string) => void): void; /** - * @description Captures the visible region of the webview. - * @param {*} options - * @param {(dataUrl: string) => void} callback + * Captures the visible region of the webview. + * @param options + * @param callback */ captureVisibleRegion(options: chrome.extensionTypes.ImageDetails, callback: (dataUrl: string) => void): void; @@ -5713,1059 +8450,975 @@ declare namespace chrome { addContentScripts(contentScriptList: ContentScriptDetails[]): void; /** - * @description Navigates backward one history entry if possible. Equivalent to go(-1). - * @param {(success: boolean) => void} [callback] Called after the navigation has either failed or completed successfully. Success parameter indicates whether the navigation was successful. + * Navigates backward one history entry if possible. Equivalent to go(-1). + * @param [callback] Called after the navigation has either failed or completed successfully. Success parameter indicates whether the navigation was successful. */ back(callback?: (success: boolean) => void): void; /** - * @description Indicates whether or not it is possible to navigate backward through history. The state of this function is cached, and updated before each loadcommit, so the best place to call it is on loadcommit. + * Indicates whether or not it is possible to navigate backward through history. + * The state of this function is cached, and updated before each loadcommit, + * so the best place to call it is on loadcommit. */ canGoBack(): void; /** - * @description Indicates whether or not it is possible to navigate forward through history. The state of this function is cached, and updated before each loadcommit, so the best place to call it is on loadcommit. + * Indicates whether or not it is possible to navigate forward through history. + * The state of this function is cached, and updated before each loadcommit, + * so the best place to call it is on loadcommit. */ canGoForward(): void; /** - * @description

Clears browsing data for the webview partition.

- * @param options Options determining which data to clear. - * @param types The types of data to be cleared. + * Clears browsing data for the webview partition. + * @param options Options determining which data to clear. + * @param types The types of data to be cleared. * @param callback */ clearData(options: ClearDataOptions, types: ClearDataTypeSet, callback?: () => void): void; /** - * @description

Injects JavaScript code into the guest page.

The following sample code uses script injection to set the guest page's background color to red:

webview.executeScript({ code: 'document.body.style.backgroundColor = 'red'' });
- * @param details Details of the script to run. + * Injects JavaScript code into the guest page. + * The following sample code uses script injection + * to set the guest page's background color to red: + * @example webview.executeScript({ code: 'document.body.style.backgroundColor = 'red'' }); + * @param details Details of the script to run. * @param callback */ executeScript(details: InjectDetails, callback?: (result?: any[]) => void): void; /** - * @description Initiates a find-in-page request. - * @param {string} searchText The string to find in the page. - * @param options Options for the find request. + * Initiates a find-in-page request. + * @param {string} searchText The string to find in the page. + * @param options Options for the find request. * @param callback */ find(searchText: string, options?: FindOptions, callback?: (results?: any) => void): void; /** - * @description Navigates forward one history entry if possible. Equivalent to go(1). + * Navigates forward one history entry if possible. Equivalent to go(1). * @param callback */ forward(callback?: (success: boolean) => void): void; /** - * @description Returns Chrome's internal process ID for the guest web page's current process, allowing embedders to know how many guests would be affected by terminating the process. Two guests will share a process only if they belong to the same app and have the same storage partition ID. The call is synchronous and returns the embedder's cached notion of the current process ID. The process ID isn't the same as the operating system's process ID. + * Returns Chrome's internal process ID for the guest web page's current process, allowing embedders to know how many guests would be affected by terminating the process. Two guests will share a process only if they belong to the same app and have the same storage partition ID. The call is synchronous and returns the embedder's cached notion of the current process ID. The process ID isn't the same as the operating system's process ID. */ getProcessId(): void; /** - * @description Returns the user agent string used by the webview for guest page requests. + * Returns the user agent string used by the webview for guest page requests. */ getUserAgent(): void; /** - * @description Gets the current zoom factor. + * Gets the current zoom factor. * @param callback */ getZoom(callback: (zoomFactor: number) => void): void; /** - * @description Gets the current zoom mode. + * Gets the current zoom mode. * @param callback */ getZoomMode(callback: (ZoomMode: any) => void): void; /** - * @description Navigates to a history entry using a history index relative to the current navigation. If the requested navigation is impossible, this method has no effect. - * @param {number} relativeIndex Relative history index to which the webview should be navigated. For example, a value of 2 will navigate forward 2 history entries if possible; a value of -3 will navigate backward 3 entries. + * Navigates to a history entry using a history index relative to the current navigation. + * If the requested navigation is impossible, this method has no effect. + * @param relativeIndex Relative history index to which the webview should be navigated. + * For example, a value of 2 will navigate forward 2 history entries if possible; + * a value of -3 will navigate backward 3 entries. * @param callback */ go(relativeIndex: number, callback?: (success: boolean) => void): void; /** - * @description Injects CSS into the guest page. - * @param details Details of the CSS to insert. + * Injects CSS into the guest page. + * @param details Details of the CSS to insert. * @param callback */ insertCSS(details: InjectDetails, callback?: () => void): void; - /** - * @description Indicates whether or not the webview's user agent string has been overridden by $(ref:webviewTag.setUserAgentOverride). - */ + /** Indicates whether or not the webview's user agent string has been overridden by *setUserAgentOverride*. */ isUserAgentOverridden(): void; - /** - * @description Prints the contents of the webview. This is equivalent to calling scripted print function from the webview itself. - */ + /** Prints the contents of the webview. This is equivalent to calling scripted print function from the webview itself. */ print(): void; - /** - * @description Reloads the current top-level page. - */ + /** Reloads the current top-level page. */ reload(): void; /** - * @description Removes content scripts from a webview. - * @description The following example removes 'myRule' which was added before. - * @example webview.removeContentScripts(['myRule']); - * @description You can remove all the rules by calling: - * @example webview.removeContentScripts(); - * @param {any[]} scriptNameList A list of names of content scripts that will be removed. If the list is empty, all the content scripts added to the webview will be removed. + * Removes content scripts from a webview. + * The following example removes 'myRule' which was added before. + * @example webview.removeContentScripts(['myRule']); + * @description You can remove all the rules by calling: + * @example webview.removeContentScripts(); + * @todo TODO LIST FIX + * @param {any[]} scriptNameList A list of names of content scripts that will be removed. If the list is empty, all the content scripts added to the webview will be removed. */ removeContentScripts(scriptNameList?: any[]): void; /** - * @description Override the user agent string used by the webview for guest page requests. - * @param {string} userAgent The user agent string to use. + * Override the user agent string used by the webview for guest page requests. + * @param userAgent The user agent string to use. */ setUserAgentOverride(userAgent: string): void; /** - * @description Changes the zoom factor of the page. The scope and persistence of this change are determined by the webview's current zoom mode (see $(ref:webviewTag.ZoomMode)). - * @param {number} zoomFactor The new zoom factor. - * @param callback + * Changes the zoom factor of the page. + * The scope and persistence of this change + * are determined by the webview's current zoom mode. + * @param zoomFactor The new zoom factor. + * @param [callback] */ setZoom(zoomFactor: number, callback?: () => void): void; /** - * @description Sets the zoom mode of the webview. - * @param ZoomMode Defines how zooming is handled in the webview. - * @param callback + * Sets the zoom mode of the webview. + * @param ZoomMode Defines how zooming is handled in the webview. + * @param [callback] */ setZoomMode(ZoomMode: ZoomMode, callback?: () => void): void; - /** - * @description Stops loading the current webview navigation if in progress. - */ + /** Stops loading the current webview navigation if in progress. */ stop(): void; /** - * @description Ends the current find session (clearing all highlighting) and cancels all find requests in progress. - * @param {string} action Determines what to do with the active match after the find session has ended. clear will clear the highlighting over the active match; keep will keep the active match highlighted; activate will keep the active match highlighted and simulate a user click on that match. The default action is keep. + * @todo TODO Fix action param + * Ends the current find session (clearing all highlighting) + * and cancels all find requests in progress. + * @param {string} action Determines what to do with the active match after the find session has ended. clear will clear the highlighting over the active match; keep will keep the active match highlighted; activate will keep the active match highlighted and simulate a user click on that match. The default action is keep. */ stopFinding(action?: string): void; /** - * @description Loads a data URL with a specified base URL used for relative links. Optionally, a virtual URL can be provided to be shown to the user instead of the data URL. - * @param {string} dataUrl The data URL to load. - * @param {string} baseUrl The base URL that will be used for relative links. - * @param {string} virtualUrl The URL that will be displayed to the user (in the address bar). + * Loads a data URL with a specified base URL used for relative links. + * Optionally, a virtual URL can be provided to be shown to the user instead of the data URL. + * @param {string} dataUrl The data URL to load. + * @param {string} baseUrl The base URL that will be used for relative links. + * @param {string} virtualUrl The URL that will be displayed to the user (in the address bar). */ loadDataWithBaseUrl(dataUrl: string, baseUrl: string, virtualUrl?: string): void; /** - * @description Forcibly kills the guest web page's renderer process. This may affect multiple webview tags in the current app if they share the same process, but it will not affect webview tags in other apps. + * Forcibly kills the guest web page's renderer process. + * This may affect multiple webview tags in the current app if they share the same process, + * but it will not affect webview tags in other apps. */ terminate(): void; /** - * @description Fired when the guest window attempts to close itself.

The following example code navigates the webview to about:blank when the guest attempts to close itself.

webview.addEventListener('close', function() {
-              webview.src = 'about:blank';
-            });
+ * Fired when the guest window attempts to close itself. + * The following example code navigates the webview to + * about:blank when the guest attempts to close itself. + * @example + * webview.addEventListener('close', function() { + * webview.src = 'about:blank'; + * }); */ - close(event: chrome.events.Event): void; /** - * @description Fired when the guest window logs a console message.

The following example code forwards all log messages to the embedder's console without regard for log level or other properties.

webview.addEventListener('consolemessage', function(e) {
-              console.log('Guest page logged a message: ', e.message);
-            });
- * @param callback + * Fired when the guest window logs a console message. + * The following example code forwards all log messages + * to the embedder's console without regard for log level + * or other properties. + * @example + * webview.addEventListener('consolemessage', function(e) { + * console.log('Guest page logged a message: ', e.message); + * }); */ - - consolemessage: chrome.events.Event; + consolemessage: chrome.events.Event; /** - * @description Fired when the guest window fires a load event, i.e., when a new document is loaded. This does not include page navigation within the current document or asynchronous resource loads.

The following example code modifies the default font size of the guest's body element after the page loads:

webview.addEventListener('contentload', function() {
-              webview.executeScript({ code: 'document.body.style.fontSize = '42px'' });
-            });
+ * Fired when the guest window fires a load event, i.e., when a new document is loaded. + * This does *not* include page navigation within the current document or asynchronous + * resource loads. The following example code modifies the default font size of the + * guest's body element after the page loads: + * @example + * webview.addEventListener('contentload', function() { + * webview.executeScript({ code: 'document.body.style.fontSize = '42px'' }); + * }); */ - contentload: (event: chrome.events.Event) => void; /** - * @description Fired when the guest window attempts to open a modal dialog via window.alert, window.confirm, or window.prompt.

Handling this event will block the guest process until each event listener returns or the dialog object becomes unreachable (if preventDefault() was called.)

The default behavior is to cancel the dialog.

+ * Fired when the guest window attempts to open a modal dialog via window.alert, window.confirm, or window.prompt.

Handling this event will block the guest process until each event listener returns or the dialog object becomes unreachable (if preventDefault() was called.)

The default behavior is to cancel the dialog.

* @param callback */ - dialog: chrome.events.Event; + dialog: chrome.events.Event; /** - * @description Fired when the process rendering the guest web content has exited.

The following example code will show a farewell message whenever the guest page crashes:

webview.addEventListener('exit', function(e) {
-              if (e.reason === 'crash') {
-                webview.src = 'data:text/plain,Goodbye, world!';
-              }
-            });
+ * Fired when the process rendering the guest web content has exited. + * The following example code will show a farewell message whenever + * the guest page crashes: + * @example + * webview.addEventListener('exit', function(e) { + * if (e.reason === 'crash') { + * webview.src = 'data:text/plain,Goodbye, world!'; + * } + * }); * @param callback */ - exit: chrome.events.Event; + exit: chrome.events.Event; /** - * @description Fired when new find results are available for an active find request. This might happen multiple times for a single find request as matches are found. + * Fired when new find results are available for an active find request. + * This might happen multiple times for a single find request as matches are found. + */ + + findupdate: chrome.events.Event; + + /** + * Fired when a top-level load has aborted without committing. + * An error message will be printed to the console unless the event is default-prevented. + * @requires Note: When a resource load is aborted, + * a loadabort event will eventually be followed by a loadstop event, + * even if all committed loads since the last loadstop event (if any) + * were aborted. + * @requires Note: When the load of either an about URL + * or a JavaScript URL is aborted, loadabort will be fired + * and then the webview will be navigated to 'about:blank'. + */ + + loadabort: chrome.events.Event; + + /** + * Fired when a load has committed. This includes navigation within the current document as well as subframe document-level loads, but does not include asynchronous resource loads. * @param callback */ - findupdate: chrome.events.Event; + loadcommit: chrome.events.Event; /** - * @description Fired when a top-level load has aborted without committing. An error message will be printed to the console unless the event is default-prevented.

Note: When a resource load is aborted, a loadabort event will eventually be followed by a loadstop event, even if all committed loads since the last loadstop event (if any) were aborted.

Note: When the load of either an about URL or a JavaScript URL is aborted, loadabort will be fired and then the webview will be navigated to 'about:blank'.

+ * Fired when a top-level load request has redirected to a different URL. * @param callback */ - loadabort: chrome.events.Event; + loadredirect: chrome.events.Event; /** - * @description Fired when a load has committed. This includes navigation within the current document as well as subframe document-level loads, but does not include asynchronous resource loads. + * Fired when a load has begun. * @param callback */ - loadcommit: chrome.events.Event; + loadstart: chrome.events.Event; /** - * @description Fired when a top-level load request has redirected to a different URL. - * @param callback + * Fired when all frame-level loads in a guest page (including all its subframes) + * have completed. This includes navigation within the current document as well + * as subframe document-level loads, but does not(!) include asynchronousresource + * loads. This event fires every time the number of document-level loads transitions + * from one (or more) to zero. For example, if a page that has already finished loading + * (i.e., loadstop already fired once) creates a new iframe which loads a page, + * then a second loadstop will fire when the iframe page load completes. This pattern + * is commonly observed on pages that load ads. + * @requires Note: When a committed load is aborted, + * a loadstop event will eventually follow a loadabort event, + * even if all committed loads since the last loadstop event (if any) were aborted. */ - - loadredirect: chrome.events.Event; - - /** - * @description Fired when a load has begun. - * @param callback - */ - - loadstart: chrome.events.Event; - - /** - * @description Fired when all frame-level loads in a guest page (including all its subframes) have completed. This includes navigation within the current document as well as subframe document-level loads, but does not include asynchronous resource loads. This event fires every time the number of document-level loads transitions from one (or more) to zero. For example, if a page that has already finished loading (i.e., loadstop already fired once) creates a new iframe which loads a page, then a second loadstop will fire when the iframe page load completes. This pattern is commonly observed on pages that load ads.

Note: When a committed load is aborted, a loadstop event will eventually follow a loadabort event, even if all committed loads since the last loadstop event (if any) were aborted.

- */ - loadstop(event: chrome.events.Event): void; /** - * @description Fired when the guest page attempts to open a new browser window.

The following example code will create and navigate a new webview in the embedder for each requested new window:

webview.addEventListener('newwindow', function(e) {
-              var newWebview = document.createElement('webview');
-              document.body.appendChild(newWebview);
-              e.window.attach(newWebview);
-            });
- * @param callback + * Fired when the guest page attempts to open a new browser window. + * The following example code will create and navigate a new webview + * in the embedder for each requested new window: + * @example + * webview.addEventListener('newwindow', function(e) { + * const newWebview = document.createElement('webview'); + * document.body.appendChild(newWebview); + * e.window.attach(newWebview); + * }); */ - newwindow: chrome.events.Event; + newwindow: chrome.events.Event; /** - * @description Fired when the guest page needs to request special permission from the embedder.

The following example code will grant the guest page access to the webkitGetUserMedia API. Note that an app using this example code must itself specify audioCapture and/or videoCapture manifest permissions:

webview.addEventListener('permissionrequest', function(e) {
-              if (e.permission === 'media') {
-                e.request.allow();
-              }
-            });
- * @param callback + * Fired when the guest page needs to request special permission from the embedder. + * The following example code will grant the guest page access to the webkitGetUserMedia API. + * Note that an app using this example code must itself specify audioCapture and / or + * videoCapture manifest permissions: + * @example + * webview.addEventListener('permissionrequest', function(e) { + * if (e.permission === 'media') { + * e.request.allow(); + * } + * }); */ - permissionrequest: chrome.events.Event; + permissionrequest: chrome.events.Event; /** - * @description Fired when the process rendering the guest web content has become responsive again after being unresponsive.

The following example code will fade the webview element in or out as it becomes responsive or unresponsive:

webview.style.webkitTransition = 'opacity 250ms';
-            webview.addEventListener('unresponsive', function() {
-              webview.style.opacity = '0.5';
-            });
-            webview.addEventListener('responsive', function() {
-              webview.style.opacity = '1';
-            });
- * @param callback + * Fired when the process rendering the guest web content has become + * responsive again after being unresponsive. + * + * The following example code will fade the webview element + * in or out as it becomes responsive or unresponsive: + * + * @example + * webview.style.webkitTransition = 'opacity 250ms'; + * webview.addEventListener('unresponsive', function() { + * webview.style.opacity = '0.5'; + * }); + * webview.addEventListener('responsive', function() { + * webview.style.opacity = '1'; + * }); */ - - responsive: chrome.events.Event; - + responsive: chrome.events.Event; /** - * @description Fired when the embedded web content has been resized via autosize. Only fires if autosize is enabled. - * @param callback + * Fired when the embedded web content has been resized via autosize. + * @requires Note: Only fires if autosize is enabled. */ - - sizechanged: chrome.events.Event; - + sizechanged: chrome.events.Event; /** - * @description Fired when the process rendering the guest web content has become unresponsive. This event will be generated once with a matching responsive event if the guest begins to respond again. - * @param callback + * Fired when the process rendering the guest web content has become unresponsive. + * This event will be generated once with a matching responsive event if the guest begins to respond again. */ - - unresponsive: chrome.events.Event; - + unresponsive: chrome.events.Event; /** - * @description Fired when the page's zoom changes. - * @param callback + * Fired when the page's zoom changes. */ - - zoomchange: chrome.events.Event; + zoomchange: chrome.events.Event; } - /**Options that determine what data should be cleared by clearData. */ + /** Options that determine what data should be cleared by clearData. */ interface ClearDataOptions { - /** - * @description Clear data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the getTime method of the JavaScript Date object). If absent, defaults to 0 (which would remove all browsing data). + * Clear data accumulated on or after this date, + * represented in milliseconds since the epoch + * (accessible via the getTime method of the JavaScript Date object). + * If absent, defaults to 0 (which would remove all browsing data). + * @default 0 */ - since?: number; + since?: integer; } - /**A set of data types. Missing properties are interpreted as false. */ + /** A set of data types. Missing properties are interpreted as false. */ interface ClearDataTypeSet { - + /** Websites' appcaches. */ + appcache?: boolean; /** - * @description Websites' appcaches. + * The browser's cache. Note: when removing data, this clears the entire cache; it is not limited to the range you specify. + * @since Available since Chrome 43. */ - appcache?: boolean - - /** - * @description Since Chrome 43. The browser's cache. Note: when removing data, this clears the entire cache; it is not limited to the range you specify. - */ - cache?: boolean - - /** - * @description The partition's cookies. - */ - cookies?: boolean - - /** - * @description The partition's session cookies. - */ - sessionCookies?: boolean - - /** - * @description The partition's persistent cookies. - */ - persistentCookies?: boolean - - /** - * @description Websites' filesystems. - */ - fileSystems?: boolean - - /** - * @description Websites' IndexedDB data. - */ - indexedDB?: boolean - - /** - * @description Websites' local storage data. - */ - localStorage?: boolean - - /** - * @description Websites' WebSQL data. - */ - webSQL?: boolean + cache?: boolean; + /** The partition's cookies. */ + cookies?: boolean; + /** The partition's session cookies. */ + sessionCookies?: boolean; + /** The partition's persistent cookies. */ + persistentCookies?: boolean; + /** Websites' filesystems. */ + fileSystems?: boolean; + /** Websites' IndexedDB data. */ + indexedDB?: boolean; + /** Websites' local storage data. */ + localStorage?: boolean; + /** Websites' WebSQL data. */ + webSQL?: boolean; } /** - * The different contexts a menu can appear in. Specifying 'all' is equivalent to the combination of all other contexts. - * Enum values: - * 'all' - * 'page' - * 'frame' - * 'selection' - * 'link' - * 'editable' - * 'image' - * 'video' - * 'audio' */ - export type ContextType = 'all' | 'page' | 'frame' | 'selection' | 'link' | 'editable' | 'image' | 'video' | 'audio'; - /**Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time. */ + * The different contexts a menu can appear in. + * Specifying 'all' is equivalent to the combination of all other contexts. + **/ + type ContextType = + 'all' | + 'page' | + 'frame' | + 'selection' | + 'link' | + 'editable' | + 'image' | + 'video' | + 'audio'; + /** + * Details of the script or CSS to inject. + * Either the code or the file property must be set, + * but both may not be set at the same time. + **/ interface InjectDetails { - /** - * @description JavaScript or CSS code to inject. Warning: Be careful using the code parameter. Incorrect use of it may open your app to cross site scripting attacks. + * JavaScript or CSS code to inject. + * Warning: Be careful using the code parameter. + * Incorrect use of it may open your app to xss attacks. */ - code?: string + code?: string; - /** - * @description JavaScript or CSS file to inject. - */ + /** JavaScript or CSS file to inject. */ file?: string } - /**The type of injection item: code or a set of files. */ + /** The type of injection item: code or a set of files. */ interface InjectionItems { - - /** - * @description JavaScript code or CSS to be injected into matching pages. - */ + /** JavaScript code or CSS to be injected into matching pages. */ code?: string - /** - * @description The list of JavaScript or CSS files to be injected into matching pages. These are injected in the order they appear in this array. + * The list of JavaScript or CSS files to be injected into matching pages. + * These are injected in the order they appear in this array. */ files?: any[] } - /**Details of the content script to inject. Refer to the content scripts documentation for more details. */ + /** Details of the content script to inject. **/ interface ContentScriptDetails { - - /** - * @description The name of the content script to inject. - */ + /** The name of the content script to inject. */ name: string - /** - * @description Specifies which pages this content script will be injected into. - */ + /** Specifies which pages this content script will be injected into. */ matches: any[] - /** - * @description Excludes pages that this content script would otherwise be injected into. - */ + /** Excludes pages that this content script would otherwise be injected into. */ exclude_matches?: any[] /** - * @description Whether to insert the content script on about:blank and about:srcdoc. Content scripts will only be injected on pages when their inherit URL is matched by one of the declared patterns in the matches field. The inherit URL is the URL of the document that created the frame or window. Content scripts cannot be inserted in sandboxed frames. + * Whether to insert the content script on about:blank and about:srcdoc. + * Content scripts will only be injected on pages when their inherit URL + * is matched by one of the declared patterns in the matches field. + * The inherit URL is the URL of the document that created the frame or window. + * Content scripts cannot be inserted in sandboxed frames. */ - match_about_blank?: boolean + match_about_blank?: boolean; /** - * @description The CSS code or a list of CSS files to be injected into matching pages. These are injected in the order they appear, before any DOM is constructed or displayed for the page. + * The CSS code or a list of CSS files to be injected into matching pages. + * These are injected in the order they appear, + * before any DOM is constructed or displayed for the page. */ - css?: InjectionItems + css?: InjectionItems; /** - * @description The JavaScript code or a list of JavaScript files to be injected into matching pages. These are injected in the order they appear. + * The JavaScript code or a list of JavaScript files to be injected into matching pages. + * These are injected in the order they appear. */ - js?: InjectionItems + js?: InjectionItems; /** - * @description The soonest that the JavaScript or CSS will be injected into the tab. Defaults to 'document_idle'. + * The soonest that the JavaScript or CSS will be injected into the tab. + * Defaults to 'document_idle'. */ run_at?: chrome.extensionTypes.RunAt; /** - * @description If all_frames is true, this implies that the JavaScript or CSS should be injected into all frames of current page. By default, all_frames is false and the JavaScript or CSS is only injected into the top frame. + * If all_frames is true, this implies that the JavaScript or CSS should be injected into all frames of current page. + * By default, all_frames is false and the JavaScript or CSS is only injected into the top frame. + * @default false */ all_frames?: boolean; /** - * @description Applied after matches to include only those URLs that also match this glob. Intended to emulate the @include Greasemonkey keyword. + * Applied after matches to include only those URLs that also match this glob. + * Intended to emulate the @include Greasemonkey keyword. */ include_globs?: string[]; /** - * @description Applied after matches to exclude URLs that match this glob. Intended to emulate the @exclude Greasemonkey keyword. + * Applied after matches to exclude URLs that match this glob. + * Intended to emulate the @exclude Greasemonkey keyword. */ exclude_globs?: string[]; } - /**@todo Add documentation */ + /** @todo TODO Add documentation */ interface ContextMenuCreateProperties { /** - * @description The type of menu item. Defaults to 'normal' if not specified. + * The type of menu item. Defaults to 'normal' if not specified. */ - type?: chrome.contextMenus.ItemType + type?: chrome.contextMenus.ItemType; /** - * @description The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension. + * The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension. */ - id?: string + id?: string; /** - * @description The text to be displayed in the item; this is required unless type is 'separator'. When the context is 'selection', you can use %s within the string to show the selected text. For example, if this parameter's value is 'Translate '%s' to Pig Latin' and the user selects the word 'cool', the context menu item for the selection is 'Translate 'cool' to Pig Latin'. + * The text to be displayed in the item; this is -required- unless type is 'separator'. + * When the context is 'selection', you can use %s within the string to show the selected text. + * For example, if this parameter's value is 'Translate '%s' to Pig Latin' and the user selects + * the word 'cool', the context menu item for the selection is 'Translate 'cool' to Pig Latin'. */ - title?: string + title?: string; /** - * @description The initial state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items. + * The initial state of a checkbox or radio item: + * true for selected and false for unselected. + * Only one radio item can be selected at a time in a given group of radio items. */ checked?: boolean /** - * @description List of contexts this menu item will appear in. Defaults to ['page'] if not specified. + * List of contexts this menu item will appear in. + * Defaults to ['page'] if not specified. */ - contexts?: any[] + contexts?: any[]; /** - * @description A function that will be called back when the menu item is clicked. - * @param callback + * A function that will be called back when the menu item is clicked. */ onclick?: (info: any) => void /** - * @description The ID of a parent menu item; this makes the item a child of a previously added item. + * The ID of a parent menu item; this makes the item a child of a previously added item. */ - parentId?: number | string + parentId?: number | string; /** - * @description Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see Match Patterns. + * Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see Match Patterns. */ - documentUrlPatterns?: any[] + documentUrlPatterns?: any[]; /** - * @description Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags. + * Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags. */ - targetUrlPatterns?: any[] + targetUrlPatterns?: any[]; /** - * @description Whether this context menu item is enabled or disabled. Defaults to true. + * Whether this context menu item is enabled or disabled. Defaults to true. */ - enabled?: boolean + enabled?: boolean; } /**@todo Add documentation */ interface ContextMenuUpdateProperties { - - /** - * @description The type of menu item. - */ + /** The type of menu item. */ type?: chrome.webview.ContextType; - /** - * @description The text to be displayed in the item - */ - title?: string + /** The text to be displayed in the item */ + title?: string; /** - * @description The state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items. + * The state of a checkbox or radio item: true for selected and false for unselected. + * Only one radio item can be selected at a time in a given group of radio items. */ - checked?: boolean + checked?: boolean; /** - * @description List of contexts this menu item will appear in. + * List of contexts this menu item will appear in. */ - contexts?: any[] + contexts?: any[]; /** - * @description A function that will be called back when the menu item is clicked. + * A function that will be called back when the menu item is clicked. * @param callback */ - onclick?: (info: any) => void + onclick?: (info: any) => void; /** - * @description The ID of a parent menu item; this makes the item a child of a previously added item. Note: You cannot change an item to be a child of one of its own descendants. + * The ID of a parent menu item; this makes the item a child of a previously added item. Note: You cannot change an item to be a child of one of its own descendants. */ - parentId?: number | string + parentId?: number | string; /** - * @description Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see Match Patterns. + * Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. + * (This applies to frames as well.) */ - documentUrlPatterns?: any[] + documentUrlPatterns?: any[]; /** - * @description Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags. + * Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags. */ - targetUrlPatterns?: any[] + targetUrlPatterns?: any[]; /** - * @description Whether this context menu item is enabled or disabled. + * Whether this context menu item is enabled or disabled. */ - enabled?: boolean + enabled?: boolean; } interface ContextMenus { - /** - * @description Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in chrome.runtime.lastError). - * @param {object} createProperties The properties used to create the item - * @param callback + * Creates a new context menu item. Note that if an error occurs during creation, + * you may not find out until the creation callback fires + * (the details will be in chrome.runtime.lastError). + * @param createProperties The properties used to create the item + * @param [callback] */ create(createProperties: object, callback?: () => void): void; /** - * @description Updates a previously created context menu item. - * @param id The ID of the item to update. - * @param {object} updateProperties The properties to update. Accepts the same values as the create function. - * @param callback + * Updates a previously created context menu item. + * @param id The ID of the item to update. + * @param updateProperties The properties to update. Accepts the same values as the create function. + * @param [callback] */ - update(id: number | string, updateProperties: object, callback?: () => void): void; + update(id: integer | string, updateProperties: object, callback?: () => void): void; /** - * @description Removes a context menu item. - * @param menuItemId The ID of the context menu item to remove. - * @param callback + * Removes a context menu item. + * @param menuItemId The ID of the context menu item to remove. + * @param [callback] */ - remove(menuItemId: number | string, callback?: () => void): void; + remove(menuItemId: integer | string, callback?: () => void): void; /** - * @description Removes all context menu items added to this webview. - * @param callback + * Removes all context menu items added to this webview. + * @param [callback] */ removeAll(callback?: () => void): void; - /** - * @description Fired before showing a context menu on this webview. Can be used to disable this context menu by calling event.preventDefault(). + * Fired before showing a context menu on this webview. + * Can be used to disable this context menu by calling event.preventDefault(). */ - onShow: chrome.events.Event; - + onShow: chrome.events.Event; } - interface IOnShowEvent { - /** - * @description Call this to prevent showing the context menu. - * @memberof IOnShowEvent - */ + interface OnShowEvent { + /** Call this to prevent showing the context menu. */ preventDefault: () => void; } interface ContentWindow { - /** - * @description

Posts a message to the embedded web content as long as the embedded content is displaying a page from the target origin. This method is available once the page has completed loading. Listen for the contentload event and then call the method.

The guest will be able to send replies to the embedder by posting message to event.source on the message event it receives.

This API is identical to the HTML5 postMessage API for communication between web pages. The embedder may listen for replies by adding a message event listener to its own frame.

- * @param message Message object to send to the guest. - * @param {string} targetOrigin Specifies what the origin of the guest window must be for the event to be dispatched. + * Posts a message to the embedded web content as long as the embedded + * content is displaying a page from the target origin. This method is + * available once the page has completed loading. Listen for the + * contentload event and then call the method. + * + * The guest will be able to send replies to the embedder by posting message + * to event.source on the message event it receives. + * + * This API is identical to the HTML5 postMessage API for communication + * between web pages. The embedder may listen for replies by adding + * a message event listener to its own frame. + * + * @param message Message object to send to the guest. + * @param targetOrigin Specifies what the origin of the guest window must be for the event to be dispatched. */ postMessage(message: any, targetOrigin: string): void; - } interface DialogController { - /** - * @description Accept the dialog. Equivalent to clicking OK in an alert, confirm, or prompt dialog. - * @param {string} response The response string to provide to the guest when accepting a prompt dialog. + * Accept the dialog. Equivalent to clicking OK in an alert, confirm, or prompt dialog. + * @param response The response string to provide to the guest when accepting a prompt dialog. */ ok(response?: string): void; - - /** - * @description Reject the dialog. Equivalent to clicking Cancel in a confirm or prompt dialog. - */ + /** Reject the dialog. Equivalent to clicking Cancel in a confirm or prompt dialog. */ cancel(): void; - } - /**Contains all of the results of the find request. */ + /** Contains all of the results of the find request. */ interface FindCallbackResults { - - /** - * @description The number of times searchText was matched on the page. - */ - numberOfMatches: number - - /** - * @description The ordinal number of the current match. - */ - activeMatchOrdinal: number - - /** - * @description Describes a rectangle around the active match in screen coordinates. - */ - selectionRect: SelectionRect - - /** - * @description Indicates whether this find request was canceled. - */ - canceled: boolean + /** The number of times searchText was matched on the page. */ + numberOfMatches: number; + /** The ordinal number of the current match. */ + activeMatchOrdinal: number; + /** Describes a rectangle around the active match in screen coordinates. */ + selectionRect: SelectionRect; + /** Indicates whether this find request was canceled. */ + canceled: boolean; } - /**Options for the find request. */ interface FindOptions { - /** - * @description Flag to find matches in reverse order. The default value is false. + * Flag to find matches in reverse order. + * @default false */ - backward?: boolean - + backward?: boolean; /** - * @description Flag to match with case-sensitivity. The default value is false. + * Flag to match with case-sensitivity. + * @default false */ - matchCase?: boolean + matchCase?: boolean; } interface NewWindow { - /** - * @description Attach the requested target page to an existing webview element. - * @param {object} webview The webview element to which the target page should be attached. + * Attach the requested target page to an existing webview element. + * @param webview The webview element to which the target page should be attached. */ - attach(webview: object): void; - + attach(webview: HTMLWebViewElement): void; /** - * @description Cancel the new window request. + * Cancel the new window request. */ discard(): void; - } - interface MediaPermissionRequest { - - /** - * @description Allow the permission request. - */ + interface PermissionRequestHandler { + /** Allow the permission request. */ allow(): void; - - /** - * @description Deny the permission request. This is the default behavior if allow is not called. - */ + /** Deny the permission request. This is the default behavior if allow is not called. */ deny(): void; - - } - interface GeolocationPermissionRequest { - - /** - * @description Allow the permission request. - */ - allow(): void; - - /** - * @description Deny the permission request. This is the default behavior if allow is not called. - */ - deny(): void; - - } - interface PointerLockPermissionRequest { - - /** - * @description Allow the permission request. - */ - allow(): void; - - /** - * @description Deny the permission request. This is the default behavior if allow is not called. - */ - deny(): void; - - } - interface DownloadPermissionRequest { - - /** - * @description Allow the permission request. - */ - allow(): void; - - /** - * @description Deny the permission request. This is the default behavior if allow is not called. - */ - deny(): void; - - } - interface FileSystemPermissionRequest { - - /** - * @description Allow the permission request. - */ - allow(): void; - - /** - * @description Deny the permission request. - */ - deny(): void; - - } - interface FullscreenPermissionRequest { - - /** - * @description Allow the permission request. - */ - allow(): void; - - /** - * @description Deny the permission request. - */ - deny(): void; - - } - interface LoadPluginPermissionRequest { - - /** - * @description Allow the permission request. This is the default behavior if deny is not called.. - */ - allow(): void; - - /** - * @description Deny the permission request. - */ - deny(): void; - } /** - * Fescribes a rectangle in screen coordinates. + * Describes a rectangle in screen coordinates. * The containment semantics are array-like; that is, the coordinate (left, top) is considered to be contained by the rectangle, * but the coordinate (left + width, top) is not. **/ interface SelectionRect { - - /** - * @description Distance from the left edge of the screen to the left edge of the rectangle. - */ - left: number - - /** - * @description Distance from the top edge of the screen to the top edge of the rectangle. - */ - top: number - - /** - * @description Width of the rectangle. - */ - width: number - - /** - * @description Height of the rectangle. - */ - height: number + /** Distance from the left edge of the screen to the left edge of the rectangle. */ + left: number; + /** Distance from the top edge of the screen to the top edge of the rectangle. */ + top: number; + /** Width of the rectangle. */ + width: number; + /** Height of the rectangle. */ + height: number; } /** - * @description Interface which provides access to webRequest events on the guest page. See the chrome.webRequest extensions API for details on webRequest life cycle and related concepts.

To illustrate how usage differs from the extensions webRequest API, consider the following example code which blocks any guest requests for URLs which match *://www.evil.com/*:

webview.request.onBeforeRequest.addListener(
-         * @example function(details) { return {cancel: true}; }, {urls: ['*://www.evil.com/*']}, ['blocking']);
-         * @description Additionally, this interface supports declarative webRequest rules through onRequest and onMessage events.
-         * @see http://developer.chrome.com/extensions/declarativeWebRequest.htmldeclarativeWebRequest
-         * @description Note that conditions and actions for declarative webview webRequests should be instantiated from their chrome.webViewRequest.* counterparts. The following example code declaratively blocks all requests to 'example.com' on the webview myWebview:
-         * @example var rule = { conditions: [ new chrome.webViewRequest.RequestMatcher({ url: { hostSuffix: 'example.com' } }) ], actions: [ new chrome.webViewRequest.CancelRequest() ] }; myWebview.request.onRequest.addRules([rule]);
+         * Interface which provides access to webRequest events on the guest page.
+         * @see[chrome.webRequest]{@link http://developer.chrome.com/extensions/webRequest}
+         * extensions API for details on webRequest life cycle and related concepts.
+         *
+         * To illustrate how usage differs from the extensions webRequest API,
+         * consider the following example code which blocks any guest requests
+         * for URLs which match *://www.evil.com/*:
+         * @example
+         * webview.request.onBeforeRequest.addListener(
+         *   function(details) { return {cancel: true}; }, {urls: ['*://www.evil.com/*']}, ['blocking']);
+         * @description
+         * Additionally, this interface supports declarative webRequest rules through onRequest and onMessage events.
+         * @see[Docs]{@link http://developer.chrome.com/extensions/declarativeWebRequest.htmldeclarativeWebRequest}
+         * @description
+         * Note that conditions and actions for declarative webview webRequests should be instantiated
+         * from their chrome.webViewRequest.* counterparts. The following example code declaratively
+         * blocks all requests to 'example.com' on the webview myWebview:
+         * @example const rule = { conditions: [ new chrome.webViewRequest.RequestMatcher({ url: { hostSuffix: 'example.com' } }) ], actions: [ new chrome.webViewRequest.CancelRequest() ] }; myWebview.request.onRequest.addRules([rule]);
          **/
         interface WebRequestEventInterface {
+            /** @todo TODO */
         }
         /**
         * Defines the how zooming is handled in the webview.
         * Enum values:
         * 'per-origin'
-        * * Zoom changes will persist in the zoomed page's origin, i.e. all other webviews in the same partition that are navigated to that same origin will be zoomed as well. Moreover, per-origin zoom changes are saved with the origin, meaning that when navigating to other pages in the same origin, they will all be zoomed to the same zoom factor.
+        *   > Zoom changes will persist in the zoomed page's origin,
+        *     i.e. all other webviews in the same partition that are
+        *     navigated to that same origin will be zoomed as well.
+        *     Moreover, per-origin zoom changes are saved with the origin,
+        *     meaning that when navigating to other pages in the same origin,
+        *     they will all be zoomed to the same zoom factor.
         * 'per-view'
-        * * Zoom changes only take effect in this webview, and zoom changes in other webviews will not affect the zooming of this webview. Also, per-view zoom changes are reset on navigation; navigating a webview will always load pages with their per-origin zoom factors (within the scope of the partition).
+        *   > Zoom changes only take effect in this webview,
+        *     and zoom changes in other webviews will not affect
+        *     the zooming of this webview. Also, per-view zoom
+        *     changes are reset on navigation; navigating a webview
+        *     will always load pages with their per-origin zoom factors
+        *     (within the scope of the partition).
         * 'disabled'
-        * * Disables all zooming in the webview. The content will revert to the default zoom level, and all attempted zoom changes will be ignored. */
-        export type ZoomMode = 'per-origin' | 'per-view' | 'disabled';
-
-        export enum ConsoleMessageLevel {
-            LOG_VERBOSE = -1,
-            LOG_INFO = 0,
-            LOG_WARNING = 1,
-            LOG_ERROR = 2
-        }
-        interface IConsoleMessage {
-
+        *   > Disables all zooming in the webview.
+        *     The content will revert to the default zoom level,
+        *     and all attempted zoom changes will be ignored.
+        **/
+        type ZoomMode =
+            'per-origin' |
+            'per-view' |
+            'disabled';
+        type ConsoleMessageLevel = -1 | 0 | 1 | 2;
+        type LoadAbortReason =
+            'ERR_ABORTED' |
+            'ERR_INVALID_URL' |
+            'ERR_DISALLOWED_URL_SCHEME' |
+            'ERR_BLOCKED_BY_CLIENT' |
+            'ERR_ADDRESS_UNREACHABLE' |
+            'ERR_EMPTY_RESPONSE' |
+            'ERR_FILE_NOT_FOUND' |
+            'ERR_UNKNOWN_URL_SCHEME';
+        interface ConsoleMessage {
             /**
-            * @description The severity level of the log message. Ranges from -1 to 2. LOG_VERBOSE (console.debug) = -1, LOG_INFO (console.log, console.info) = 0, LOG_WARNING (console.warn) = 1, LOG_ERROR (console.error) = 2.
+             * The severity level of the log message.
+             * Ranges from -1 to 2.
+             * LOG_VERBOSE (console.debug) = -1
+             * LOG_INFO (console.log, console.info) = 0
+             * LOG_WARNING (console.warn) = 1
+             * LOG_ERROR (console.error) = 2
              */
             level: ConsoleMessageLevel;
-
-            /**
-            * @description The logged message contents.
-             */
-            message: string
-
-            /**
-            * @description The line number of the message source.
-             */
-            line: number
-
-            /**
-            * @description A string identifying the resource which logged the message.
-             */
-            sourceId: string
+            /** The logged message contents. */
+            message: string;
+            /** The line number of the message source. */
+            line: number;
+            /** A string identifying the resource which logged the message. */
+            sourceId: string;
         }
-        interface IDialog {
+        type DialogMessageType =
+            'alert' |
+            'confirm' |
+            'prompt';
 
+        interface Dialog {
             /**
-            * @description The type of modal dialog requested by the guest.
+             * The type of modal dialog requested by the guest.
              */
-            messageType: 'alert' | 'confirm' | 'prompt'
-
+            messageType: DialogMessageType;
             /**
-            * @description The text the guest attempted to display in the modal dialog.
+             * The text the guest attempted to display in the modal dialog.
              */
-            messageText: string
-
+            messageText: string;
             /**
-            * @description An interface that can be used to respond to the guest's modal request.
+             * An interface that can be used to respond to the guest's modal request.
              */
-            dialog: DialogController
+            dialog: DialogController;
         }
-        interface IExit {
-
-            /**
-            * @description Chrome's internal ID of the process that exited.
-             */
-            processID: number
-
-            /**
-            * @description String indicating the reason for the exit.
-             */
-            reason: 'normal' | 'abnormal' | 'crash' | 'kill'
+        type ExitReason =
+            'normal' |
+            'abnormal' |
+            'crash' |
+            'kill';
+        interface Exit {
+            /** Chrome's internal ID of the process that exited. */
+            processID: number;
+            /** String indicating the reason for the exit. */
+            reason: ExitReason;
         }
-        interface IFindupdate {
-
+        interface FindUpdate {
             /**
-            * @description The string that is being searched for in the page.
+             * The string that is being searched for in the page.
              */
-            searchText: string
-
+            searchText: string;
             /**
-            * @description The number of matches found for searchText on the page so far.
+             * The number of matches found for searchText on the page so far.
              */
-            numberOfMatches: number
-
+            numberOfMatches: number;
             /**
-            * @description The ordinal number of the current active match, if it has been found. This will be 0 until then.
+             * The ordinal number of the current active match,
+             * if it has been found. This will be 0 until then.
              */
-            activeMatchOrdinal: number
-
+            activeMatchOrdinal: number;
             /**
-            * @description Describes a rectangle around the active match, if it has been found, in screen coordinates.
+             * Describes a rectangle around the active match,
+             * if it has been found, in screen coordinates.
              */
-            selectionRect: SelectionRect
-
+            selectionRect: SelectionRect;
             /**
-            * @description Indicates whether the find request was canceled.
+             * Indicates whether the find request was canceled.
              */
-            canceled: boolean
-
+            canceled: boolean;
             /**
-            * @description Indicates that all find requests have completed and that no more findupdate events will be fired until more find requests are made.
+             * Indicates that all find requests have completed
+             * and that no more findupdate events will be fired
+             * until more find requests are made.
              */
-            finalUpdate: string
+            finalUpdate: string;
         }
-        interface ILoadabort {
-
+        interface LoadAbort {
+            /** Requested URL. */
+            url: string;
+            /** Whether the load was top-level or in a subframe. */
+            isTopLevel: boolean;
             /**
-            * @description Requested URL.
+             * Unique integer ID for the type of abort.
+             * Note that this ID is `not` guaranteed to
+             * remain backwards compatible between releases.
+             * You must not act based upon this specific integer.
              */
-            url: string
-
+            code: integer;
             /**
-            * @description Whether the load was top-level or in a subframe.
+             * String indicating what type of abort occurred.
+             * This string is `not` guaranteed to remain
+             * backwards compatible between releases.
+             * You must not parse and act based upon its content.
+             * It is also possible that, in some cases,
+             * an error not listed here could be reported.
              */
-            isTopLevel: boolean
-
-            /**
-            * @description Unique integer ID for the type of abort. Note that this ID is not guaranteed to remain backwards compatible between releases. You must not act based upon this specific integer.
-             */
-            code: number
-
-            /**
-            * @description String indicating what type of abort occurred. This string is not guaranteed to remain backwards compatible between releases. You must not parse and act based upon its content. It is also possible that, in some cases, an error not listed here could be reported.
-             */
-            reason: 'ERR_ABORTED' | 'ERR_INVALID_URL' | 'ERR_DISALLOWED_URL_SCHEME' | 'ERR_BLOCKED_BY_CLIENT' | 'ERR_ADDRESS_UNREACHABLE' | 'ERR_EMPTY_RESPONSE' | 'ERR_FILE_NOT_FOUND' | 'ERR_UNKNOWN_URL_SCHEME'
+            reason: LoadAbortReason;
         }
-        interface ILoadcommit {
-
-            /**
-            * @description The URL that committed.
-             */
-            url: string
-
-            /**
-            * @description Whether the load is top-level or in a subframe.
-             */
-            isTopLevel: boolean
+        interface LoadCommit {
+            /** The URL that committed. */
+            url: string;
+            /** Whether the load is top-level or in a subframe. */
+            isTopLevel: boolean;
         }
-        /**ILoadredirect (Auto generated interface) */
-        interface ILoadredirect {
-
-            /**
-            * @description The requested URL before the redirect.
-             */
-            oldUrl: string
-
-            /**
-            * @description The new URL after the redirect.
-             */
-            newUrl: string
-
-            /**
-            * @description Whether or not the redirect happened at top-level or in a subframe.
-             */
-            isTopLevel: boolean
+        interface LoadRedirect {
+            /** The requested URL before the redirect. */
+            oldUrl: string;
+            /** The new URL after the redirect. */
+            newUrl: string;
+            /** Whether or not the redirect happened at top-level or in a subframe. */
+            isTopLevel: boolean;
         }
-        /**ILoadstart (Auto generated interface) */
-        interface ILoadstart {
-
-            /**
-            * @description Requested URL.
-             */
-            url: string
-
-            /**
-            * @description Whether the load is top-level or in a subframe.
-             */
-            isTopLevel: boolean
+        interface LoadStart {
+            /** Requested URL. */
+            url: string;
+            /** Whether the load is top-level or in a subframe. */
+            isTopLevel: boolean;
         }
-        /**INewwindow (Auto generated interface) */
-        interface INewwindow {
-
+        type WindowOpenDisposition =
+            'ignore' |
+            'save_to_disk' |
+            'current_tab' |
+            'new_background_tab' |
+            'new_foreground_tab' |
+            'new_window' |
+            'new_popup';
+        interface NewWindow {
             /**
-            * @description An interface that can be used to either attach the requested target page to an existing webview element or explicitly discard the request.
-             */
-            window: NewWindow
+             * An interface that can be used to either attach the requested
+             * target page to an existing webview element or explicitly
+             * discard the request.
+             **/
+            window: NewWindow;
 
-            /**
-            * @description The target URL requested for the new window.
-             */
-            targetUrl: string
+            /** The target URL requested for the new window. */
+            targetUrl: string;
 
-            /**
-            * @description The initial width requested for the new window.
-             */
-            initialWidth: number
+            /** The initial width requested for the new window. */
+            initialWidth: number;
 
-            /**
-            * @description The initial height requested for the new window.
-             */
-            initialHeight: number
+            /** The initial height requested for the new window. */
+            initialHeight: number;
 
-            /**
-            * @description The requested name of the new window.
-             */
-            name: string
+            /** The requested name of the new window. */
+            name: string;
 
-            /**
-            * @description The requested disposition of the new window.
-             */
-            windowOpenDisposition: 'ignore' | 'save_to_disk' | 'current_tab' | 'new_background_tab' | 'new_foreground_tab' | 'new_window' | 'new_popup'
+            /** The requested disposition of the new window. */
+            windowOpenDisposition: WindowOpenDisposition;
         }
-        interface IPermissionrequest {
-
-            /**
-            * @description The type of permission being requested.
-             */
-            permission: 'media' | 'geolocation' | 'pointerLock' | 'download' | 'loadplugin' | 'filesystem' | 'fullscreen'
-
-            /**
-            * @description An object which holds details of the requested permission. Depending on the type of permission requested, this may be a $(ref:webviewTag.MediaPermissionRequest), $(ref:webviewTag.GeolocationPermissionRequest), $(ref:webviewTag.PointerLockPermissionRequest), $(ref:webviewTag.DownloadPermissionRequest), $(ref:webviewTag.LoadPluginPermissionRequest), or $(ref:webviewTag.FullscreenPermissionRequest).
-             */
-            request: GeolocationPermissionRequest | PointerLockPermissionRequest | DownloadPermissionRequest | LoadPluginPermissionRequest | FullscreenPermissionRequest;
+        type RequestedPermission =
+            'media' |
+            'geolocation' |
+            'pointerLock' |
+            'download' |
+            'loadplugin' |
+            'filesystem' |
+            'fullscreen';
+        interface PermissionRequest {
+            /** The type of permission being requested. */
+            permission: RequestedPermission;
+            /** An object which holds details of the requested permission.*/
+            request: PermissionRequestHandler;
         }
-
-        /**IResponsive (Auto generated interface) */
-        interface IResponsive {
-
-            /**
-            * @description Chrome's internal ID of the process that became responsive.
-             */
-            processID: number
+        interface ProcessResponsive {
+            /** Chrome's internal ID of the process that became responsive. */
+            processID: number;
         }
-        /**ISizechanged (Auto generated interface) */
-        interface ISizechanged {
-
-            /**
-            * @description Old width of embedded web content.
-             */
-            oldWidth: number
-
-            /**
-            * @description Old height of embedded web content.
-             */
-            oldHeight: number
-
-            /**
-            * @description New width of embedded web content.
-             */
-            newWidth: number
-
-            /**
-            * @description New height of embedded web content.
-             */
-            newHeight: number
+        interface SizeChanged {
+            /** Old width of embedded web content. */
+            oldWidth: number;
+            /** Old height of embedded web content. */
+            oldHeight: number;
+            /** New width of embedded web content. */
+            newWidth: number;
+            /** New height of embedded web content. */
+            newHeight: number;
         }
-        /**IUnresponsive (Auto generated interface) */
-        interface IUnresponsive {
-
-            /**
-            * @description Chrome's internal ID of the process that has become unresponsive.
-             */
-            processID: number
+        interface ProcessUnresponsive {
+            /** Chrome's internal ID of the process that has become unresponsive. */
+            processID: number;
         }
-        /**IZoomchange (Auto generated interface) */
-        interface IZoomchange {
-
-            /**
-            * @description The page's previous zoom factor.
-             */
-            oldZoomFactor: number
-
-            /**
-            * @description The new zoom factor that the page was zoomed to.
-             */
-            newZoomFactor: number
+        interface ZoomChange {
+            /** The page's previous zoom factor. */
+            oldZoomFactor: number;
+            /** The new zoom factor that the page was zoomed to. */
+            newZoomFactor: number;
         }
-
     }
 
+    /////////////
+    // METHODS //
+    /////////////
+
+    /**
+     * Different page speed and load metrics
+     */
+    function csi(): {
+        onloadT: number;
+        pageT: number;
+        startE: number;
+        tran: number;
+    }
+
+    /**
+     * @deprecated Deprecated in Chrome 64.
+     * chrome.loadTimes() is a non-standard API that exposes loading metrics
+     * and network information to developers in order to help them better
+     * understand their site's performance in the real world.
+     * @see[Use this instead]{@link https://www.w3.org/TR/navigation-timing-2/}
+     * @see[Deprecation article]{@link https://developers.google.com/web/updates/2017/12/chrome-loadtimes-deprecated}
+     */
+    function loadTimes(): chrome.deprecatedButUsable;
 }
 
 /////////////////////
diff --git a/types/chrome-apps/test/index.ts b/types/chrome-apps/test/index.ts
index c0dc6402a6..3babb0b80e 100644
--- a/types/chrome-apps/test/index.ts
+++ b/types/chrome-apps/test/index.ts
@@ -1,8 +1,8 @@
 import runtime = chrome.app.runtime;
-import cwindow = chrome.app.window;
+const cwindow = chrome.app.window;
 
-const createOptions: cwindow.CreateWindowOptions = {
-    id: "My Window",
+const createOptions: chrome.app.CreateWindowOptions = {
+    id: 'My Window',
     bounds: {
         left: 0,
         top: 0,
@@ -14,7 +14,7 @@ const createOptions: cwindow.CreateWindowOptions = {
 
 //Create new window on app launch
 chrome.app.runtime.onLaunched.addListener(function (launchData: runtime.LaunchData) {
-    chrome.app.window.create('app/url', createOptions, function (created_window: cwindow.AppWindow) {
+    chrome.app.window.create('app/url', createOptions, function (created_window: chrome.app.AppWindow) {
         return;
     });
 });
@@ -22,9 +22,9 @@ chrome.app.runtime.onLaunched.addListener(function (launchData: runtime.LaunchDa
 chrome.app.runtime.onRestarted.addListener(function () { return; });
 
 // retrieving windows
-var currentWindow: cwindow.AppWindow = chrome.app.window.current();
-var otherWindow: cwindow.AppWindow = chrome.app.window.get('some-string');
-var allWindows: cwindow.AppWindow[] = chrome.app.window.getAll();
+var currentWindow: chrome.app.AppWindow = chrome.app.window.current();
+var otherWindow: chrome.app.AppWindow = chrome.app.window.get('some-string');
+var allWindows: chrome.app.AppWindow[] = chrome.app.window.getAll();
 
 // listening to window events
 currentWindow.onBoundsChanged.addListener(function () { return; });
@@ -42,11 +42,11 @@ var visibleEverywhere: boolean = chrome.app.window.canSetVisibleOnAllWorkspaces(
 
 function test_fileSystem(): void {
     var accepts: chrome.fileSystem.AcceptOptions[] = [
-        { mimeTypes: ["text/*"], extensions: ['js', 'css', 'txt', 'html', 'xml', 'tsv', 'csv', 'rtf'] }
+        { mimeTypes: ['text/*'], extensions: ['js', 'css', 'txt', 'html', 'xml', 'tsv', 'csv', 'rtf'] }
     ];
     var chooseOption: chrome.fileSystem.ChooseEntryOptions = {
-        type: "openFile",
-        suggestedName: "foo.txt",
+        type: 'openFile',
+        suggestedName: 'foo.txt',
         accepts: accepts,
         acceptsAllTypes: false,
         acceptsMultiple: false
@@ -98,7 +98,7 @@ function test_socketsTcp(): void {
     chrome.sockets.tcp.setNoDelay(socketId, true, (result: number) => { });
 
     // connect
-    chrome.sockets.tcp.connect(socketId, "192.168.0.1", 8080, (result: number) => { });
+    chrome.sockets.tcp.connect(socketId, '192.168.0.1', 8080, (result: number) => { });
 
     // disconnect
     chrome.sockets.tcp.disconnect(socketId);
@@ -132,7 +132,7 @@ function testSocketsTcpTypes(): void {
 
     properties = {
         persistent: true,
-        name: "test",
+        name: 'test',
         bufferSize: 1024
     };
 
@@ -146,11 +146,11 @@ function testSocketsTcpTypes(): void {
         connected: false
     };
 
-    socketInfo.name = "test";
+    socketInfo.name = 'test';
     socketInfo.bufferSize = 1024;
-    socketInfo.localAddress = "192.168.0.2";
+    socketInfo.localAddress = '192.168.0.2';
     socketInfo.localPort = 8000;
-    socketInfo.peerAddress = "192.168.0.3";
+    socketInfo.peerAddress = '192.168.0.3';
     socketInfo.peerPort = 1000;
 }
 
@@ -178,10 +178,10 @@ function test_socketsUdp(): void {
     chrome.sockets.udp.setPaused(socketId, true, () => { });
 
     // bind
-    chrome.sockets.udp.bind(socketId, "0.0.0.0", 8080, (result: number) => { });
+    chrome.sockets.udp.bind(socketId, '0.0.0.0', 8080, (result: number) => { });
 
     // send
-    chrome.sockets.udp.send(socketId, buffer, "172.21.0.1", 10080, (info: chrome.sockets.udp.SendInfo) => { });
+    chrome.sockets.udp.send(socketId, buffer, '172.21.0.1', 10080, (info: chrome.sockets.udp.SendInfo) => { });
 
     // close
     chrome.sockets.udp.close(socketId);
@@ -194,10 +194,10 @@ function test_socketsUdp(): void {
     chrome.sockets.udp.getSockets((infos: chrome.sockets.udp.SocketInfo[]) => { });
 
     // joinGroup
-    chrome.sockets.udp.joinGroup(socketId, "224.0.0.1", (result: number) => { });
+    chrome.sockets.udp.joinGroup(socketId, '224.0.0.1', (result: number) => { });
 
     // leaveGroup
-    chrome.sockets.udp.leaveGroup(socketId, "224.0.0.1", (result: number) => { });
+    chrome.sockets.udp.leaveGroup(socketId, '224.0.0.1', (result: number) => { });
 
     // setMulticastTimeToLive
     chrome.sockets.udp.setMulticastTimeToLive(socketId, 100, (result: number) => { });
@@ -223,7 +223,7 @@ function testSocketsUdpTypes(): void {
 
     properties = {
         persistent: true,
-        name: "test",
+        name: 'test',
         bufferSize: 1024
     };
 
@@ -236,9 +236,9 @@ function testSocketsUdpTypes(): void {
         paused: true
     };
 
-    socketInfo.name = "test";
+    socketInfo.name = 'test';
     socketInfo.bufferSize = 1024;
-    socketInfo.localAddress = "192.168.0.2";
+    socketInfo.localAddress = '192.168.0.2';
     socketInfo.localPort = 8000;
 }
 
@@ -266,8 +266,8 @@ function test_socketsTcpServer(): void {
     chrome.sockets.tcpServer.setPaused(socketId, true, () => { });
 
     // listen
-    chrome.sockets.tcpServer.listen(socketId, "0.0.0.0", 80, (result: number) => { });
-    chrome.sockets.tcpServer.listen(socketId, "0.0.0.0", 80, 128, (result: number) => { });
+    chrome.sockets.tcpServer.listen(socketId, '0.0.0.0', 80, (result: number) => { });
+    chrome.sockets.tcpServer.listen(socketId, '0.0.0.0', 80, 128, (result: number) => { });
 
     // disconnect
     chrome.sockets.tcp.disconnect(socketId);
@@ -298,7 +298,7 @@ function testSocketsTcpServerTypes(): void {
 
     properties = {
         persistent: true,
-        name: "test"
+        name: 'test'
     };
 
     // SocketInfo
@@ -310,8 +310,8 @@ function testSocketsTcpServerTypes(): void {
         paused: true
     };
 
-    socketInfo.name = "test";
-    socketInfo.localAddress = "192.168.0.2";
+    socketInfo.name = 'test';
+    socketInfo.localAddress = '192.168.0.2';
     socketInfo.localPort = 8000;
 }
 
@@ -340,7 +340,7 @@ wve.addEventListener('close', () => {
     return;
 });
 wve.addEventListener('consolemessage', (ev) => {
-    if (ev.level === chrome.webview.ConsoleMessageLevel.LOG_ERROR) {
+    if (ev.level === 2) {
         const msg = ev.message;
     }
 });
@@ -360,4 +360,177 @@ wve.addEventListener('loadredirect', (ev) => {
     return ev.newUrl || ev.oldUrl;
 });
 
-chrome.bluetoothLowEnergy.connect('1111111', () => { });
+chrome.bluetooth.getAdapterState((adapter) => {
+    console.log('Adapter ' + adapter.address + ': ' + adapter.name);
+});
+
+chrome.bluetooth.getDevices((devices) => {
+    for (const device of devices) {
+        console.log(device.address);
+    }
+});
+
+chrome.bluetooth.onDeviceAdded.addListener((device) => {
+    let uuid = '0000180d-0000-1000-8000-00805f9b34fb';
+    if (!device.uuids || device.uuids.indexOf(uuid) < 0)
+        return;
+
+    // The device has a service with the desired UUID.
+    chrome.bluetoothLowEnergy.connect(device.address, () => {
+        if (chrome.runtime.lastError) {
+            console.log('Failed to connect: ' + chrome.runtime.lastError.message);
+            return;
+        }
+        // Connected! Do stuff...
+    });
+});
+
+const uuid = '1105';
+
+chrome.bluetooth.getDevices((devices) => {
+    chrome.bluetoothSocket.create((createInfo) => {
+        chrome.bluetoothSocket.connect(createInfo.socketId,
+            devices[0].address, uuid, () => {
+                if (chrome.runtime.lastError) {
+                    console.log('Connection failed: ' + chrome.runtime.lastError.message);
+                } else {
+                    chrome.bluetoothSocket.send(createInfo.socketId, new ArrayBuffer(4096), (bytes_sent) => {
+                        if (chrome.runtime.lastError) {
+                            console.log('Send failed: ' + chrome.runtime.lastError.message);
+                        } else {
+                            console.log('Sent ' + bytes_sent + ' bytes')
+                        }
+                    });
+                }
+            });
+        chrome.bluetoothSocket.onReceive.addListener((receiveInfo) => {
+            if (receiveInfo.socketId != createInfo.socketId)
+                return;
+            // receiveInfo.data is an ArrayBuffer.
+        });
+    });
+});
+
+chrome.hid.getDevices({
+    filters: [
+        { vendorId: 5 }
+    ]
+}, (devices) => {
+    const productId = devices[0].productId;
+    chrome.hid.getUserSelectedDevices((selectedDevices) => {
+        const hmm = selectedDevices.productId == productId ? selectedDevices.vendorId : selectedDevices.maxFeatureReportSize;
+    });
+});
+
+chrome.syncFileSystem.getConflictResolutionPolicy((policy) => {
+    if (policy === 'manual') {
+        chrome.syncFileSystem.requestFileSystem((fs) => {
+            if (fs.root.isFile) {
+                throw new Error('It was a file!');
+            }
+        });
+    }
+})
+chrome.contextMenus.ACTION_MENU_TOP_LEVEL_LIMIT;
+
+chrome.i18n.getMessage('click_here', ['string1', 'string2']);
+
+const TLSFormatExample = {
+    NetworkConfigurations: 
+        {
+            GUID: '{00f79111-51e0-e6e0-76b3b55450d80a1b}',
+            Name: 'MyTTLSNetwork',
+            Type: 'WiFi',
+            WiFi: {
+                AutoConnect: false,
+                EAP: {
+                    ClientCertPattern: {
+                        EnrollmentURI: [
+                            'http://fetch-my-certificate.com'
+                        ],
+                        IssuerCARef: [
+                            '{6ed8dce9-64c8-d568-d225d7e467e37828}'
+                        ]
+                    },
+                    'ClientCertType': 'Pattern',
+                    'Outer': 'EAP-TLS',
+                    'ServerCARef': '{6ed8dce9-64c8-d568-d225d7e467e37828}',
+                    'UseSystemCAs': true
+                },
+                'HiddenSSID': false,
+                'SSID': 'MyTTLSNetwork',
+                'Security': 'WPA-EAP'
+            }
+        }
+}
+
+let serviceId: any = null;
+
+const runApp = () => {
+    var options = {
+        'id': 'Bluetooth Sample App',
+        'bounds': {
+            'width': 1024,
+            'height': 768
+        }
+    };
+
+    chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
+        if (request.serviceId) {
+            serviceId = request.serviceId;
+            console.log('Received registered service Id: ' + serviceId);
+        }
+    });
+
+    chrome.app.window.create('test.html', options, (theWindow) => {
+        theWindow.onClosed.addListener(() => {
+            if (serviceId) {
+                console.log('Unregistering service: ' + serviceId);
+                chrome.bluetoothLowEnergy.unregisterService(serviceId, (status) => {
+                    console.log('Unregister service status = ' + status);
+                });
+            }
+        });
+    });
+}
+
+chrome.app.runtime.onLaunched.addListener(runApp);
+chrome.app.runtime.onRestarted.addListener(runApp);
+
+// networking.onc
+
+chrome.networking.onc.getNetworks({ 'networkType': 'All' }, (networkList) => {
+    console.log('Length of Network list: ' + networkList.length);
+    for (let networkObj of networkList) {
+        console.log('GUID: ' + networkObj.GUID);
+        console.log('Connectable: ' + networkObj.Connectable);
+        if (networkObj.WiFi) {
+            // WiFi active :)
+            console.log('Wifi BSID: ' + networkObj.WiFi.BSSID);
+        }
+        chrome.networking.onc.setProperties(networkObj.GUID || '', {
+            WiFi: {
+                Passphrase: 'Can be set :) but not get?'
+            }
+        })
+        // Test that we can't get passphrase
+        chrome.networking.onc.getProperties(networkObj.GUID || '', (props) => {
+            const WiFiResult = props.WiFi;
+        });
+    }
+});
+
+//// AUDIO
+
+chrome.audio.getDevices({}, (audioDeviceInfoList) => {
+    for (let audioObj of audioDeviceInfoList) {
+        console.log('ID: ' + audioObj.id);
+        console.log('Audio Stream Type: ' + audioObj.streamType);
+        console.log('Audio Device Name: ' + audioObj.deviceName);
+    }
+});
+
+
+chrome.desktopCapture.chooseDesktopMedia(["screen", "window", "tab"], () => { });
+chrome.desktopCapture.chooseDesktopMedia([chrome.desktopCapture.DesktopCaptureSourceType.AUDIO], () => { });
+
diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts
index 0bfec6bfd8..6dbf118947 100644
--- a/types/chrome/index.d.ts
+++ b/types/chrome/index.d.ts
@@ -6564,7 +6564,7 @@ declare namespace chrome.tabs {
      * @param callback Optional.
      * Parameter window: Contains details about the window whose tabs were highlighted.
      */
-    export function highlight(highlightInfo: HighlightInfo, callback: (window: chrome.windows.Window) => void): void;
+    export function highlight(highlightInfo: HighlightInfo, callback?: (window: chrome.windows.Window) => void): void;
     /**
      * Gets all tabs that have the specified properties, or all tabs if no properties are specified.
      * @since Chrome 16.
@@ -7383,6 +7383,10 @@ declare namespace chrome.webRequest {
         type: ResourceType;
         /** The time when this signal is triggered, in milliseconds since the epoch. */
         timeStamp: number;
+        /** The origin where the request was initiated. This does not change through redirects. If this is an opaque origin, the string 'null' will be used.
+         * @since Since Chrome 63.
+        */
+        initiator?: string;
     }
 
     export interface WebRequestDetails extends ResourceRequest {
diff --git a/types/classnames/index.d.ts b/types/classnames/index.d.ts
index 40e3ce835c..84073ec109 100644
--- a/types/classnames/index.d.ts
+++ b/types/classnames/index.d.ts
@@ -12,7 +12,7 @@
 type ClassValue = string | number | ClassDictionary | ClassArray | undefined | null | boolean;
 
 interface ClassDictionary {
-	[id: string]: boolean | undefined | null;
+	[id: string]: any;
 }
 
 // This is the only way I found to break circular references between ClassArray and ClassValue
@@ -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/options/index.d.ts b/types/cleave.js/options/index.d.ts
index 60e2e99e40..65d87d79e1 100644
--- a/types/cleave.js/options/index.d.ts
+++ b/types/cleave.js/options/index.d.ts
@@ -19,6 +19,12 @@ export interface CleaveOptions {
     datePattern?: ReadonlyArray;
 }
 
+// Time Options
+export interface CleaveOptions {
+    time?: boolean;
+    timePattern?: ReadonlyArray;
+}
+
 // Numeral Options
 export type NumeralThousandsGroupStyleType = "lakh" | "thousand" | "wan" | "none";
 
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/clipboard/clipboard-tests.ts b/types/clipboard/clipboard-tests.ts
index a2ae8f9354..1a9a170087 100644
--- a/types/clipboard/clipboard-tests.ts
+++ b/types/clipboard/clipboard-tests.ts
@@ -14,6 +14,12 @@ const cb5 = new ClipboardJS(".btn", {
     action: elem => "copy",
     target: elem => null
 });
+const cb6 = new ClipboardJS(".btn", {
+    action: elem => "copy",
+    text: trigger => trigger.getAttribute('aria-label'),
+    target: trigger => trigger.nextElementSibling,
+    container: document.getElementById('modal')
+});
 
 cb1.destroy();
 ClipboardJS.isSupported();
diff --git a/types/clipboard/index.d.ts b/types/clipboard/index.d.ts
index 2405c0c6f0..ceb15b885b 100644
--- a/types/clipboard/index.d.ts
+++ b/types/clipboard/index.d.ts
@@ -49,6 +49,14 @@ declare namespace ClipboardJS {
          * @returns Text to be copied.
          */
         text?(elem: Element): string;
+
+        /**
+         * For use in Bootstrap Modals or with any
+         * other library that changes the focus
+         * you'll want to set the focused element
+         * as the container value.
+         */
+        container?: Element;
     }
 
     interface Event {
diff --git a/types/codemirror/index.d.ts b/types/codemirror/index.d.ts
index 6dbfef6e60..5ece4f497e 100644
--- a/types/codemirror/index.d.ts
+++ b/types/codemirror/index.d.ts
@@ -15,7 +15,7 @@ declare function CodeMirror(callback: (host: HTMLElement) => void , options?: Co
 declare namespace CodeMirror {
     export var Doc : CodeMirror.DocConstructor;
     export var Pos: CodeMirror.PositionConstructor;
-    export var Pass: any;
+    export var Pass: {toString(): "CodeMirror.PASS"};
 
     function countColumn(line: string, index: number | null, tabSize: number): number;
     function fromTextArea(host: HTMLTextAreaElement, options?: EditorConfiguration): CodeMirror.EditorFromTextArea;
@@ -129,6 +129,10 @@ declare namespace CodeMirror {
         state: any;
     }
 
+    interface KeyMap {
+        [keyName: string]: false | string | ((instance: Editor) => void | typeof Pass);
+    }
+
     interface Editor {
 
         /** Tells you whether the editor currently has focus. */
@@ -159,11 +163,11 @@ declare namespace CodeMirror {
         Maps added in this way have a higher precedence than the extraKeys and keyMap options, and between them,
         the maps added earlier have a lower precedence than those added later, unless the bottom argument was passed,
         in which case they end up below other keymaps added with this method. */
-        addKeyMap(map: any, bottom?: boolean): void;
+        addKeyMap(map: string | KeyMap, bottom?: boolean): void;
 
         /** Disable a keymap added with addKeyMap.Either pass in the keymap object itself , or a string,
         which will be compared against the name property of the active keymaps. */
-        removeKeyMap(map: any): void;
+        removeKeyMap(map: string | KeyMap): void;
 
         /** Enable a highlighting overlay.This is a stateless mini - mode that can be used to add extra highlighting.
         For example, the search add - on uses it to highlight the term that's currently being searched.
@@ -716,8 +720,9 @@ declare namespace CodeMirror {
     }
 
     interface EditorChangeCancellable extends CodeMirror.EditorChange {
-        /** may be used to modify the change. All three arguments to update are optional, and can be left off to leave the existing value for that field intact. */
-        update(from?: CodeMirror.Position, to?: CodeMirror.Position, text?: string[]): void;
+        /** may be used to modify the change. All three arguments to update are optional, and can be left off to leave the existing value for that field intact.
+        If the change came from undo/redo, `update` is undefined and the change cannot be modified. */
+        update?(from?: CodeMirror.Position, to?: CodeMirror.Position, text?: string[]): void;
 
         cancel(): void;
     }
@@ -780,7 +785,7 @@ declare namespace CodeMirror {
         keyMap?: string;
 
         /** Can be used to specify extra keybindings for the editor, alongside the ones defined by keyMap. Should be either null, or a valid keymap value. */
-        extraKeys?: any;
+        extraKeys?: string | KeyMap;
 
         /** Whether CodeMirror should scroll or wrap for long lines. Defaults to false (scroll). */
         lineWrapping?: boolean;
diff --git a/types/codemirror/test/index.ts b/types/codemirror/test/index.ts
index 39c601f159..bd2aefac88 100644
--- a/types/codemirror/test/index.ts
+++ b/types/codemirror/test/index.ts
@@ -4,7 +4,18 @@ var myCodeMirror: CodeMirror.Editor = CodeMirror(document.body);
 
 var myCodeMirror2: CodeMirror.Editor = CodeMirror(document.body, {
     value: "function myScript(){return 100;}\n",
-    mode: "javascript"
+    mode: "javascript",
+    extraKeys: {
+        Enter: (cm) => { console.log("save"); },
+        Esc: (cm) => { return CodeMirror.Pass; }
+    }
+});
+
+// $ExpectError
+var myCodeMirror2_1: CodeMirror.Editor = CodeMirror(document.body, {
+    extraKeys: {
+        "Shift-Enter": (cm) => { return 42; }  // not a valid return value
+    }
 });
 
 var range = myCodeMirror2.findWordAt(CodeMirror.Pos(0, 2));
@@ -13,9 +24,9 @@ var head = range.head;
 var from = range.from();
 var to = range.to();
 
-var myTextArea: HTMLTextAreaElement;
+var myTextArea: HTMLTextAreaElement = undefined!;
 var myCodeMirror3: CodeMirror.Editor = CodeMirror(function (elt) {
-    myTextArea.parentNode.replaceChild(elt, myTextArea);
+    myTextArea.parentNode!.replaceChild(elt, myTextArea);
 }, { value: myTextArea.value });
 
 var myCodeMirror4: CodeMirror.Editor = CodeMirror.fromTextArea(myTextArea);
@@ -67,6 +78,15 @@ myCodeMirror.on(
   (instance: CodeMirror.Editor, line: CodeMirror.LineHandle, element: HTMLElement) => { }
 );
 
+myCodeMirror.on(
+  "beforeChange",
+  (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeCancellable) => {
+    // $ExpectError
+    change.update();
+    if (change.update != null) change.update();
+  }
+);
+
 CodeMirror.registerHelper("lint", "javascript", {});
 
 myCodeMirror.isReadOnly();
diff --git a/types/codemirror/tsconfig.json b/types/codemirror/tsconfig.json
index 2ff349d98e..a2c6a52430 100644
--- a/types/codemirror/tsconfig.json
+++ b/types/codemirror/tsconfig.json
@@ -7,7 +7,7 @@
         ],
         "noImplicitAny": true,
         "noImplicitThis": true,
-        "strictNullChecks": false,
+        "strictNullChecks": true,
         "strictFunctionTypes": true,
         "baseUrl": "../",
         "typeRoots": [
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/commondir/commondir-tests.ts b/types/commondir/commondir-tests.ts
new file mode 100644
index 0000000000..33adefb491
--- /dev/null
+++ b/types/commondir/commondir-tests.ts
@@ -0,0 +1,14 @@
+import commondir = require('commondir');
+
+// $ExpectType string
+commondir('wwwroot', [
+    'static_files/png/',
+    '../gif/image.gif',
+]);
+
+// $ExpectType string
+commondir([
+    '/x/y/z',
+    '/x/y',
+    '/x/y/w/q',
+]);
diff --git a/types/commondir/index.d.ts b/types/commondir/index.d.ts
new file mode 100644
index 0000000000..ac75d00d00
--- /dev/null
+++ b/types/commondir/index.d.ts
@@ -0,0 +1,20 @@
+// Type definitions for commondir 1.0
+// Project: https://github.com/substack/node-commondir
+// Definitions by: Leonard Thieu 
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+export = commondir;
+
+/**
+ * Compute the closest common parent directory for an array absolutePaths.
+ *
+ * @see \`{@link https://github.com/substack/node-commondir#commondirabsolutepaths }\`
+ */
+declare function commondir(basedir: string, relativePaths: string[]): string;
+/**
+ * Compute the closest common parent directory for an array relativePaths which will be resolved for each dir in
+ * relativePaths according to: path.resolve(basedir, dir).
+ *
+ * @see \`{@link https://github.com/substack/node-commondir#commondirbasedir-relativepaths }\`
+ */
+declare function commondir(absolutePaths: string[]): string;
diff --git a/types/commondir/tsconfig.json b/types/commondir/tsconfig.json
new file mode 100644
index 0000000000..e00a5278b8
--- /dev/null
+++ b/types/commondir/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",
+        "commondir-tests.ts"
+    ]
+}
diff --git a/types/commondir/tslint.json b/types/commondir/tslint.json
new file mode 100644
index 0000000000..3db14f85ea
--- /dev/null
+++ b/types/commondir/tslint.json
@@ -0,0 +1 @@
+{ "extends": "dtslint/dt.json" }
diff --git a/types/connect-mongo/index.d.ts b/types/connect-mongo/index.d.ts
index cf3d5ddb3e..ee110ab6b0 100644
--- a/types/connect-mongo/index.d.ts
+++ b/types/connect-mongo/index.d.ts
@@ -104,11 +104,11 @@ declare namespace connectMongo {
     }
 
     export class MongoStore extends session.Store {
-        get: (sid: string, callback: (err: any, session: Express.Session) => void) => void;
+        get: (sid: string, callback: (err: any, session: Express.Session | null) => void) => void;
         set: (sid: string, session: Express.Session, callback?: (err: any) => void) => void;
         destroy: (sid: string, callback?: (err: any) => void) => void;
         length: (callback: (err: any, length: number) => void) => void;
-        clear: (callback?: (err: any) => void) => void;
+        clear: (callback?: (err?: any) => void) => void;
         touch: (sid: string, session: Express.Session, callback?: (err: any) => void) => void;
     }
 }
diff --git a/types/console-log-level/console-log-level-tests.ts b/types/console-log-level/console-log-level-tests.ts
new file mode 100644
index 0000000000..3df123421b
--- /dev/null
+++ b/types/console-log-level/console-log-level-tests.ts
@@ -0,0 +1,20 @@
+import consoleLogLevel = require("console-log-level");
+
+const logger1 = consoleLogLevel({
+    level: "trace",
+    stderr: undefined,
+    prefix: () => "SOME PREFIX"
+});
+
+const logger2 = consoleLogLevel({
+    level: "trace",
+    stderr: true,
+    prefix: "OTHER PREFIX"
+});
+
+logger1.trace("hello %s", "world");
+logger2.debug("hello %s", "world");
+logger2.info("hello %s", "world");
+logger2.warn("hello %s", "world");
+logger2.error("hello %s", "world");
+logger2.fatal("hello %s", "world");
diff --git a/types/console-log-level/index.d.ts b/types/console-log-level/index.d.ts
new file mode 100644
index 0000000000..3a70f850df
--- /dev/null
+++ b/types/console-log-level/index.d.ts
@@ -0,0 +1,23 @@
+// Type definitions for console-log-level 1.4
+// Project: https://github.com/watson/console-log-level
+// Definitions by: Ali Ijaz Sheikh 
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.1
+
+type PrefixFunction = (level: string) => string;
+
+declare namespace consoleLogLevel {
+    type LogLevelNames =
+        "trace" | "debug" | "info" | "warn" | "error" | "fatal";
+    type Logger = Record void>;
+}
+
+interface Options {
+    level?: consoleLogLevel.LogLevelNames;
+    prefix?: string | PrefixFunction;
+    stderr?: boolean;
+}
+
+declare function consoleLogLevel(opts: Options): consoleLogLevel.Logger;
+
+export = consoleLogLevel;
diff --git a/types/console-log-level/tsconfig.json b/types/console-log-level/tsconfig.json
new file mode 100644
index 0000000000..3fcb21220b
--- /dev/null
+++ b/types/console-log-level/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",
+        "console-log-level-tests.ts"
+    ]
+}
diff --git a/types/console-log-level/tslint.json b/types/console-log-level/tslint.json
new file mode 100644
index 0000000000..3db14f85ea
--- /dev/null
+++ b/types/console-log-level/tslint.json
@@ -0,0 +1 @@
+{ "extends": "dtslint/dt.json" }
diff --git a/types/console-stamp/console-stamp-tests.ts b/types/console-stamp/console-stamp-tests.ts
index d4dad4d695..55408d318a 100644
--- a/types/console-stamp/console-stamp-tests.ts
+++ b/types/console-stamp/console-stamp-tests.ts
@@ -15,6 +15,8 @@ var options2 = {
 		label: "white",
 		metadata: "green"
 	},
-	label: true
+	label: true,
+	labelPrefix: '[',
+	labelSuffix: ']'
 };
 consoleStamp(console, options2);
diff --git a/types/console-stamp/index.d.ts b/types/console-stamp/index.d.ts
index c7b9547cc8..5912b6876e 100644
--- a/types/console-stamp/index.d.ts
+++ b/types/console-stamp/index.d.ts
@@ -1,6 +1,7 @@
 // Type definitions for console-stamp 0.2.0
 // Project: https://github.com/starak/node-console-stamp
 // Definitions by: Eric Byers 
+//                 Guus De Graeve 
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
 
 
@@ -16,6 +17,16 @@ declare function consoleStamp(console: {}, options?: {
      */
     label?: boolean;
 
+    /**
+     * A custom prefix for the label.
+     */
+    labelPrefix?: string;
+
+    /**
+     * A custom suffix for the label.
+     */
+    labelSuffix?: string;
+
     /**
      * An array containing the methods to include in the patch
      */
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/cookie-session/index.d.ts b/types/cookie-session/index.d.ts
index 001ba646d5..a0b7a2e6b0 100644
--- a/types/cookie-session/index.d.ts
+++ b/types/cookie-session/index.d.ts
@@ -78,17 +78,17 @@ declare namespace CookieSessionInterfaces {
         /**
          * Is true if the session has been changed during the request.
          */
-        isChanged: boolean;
+        isChanged?: boolean;
 
         /**
          * Is true if the session is new.
          */
-        isNew: boolean;
+        isNew?: boolean;
 
         /**
          * Determine if the session has been populated with data or is empty.
          */
-        isPopulated: boolean;
+        isPopulated?: boolean;
 
         [propertyName: string]: any;
     }
@@ -97,7 +97,7 @@ declare namespace CookieSessionInterfaces {
         /**
          * Represents the session for the given request.
          */
-        session: CookieSessionObject;
+        session?: CookieSessionObject;
 
         /**
          * Represents the session options for the current request. These options are a shallow clone of what was provided at middleware construction and can be altered to change cookie setting behavior on a per-request basis.
diff --git a/types/copy-webpack-plugin/index.d.ts b/types/copy-webpack-plugin/index.d.ts
index eedf42f450..59c1b8d0cb 100644
--- a/types/copy-webpack-plugin/index.d.ts
+++ b/types/copy-webpack-plugin/index.d.ts
@@ -61,7 +61,7 @@ interface CopyWebpackPluginConfiguration {
 }
 
 interface CopyWebpackPlugin {
-    new (patterns?: CopyPattern[], options?: CopyWebpackPluginConfiguration): Plugin
+    new (patterns?: (string | CopyPattern)[], options?: CopyWebpackPluginConfiguration): Plugin
 }
 
 declare const copyWebpackPlugin: CopyWebpackPlugin
diff --git a/types/couchbase/couchbase-tests.ts b/types/couchbase/couchbase-tests.ts
index 547133754b..e6ea7c12d3 100644
--- a/types/couchbase/couchbase-tests.ts
+++ b/types/couchbase/couchbase-tests.ts
@@ -1,14 +1,167 @@
 import couchbase = require('couchbase');
 var cluster = new couchbase.Cluster('couchbase://127.0.0.1');
+
+cluster.authenticate('username', 'password');
+cluster.authenticate({username: 'username', password: 'password'});
+cluster.authenticate(new couchbase.ClassicAuthenticator({'bucket': 'password'}, 'username', 'password'));
+
 var bucket = cluster.openBucket('default');
+var N1qlQuery = couchbase.N1qlQuery;
 
-bucket.upsert('testdoc', { name: 'Frank' }, (error) => {
-    if (error) throw error;
+bucket.on('connect', () => console.error('Connected!'));
+bucket.on('error', err => console.error('Connection failed!'));
 
-    bucket.get('testdoc', (err, result) => {
-        if (err) throw err;
+bucket.once('connect', () => console.error('Connected!'));
+bucket.once('error', err => console.error('Connection failed!'));
 
-        console.log(result.value);
-        // {name: Frank} 
+bucket.manager().createPrimaryIndex(function() {
+    bucket.upsert('user:king_arthur', {
+        'email': 'kingarthur@couchbase.com', 'interests': ['Holy Grail', 'African Swallows']
+    },
+    function(err, result) {
+        bucket.get('user:king_arthur', function(err, result) {
+            console.log('Got result: %j', result.value);
+            bucket.query(
+                N1qlQuery.fromString('SELECT * FROM bucketname WHERE $1 in interests LIMIT 1'),
+                ['African Swallows'],
+                function(err, rows) {
+                    console.log("Got rows: %j", rows);
+                });
+        });
     });
-});
\ No newline at end of file
+});
+
+// Ensure bucket.upsert is composable with normal callbacks
+function composable(callback: (err?: Error) => void) {
+    bucket.upsert('key', {value: 1}, callback);
+}
+
+// From https://developer.couchbase.com/documentation/server/current/sdk/nodejs/n1ql-queries-with-sdk.html
+function n1ql_a() {
+    const n1qlquery = N1qlQuery.fromString('SELECT name, email FROM users WHERE name=$1');
+    bucket.query(n1qlquery, ['Monty Python'], function(err, rows) {
+    // ...
+    });
+}
+
+function n1ql_b() {
+    const q = N1qlQuery.fromString('SELECT * FROM `travel-sample` LIMIT 10');
+    const req = bucket.query(q);
+    req.on('row', function(row) {
+    console.log('Got a row');
+    });
+    req.on('error', function(err) {
+    console.error('Got error %j', err);
+    });
+    req.on('end', function(meta) {
+    console.log('All rows received. Metadata is %j:', meta);
+    });
+}
+
+function n1ql_c() {
+    // Insert a document with a random x value
+    bucket.upsert('test-doc', {x: Math.round(Math.random()*10000000)}, function(err, res) {
+        if (err) {
+        throw err;
+        }
+
+        var qs = 'SELECT t.*, TOSTRING(META().cas) AS `_cas` FROM `travel-sample` t WHERE META().id="test-doc"';
+        var q = couchbase.N1qlQuery.fromString(qs);
+        q.consistency(couchbase.N1qlQuery.Consistency.REQUEST_PLUS);
+        bucket.query(q, function(err, rows) {
+            if (err) {
+                throw err;
+            }
+
+            if (rows.length !== 1) {
+                throw new Error('unexpected number of rows');
+            }
+
+            console.log('Query Result:', rows[0]);
+
+            var cas = rows[0]._cas;
+            var doc = rows[0];
+            delete(doc._cas);
+            doc.y = doc.x;
+
+            bucket.replace('test-doc', doc, {cas: cas}, function(err) {
+                if (err) {
+                    throw err;
+                }
+
+                bucket.get('test-doc', function(err, res) {
+                if (err) {
+                    throw err;
+                }
+
+                console.log('Updated:', res.value);
+
+                process.exit(0);
+                });
+            });
+        });
+    });
+}
+
+// From https://developer.couchbase.com/documentation/server/current/sdk/nodejs/full-text-searching-with-sdk.html
+const SearchQuery = couchbase.SearchQuery;
+const SearchFacet = couchbase.SearchFacet;
+
+function search_a() {
+    let searchQuery = SearchQuery.new('travel-search', SearchQuery.term('office'));
+    bucket.query(searchQuery, function(err, res, meta) {
+        for (var i = 0; i < res.length; ++i) {
+            console.log('Hit:', res[i].id);
+        }
+    });
+}
+
+function search_b() {
+    const searchQuery = SearchQuery.new('travel-search', SearchQuery.term('office'));
+    searchQuery.addFacet('countries', SearchFacet.term('country', 5));
+    bucket.query(searchQuery, function(err, res, meta) {
+        console.log('Total Countries:', meta.facets['countries'].total);
+    });
+}
+
+// From https://developer.couchbase.com/documentation/server/5.1/sdk/nodejs/view-queries-with-sdk.html
+const ViewQuery = couchbase.ViewQuery;
+
+function view_a() {
+    var query = ViewQuery.from('beer', 'by_name').skip(6).limit(3);
+    bucket.query(query, function(err, results) {
+        for(let i in results)
+            console.log(results[i]);
+    });
+}
+
+function view_b() {
+    var SpatialQuery = couchbase.SpatialQuery;
+
+    var query = SpatialQuery.from('spatial', 'by_location').limit(10);
+    bucket.query(query, function(err, results) {
+        for(let i in results)
+            console.log(results[i]);
+    });
+}
+
+// From https://developer.couchbase.com/documentation/server/current/sdk/nodejs/sample-app-backend.html
+function userSearch(location: string | undefined, description: string | undefined) {
+    var qp = couchbase.SearchQuery.conjuncts(couchbase.SearchQuery.term('hotel').field('type'));
+    if (location && location !== '*') {
+        qp.and(couchbase.SearchQuery.disjuncts(
+            couchbase.SearchQuery.matchPhrase(location).field("country"),
+            couchbase.SearchQuery.matchPhrase(location).field("city"),
+            couchbase.SearchQuery.matchPhrase(location).field("state"),
+            couchbase.SearchQuery.matchPhrase(location).field("address")
+        ));
+    }
+
+    if (description && description !== '*') {
+        qp.and(
+            couchbase.SearchQuery.disjuncts(
+                couchbase.SearchQuery.matchPhrase(description).field("description"),
+                couchbase.SearchQuery.matchPhrase(description).field("name")
+            ));
+    }
+}
diff --git a/types/couchbase/index.d.ts b/types/couchbase/index.d.ts
index eb945af458..813ee8f110 100644
--- a/types/couchbase/index.d.ts
+++ b/types/couchbase/index.d.ts
@@ -1,6 +1,7 @@
-// Type definitions for Couchbase Node.js SDK 2.1.2
+// Type definitions for Couchbase Node.js SDK 2.4.5
 // Project: https://github.com/couchbase/couchnode
 // Definitions by: Marwan Aouida 
+//      Brian Crowell 
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
 
 /// 
@@ -144,10 +145,75 @@ declare enum errors {
     restError
 }
 
+/**
+ * Virtual base for authenticators.
+ */
+declare interface Authenticator {
+    username: string;
+    password: string;
+}
+
+/**
+ * Authenticator for using classic authentication.
+ */
+declare class ClassicAuthenticator implements Authenticator {
+    /**
+     * Create a new instance of the ClassicAuthenticator class.
+     * @param buckets Map of bucket names to passwords.
+     * @param username Cluster administration username.
+     * @param password Cluster administration password.
+     */
+    constructor(buckets: {[key: string]: string}, username: string, password: string);
+
+    username: string;
+    password: string;
+}
+
+/**
+ * Authenticator for using role-based authentication.
+ */
+declare class PasswordAuthenticator implements Authenticator {
+    /**
+     * Create a new instance of the PasswordAuthenticator class.
+     * @param username RBAC username.
+     * @param password RBAC password.
+     */
+    constructor(username: string, password: string);
+
+    username: string;
+    password: string;
+}
+
+/**
+ * Authenticator for performing certificate-based authentication.
+ */
+declare class CertAuthenticator implements Authenticator {
+    /**
+     * Create a new instance of the CertAuthenticator class.
+     */
+    constructor();
+
+    username: string;
+    password: string;
+}
+
 /**
  * Represents a singular cluster containing your buckets.
  */
 declare class Cluster {
+    /**
+     * Authenticate to the cluster using role-based authentication.
+     * @param username RBAC username.
+     * @param password RBAC password.
+     */
+    authenticate(username: string, password: string): void;
+
+    /**
+     * Authenticate to the cluster using a specific authentication type.
+     * @param auther
+     */
+    authenticate(auther: Authenticator): void;
+
     /**
      * Create a new instance of the Cluster class.
      * @param cnstr The connection string for your cluster.
@@ -255,7 +321,17 @@ interface CouchbaseError extends Error {
     /**
      * The error code for this error.
      */
-    code: errors;
+    code?: errors;
+
+    /**
+     * Possible response body included with the error.
+     */
+    responseBody?: any;
+
+    /**
+     * Possible inner error for this error.
+     */
+    innerError?: CouchbaseError;
 }
 
 interface AppendOptions {
@@ -352,10 +428,198 @@ interface InsertOptions {
     replicate_to?: number;
 }
 
+interface CreateIndexOptions {
+    /**
+     * If a secondary index already exists, an error will be thrown unless this is set to true.
+     */
+    ignoreIfExists?: boolean;
+
+    /**
+     * True to defer building of the index until buildDeferredIndexes is called (or a direct call to the corresponding query service API).
+     */
+    deferred?: boolean;
+}
+
+interface CreatePrimaryIndexOptions {
+    /**
+     * The custom name for the primary index.
+     */
+    name?: string;
+
+    /**
+     * If a primary index already exists, an error will be thrown unless this is set to true.
+     */
+    ignoreIfExists?: boolean;
+
+    /**
+     * True to defer building of the index until buildDeferredIndexes is called (or a direct call to the corresponding query service API).
+     */
+    deferred?: boolean;
+}
+
+interface DropIndexOptions {
+    /**
+     * If true, attempting to drop on a bucket without the specified index won't cause an error to be thrown.
+     */
+    ignoreIfNotExists?: boolean;
+}
+
+interface DropPrimaryIndexOptions {
+    /**
+     * The custom name for the primary index.
+     */
+    name?: string;
+
+    /**
+     * If true, attempting to drop on a bucket without the specified index won't cause an error to be thrown.
+     */
+    ignoreIfNotExists?: boolean;
+}
+
+interface CreatePrimaryIndexOptions {
+    /**
+     * The custom name for the primary index.
+     */
+    name?: string;
+
+    /**
+     * If a primary index already exists, an error will be thrown unless this is set to true.
+     */
+    ignoreIfExists?: boolean;
+
+    /**
+     * True to defer building of the index until buildDeferredIndexes is called (or a direct call to the corresponding query service API).
+     */
+    deferred?: boolean;
+}
+
+interface IndexInfo {
+    /**
+     * ID for the index.
+     */
+    id: string;
+
+    /**
+     * Name for the index.
+     */
+    name: string;
+
+    /**
+     * List of index keys.
+     */
+    index_key: string[];
+
+    /**
+     * True if this is a primary index.
+     */
+    is_primary: boolean;
+
+    /**
+     * ID for the keyspace to which the index belongs.
+     */
+    keyspace_id: string;
+
+    /**
+     * ID for the namespace to which the index belongs.
+     */
+    namespace_id: string;
+
+    /**
+     * ID for the datastore to which the index belongs.
+     */
+    store_id: string;
+
+    /**
+     * The current state of the index.
+     *
+     * Values include `online` and `pending`.
+     */
+    state: string;
+
+    /**
+     * The type of view, which will always be `gsi`.
+     */
+    using: 'gsi';
+}
+
+interface WatchIndexesOptions {
+    /**
+     * Timeout for the operation in milliseconds.
+     */
+    timeout?: number;
+}
+
 /**
  * A class for performing management operations against a bucket. This class should not be instantiated directly, but instead through the use of the Bucket#manager method instead.
  */
 interface BucketManager {
+    /**
+     * Builds any indexes that were previously created with the deferred attribute.
+     * @param callback The callback function.
+     */
+    buildDeferredIndexes(callback: (err: CouchbaseError | null, deferredIndexes: string[]) => void): void;
+
+    /**
+     * Creates a non-primary GSI index with an optional name.
+     * @param indexName The name of the index.
+     * @param fields The JSON fields to index.
+     * @param options
+     * @param callback The callback function.
+     */
+    createIndex(indexName: string, fields: string[], callback: (err: CouchbaseError | null) => void): void;
+
+    /**
+     * Creates a non-primary GSI index with an optional name.
+     * @param indexName The name of the index.
+     * @param fields The JSON fields to index.
+     * @param options
+     * @param callback The callback function.
+     */
+    createIndex(indexName: string, fields: string[], options: CreateIndexOptions, callback: (err: CouchbaseError | null) => void): void;
+
+    /**
+     * Creates a primary GSI index with an optional name.
+     * @param options
+     * @param callback The callback function.
+     */
+    createPrimaryIndex(callback: (err: CouchbaseError | null) => void): void;
+
+    /**
+     * Creates a primary GSI index with an optional name.
+     * @param options
+     * @param callback The callback function.
+     */
+    createPrimaryIndex(options: CreateIndexOptions, callback: (err: CouchbaseError | null) => void): void;
+
+    /**
+     * Drops a specific GSI index by name.
+     * @param indexName The name of the index.
+     * @param options
+     * @param callback The callback function.
+     */
+    dropIndex(indexName: string, callback: (err: CouchbaseError | null) => void): void;
+
+    /**
+     * Drops a specific GSI index by name.
+     * @param indexName The name of the index.
+     * @param options
+     * @param callback The callback function.
+     */
+    dropIndex(indexName: string, options: DropIndexOptions, callback: (err: CouchbaseError | null) => void): void;
+
+    /**
+     * Drops a primary GSI index.
+     * @param options
+     * @param callback The callback function.
+     */
+    dropPrimaryIndex(callback: (err: CouchbaseError | null) => void): void;
+
+    /**
+     * Drops a primary GSI index.
+     * @param options
+     * @param callback The callback function.
+     */
+    dropPrimaryIndex(options: DropPrimaryIndexOptions, callback: (err: CouchbaseError | null) => void): void;
 
     /**
      * Flushes the cluster, deleting all data stored within this bucket. Note that this method requires the Flush permission to be enabled on the bucket from the management console before it will work.
@@ -376,6 +640,12 @@ interface BucketManager {
      */
     getDesignDocuments(callback: Function): void;
 
+    /**
+     * Retrieves a list of the indexes currently configured on the cluster.
+     * @param callback The callback function.
+     */
+    getIndexes(callback: (err: CouchbaseError | null, indexes: IndexInfo[] | null) => void): void;
+
     /**
      * Registers a design document to this bucket, failing if it already exists.
      * @param name
@@ -401,6 +671,21 @@ interface BucketManager {
      * @returns {}
      */
     upsertDesignDocument(name: string, data: any, callback: Function): void;
+
+    /**
+     * Watches a list of indexes, waiting for them to become available for use.
+     * @param watchList List of indexes to watch.
+     * @param callback The callback function.
+     */
+    watchIndexes(watchList: string[], callback: (err: Error | null) => void): void;
+
+    /**
+     * Watches a list of indexes, waiting for them to become available for use.
+     * @param watchList List of indexes to watch.
+     * @param options
+     * @param callback The callback function.
+     */
+    watchIndexes(watchList: string[], options: WatchIndexesOptions, callback: (err: Error | null) => void): void;
 }
 
 /**
@@ -571,6 +856,9 @@ declare namespace ViewQuery {
  * Class for dynamically construction of N1QL queries. This class should never be constructed directly, instead you should use the N1qlQuery.fromString static method to instantiate a N1qlStringQuery.
  */
 declare class N1qlQuery {
+    // Private declaration to avoid other queries being misstaken for N1qlQuery
+    private __nominal: void;
+
     /**
      * Creates a query object directly from the passed query string.
      * @param str
@@ -703,10 +991,654 @@ declare namespace SpatialQuery {
     }
 }
 
+declare abstract class SearchQuery {
+    /**
+     * Creates a new search query from an index name and search query definition.
+     * @param indexName The FTS index to search in.
+     * @param query The body of the FTS query.
+     */
+    static new(indexName: string, query: SearchQuery.Query): SearchQuery;
+
+    /**
+     * Creates a compound BooleanQuery composed of several other query objects.
+     */
+    static boolean(): SearchQuery.BooleanQuery;
+
+    /**
+     * Creates a BooleanFieldQuery for searching boolean fields in an index.
+     */
+    static booleanField(val: boolean): SearchQuery.BooleanFieldQuery;
+
+    /**
+     * Creates a query for matches all of a list of subqueries in an index.
+     */
+    static conjuncts(queries: ReadonlyArray): SearchQuery.ConjunctionQuery;
+
+    /**
+     * Creates a query for matches all of a list of subqueries in an index.
+     */
+    static conjuncts(...queries: SearchQuery.Query[]): SearchQuery.ConjunctionQuery;
+
+    /**
+     * Creates a search query for matching date ranges in an index.
+     */
+    static dateRange(): SearchQuery.DateRangeQuery;
+
+    /**
+     * Creates a query for matches any of a list of subqueries in an index.
+     */
+    static disjuncts(queries: ReadonlyArray): SearchQuery.DisjunctionQuery;
+
+    /**
+     * Creates a query for matches any of a list of subqueries in an index.
+     */
+    static disjuncts(...queries: SearchQuery.Query[]): SearchQuery.DisjunctionQuery;
+
+    /**
+     * Creates a query which allows you to match a list of document IDs in an index.
+     */
+    static docIds(ids: ReadonlyArray): SearchQuery.DocIdQuery;
+
+    /**
+     * Creates a query which allows you to match a list of document IDs in an index.
+     */
+    static docIds(...ids: string[]): SearchQuery.DocIdQuery;
+
+    /**
+     * Creates a geographical bounding-box based query.
+     * @param tl_lat Top-left latitude.
+     * @param tl_lon Top-left longitude.
+     * @param br_lat Bottom-right latitude.
+     * @param br_lon Bottom-right longitude.
+     */
+    static geoBoundingBoxQuery(tl_lat: number, tl_lon: number, br_lat: number, br_lon: number): SearchQuery.GeoBoundingBoxQuery;
+
+    /**
+     * Creates a geographical distance based query.
+     */
+    static geoDistanceQuery(): SearchQuery.GeoDistanceQuery;
+
+    /**
+     * Creates a search query for matching text.
+     */
+    static match(match: string): SearchQuery.MatchQuery;
+
+    /**
+     * Creates a search query which matches anything.
+     */
+    static matchAll(): SearchQuery.MatchAllQuery;
+
+    /**
+     * Creates a search query which matches nothing.
+     */
+    static matchNone(): SearchQuery.MatchAllQuery;
+
+    /**
+     * Creates a search query for matching phrases in an index.
+     */
+    static matchPhrase(phrase: string): SearchQuery.MatchPhraseQuery;
+
+    /**
+     * Creates a search query for matching numeric ranges in an index.
+     */
+    static numericRange(): SearchQuery.NumericRangeQuery;
+
+    /**
+     * Creates a search query for a prefix in an index.
+     */
+    static phrase(terms: ReadonlyArray): SearchQuery.PhraseQuery;
+
+    /**
+     * Creates a search query for a prefix in an index.
+     */
+    static prefix(prefix: string): SearchQuery.PrefixQuery;
+    /**
+     * Creates a query for matches any of a list of subqueries in an index.
+     */
+
+    /**
+     * Creates a search query for matching string.
+     */
+    static queryString(query: string): SearchQuery.QueryStringQuery;
+
+    /**
+     * Creates a search query for matching against a regexp query in an index.
+     */
+    static regexp(regexp: string): SearchQuery.RegexpQuery;
+
+    /**
+     * Creates a search query for searching terms in an index.
+     */
+    static term(term: string): SearchQuery.TermQuery;
+
+    /**
+     * Creates a search query for matching term ranges in the index.
+     */
+    static termRange(): SearchQuery.TermRangeQuery;
+
+    /**
+     * Creates a search query for matching a string with wildcards in an index.
+     */
+    static wildcard(wildcard: string): SearchQuery.WildcardQuery;
+
+    /**
+     * Adds a SearchFacet object to return information about as part of the execution of this query.
+     */
+    addFacet(name: string, facet: SearchFacet): this;
+
+    /**
+     * Specify the consistency level for this query.
+     */
+    consistency(val: SearchQuery.Consistency): this;
+
+    /**
+     * Includes information about the internal search semantics used to execute your query.
+     */
+    explain(explain: boolean): this;
+
+    /**
+     * Specifies the fields you wish to receive in the result set.
+     */
+    fields(fields: ReadonlyArray): this;
+
+    /**
+     * Specifies the fields you wish to receive in the result set.
+     */
+    fields(...fields: string[]): this;
+
+    /**
+     * Request a particular highlight style and field list for this query.
+     */
+    highlight(style: SearchQuery.HighlightStyle, fields: ReadonlyArray): this;
+
+    /**
+     * Request a particular highlight style and field list for this query.
+     */
+    highlight(style: SearchQuery.HighlightStyle, ...fields: string[]): this;
+
+    /**
+     * Specifies the maximum number of results to return.
+     * @param limit Maximum number of results to return.
+     */
+    limit(limit: number): this;
+
+    /**
+     * Specifies how many results to skip from the beginning of the result set.
+     * @param skip How many results to skip from the beginning of the result set.
+     */
+    skip(skip: number): this;
+
+    /**
+     * Specifies the fields you wish to sort by in your result set.
+     */
+    sort(fields: ReadonlyArray): this;
+
+    /**
+     * Specifies the fields you wish to sort by in your result set.
+     */
+    sort(...fields: (string | SearchSort)[]): this;
+
+    /**
+     * Specifies the maximum time to wait for this query to complete.
+     * @param timeout Maximum time to wait (in milliseconds) for this query to complete.
+     */
+    timeout(timeout: number): this;
+}
+
+declare namespace SearchQuery {
+    abstract class Query {
+    }
+
+    abstract class BooleanQuery extends Query {
+        /**
+         * Specifies a predicate query which must match.
+         * @param query
+         */
+        must(query: Query): this;
+
+        /**
+         * Specifies a predicate query which must not match.
+         * @param query
+         */
+        mustNot(query: Query): this;
+
+        /**
+         * Specifies a predicate query which should match.
+         * @param query
+         */
+        should(query: Query): this;
+
+        /**
+         * Specifies the minimum score for should predicate matches.
+         * @param shouldMin
+         */
+        shouldMin(shouldMin: number): this;
+
+        /**
+         * Defines the amount to boost the query.
+         * @param boost Amount to boost the query.
+         */
+        boost(boost: number): this;
+    }
+
+    abstract class BooleanFieldQuery extends Query {
+        /**
+         * Defines the amount to boost the query.
+         * @param boost Amount to boost the query.
+         */
+        boost(boost: number): this;
+
+        /**
+         * Specifies the field to query.
+         * @param boost The field to query.
+         */
+        field(field: string): this;
+    }
+
+    abstract class ConjunctionQuery extends Query {
+        /**
+         * Specifies additional predicate queries.
+         * @param queries Additional predicate queries.
+         */
+        and(queries: ReadonlyArray): this;
+
+        /**
+         * Specifies additional predicate queries.
+         * @param queries Additional predicate queries.
+         */
+        and(...queries: SearchQuery.Query[]): this;
+
+        /**
+         * Defines the amount to boost the query.
+         * @param boost Amount to boost the query.
+         */
+        boost(boost: number): this;
+    }
+
+    abstract class DateRangeQuery extends Query {
+        /**
+         * Defines the lower bound of the date range query.
+         * @param start The lower bound of the query.
+         * @param inclusive True to set an inclusive bound. Defaults to true.
+         */
+        start(start: Date | string, inclusive?: boolean): this;
+
+        /**
+         * Defines the upper bound of the date range query.
+         * @param end The upper bound of the query.
+         * @param inclusive True to set an inclusive bound. Defaults to false.
+         */
+        end(end: Date | string, inclusive?: boolean): this;
+
+        /**
+         * Defines the amount to boost the query.
+         * @param boost Amount to boost the query.
+         */
+        boost(boost: number): this;
+
+        /**
+         * Specifies the field to query.
+         * @param field The field to query.
+         */
+        field(field: string): this;
+    }
+
+    abstract class DisjunctionQuery extends Query {
+        /**
+         * Specifies additional predicate queries.
+         * @param queries Additional predicate queries.
+         */
+        or(queries: ReadonlyArray): this;
+
+        /**
+         * Specifies additional predicate queries.
+         * @param queries Additional predicate queries.
+         */
+        or(...queries: SearchQuery.Query[]): this;
+
+        /**
+         * Defines the amount to boost the query.
+         * @param boost Amount to boost the query.
+         */
+        boost(boost: number): this;
+    }
+
+    abstract class DocIdQuery extends Query {
+        /**
+         * Defines the amount to boost the query.
+         * @param boost Amount to boost the query.
+         */
+        boost(boost: number): this;
+
+        /**
+         * Specifies the field to query.
+         * @param field The field to query.
+         */
+        field(field: string): this;
+    }
+
+    abstract class GeoBoundingBoxQuery extends Query {
+        /**
+         * Defines the amount to boost the query.
+         * @param boost Amount to boost the query.
+         */
+        boost(boost: number): this;
+
+        /**
+         * Specifies the field to query.
+         * @param field The field to query.
+         */
+        field(field: string): this;
+    }
+
+    abstract class GeoDistanceQuery extends Query {
+        /**
+         * Defines the amount to boost the query.
+         * @param boost Amount to boost the query.
+         */
+        boost(boost: number): this;
+
+        /**
+         * Specifies the field to query.
+         * @param field The field to query.
+         */
+        field(field: string): this;
+    }
+
+    abstract class MatchAllQuery extends Query {
+    }
+
+    abstract class MatchNoneQuery extends Query {
+    }
+
+    abstract class MatchPhraseQuery extends Query {
+        /**
+         * Defines the amount to boost the query.
+         * @param boost Amount to boost the query.
+         */
+        boost(boost: number): this;
+
+        /**
+         * Specifies the field to query.
+         * @param field The field to query.
+         */
+        field(field: string): this;
+
+        /**
+         * Specifies the analyzer to use for the query.
+         * @param analyzer Analyzer to use for the query.
+         */
+        analyzer(analyzer: string): this;
+    }
+
+    abstract class MatchQuery extends Query {
+        /**
+         * Defines the amount to boost the query.
+         * @param boost Amount to boost the query.
+         */
+        boost(boost: number): this;
+
+        /**
+         * Specifies the field to query.
+         * @param field The field to query.
+         */
+        field(field: string): this;
+
+        /**
+         * Defines the level of fuzziness for the query.
+         * @param fuzziness Level of fuzziness for the query.
+         */
+        fuzziness(fuzziness: number): this;
+
+        /**
+         * Specifies the prefix length to consider for the query.
+         * @param prefixLength Prefix length to consider for the query.
+         */
+        prefixLength(prefixLength: number): this;
+
+        /**
+         * Specifies the analyzer to use for the query.
+         * @param analyzer Analyzer to use for the query.
+         */
+        analyzer(analyzer: string): this;
+    }
+
+    abstract class NumericRangeQuery extends Query {
+        /**
+         * Defines the lower bound of the numeric range query.
+         * @param min The lower bound of the query.
+         * @param inclusive True to set an inclusive bound. Defaults to true.
+         */
+        min(min: number, inclusive?: boolean): this;
+
+        /**
+         * Defines the upper bound of the numeric range query.
+         * @param max The upper bound of the query.
+         * @param inclusive True to set an inclusive bound. Defaults to false.
+         */
+        max(max: number, inclusive?: boolean): this;
+
+        /**
+         * Defines the amount to boost the query.
+         * @param boost Amount to boost the query.
+         */
+        boost(boost: number): this;
+
+        /**
+         * Specifies the field to query.
+         * @param field The field to query.
+         */
+        field(field: string): this;
+    }
+
+    abstract class PhraseQuery extends Query {
+        /**
+         * Defines the amount to boost the query.
+         * @param boost Amount to boost the query.
+         */
+        boost(boost: number): this;
+
+        /**
+         * Specifies the field to query.
+         * @param field The field to query.
+         */
+        field(field: string): this;
+    }
+
+    abstract class PrefixQuery extends Query {
+        /**
+         * Defines the amount to boost the query.
+         * @param boost Amount to boost the query.
+         */
+        boost(boost: number): this;
+
+        /**
+         * Specifies the field to query.
+         * @param field The field to query.
+         */
+        field(field: string): this;
+    }
+
+    abstract class QueryStringQuery extends Query {
+        /**
+         * Defines the amount to boost the query.
+         * @param boost Amount to boost the query.
+         */
+        boost(boost: number): this;
+    }
+
+    abstract class RegexpQuery extends Query {
+        /**
+         * Defines the amount to boost the query.
+         * @param boost Amount to boost the query.
+         */
+        boost(boost: number): this;
+
+        /**
+         * Specifies the field to query.
+         * @param field The field to query.
+         */
+        field(field: string): this;
+    }
+
+    abstract class TermQuery extends Query {
+        /**
+         * Defines the amount to boost the query.
+         * @param boost Amount to boost the query.
+         */
+        boost(boost: number): this;
+
+        /**
+         * Specifies the field to query.
+         * @param field The field to query.
+         */
+        field(field: string): this;
+
+        /**
+         * Defines the level of fuzziness for the query.
+         * @param fuzziness Level of fuzziness for the query.
+         */
+        fuzziness(fuzziness: number): this;
+
+        /**
+         * Specifies the prefix length to consider for the query.
+         * @param prefixLength Prefix length to consider for the query.
+         */
+        prefixLength(prefixLength: number): this;
+    }
+
+    abstract class TermRangeQuery extends Query {
+        /**
+         * Defines the lower bound of the term range query.
+         * @param min The lower bound of the query.
+         * @param inclusive True to set an inclusive bound. Defaults to true.
+         */
+        min(min: string, inclusive?: boolean): this;
+
+        /**
+         * Defines the upper bound of the term range query.
+         * @param max The upper bound of the query.
+         * @param inclusive True to set an inclusive bound. Defaults to false.
+         */
+        max(max: string, inclusive?: boolean): this;
+
+        /**
+         * Defines the amount to boost the query.
+         * @param boost Amount to boost the query.
+         */
+        boost(boost: number): this;
+
+        /**
+         * Specifies the field to query.
+         * @param field The field to query.
+         */
+        field(field: string): this;
+    }
+
+    abstract class WildcardQuery extends Query {
+        /**
+         * Defines the amount to boost the query.
+         * @param boost Amount to boost the query.
+         */
+        boost(boost: number): this;
+
+        /**
+         * Specifies the field to query.
+         * @param boost The field to query.
+         */
+        field(field: string): this;
+    }
+
+    /**
+     * Enumeration for specifying FTS consistency semantics.
+     */
+    enum Consistency {
+        /**
+         * This is the default (for single-statement requests).
+         */
+        NOT_BOUNDED,
+    }
+
+    /**
+     * Enumeration for specifying FTS highlight styling.
+     */
+    enum HighlightStyle {
+        /**
+         * This causes hits to be highlighted using the default style.
+         */
+        DEFAULT,
+
+        /**
+         * This causes hits to be highlighted using HTML tags.
+         */
+        HTML,
+
+        /**
+         * This causes hits to be highlighted with ANSI character codes.
+         */
+        ANSI,
+    }
+}
+
+declare class SearchFacet {
+}
+
+declare namespace SearchFacet {
+    class TermFacet extends SearchFacet {
+    }
+
+    function term(field: string, size: number): TermFacet;
+
+    class NumericFacet extends SearchFacet {
+        addRange(name: string, min: number, max: number): this;
+    }
+
+    function numeric(field: string, size: number): NumericFacet;
+
+    class DateFacet extends SearchFacet {
+        addRange(name: string, start: string, end: string): this;
+    }
+
+    function date(field: string, size: number): DateFacet;
+}
+
+declare class SearchSort {
+    /**
+     * Specifies whether to sort descending or not.
+     */
+    descending(descending: boolean): this;
+}
+
+declare namespace SearchSort {
+    class ScoreSort extends SearchSort {
+    }
+
+    function score(): ScoreSort;
+
+    class IdSort extends SearchSort {
+    }
+
+    function id(): IdSort;
+
+    class FieldSort extends SearchSort {
+        type(type: string): this;
+        mode(mode: string): this;
+        missing(missing: string): this;
+    }
+
+    function field(field: string): FieldSort;
+
+    class GeoDistanceSort extends SearchSort {
+        unit(unit: string): this;
+    }
+
+    function geoDistance(field: string, lat: number, lon: number): GeoDistanceSort;
+}
+
 /**
  * The Bucket class represents a connection to a Couchbase bucket. Never instantiate this class directly. Instead use the Cluster#openBucket method instead.
  */
-interface Bucket {
+interface Bucket extends events.EventEmitter {
     /**
      * Returns the version of the Node.js library as a string.
      */
@@ -763,7 +1695,7 @@ interface Bucket {
      * @param fragment The document's contents to append.
      * @param callback The callback function.
      */
-    append(key: any | Buffer, fragment: any, callback: Bucket.OpCallback): void;
+    append(key: string | Buffer, fragment: any, callback: Bucket.OpCallback): void;
 
     /**
      *
@@ -772,7 +1704,7 @@ interface Bucket {
      * @param options The options object.
      * @param callback The callback function.
      */
-    append(key: any | Buffer, fragment: any, options: AppendOptions, callback: Bucket.OpCallback): void;
+    append(key: string | Buffer, fragment: any, options: AppendOptions, callback: Bucket.OpCallback): void;
 
     /**
      * Increments or decrements a key's numeric value.
@@ -781,7 +1713,7 @@ interface Bucket {
      * @param delta The amount to add or subtract from the counter value. This value may be any non-zero integer.
      * @param callback The callback function.
      */
-    counter(key: any | Buffer, delta: number, callback: Bucket.OpCallback): void;
+    counter(key: string | Buffer, delta: number, callback: Bucket.OpCallback): void;
 
     /**
      *
@@ -790,7 +1722,7 @@ interface Bucket {
      * @param options The options object.
      * @param callback The callback function.
      */
-    counter(key: any | Buffer, delta: number, options: CounterOptions, callback: Bucket.OpCallback): void;
+    counter(key: string | Buffer, delta: number, options: CounterOptions, callback: Bucket.OpCallback): void;
 
     /**
      * Shuts down this connection.
@@ -808,14 +1740,14 @@ interface Bucket {
      * @param key The target document key.
      * @param callback The callback function.
      */
-    get(key: any | Buffer, callback: Bucket.OpCallback): void;
+    get(key: string | Buffer, callback: Bucket.OpCallback): void;
 
     /**
      * @param key The target document key.
      * @param options The options object.
      * @param callback The callback function.
      */
-    get(key: any | Buffer, options: any, callback: Bucket.OpCallback): void;
+    get(key: string | Buffer, options: any, callback: Bucket.OpCallback): void;
 
     /**
      * Lock the document on the server and retrieve it. When an document is locked, its CAS changes and subsequent operations on the document (without providing the current CAS) will fail until the lock is no longer held.
@@ -824,7 +1756,7 @@ interface Bucket {
      * @param key The target document key.
      * @param callback The callback function.
      */
-    getAndLock(key: any, callback: Bucket.OpCallback): void;
+    getAndLock(key: string, callback: Bucket.OpCallback): void;
 
     /**
      * Lock the document on the server and retrieve it. When an document is locked, its CAS changes and subsequent operations on the document (without providing the current CAS) will fail until the lock is no longer held.
@@ -835,7 +1767,7 @@ interface Bucket {
      * @param callback The callback function.
      * @returns {}
      */
-    getAndLock(key: any, options: GetAndLockOptions, callback: Bucket.OpCallback): void;
+    getAndLock(key: string, options: GetAndLockOptions, callback: Bucket.OpCallback): void;
 
     /**
      * Retrieves a document and updates the expiry of the item at the same time.
@@ -844,7 +1776,7 @@ interface Bucket {
      * @param options The options object.
      * @param callback The callback function.
      */
-    getAndTouch(key: any | Buffer, expiry: number, options: any, callback: Bucket.OpCallback): void;
+    getAndTouch(key: string | Buffer, expiry: number, options: any, callback: Bucket.OpCallback): void;
 
     /**
      * Retrieves a document and updates the expiry of the item at the same time.
@@ -852,21 +1784,21 @@ interface Bucket {
      * @param expiry The expiration time to use. If a value of 0 is provided, then the current expiration time is cleared and the key is set to never expire. Otherwise, the key is updated to expire in the time provided (in seconds).
      * @param callback The callback function.
      */
-    getAndTouch(key: any | Buffer, expiry: number, callback: Bucket.OpCallback): void;
+    getAndTouch(key: string | Buffer, expiry: number, callback: Bucket.OpCallback): void;
 
     /**
      * Retrieves a list of keys
      * @param keys The target document keys.
      * @param callback The callback function.
      */
-    getMulti(key: any[] | Buffer[], callback: Bucket.MultiGetCallback): void;
+    getMulti(key: ReadonlyArray, callback: Bucket.MultiGetCallback): void;
 
     /**
      * Get a document from a replica server in your cluster.
      * @param key The target document key.
      * @param callback The callback function.
      */
-    getReplica(key: any | Buffer, callback: Bucket.OpCallback): void;
+    getReplica(key: string | Buffer, callback: Bucket.OpCallback): void;
 
     /**
     * Get a document from a replica server in your cluster.
@@ -874,7 +1806,7 @@ interface Bucket {
     * @param options The options object.
     * @param callback The callback function.
     */
-    getReplica(key: any | Buffer, options: GetReplicaOptions, callback: Bucket.OpCallback): void;
+    getReplica(key: string | Buffer, options: GetReplicaOptions, callback: Bucket.OpCallback): void;
 
     /**
      * Identical to Bucket#upsert but will fail if the document already exists.
@@ -882,7 +1814,7 @@ interface Bucket {
      * @param value The document's contents.
      * @param callback The callback function.
      */
-    insert(key: any | Buffer, value: any, callback: Bucket.OpCallback): void;
+    insert(key: string | Buffer, value: any, callback: Bucket.OpCallback): void;
 
     /**
      * Identical to Bucket#upsert but will fail if the document already exists.
@@ -891,7 +1823,7 @@ interface Bucket {
      * @param options The options object.
      * @param callback The callback function.
      */
-    insert(key: any | Buffer, value: any, options: InsertOptions, callback: Bucket.OpCallback): void;
+    insert(key: string | Buffer, value: any, options: InsertOptions, callback: Bucket.OpCallback): void;
 
     /**
      * Returns an instance of a BuckerManager for performing management operations against a bucket.
@@ -904,7 +1836,7 @@ interface Bucket {
      * @param fragment The document's contents to prepend.
      * @param callback The callback function.
      */
-    prepend(key: any, fragment: any, callback: Bucket.OpCallback): void;
+    prepend(key: string, fragment: any, callback: Bucket.OpCallback): void;
 
     /**
      * Like Bucket#append, but prepends data to the existing value.
@@ -913,31 +1845,43 @@ interface Bucket {
      * @param options The options object.
      * @param callback The callback function.
      */
-    prepend(key: any, fragment: any, options: PrependOptions, callback: Bucket.OpCallback): void;
+    prepend(key: string, fragment: any, options: PrependOptions, callback: Bucket.OpCallback): void;
 
     /**
-     * Executes a previously prepared query object. This could be a ViewQuery or a N1qlQuery.
-     * Note: N1qlQuery queries are currently an uncommitted interface and may be subject to change in 2.0.0's final release.
+     * Executes a previously prepared query object.
      * @param query The query to execute.
      * @param callback The callback function.
      */
-    query(query: ViewQuery | N1qlQuery, callback: Bucket.QueryCallback): Bucket.ViewQueryResponse | Bucket.N1qlQueryResponse;
+    query(query: ViewQuery | SpatialQuery, callback?: Bucket.QueryCallback): Bucket.ViewQueryResponse;
 
     /**
-     * Executes a previously prepared query object. This could be a ViewQuery or a N1qlQuery.
-     * Note: N1qlQuery queries are currently an uncommitted interface and may be subject to change in 2.0.0's final release.
+     * Executes a previously prepared query object.
+     * @param query The query to execute.
+     * @param callback The callback function.
+     */
+    query(query: N1qlQuery, callback?: Bucket.N1qlQueryCallback): Bucket.N1qlQueryResponse;
+
+    /**
+     * Executes a previously prepared query object.
+     * @param query The query to execute.
+     * @param callback The callback function.
+     */
+    query(query: SearchQuery, callback?: Bucket.FtsQueryCallback): Bucket.FtsQueryResponse;
+
+    /**
+     * Executes a previously prepared query object.
      * @param query The query to execute.
      * @param params A list or map to do replacements on a N1QL query.
      * @param callback The callback function.
      */
-    query(query: ViewQuery | N1qlQuery, params: Object | Array, callback: Bucket.QueryCallback): Bucket.ViewQueryResponse | Bucket.N1qlQueryResponse;
+    query(query: N1qlQuery, params: {[param: string]: any} | any[], callback?: Bucket.N1qlQueryCallback): Bucket.N1qlQueryResponse;
 
     /**
      * Deletes a document on the server.
      * @param key The target document key.
      * @param callback The callback function.
      */
-    remove(key: any | Buffer, callback: Bucket.OpCallback): void;
+    remove(key: string | Buffer, callback: Bucket.OpCallback): void;
 
     /**
      * Deletes a document on the server.
@@ -945,7 +1889,7 @@ interface Bucket {
      * @param options The options object.
      * @param callback The callback function.
      */
-    remove(key: any | Buffer, options: RemoveOptions, callback: Bucket.OpCallback): void;
+    remove(key: string | Buffer, options: RemoveOptions, callback: Bucket.OpCallback): void;
 
     /**
      * Identical to Bucket#upsert, but will only succeed if the document exists already (i.e. the inverse of Bucket#insert).
@@ -953,7 +1897,7 @@ interface Bucket {
      * @param value The document's contents.
      * @param callback The callback function.
      */
-    replace(key: any | Buffer, value: any, callback: Bucket.OpCallback): void;
+    replace(key: string | Buffer, value: any, callback: Bucket.OpCallback): void;
 
     /**
      * Identical to Bucket#upsert, but will only succeed if the document exists already (i.e. the inverse of Bucket#insert).
@@ -962,7 +1906,7 @@ interface Bucket {
      * @param options The options object.
      * @param callback The callback function.
      */
-    replace(key: any | Buffer, value: any, options: ReplaceOptions, callback: Bucket.OpCallback): void;
+    replace(key: string | Buffer, value: any, options: ReplaceOptions, callback: Bucket.OpCallback): void;
 
     /**
      * Configures a custom set of transcoder functions for encoding and decoding values that are being stored or retreived from the server.
@@ -978,7 +1922,7 @@ interface Bucket {
      * @param options The options object.
      * @param callback The callback function.
      */
-    touch(key: any | Buffer, expiry: number, options: TouchOptions, callback: Bucket.OpCallback): void;
+    touch(key: string | Buffer, expiry: number, options: TouchOptions, callback: Bucket.OpCallback): void;
 
     /**
      * Unlock a previously locked document on the server. See the Bucket#lock method for more details on locking.
@@ -986,7 +1930,7 @@ interface Bucket {
      * @param cas The CAS value returned when the key was locked. This operation will fail if the CAS value provided does not match that which was the result of the original lock operation.
      * @param callback The callback function.
      */
-    unlock(key: any | Buffer, cas: Bucket.CAS, callback: Bucket.OpCallback): void;
+    unlock(key: string | Buffer, cas: Bucket.CAS, callback: Bucket.OpCallback): void;
 
     /**
      * Unlock a previously locked document on the server. See the Bucket#lock method for more details on locking.
@@ -995,7 +1939,7 @@ interface Bucket {
      * @param options The options object.
      * @param callback The callback function.
      */
-    unlock(key: any | Buffer, cas: Bucket.CAS, options: any, callback: Bucket.OpCallback): void;
+    unlock(key: string | Buffer, cas: Bucket.CAS, options: any, callback: Bucket.OpCallback): void;
 
     /**
      * Stores a document to the bucket.
@@ -1003,7 +1947,7 @@ interface Bucket {
      * @param value The document's contents.
      * @param callback The callback function.
      */
-    upsert(key: any | Buffer, value: any, callback: Bucket.OpCallback): void;
+    upsert(key: string | Buffer, value: any, callback: Bucket.OpCallback): void;
 
     /**
      * Stores a document to the bucket.
@@ -1012,13 +1956,28 @@ interface Bucket {
      * @param options The options object.
      * @param callback The callback function.
      */
-    upsert(key: any | Buffer, value: any, options: UpsertOptions, callback: Bucket.OpCallback): void;
+    upsert(key: string | Buffer, value: any, options: UpsertOptions, callback: Bucket.OpCallback): void;
+
+    addListener(event: 'connect', listener: () => void): this;
+    addListener(event: 'error', listener: (error: CouchbaseError) => void): this;
+
+    on(event: 'connect', listener: () => void): this;
+    on(event: 'error', listener: (error: CouchbaseError) => void): this;
+
+    once(event: 'connect', listener: () => void): this;
+    once(event: 'error', listener: (error: CouchbaseError) => void): this;
+
+    prependListener(event: 'connect', listener: () => void): this;
+    prependListener(event: 'error', listener: (error: CouchbaseError) => void): this;
+
+    prependOnceListener(event: 'connect', listener: () => void): this;
+    prependOnceListener(event: 'error', listener: (error: CouchbaseError) => void): this;
 }
 
 declare namespace Bucket {
 
     /**
-     * his is used as a callback from executed queries. It is a shortcut method that automatically subscribes to the rows and error events of the Bucket.ViewQueryResponse.
+     * This is used as a callback from executed queries. It is a shortcut method that automatically subscribes to the rows and error events of the Bucket.ViewQueryResponse.
      */
     interface QueryCallback {
         /**
@@ -1026,7 +1985,31 @@ declare namespace Bucket {
          * @param rows The rows returned from the query.
          * @param meta The metadata returned by the query.
          */
-        (error: CouchbaseError, rows: any[], meta: Bucket.ViewQueryResponse.Meta): void;
+        (error: CouchbaseError | null, rows: any[] | null, meta: Bucket.ViewQueryResponse.Meta): void;
+    }
+
+    /**
+     * This is used as a callback from executed queries. It is a shortcut method that automatically subscribes to the rows and error events of the Bucket.ViewQueryResponse.
+     */
+    interface N1qlQueryCallback {
+        /**
+         * @param error The error for the operation. This can either be an Error object or a falsy value.
+         * @param rows The rows returned from the query.
+         * @param meta The metadata returned by the query.
+         */
+        (error: CouchbaseError | null, rows: any[] | null, meta: Bucket.N1qlQueryResponse.Meta): void;
+    }
+
+    /**
+     * This is used as a callback from executed queries. It is a shortcut method that automatically subscribes to the rows and error events of the Bucket.ViewQueryResponse.
+     */
+    interface FtsQueryCallback {
+        /**
+         * @param error The error for the operation. This can either be an Error object or a falsy value.
+         * @param rows The rows returned from the query.
+         * @param meta The metadata returned by the query.
+         */
+        (error: CouchbaseError | null, rows: any[] | null, meta: Bucket.FtsQueryResponse.Meta): void;
     }
 
     /**
@@ -1036,10 +2019,10 @@ declare namespace Bucket {
      */
     interface OpCallback {
         /**
-         * @param error The error for the operation. This can either be an Error object or a value which evaluates to false (null, undefined, 0 or false).
+         * @param error The error for the operation. This can either be an Error object or a value which evaluates to false.
          * @param result The result of the operation that was executed. This usually contains at least a cas property, and on some operations will contain a value property as well.
          */
-        (error: CouchbaseError | number, result: any): void;
+        (error: CouchbaseError | null, result: any): void;
     }
 
     /**
@@ -1081,7 +2064,7 @@ declare namespace Bucket {
 
     /**
      * The CAS value is a special object that indicates the current state of the item on the server. Each time an object is mutated on the server, the value is changed. CAS objects can be used in conjunction with mutation operations to ensure that the value on the server matches the local value retrieved by the client. This is useful when doing document updates on the server as you can ensure no changes were applied by other clients while you were in the process of mutating the document locally.
-     * In the Node.js SDK, the CAS is represented as an opaque value. As such,y ou cannot generate CAS objects, but should rather use the values returned from a Bucket.OpCallback.
+     * In the Node.js SDK, the CAS is represented as an opaque value. As such, you cannot generate CAS objects, but should rather use the values returned from a Bucket.OpCallback.
      */
     interface CAS {
 
@@ -1091,7 +2074,30 @@ declare namespace Bucket {
      * An event emitter allowing you to bind to various query result set events.
      */
     interface N1qlQueryResponse extends events.EventEmitter {
+        addListener(event: 'end', listener: (meta: N1qlQueryResponse.Meta) => void): this;
+        addListener(event: 'error', listener: (error: CouchbaseError) => void): this;
+        addListener(event: 'row', listener: (row: any, meta: N1qlQueryResponse.Meta) => void): this;
+        addListener(event: 'rows', listener: (rows: any[], meta: N1qlQueryResponse.Meta) => void): this;
 
+        on(event: 'end', listener: (meta: N1qlQueryResponse.Meta) => void): this;
+        on(event: 'error', listener: (error: CouchbaseError) => void): this;
+        on(event: 'row', listener: (row: any, meta: N1qlQueryResponse.Meta) => void): this;
+        on(event: 'rows', listener: (rows: any[], meta: N1qlQueryResponse.Meta) => void): this;
+
+        once(event: 'end', listener: (meta: N1qlQueryResponse.Meta) => void): this;
+        once(event: 'error', listener: (error: CouchbaseError) => void): this;
+        once(event: 'row', listener: (row: any, meta: N1qlQueryResponse.Meta) => void): this;
+        once(event: 'rows', listener: (rows: any[], meta: N1qlQueryResponse.Meta) => void): this;
+
+        prependListener(event: 'end', listener: (meta: N1qlQueryResponse.Meta) => void): this;
+        prependListener(event: 'error', listener: (error: CouchbaseError) => void): this;
+        prependListener(event: 'row', listener: (row: any, meta: N1qlQueryResponse.Meta) => void): this;
+        prependListener(event: 'rows', listener: (rows: any[], meta: N1qlQueryResponse.Meta) => void): this;
+
+        prependOnceListener(event: 'end', listener: (meta: N1qlQueryResponse.Meta) => void): this;
+        prependOnceListener(event: 'error', listener: (error: CouchbaseError) => void): this;
+        prependOnceListener(event: 'row', listener: (row: any, meta: N1qlQueryResponse.Meta) => void): this;
+        prependOnceListener(event: 'rows', listener: (rows: any[], meta: N1qlQueryResponse.Meta) => void): this;
     }
 
     namespace N1qlQueryResponse {
@@ -1118,7 +2124,30 @@ declare namespace Bucket {
      * An event emitter allowing you to bind to various query result set events.
      */
     interface ViewQueryResponse extends events.EventEmitter {
+        addListener(event: 'end', listener: (meta: ViewQueryResponse.Meta) => void): this;
+        addListener(event: 'error', listener: (error: CouchbaseError) => void): this;
+        addListener(event: 'row', listener: (row: any, meta: ViewQueryResponse.Meta) => void): this;
+        addListener(event: 'rows', listener: (rows: any[], meta: ViewQueryResponse.Meta) => void): this;
 
+        on(event: 'end', listener: (meta: ViewQueryResponse.Meta) => void): this;
+        on(event: 'error', listener: (error: CouchbaseError) => void): this;
+        on(event: 'row', listener: (row: any, meta: ViewQueryResponse.Meta) => void): this;
+        on(event: 'rows', listener: (rows: any[], meta: ViewQueryResponse.Meta) => void): this;
+
+        once(event: 'end', listener: (meta: ViewQueryResponse.Meta) => void): this;
+        once(event: 'error', listener: (error: CouchbaseError) => void): this;
+        once(event: 'row', listener: (row: any, meta: ViewQueryResponse.Meta) => void): this;
+        once(event: 'rows', listener: (rows: any[], meta: ViewQueryResponse.Meta) => void): this;
+
+        prependListener(event: 'end', listener: (meta: ViewQueryResponse.Meta) => void): this;
+        prependListener(event: 'error', listener: (error: CouchbaseError) => void): this;
+        prependListener(event: 'row', listener: (row: any, meta: ViewQueryResponse.Meta) => void): this;
+        prependListener(event: 'rows', listener: (rows: any[], meta: ViewQueryResponse.Meta) => void): this;
+
+        prependOnceListener(event: 'end', listener: (meta: ViewQueryResponse.Meta) => void): this;
+        prependOnceListener(event: 'error', listener: (error: CouchbaseError) => void): this;
+        prependOnceListener(event: 'row', listener: (row: any, meta: ViewQueryResponse.Meta) => void): this;
+        prependOnceListener(event: 'rows', listener: (rows: any[], meta: ViewQueryResponse.Meta) => void): this;
     }
 
     namespace ViewQueryResponse {
@@ -1132,4 +2161,73 @@ declare namespace Bucket {
             total_rows: number;
         }
     }
+
+    /**
+     * An event emitter allowing you to bind to various query result set events.
+     */
+    interface FtsQueryResponse extends events.EventEmitter {
+        addListener(event: 'end', listener: (meta: FtsQueryResponse.Meta) => void): this;
+        addListener(event: 'error', listener: (error: CouchbaseError) => void): this;
+        addListener(event: 'row', listener: (row: any, meta: FtsQueryResponse.Meta) => void): this;
+        addListener(event: 'rows', listener: (rows: any[], meta: FtsQueryResponse.Meta) => void): this;
+
+        on(event: 'end', listener: (meta: FtsQueryResponse.Meta) => void): this;
+        on(event: 'error', listener: (error: CouchbaseError) => void): this;
+        on(event: 'row', listener: (row: any, meta: FtsQueryResponse.Meta) => void): this;
+        on(event: 'rows', listener: (rows: any[], meta: FtsQueryResponse.Meta) => void): this;
+
+        once(event: 'end', listener: (meta: FtsQueryResponse.Meta) => void): this;
+        once(event: 'error', listener: (error: CouchbaseError) => void): this;
+        once(event: 'row', listener: (row: any, meta: FtsQueryResponse.Meta) => void): this;
+        once(event: 'rows', listener: (rows: any[], meta: FtsQueryResponse.Meta) => void): this;
+
+        prependListener(event: 'end', listener: (meta: FtsQueryResponse.Meta) => void): this;
+        prependListener(event: 'error', listener: (error: CouchbaseError) => void): this;
+        prependListener(event: 'row', listener: (row: any, meta: FtsQueryResponse.Meta) => void): this;
+        prependListener(event: 'rows', listener: (rows: any[], meta: FtsQueryResponse.Meta) => void): this;
+
+        prependOnceListener(event: 'end', listener: (meta: FtsQueryResponse.Meta) => void): this;
+        prependOnceListener(event: 'error', listener: (error: CouchbaseError) => void): this;
+        prependOnceListener(event: 'row', listener: (row: any, meta: FtsQueryResponse.Meta) => void): this;
+        prependOnceListener(event: 'rows', listener: (rows: any[], meta: FtsQueryResponse.Meta) => void): this;
+    }
+
+    namespace FtsQueryResponse {
+        /**
+         * The meta-information available from a search query response.
+         */
+        interface Meta {
+            /**
+             * The status information for this query, includes properties
+             * such as total, failed, and successful.
+             */
+            status: any;
+
+            /**
+             * Any non-fatal errors that occurred during query processing.
+             */
+            errors: any;
+
+            /**
+             * The total number of hits that were available for this search query.
+             */
+            totalHits: number;
+
+            /**
+             * The resulting facet information for any facets that were specified
+             * in the search query.
+             */
+            facets: any;
+
+            /**
+             * The time spent processing this query.
+             */
+            took: number;
+
+            /**
+             * The maximum score out of all the results in this query.
+             */
+            maxScore: number;
+        }
+    }
 }
diff --git a/types/cqrs-domain/index.d.ts b/types/cqrs-domain/index.d.ts
index f826b45ffd..33db11b857 100644
--- a/types/cqrs-domain/index.d.ts
+++ b/types/cqrs-domain/index.d.ts
@@ -252,7 +252,7 @@ declare namespace Domain {
 
     /**
      * @param data is the command data
-     * @callback callback is optional, if not defined as function argument you can throw errors or return errors here (sync way)
+     * @param callback is optional, if not defined as function argument you can throw errors or return errors here (sync way)
      */
     type preLoadConditionHandler = (data: any, callback?: (err: string | Error) => string | Error) => void | string | Error;
 
@@ -295,7 +295,7 @@ declare namespace Domain {
     /**
      * @param data is the command data
      * @param aggregate is the aggregate object
-     * @callback callback is optional, if not defined as function argument you can throw errors or return errors here (sync way)
+     * @param callback is optional, if not defined as function argument you can throw errors or return errors here (sync way)
      */
     type preConditionHandler = (data: any, aggregate: AggregateModel, callback?: (err: string | Error) => string | Error) => void | string | Error;
 
diff --git a/types/create-react-class/index.d.ts b/types/create-react-class/index.d.ts
index 9a1b0b12b5..9b9d2b2ad5 100644
--- a/types/create-react-class/index.d.ts
+++ b/types/create-react-class/index.d.ts
@@ -2,7 +2,7 @@
 // Project: https://facebook.github.io/react/
 // Definitions by: John Gozde 
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-// TypeScript Version: 2.6
+// TypeScript Version: 2.8
 
 import { ComponentSpec, ClassicComponentClass } from "react";
 
diff --git a/types/create-subscription/index.d.ts b/types/create-subscription/index.d.ts
index 79003980ee..8c7d8c1ced 100644
--- a/types/create-subscription/index.d.ts
+++ b/types/create-subscription/index.d.ts
@@ -3,7 +3,7 @@
 // Definitions by: Asana 
 //                 Vincent Siao 
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-// TypeScript Version: 2.6
+// TypeScript Version: 2.8
 
 import * as React from "react";
 
diff --git a/types/crypto-js/index.d.ts b/types/crypto-js/index.d.ts
index 99df7ce4cb..faeeac78e6 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;
@@ -25,7 +29,7 @@ declare namespace CryptoJS {
 	interface StreamCipher extends Cipher {}
 
 	interface CipherHelper {
-		encrypt(message: string, secretPassphrase: string | WordArray, option?: CipherOption): WordArray;
+		encrypt(message: string | LibWordArray, secretPassphrase: string | WordArray, option?: CipherOption): WordArray;
 		decrypt(encryptedMessage: string | WordArray, secretPassphrase: string | WordArray, option?: CipherOption): DecryptedMessage;
 	}
 	interface Encryptor {
diff --git a/types/crypto-random-string/crypto-random-string-tests.ts b/types/crypto-random-string/crypto-random-string-tests.ts
new file mode 100644
index 0000000000..1a66c25981
--- /dev/null
+++ b/types/crypto-random-string/crypto-random-string-tests.ts
@@ -0,0 +1,4 @@
+import generate = require('crypto-random-string');
+
+// $ExpectType string
+generate(10);
diff --git a/types/crypto-random-string/index.d.ts b/types/crypto-random-string/index.d.ts
new file mode 100644
index 0000000000..dc41e18428
--- /dev/null
+++ b/types/crypto-random-string/index.d.ts
@@ -0,0 +1,13 @@
+// Type definitions for crypto-random-string 1.0
+// Project: https://github.com/sindresorhus/crypto-random-string
+// Definitions by: Manuel Warum 
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+/**
+ * Generate a hexadecimal string of the given length.
+ * @param length the length of the random string.
+ * @return a string of the specified length.
+ */
+declare function cryptoRandomString(length: number): string;
+
+export = cryptoRandomString;
diff --git a/types/crypto-random-string/tsconfig.json b/types/crypto-random-string/tsconfig.json
new file mode 100644
index 0000000000..fd68e9d080
--- /dev/null
+++ b/types/crypto-random-string/tsconfig.json
@@ -0,0 +1,23 @@
+{
+    "compilerOptions": {
+        "module": "commonjs",
+        "lib": [
+            "es6"
+        ],
+        "noImplicitAny": true,
+        "noImplicitThis": true,
+        "strictNullChecks": true,
+        "strictFunctionTypes": true,
+        "baseUrl": "../",
+        "typeRoots": [
+            "../"
+        ],
+        "types": [],
+        "noEmit": true,
+        "forceConsistentCasingInFileNames": true
+    },
+    "files": [
+        "index.d.ts",
+        "crypto-random-string-tests.ts"
+    ]
+}
diff --git a/types/crypto-random-string/tslint.json b/types/crypto-random-string/tslint.json
new file mode 100644
index 0000000000..f93cf8562a
--- /dev/null
+++ b/types/crypto-random-string/tslint.json
@@ -0,0 +1,3 @@
+{
+    "extends": "dtslint/dt.json"
+}
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/cssnano/cssnano-tests.ts b/types/cssnano/cssnano-tests.ts
new file mode 100644
index 0000000000..17828e1b02
--- /dev/null
+++ b/types/cssnano/cssnano-tests.ts
@@ -0,0 +1,17 @@
+import cssnano = require('cssnano');
+import { Transformer } from 'postcss';
+
+const nano1: Transformer = cssnano();
+const nano2: Transformer = cssnano({
+    configFile: '/path/to/config',
+});
+const nano3: Transformer = cssnano({
+    preset: 'default',
+});
+const nano4: Transformer = cssnano({
+    preset: ['default', {
+        discardComments: {
+            removeAll: true,
+        },
+    }],
+});
diff --git a/types/cssnano/index.d.ts b/types/cssnano/index.d.ts
new file mode 100644
index 0000000000..bf298f1854
--- /dev/null
+++ b/types/cssnano/index.d.ts
@@ -0,0 +1,19 @@
+// Type definitions for cssnano 4.0
+// Project: https://github.com/cssnano/cssnano
+// Definitions by: Armando Meziat 
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.2
+
+import { Plugin } from 'postcss';
+
+declare namespace cssnano {
+    interface CssNanoOptions {
+        configFile?: string;
+        preset?: [string, object] | string;
+    }
+
+    type CssNano = Plugin;
+}
+
+declare const cssnano: cssnano.CssNano;
+export = cssnano;
diff --git a/types/styled-system/package.json b/types/cssnano/package.json
similarity index 58%
rename from types/styled-system/package.json
rename to types/cssnano/package.json
index da1a3181d0..3c7b1f0f76 100644
--- a/types/styled-system/package.json
+++ b/types/cssnano/package.json
@@ -1,6 +1,6 @@
 {
     "private": true,
     "dependencies": {
-        "styled-components": "^3.3.2"
+        "postcss": "5 - 7"
     }
 }
diff --git a/types/cssnano/tsconfig.json b/types/cssnano/tsconfig.json
new file mode 100644
index 0000000000..5667012b67
--- /dev/null
+++ b/types/cssnano/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",
+        "cssnano-tests.ts"
+    ]
+}
diff --git a/types/cssnano/tslint.json b/types/cssnano/tslint.json
new file mode 100644
index 0000000000..3db14f85ea
--- /dev/null
+++ b/types/cssnano/tslint.json
@@ -0,0 +1 @@
+{ "extends": "dtslint/dt.json" }
diff --git a/types/cytoscape/cytoscape-tests.ts b/types/cytoscape/cytoscape-tests.ts
index 3d80506185..0cffa42b31 100644
--- a/types/cytoscape/cytoscape-tests.ts
+++ b/types/cytoscape/cytoscape-tests.ts
@@ -341,7 +341,8 @@ const positions = oneOf({a: {x: 100, y: 100}}, (node: cytoscape.NodeCollection):
 //   layout.stop();
 // });
 
-// TODO: cy.style
+cy.style(cy.style());
+cy.style([cy.style()]);
 
 // $ExpectType string
 cy.png({
@@ -469,6 +470,13 @@ const edgePoints: cytoscape.Position[] = [
 aliases(eles.layout, eles.createLayout, eles.makeLayout);
 const layout = eles.layout({name: 'random'}).run();
 
+layout.on('layoutstop', () => {
+  cy.fit();
+});
+layout.on('layoutstop', {}, (obj) => {
+  console.log(obj);
+});
+
 eles.select();
 assert(ele.selected()); // as we selected all, and this too
 aliases(eles.unselect, eles.deselect);
@@ -489,6 +497,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);
@@ -517,10 +546,24 @@ eles.difference(collNodes).abscomp().intersection(collSel).symdiff(collNodes);
 const diff = collSel.diff(collNodes);
 cy.collection().merge(diff.left).merge(diff.right).merge(diff.both).unmerge(collSel).filter((ele, i, eles) => true);
 
-eles.sort((a, b) => 1).map((ele, i, eles) => [i, ele]);
+nodes.map(n => n.degree(false));
+edges.map(e => e.source());
+eles.map(e => e.id());
+eles.map(e => e.isNode() ? e.degree(false) : e.source());
+eles.map(e => e.isEdge() ? e.source() : e.degree(false));
+
+eles.sort((a, b) => a.id.length - b.id.length).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).scratch('min').value;
-const max = eles.max((ele, i, eles) => ele.id.length + i); max.ele.scratch('max', max.value);
+
+const min = eles.min((ele, i, eles) => ele.isNode() ? ele.degree(false) : ele.source().degree(false));
+min.ele.scratch('min', min.value).scratch('min').value;
+const max = eles.max((ele, i, eles) => ele.isEdge() ? ele.source().degree(false) : ele.degree(false));
+max.ele.scratch('max', max.value);
+
+nodes.min(n => n.degree(false));
+nodes.max(n => n.degree(false));
+edges.max(n => n.source().id().length);
+edges.max(n => n.source().id().length);
 
 // TODO: traversing (need to actively check the nodes/edges distinction)
 // TODO: algorithms
diff --git a/types/cytoscape/index.d.ts b/types/cytoscape/index.d.ts
index 13b0b38ba8..59482ad507 100644
--- a/types/cytoscape/index.d.ts
+++ b/types/cytoscape/index.d.ts
@@ -915,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;
@@ -995,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.
@@ -1008,15 +1008,18 @@ 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;
     }
 
     /**
      * Get the entry point to modify the visual style of the graph after initialisation.
      * http://js.cytoscape.org/#core/style
      */
-    interface ElementStylesheet extends StylesheetStyle {
+    interface ElementStylesheetStyle extends StylesheetStyle {
+        json(): any;
+    }
+    interface ElementStylesheetCSS extends StylesheetCSS {
         json(): any;
     }
 
@@ -1024,11 +1027,11 @@ declare namespace cytoscape {
         /**
          * Get the current style object.
          */
-        style(): ElementStylesheet | string;
+        style(): ElementStylesheetStyle | ElementStylesheetCSS;
         /**
          * Assign a new stylesheet to replace the existing one.
          */
-        style(sheet: Stylesheet): Stylesheet;
+        style(sheet: Stylesheet | Stylesheet[] | string): Stylesheet;
     }
 
     /**
@@ -1140,7 +1143,7 @@ declare namespace cytoscape {
         CollectionLayout,
         CollectionSelection, CollectionStyle, CollectionAnimation,
         CollectionComparision, CollectionIteration,
-        CollectionBuildingFiltering, CollectionAlgorithms { }
+        CollectionBuildingFiltering, CollectionAlgorithms { }
 
     /**
      * ele  --> Cy.Singular
@@ -1163,8 +1166,8 @@ declare namespace cytoscape {
     /**
      * The output is a collection of node and edge elements OR single element.
      */
-    type CollectionArgument = EdgeCollection | NodeCollection | SingularElementArgument;
-    type CollectionReturnValue = EdgeCollection & NodeCollection & SingularElementReturnValue;
+    type CollectionArgument = Collection | EdgeCollection | NodeCollection | SingularElementArgument;
+    type CollectionReturnValue = Collection & EdgeCollection & NodeCollection & SingularElementReturnValue;
 
     /**
      * edges -> Cy.EdgeCollection
@@ -1430,13 +1433,13 @@ declare namespace cytoscape {
          * Get whether the element is a node.
          * http://js.cytoscape.org/#ele.isNode
          */
-        isNode(): boolean;
+        isNode(): this is NodeSingular;
 
         /**
          * Get whether the element is an edge.
          * http://js.cytoscape.org/#ele.isEdge
          */
-        isEdge(): boolean;
+        isEdge(): this is EdgeSingular;
     }
     /**
      * http://js.cytoscape.org/#collection/data
@@ -1798,9 +1801,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;
     }
 
     /**
@@ -1813,7 +1816,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;
@@ -2063,19 +2066,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 {
         /**
@@ -2083,7 +2082,7 @@ declare namespace cytoscape {
          * @param options An object containing the details of the animation.
          * http://js.cytoscape.org/#eles.animate
          */
-        animate(options: ElementAnimateOptionPos | ElementAnimateOptionRen): this;
+        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.
@@ -2104,7 +2103,7 @@ declare namespace cytoscape {
          */
         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. */
@@ -2114,7 +2113,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 {
         /**
@@ -2125,7 +2132,7 @@ declare namespace cytoscape {
          *  Get an animation for the element.
          * @param options An object containing the details of the animation.
          */
-        animation(options: SingularAnimationOptions): AnimationManipulation;
+        animation(options: SingularAnimationOptionsRen | SingularAnimationOptionsPos): AnimationManipulation;
 
         /**
          * Get a delay animation for the element.
@@ -2331,7 +2338,7 @@ declare namespace cytoscape {
     /**
      * http://js.cytoscape.org/#collection/building--filtering
      */
-    interface CollectionBuildingFiltering {
+    interface CollectionBuildingFiltering {
         /**
          * Get an element in the collection from its ID in a very performant way.
          * @param id The ID of the element to get.
@@ -2378,12 +2385,12 @@ declare namespace cytoscape {
          * Get the elements in both this collection and another specified collection.
          * http://js.cytoscape.org/#eles.intersection
          */
-        intersection: CollectionSymmetricDifferenceFunc;
-        intersect: CollectionSymmetricDifferenceFunc;
-        and: CollectionSymmetricDifferenceFunc;
-        n: CollectionSymmetricDifferenceFunc;
-        '&': CollectionSymmetricDifferenceFunc;
-        '.': CollectionSymmetricDifferenceFunc;
+        intersection: CollectionBuildingIntersectionFunc;
+        intersect: CollectionBuildingIntersectionFunc;
+        and: CollectionBuildingIntersectionFunc;
+        n: CollectionBuildingIntersectionFunc;
+        '&': CollectionBuildingIntersectionFunc;
+        '.': CollectionBuildingIntersectionFunc;
 
         /**
          * Get the elements that are in the calling collection
@@ -2438,7 +2445,7 @@ declare namespace cytoscape {
          * var col = cy.collection(); // new, empty collection
          * col.merge('#j').merge('#e');
          */
-        merge(eles: CollectionArgument | string): this;
+        merge(eles: CollectionArgument | Selector): this;
         /**
          * Perform an in-place operation on the calling collection to remove the given elements.
          * @param eles The elements to remove  in-place or a selector representing the elements to remove .
@@ -2463,7 +2470,7 @@ declare namespace cytoscape {
          * col.merge( cy.nodes() );
          * col.unmerge('#e');
          */
-        unmerge(eles: CollectionArgument | string): this;
+        unmerge(eles: CollectionArgument | Selector): this;
 
         /**
          * Get a new collection containing elements that are accepted by the specified filter.
@@ -2474,7 +2481,7 @@ declare namespace cytoscape {
          * ele - The element being considered.
          * http://js.cytoscape.org/#eles.filter
          */
-        filter(selector: Selector | ((ele: TOut, i: number, eles: CollectionArgument) => boolean)): CollectionReturnValue;
+        filter(selector: Selector | ((ele: TIn, i: number, eles: CollectionArgument) => boolean)): CollectionReturnValue;
         /**
          * Get the nodes that match the specified selector.
          *
@@ -2500,7 +2507,7 @@ declare namespace cytoscape {
          *
          * http://js.cytoscape.org/#eles.sort
          */
-        sort(sort: (ele1: CollectionArgument, ele2: CollectionArgument) => number): CollectionReturnValue;
+        sort(sort: (ele1: TIn, ele2: TIn) => number): CollectionReturnValue;
 
         /**
          * Get an array containing values mapped from the collection.
@@ -2513,7 +2520,7 @@ declare namespace cytoscape {
          *
          * http://js.cytoscape.org/#eles.map
          */
-        map(fn: (ele: CollectionArgument, i: number, eles: CollectionArgument) => any, thisArg?: any): any[];
+        map(fn: (ele: TIn, i: number, eles: CollectionArgument) => T, thisArg?: any): T[];
 
         /**
          * Reduce a single value by applying a
@@ -2523,15 +2530,15 @@ declare namespace cytoscape {
          * given the previous value and the current element.
          * prevVal The value accumulated from previous elements.
          * ele The current element.
-         * ix The index of the current element.
+         * i The index of the current element.
          * eles The collection of elements being reduced.
          * @param initialValue The initial value for reducing
          * It is used also for type inference of output, but the type can be
          * also stated explicitly as generic
          * http://js.cytoscape.org/#eles.reduce
          */
-        reduce(fn: (prevVal: T, ele: SingularElementReturnValue,
-            ix: number, eles: CollectionReturnValue) => T, initialValue: T): T;
+        reduce(fn: (prevVal: T, ele: TIn,
+            i: number, eles: CollectionArgument) => T, initialValue: T): T;
 
         /**
          * Find a minimum value in a collection.
@@ -2544,11 +2551,11 @@ declare namespace cytoscape {
          *
          * http://js.cytoscape.org/#eles.min
          */
-        min(fn: (ele: SingularElementArgument, i: number, eles: CollectionArgument) => any, thisArg?: any): {
+        min(fn: (ele: TIn, i: number, eles: CollectionArgument) => T, thisArg?: any): {
             /**
              * The minimum value found.
              */
-            value: any,
+            value: T,
             /**
              * The element that corresponds to the minimum value.
              */
@@ -2566,11 +2573,11 @@ declare namespace cytoscape {
          *
          * http://js.cytoscape.org/#eles.max
          */
-        max(fn: (ele: SingularElementArgument, i: number, eles: CollectionArgument) => any, thisArg?: any): {
+        max(fn: (ele: TIn, i: number, eles: CollectionArgument) => T, thisArg?: any): {
             /**
              * The minimum value found.
              */
-            value: any,
+            value: T,
             /**
              * The element that corresponds to the minimum value.
              */
@@ -2672,14 +2679,14 @@ declare namespace cytoscape {
          * @param selector An optional selector that is used to filter the resultant collection.
          * http://js.cytoscape.org/#edge.source
          */
-        source(selector?: Selector): NodeCollection;
+        source(selector?: Selector): NodeSingular;
 
         /**
          * Get target node of this edge.
          * @param selector An optional selector that is used to filter the resultant collection.
          * http://js.cytoscape.org/#edge.target
          */
-        target(selector?: Selector): NodeCollection;
+        target(selector?: Selector): NodeSingular;
     }
     interface EdgeCollectionTraversing {
         // http://js.cytoscape.org/#collection/traversing
@@ -2812,13 +2819,13 @@ declare namespace cytoscape {
 
     /**
      * The handler returns true when it finds the desired node, and it returns false to cancel the search.
-     * i - The index indicating this node is the ith visited node.
-     * depth - How many edge hops away this node is from the root nodes.
      * v - The current node.
      * e - The edge connecting the previous node to the current node.
      * u - The previous node.
+     * i - The index indicating this node is the ith visited node.
+     * depth - How many edge hops away this node is from the root nodes.
      */
-    type SearchVisitFunction = (i: number, depth: number, v: NodeCollection, e: EdgeCollection, u: NodeCollection) => boolean;
+    type SearchVisitFunction = (v: NodeCollection,  e: EdgeCollection, u: NodeCollection, i: number, depth: number) => boolean | void;
     interface SearchFirstOptions {
         /**
          * The root nodes (selector or collection) to start the search from.
@@ -4673,9 +4680,13 @@ declare namespace cytoscape {
          * @param handler  The handler function that is called
          * when one of the specified events occurs.
          */
+        on(events: EventNames, handler: EventHandler): this;
         on(events: EventNames, data: any, handler: EventHandler): this;
+        bind(events: EventNames, handler: EventHandler): this;
         bind(events: EventNames, data: any, handler: EventHandler): this;
+        listen(events: EventNames, handler: EventHandler): this;
         listen(events: EventNames, data: any, handler: EventHandler): this;
+        addListener(events: EventNames, handler: EventHandler): this;
         addListener(events: EventNames, data: any, handler: EventHandler): this;
 
         /**
diff --git a/types/d3-hierarchy/d3-hierarchy-tests.ts b/types/d3-hierarchy/d3-hierarchy-tests.ts
index 65b1f5c392..b75b9fbbd0 100644
--- a/types/d3-hierarchy/d3-hierarchy-tests.ts
+++ b/types/d3-hierarchy/d3-hierarchy-tests.ts
@@ -189,6 +189,10 @@ stratificatorizer = d3Hierarchy.stratify();
 
 // id(...)
 
+stratificatorizer = stratificatorizer.id((d) => {
+    return d.name; // d is of type TabularHierarchyDatum
+});
+
 stratificatorizer = stratificatorizer.id((d, i, data) => {
     console.log('Length of tabular array: ', data.length);
     console.log('Name of first entry in tabular array: ', data[0].name); // data of type Array
@@ -199,6 +203,10 @@ idStringAccessor = stratificatorizer.id();
 
 // parentId(...)
 
+stratificatorizer = stratificatorizer.parentId((d) => {
+    return d.parentId; // d is of type TabularHierarchyDatum
+});
+
 stratificatorizer = stratificatorizer.parentId((d, i, data) => {
     console.log('Length of tabular array: ', data.length);
     console.log('Name of first entry in tabular array: ', data[0].name); // data of type Array
@@ -225,14 +233,12 @@ clusterLayout = d3Hierarchy.cluster();
 
 // size() ----------------------------------------------------------------
 
-clusterLayout = clusterLayout.size(null);
 clusterLayout = clusterLayout.size([200, 200]);
 
 size = clusterLayout.size();
 
 // nodeSize() ------------------------------------------------------------
 
-clusterLayout = clusterLayout.nodeSize(null);
 clusterLayout = clusterLayout.nodeSize([10, 10]);
 size = clusterLayout.nodeSize();
 
@@ -358,14 +364,12 @@ treeLayout = d3Hierarchy.tree();
 
 // size() ----------------------------------------------------------------
 
-treeLayout = treeLayout.size(null);
 treeLayout = treeLayout.size([200, 200]);
 
 size = treeLayout.size();
 
 // nodeSize() ------------------------------------------------------------
 
-treeLayout = treeLayout.nodeSize(null);
 treeLayout = treeLayout.nodeSize([10, 10]);
 size = treeLayout.nodeSize();
 
@@ -416,7 +420,6 @@ tilingFn = treemapLayout.tile();
 
 // size() ----------------------------------------------------------------
 
-treemapLayout = treemapLayout.size(null);
 treemapLayout = treemapLayout.size([400, 200]);
 
 size = treemapLayout.size();
@@ -635,7 +638,6 @@ partitionLayout = d3Hierarchy.partition();
 
 // size() ----------------------------------------------------------------
 
-partitionLayout = partitionLayout.size(null);
 partitionLayout = partitionLayout.size([400, 200]);
 
 size = partitionLayout.size();
@@ -674,7 +676,6 @@ packLayout = d3Hierarchy.pack();
 
 // size() ----------------------------------------------------------------
 
-packLayout = packLayout.size(null);
 packLayout = packLayout.size([400, 400]);
 
 size = packLayout.size();
diff --git a/types/d3-hierarchy/index.d.ts b/types/d3-hierarchy/index.d.ts
index 440a779217..bdb7b652d5 100644
--- a/types/d3-hierarchy/index.d.ts
+++ b/types/d3-hierarchy/index.d.ts
@@ -1,65 +1,208 @@
 // Type definitions for D3JS d3-hierarchy module 1.1
 // Project: https://github.com/d3/d3-hierarchy/
-// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov 
+// Definitions by: Tom Wanzek 
+//                 Alex Ford 
+//                 Boris Yankov 
+//                 denisname 
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
 
-// Last module patch version validated against: 1.1.1
+// Last module patch version validated against: 1.1.6
 
 // -----------------------------------------------------------------------
 // Hierarchy
 // -----------------------------------------------------------------------
 
 export interface HierarchyLink {
+    /**
+     * The source of the link.
+     */
     source: HierarchyNode;
+
+    /**
+     * The target of the link.
+     */
     target: HierarchyNode;
 }
 
 export interface HierarchyNode {
-    data: Datum;
-    readonly depth: number;
-    readonly height: number;
-    parent: HierarchyNode | null;
-    children?: Array>;
     /**
-     * Aggregated numeric value as calculated by sum(value) or count(),
-     * if previously invoked.
+     * The associated data, as specified to the constructor.
+     */
+    data: Datum;
+
+    /**
+     * Zero for the root node, and increasing by one for each descendant generation.
+     */
+    readonly depth: number;
+
+    /**
+     * Zero for leaf nodes, and the greatest distance from any descendant leaf for internal nodes.
+     */
+    readonly height: number;
+
+    /**
+     * The parent node, or null for the root node.
+     */
+    parent: this | null;
+
+    /**
+     * An array of child nodes, if any; undefined for leaf nodes.
+     */
+    children?: this[];
+
+    /**
+     * Aggregated numeric value as calculated by `sum(value)` or `count()`, if previously invoked.
      */
     readonly value?: number;
+
     /**
-     * Optional Node Id string set by StratifyOperator, if
-     * hierarchical data was created from tabular data using stratify()
+     * Optional node id string set by `StratifyOperator`, if hierarchical data was created from tabular data using stratify().
      */
     readonly id?: string;
-    ancestors(): Array>;
-    descendants(): Array>;
-    leaves(): Array>;
-    path(target: HierarchyNode): Array>;
+
+    /**
+     * Returns the array of ancestors nodes, starting with this node, then followed by each parent up to the root.
+     */
+    ancestors(): this[];
+
+    /**
+     * Returns the array of descendant nodes, starting with this node, then followed by each child in topological order.
+     */
+    descendants(): this[];
+
+    /**
+     * Returns the array of leaf nodes in traversal order; leaves are nodes with no children.
+     */
+    leaves(): this[];
+
+    /**
+     * Returns the shortest path through the hierarchy from this node to the specified target node.
+     * The path starts at this node, ascends to the least common ancestor of this node and the target node, and then descends to the target node.
+     *
+     * @param target The target node.
+     */
+    path(target: this): this[];
+
+    /**
+     * Returns an array of links for this node, where each link is an object that defines source and target properties.
+     * The source of each link is the parent node, and the target is a child node.
+     */
     links(): Array>;
+
+    /**
+     * Evaluates the specified value function for this node and each descendant in post-order traversal, and returns this node.
+     * The `node.value` property of each node is set to the numeric value returned by the specified function plus the combined value of all descendants.
+     *
+     * @param value The value function is passed the node’s data, and must return a non-negative number.
+     */
     sum(value: (d: Datum) => number): this;
+
+    /**
+     * Computes the number of leaves under this node and assigns it to `node.value`, and similarly for every descendant of node.
+     * If this node is a leaf, its count is one. Returns this node.
+     */
     count(): this;
-    sort(compare: (a: HierarchyNode, b: HierarchyNode) => number): this;
-    each(func: (node: HierarchyNode) => void): this;
-    eachAfter(func: (node: HierarchyNode) => void): this;
-    eachBefore(func: (node: HierarchyNode) => void): this;
-    copy(): HierarchyNode;
+
+    /**
+     * Sorts the children of this node, if any, and each of this node’s descendants’ children,
+     * in pre-order traversal using the specified compare function, and returns this node.
+     *
+     * @param compare The compare function is passed two nodes a and b to compare.
+     * If a should be before b, the function must return a value less than zero;
+     * if b should be before a, the function must return a value greater than zero;
+     * otherwise, the relative order of a and b are not specified. See `array.sort` for more.
+     */
+    sort(compare: (a: this, b: this) => number): this;
+
+    /**
+     * Invokes the specified function for node and each descendant in breadth-first order,
+     * such that a given node is only visited if all nodes of lesser depth have already been visited,
+     * as well as all preceding nodes of the same depth.
+     *
+     * @param func The specified function is passed the current node.
+     */
+    each(func: (node: this) => void): this;
+
+    /**
+     * Invokes the specified function for node and each descendant in post-order traversal,
+     * such that a given node is only visited after all of its descendants have already been visited.
+     *
+     * @param func The specified function is passed the current node.
+     */
+    eachAfter(func: (node: this) => void): this;
+
+    /**
+     * Invokes the specified function for node and each descendant in pre-order traversal,
+     * such that a given node is only visited after all of its ancestors have already been visited.
+     *
+     * @param func The specified function is passed the current node.
+     */
+    eachBefore(func: (node: this) => void): this;
+
+    /**
+     * Return a deep copy of the subtree starting at this node. The returned deep copy shares the same data, however.
+     * The returned node is the root of a new tree; the returned node’s parent is always null and its depth is always zero.
+     */
+    copy(): this;
 }
 
+/**
+ * Constructs a root node from the specified hierarchical data.
+ *
+ * @param data The root specified data.
+ * @param children The specified children accessor function invoked for each datum, starting with the root data.
+ * Must return an array of data representing the children, and return null or undefined if the current datum has no children.
+ * If children is not specified, it defaults to: `(d) => d.children`.
+ */
 export function hierarchy(data: Datum, children?: (d: Datum) => (Datum[] | null)): HierarchyNode;
 
 // -----------------------------------------------------------------------
 // Stratify
 // -----------------------------------------------------------------------
 
-// TODO: Review the comment in the API documentation related to 'reserved properties': id, parentId, children. If this is referring to the element on node, it should be 'parent'?
-
 export interface StratifyOperator {
+    /**
+     * Generates a new hierarchy from the specified tabular data. Each node in the returned object has a shallow copy of the properties
+     * from the corresponding data object, excluding the following reserved properties: id, parentId, children.
+     *
+     * @param data The root specified data.
+     * @throws Error on missing id, ambiguous id, cycle, multiple roots or no root.
+     */
     (data: Datum[]): HierarchyNode;
+
+    /**
+     * Returns the current id accessor, which defaults to: `(d) => d.id`.
+     */
     id(): (d: Datum, i: number, data: Datum[]) => (string | null | '' | undefined);
+    /**
+     * Sets the id accessor to the given function.
+     * The id accessor is invoked for each element in the input data passed to the stratify operator.
+     * The returned string is then used to identify the node's relationships in conjunction with the parent id.
+     * For leaf nodes, the id may be undefined, null or the empty string; otherwise, the id must be unique.
+     *
+     * @param id The id accessor.
+     */
     id(id: (d: Datum, i?: number, data?: Datum[]) => (string | null | '' | undefined)): this;
+
+    /**
+     * Returns the current parent id accessor, which defaults to: `(d) => d.parentId`.
+     */
     parentId(): (d: Datum, i: number, data: Datum[]) => (string | null | '' | undefined);
+    /**
+     * Sets the parent id accessor to the given function.
+     * The parent id accessor is invoked for each element in the input data passed to the stratify operator.
+     * The returned string is then used to identify the node's relationships in conjunction with the id.
+     * For the root node, the parent id should be undefined, null or the empty string.
+     * There must be exactly one root node in the input data, and no circular relationships.
+     *
+     * @param parentId The parent id accessor.
+     */
     parentId(parentId: (d: Datum, i?: number, data?: Datum[]) => (string | null | '' | undefined)): this;
 }
 
+/**
+ * Constructs a new stratify operator with the default settings.
+ */
 export function stratify(): StratifyOperator;
 
 // -----------------------------------------------------------------------
@@ -67,52 +210,86 @@ export function stratify(): StratifyOperator;
 // -----------------------------------------------------------------------
 
 export interface HierarchyPointLink {
+    /**
+     * The source of the link.
+     */
     source: HierarchyPointNode;
+
+    /**
+     * The target of the link.
+     */
     target: HierarchyPointNode;
 }
 
-export interface HierarchyPointNode {
+export interface HierarchyPointNode extends HierarchyNode {
+    /**
+     * The x-coordinate of the node.
+     */
     x: number;
+
+    /**
+     * The y-coordinate of the node.
+     */
     y: number;
-    data: Datum;
-    readonly depth: number;
-    readonly height: number;
-    parent: HierarchyPointNode | null;
-    children?: Array>;
+
     /**
-     * Aggregated numeric value as calculated by sum(value) or count(),
-     * if previously invoked.
+     * Returns an array of links for this node, where each link is an object that defines source and target properties.
+     * The source of each link is the parent node, and the target is a child node.
      */
-    readonly value?: number;
-    /**
-     * Optional Node Id string set by StratifyOperator, if
-     * hierarchical data was created from tabular data using stratify()
-     */
-    readonly id?: string;
-    ancestors(): Array>;
-    descendants(): Array>;
-    leaves(): Array>;
-    path(target: HierarchyPointNode): Array>;
     links(): Array>;
-    sum(value: (d: Datum) => number): this;
-    count(): this;
-    sort(compare: (a: HierarchyPointNode, b: HierarchyPointNode) => number): this;
-    each(func: (node: HierarchyPointNode) => void): this;
-    eachAfter(func: (node: HierarchyPointNode) => void): this;
-    eachBefore(func: (node: HierarchyPointNode) => void): this;
-    copy(): HierarchyPointNode;
 }
 
 export interface ClusterLayout {
+    /**
+     * Lays out the specified root hierarchy.
+     * You may want to call `root.sort` before passing the hierarchy to the cluster layout.
+     *
+     * @param root The specified root hierarchy.
+     */
     (root: HierarchyNode): HierarchyPointNode;
+
+    /**
+     * Returns the current layout size, which defaults to [1, 1]. A layout size of null indicates that a node size will be used instead.
+     */
     size(): [number, number] | null;
+    /**
+     * Sets this cluster layout’s size to the specified [width, height] array and returns the cluster layout.
+     * The size represent an arbitrary coordinate system; for example, to produce a radial layout,
+     * a size of [360, radius] corresponds to a breadth of 360° and a depth of radius.
+     *
+     * @param size The specified two-element size array.
+     */
     size(size: [number, number]): this;
+
+    /**
+     * Returns the current node size, which defaults to null. A node size of null indicates that a layout size will be used instead.
+     */
     nodeSize(): [number, number] | null;
+    /**
+     * Sets this cluster layout’s node size to the specified [width, height] array and returns this cluster layout.
+     * When a node size is specified, the root node is always positioned at <0, 0>.
+     *
+     * @param size The specified two-element size array.
+     */
     nodeSize(size: [number, number]): this;
+
+    /**
+     * Returns the current separation accessor, which defaults to: `(a, b) => a.parent == b.parent ? 1 : 2`.
+     */
     separation(): (a: HierarchyPointNode, b: HierarchyPointNode) => number;
+    /**
+     * Sets the separation accessor to the specified function and returns this cluster layout.
+     * The separation accessor is used to separate neighboring leaves.
+     *
+     * @param separation The separation function is passed two leaves a and b, and must return the desired separation.
+     * The nodes are typically siblings, though the nodes may be more distantly related if the layout decides to place such nodes adjacent.
+     */
     separation(separation: (a: HierarchyPointNode, b: HierarchyPointNode) => number): this;
 }
 
+/**
+ * Creates a new cluster layout with default settings.
+ */
 export function cluster(): ClusterLayout;
 
 // -----------------------------------------------------------------------
@@ -120,15 +297,56 @@ export function cluster(): ClusterLayout;
 // -----------------------------------------------------------------------
 
 export interface TreeLayout {
+    /**
+     * Lays out the specified root hierarchy.
+     * You may want to call `root.sort` before passing the hierarchy to the tree layout.
+     *
+     * @param root The specified root hierarchy.
+     */
     (root: HierarchyNode): HierarchyPointNode;
+
+    /**
+     * Returns the current layout size, which defaults to [1, 1]. A layout size of null indicates that a node size will be used instead.
+     */
     size(): [number, number] | null;
+    /**
+     * Sets this tree layout’s size to the specified [width, height] array and returns the tree layout.
+     * The size represent an arbitrary coordinate system; for example, to produce a radial layout,
+     * a size of [360, radius] corresponds to a breadth of 360° and a depth of radius.
+     *
+     * @param size The specified two-element size array.
+     */
     size(size: [number, number]): this;
+
+    /**
+     * Returns the current node size, which defaults to null. A node size of null indicates that a layout size will be used instead.
+     */
     nodeSize(): [number, number] | null;
+    /**
+     * Sets this tree layout’s node size to the specified [width, height] array and returns this tree layout.
+     * When a node size is specified, the root node is always positioned at <0, 0>.
+     *
+     * @param size The specified two-element size array.
+     */
     nodeSize(size: [number, number]): this;
+
+    /**
+     * Returns the current separation accessor, which defaults to: `(a, b) => a.parent == b.parent ? 1 : 2`.
+     */
     separation(): (a: HierarchyPointNode, b: HierarchyPointNode) => number;
+    /**
+     * Sets the separation accessor to the specified function and returns this tree layout.
+     * The separation accessor is used to separate neighboring nodes.
+     *
+     * @param separation The separation function is passed two nodes a and b, and must return the desired separation.
+     * The nodes are typically siblings, though the nodes may be more distantly related if the layout decides to place such nodes adjacent.
+     */
     separation(separation: (a: HierarchyPointNode, b: HierarchyPointNode) => number): this;
 }
 
+/**
+ * Creates a new tree layout with default settings.
+ */
 export function tree(): TreeLayout;
 
 // -----------------------------------------------------------------------
@@ -136,91 +354,283 @@ export function tree(): TreeLayout;
 // -----------------------------------------------------------------------
 
 export interface HierarchyRectangularLink {
+    /**
+     * The source of the link.
+     */
     source: HierarchyRectangularNode;
+
+    /**
+     * The target of the link.
+     */
     target: HierarchyRectangularNode;
 }
 
-export interface HierarchyRectangularNode {
+export interface HierarchyRectangularNode extends HierarchyNode {
+    /**
+     * The left edge of the rectangle.
+     */
     x0: number;
+
+    /**
+     * The top edge of the rectangle
+     */
     y0: number;
+
+    /**
+     * The right edge of the rectangle.
+     */
     x1: number;
+
+    /**
+     * The bottom edge of the rectangle.
+     */
     y1: number;
-    data: Datum;
-    readonly depth: number;
-    readonly height: number;
-    parent: HierarchyRectangularNode | null;
-    children?: Array>;
+
     /**
-     * Aggregated numeric value as calculated by sum(value) or count(),
-     * if previously invoked.
+     * Returns an array of links for this node, where each link is an object that defines source and target properties.
+     * The source of each link is the parent node, and the target is a child node.
      */
-    readonly value?: number;
-    /**
-     * Optional Node Id string set by StratifyOperator, if
-     * hierarchical data was created from tabular data using stratify()
-     */
-    readonly id?: string;
-    ancestors(): Array>;
-    descendants(): Array>;
-    leaves(): Array>;
-    path(target: HierarchyRectangularNode): Array>;
     links(): Array>;
-    sum(value: (d: Datum) => number): this;
-    count(): this;
-    sort(compare: (a: HierarchyRectangularNode, b: HierarchyRectangularNode) => number): this;
-    each(func: (node: HierarchyRectangularNode) => void): this;
-    eachAfter(func: (node: HierarchyRectangularNode) => void): this;
-    eachBefore(func: (node: HierarchyRectangularNode) => void): this;
-    copy(): HierarchyRectangularNode;
 }
 
 export interface TreemapLayout {
+    /**
+     * Lays out the specified root hierarchy.
+     * You must call `root.sum` before passing the hierarchy to the treemap layout.
+     * You probably also want to call `root.sort` to order the hierarchy before computing the layout.
+     *
+     * @param root The specified root hierarchy.
+     */
     (root: HierarchyNode): HierarchyRectangularNode;
+
+    /**
+     * Returns the current tiling method, which defaults to `d3.treemapSquarify` with the golden ratio.
+     */
     tile(): (node: HierarchyRectangularNode, x0: number, y0: number, x1: number, y1: number) => void;
+    /**
+     * Sets the tiling method to the specified function and returns this treemap layout.
+     *
+     * @param tile The specified tiling function.
+     */
     tile(tile: (node: HierarchyRectangularNode, x0: number, y0: number, x1: number, y1: number) => void): this;
+
+    /**
+     * Returns the current size, which defaults to [1, 1].
+     */
     size(): [number, number];
+    /**
+     * Sets this treemap layout’s size to the specified [width, height] array and returns this treemap layout.
+     *
+     * @param size The specified two-element size array.
+     */
     size(size: [number, number]): this;
+
+    /**
+     * Returns the current rounding state, which defaults to false.
+     */
     round(): boolean;
+    /**
+     * Enables or disables rounding according to the given boolean and returns this treemap layout.
+     *
+     * @param round The specified boolean flag.
+     */
     round(round: boolean): this;
+
+    /**
+     * Returns the current inner padding function.
+     */
     padding(): (node: HierarchyRectangularNode) => number;
+    /**
+     * Sets the inner and outer padding to the specified number and returns this treemap layout.
+     *
+     * @param padding The specified padding value.
+     */
     padding(padding: number): this;
+    /**
+     * Sets the inner and outer padding to the specified function and returns this treemap layout.
+     *
+     * @param padding The specified padding function.
+     */
     padding(padding: (node: HierarchyRectangularNode) => number): this;
+
+    /**
+     * Returns the current inner padding function, which defaults to the constant zero.
+     */
     paddingInner(): (node: HierarchyRectangularNode) => number;
+    /**
+     * Sets the inner padding to the specified number and returns this treemap layout.
+     * The inner padding is used to separate a node’s adjacent children.
+     *
+     * @param padding The specified inner padding value.
+     */
     paddingInner(padding: number): this;
+    /**
+     * Sets the inner padding to the specified function and returns this treemap layout.
+     * The function is invoked for each node with children, being passed the current node.
+     * The inner padding is used to separate a node’s adjacent children.
+     *
+     * @param padding The specified inner padding function.
+     */
     paddingInner(padding: (node: HierarchyRectangularNode) => number): this;
+
+    /**
+     * Returns the current top padding function.
+     */
     paddingOuter(): (node: HierarchyRectangularNode) => number;
+    /**
+     * Sets the top, right, bottom and left padding to the specified function and returns this treemap layout.
+     *
+     * @param padding The specified padding outer value.
+     */
     paddingOuter(padding: number): this;
+    /**
+     * Sets the top, right, bottom and left padding to the specified function and returns this treemap layout.
+     *
+     * @param padding The specified padding outer function.
+     */
     paddingOuter(padding: (node: HierarchyRectangularNode) => number): this;
+
+    /**
+     * Returns the current top padding function, which defaults to the constant zero.
+     */
     paddingTop(): (node: HierarchyRectangularNode) => number;
+    /**
+     * Sets the top padding to the specified number and returns this treemap layout.
+     * The top padding is used to separate the top edge of a node from its children.
+     *
+     * @param padding The specified top padding value.
+     */
     paddingTop(padding: number): this;
+    /**
+     * Sets the top padding to the specified function and returns this treemap layout.
+     * The function is invoked for each node with children, being passed the current node.
+     * The top padding is used to separate the top edge of a node from its children.
+     *
+     * @param padding The specified top padding function.
+     */
     paddingTop(padding: (node: HierarchyRectangularNode) => number): this;
+
+    /**
+     * Returns the current right padding function, which defaults to the constant zero.
+     */
     paddingRight(): (node: HierarchyRectangularNode) => number;
+    /**
+     * Sets the right padding to the specified number and returns this treemap layout.
+     * The right padding is used to separate the right edge of a node from its children.
+     *
+     * @param padding The specified right padding value.
+     */
     paddingRight(padding: number): this;
+    /**
+     * Sets the right padding to the specified function and returns this treemap layout.
+     * The function is invoked for each node with children, being passed the current node.
+     * The right padding is used to separate the right edge of a node from its children.
+     *
+     * @param padding The specified right padding function.
+     */
     paddingRight(padding: (node: HierarchyRectangularNode) => number): this;
+
+    /**
+     * Returns the current bottom padding function, which defaults to the constant zero.
+     */
     paddingBottom(): (node: HierarchyRectangularNode) => number;
+    /**
+     * Sets the bottom padding to the specified number and returns this treemap layout.
+     * The bottom padding is used to separate the bottom edge of a node from its children.
+     *
+     * @param padding The specified bottom padding value.
+     */
     paddingBottom(padding: number): this;
+    /**
+     * Sets the bottom padding to the specified function and returns this treemap layout.
+     * The function is invoked for each node with children, being passed the current node.
+     * The bottom padding is used to separate the bottom edge of a node from its children.
+     *
+     * @param padding The specified bottom padding function.
+     */
     paddingBottom(padding: (node: HierarchyRectangularNode) => number): this;
+
+    /**
+     * Returns the current left padding function, which defaults to the constant zero.
+     */
     paddingLeft(): (node: HierarchyRectangularNode) => number;
+    /**
+     * Sets the left padding to the specified number and returns this treemap layout.
+     * The left padding is used to separate the left edge of a node from its children.
+     *
+     * @param padding The specified left padding value.
+     */
     paddingLeft(padding: number): this;
+    /**
+     * Sets the left padding to the specified function and returns this treemap layout.
+     * The function is invoked for each node with children, being passed the current node.
+     * The left padding is used to separate the left edge of a node from its children.
+     *
+     * @param padding The specified left padding function.
+     */
     paddingLeft(padding: (node: HierarchyRectangularNode) => number): this;
 }
 
+/**
+ * Creates a new treemap layout with default settings.
+ */
 export function treemap(): TreemapLayout;
 
-// Tiling functions ---------------------------------------------------------------------------------
+// Tiling functions -----------------------------------------------------------------------
 
+/**
+ * Recursively partitions the specified nodes into an approximately-balanced binary tree,
+ * choosing horizontal partitioning for wide rectangles and vertical partitioning for tall rectangles.
+ */
 export function treemapBinary(node: HierarchyRectangularNode, x0: number, y0: number, x1: number, y1: number): void;
+
+/**
+ * Divides the rectangular area specified by x0, y0, x1, y1 horizontally according the value of each of the specified node’s children.
+ * The children are positioned in order, starting with the left edge (x0) of the given rectangle.
+ * If the sum of the children’s values is less than the specified node’s value (i.e., if the specified node has a non-zero internal value),
+ * the remaining empty space will be positioned on the right edge (x1) of the given rectangle.
+ */
 export function treemapDice(node: HierarchyRectangularNode, x0: number, y0: number, x1: number, y1: number): void;
+
+/**
+ * Divides the rectangular area specified by x0, y0, x1, y1 vertically according the value of each of the specified node’s children.
+ * The children are positioned in order, starting with the top edge (y0) of the given rectangle.
+ * If the sum of the children’s values is less than the specified node’s value (i.e., if the specified node has a non-zero internal value),
+ * the remaining empty space will be positioned on the bottom edge (y1) of the given rectangle.
+ */
 export function treemapSlice(node: HierarchyRectangularNode, x0: number, y0: number, x1: number, y1: number): void;
+
+/**
+ * If the specified node has odd depth, delegates to treemapSlice; otherwise delegates to treemapDice.
+ */
 export function treemapSliceDice(node: HierarchyRectangularNode, x0: number, y0: number, x1: number, y1: number): void;
 
 // TODO: Test Factory code
 export interface RatioSquarifyTilingFactory {
     (node: HierarchyRectangularNode, x0: number, y0: number, x1: number, y1: number): void;
+
+    /**
+     * Specifies the desired aspect ratio of the generated rectangles.
+     * Note that the orientation of the generated rectangles (tall or wide) is not implied by the ratio.
+     * Furthermore, the rectangles ratio are not guaranteed to have the exact specified aspect ratio.
+     * If not specified, the aspect ratio defaults to the golden ratio, φ = (1 + sqrt(5)) / 2, per Kong et al.
+     *
+     * @param ratio The specified ratio value greater than or equal to one.
+     */
     ratio(ratio: number): RatioSquarifyTilingFactory;
 }
 
+/**
+ * Implements the squarified treemap algorithm by Bruls et al., which seeks to produce rectangles of a given aspect ratio.
+ */
 export const treemapSquarify: RatioSquarifyTilingFactory;
+
+/**
+ * Like `d3.treemapSquarify`, except preserves the topology (node adjacencies) of the previous layout computed by `d3.treemapResquarify`,
+ * if there is one and it used the same target aspect ratio. This tiling method is good for animating changes to treemaps because
+ * it only changes node sizes and not their relative positions, thus avoiding distracting shuffling and occlusion.
+ * The downside of a stable update, however, is a suboptimal layout for subsequent updates: only the first layout uses the Bruls et al. squarified algorithm.
+ */
 export const treemapResquarify: RatioSquarifyTilingFactory;
 
 // -----------------------------------------------------------------------
@@ -228,15 +638,53 @@ export const treemapResquarify: RatioSquarifyTilingFactory;
 // -----------------------------------------------------------------------
 
 export interface PartitionLayout {
+    /**
+     * Lays out the specified root hierarchy.
+     * You must call `root.sum` before passing the hierarchy to the partition layout.
+     * You probably also want to call `root.sort` to order the hierarchy before computing the layout.
+     *
+     * @param root The specified root hierarchy.
+     */
     (root: HierarchyNode): HierarchyRectangularNode;
+
+    /**
+     * Returns the current size, which defaults to [1, 1].
+     */
     size(): [number, number];
+    /**
+     * Sets this partition layout’s size to the specified [width, height] array and returns this partition layout.
+     *
+     * @param size The specified two-element size array.
+     */
     size(size: [number, number]): this;
+
+    /**
+     * Returns the current rounding state, which defaults to false.
+     */
     round(): boolean;
+    /**
+     * Enables or disables rounding according to the given boolean and returns this partition layout.
+     *
+     * @param round The specified boolean flag.
+     */
     round(round: boolean): this;
+
+    /**
+     * Returns the current padding, which defaults to zero.
+     */
     padding(): number;
+    /**
+     * Sets the padding to the specified number and returns this partition layout.
+     * The padding is used to separate a node’s adjacent children.
+     *
+     * @param padding The specified padding value.
+     */
     padding(padding: number): this;
 }
 
+/**
+ * Creates a new partition layout with the default settings.
+ */
 export function partition(): PartitionLayout;
 
 // -----------------------------------------------------------------------
@@ -244,54 +692,110 @@ export function partition(): PartitionLayout;
 // -----------------------------------------------------------------------
 
 export interface HierarchyCircularLink {
+    /**
+     * The source of the link.
+     */
     source: HierarchyCircularNode;
+
+    /**
+     * The target of the link.
+     */
     target: HierarchyCircularNode;
 }
 
-export interface HierarchyCircularNode {
+export interface HierarchyCircularNode extends HierarchyNode {
+    /**
+     * The x-coordinate of the circle’s center.
+     */
     x: number;
+
+    /**
+     * The y-coordinate of the circle’s center.
+     */
     y: number;
+
+    /**
+     * The radius of the circle.
+     */
     r: number;
-    data: Datum;
-    readonly depth: number;
-    readonly height: number;
-    parent: HierarchyCircularNode | null;
-    children?: Array>;
+
     /**
-     * Aggregated numeric value as calculated by sum(value) or count(),
-     * if previously invoked.
+     * Returns an array of links for this node, where each link is an object that defines source and target properties.
+     * The source of each link is the parent node, and the target is a child node.
      */
-    readonly value?: number;
-    /**
-     * Optional Node Id string set by StratifyOperator, if
-     * hierarchical data was created from tabular data using stratify()
-     */
-    readonly id?: string;
-    ancestors(): Array>;
-    descendants(): Array>;
-    leaves(): Array>;
-    path(target: HierarchyCircularNode): Array>;
     links(): Array>;
-    sum(value: (d: Datum) => number): this;
-    count(): this;
-    sort(compare: (a: HierarchyCircularNode, b: HierarchyCircularNode) => number): this;
-    each(func: (node: HierarchyCircularNode) => void): this;
-    eachAfter(func: (node: HierarchyCircularNode) => void): this;
-    eachBefore(func: (node: HierarchyCircularNode) => void): this;
-    copy(): HierarchyCircularNode;
 }
 
 export interface PackLayout {
+    /**
+     * Lays out the specified root hierarchy.
+     * You must call `root.sum` before passing the hierarchy to the pack layout.
+     * You probably also want to call `root.sort` to order the hierarchy before computing the layout.
+     *
+     * @param root The specified root hierarchy.
+     */
     (root: HierarchyNode): HierarchyCircularNode;
+
+    /**
+     * Returns the current radius accessor, which defaults to null.
+     */
     radius(): null | ((node: HierarchyCircularNode) => number);
+    /**
+     * Sets the pack layout’s radius accessor to the specified function and returns this pack layout.
+     * If the radius accessor is null, the radius of each leaf circle is derived from the leaf `node.value` (computed by `node.sum`);
+     * the radii are then scaled proportionally to fit the layout size.
+     * If the radius accessor is not null, the radius of each leaf circle is specified exactly by the function.
+     *
+     * @param radius The specified radius accessor.
+     */
     radius(radius: (node: HierarchyCircularNode) => number): this;
+
+    /**
+     * Returns the current size, which defaults to [1, 1].
+     */
     size(): [number, number];
+    /**
+     * Sets this pack layout’s size to the specified [width, height] array and returns this pack layout.
+     *
+     * @param size The specified two-element size array.
+     */
     size(size: [number, number]): this;
+
+    /**
+     * Returns the current padding accessor, which defaults to the constant zero.
+     */
     padding(): (node: HierarchyCircularNode) => number;
+    /**
+     * Sets this pack layout’s padding accessor to the specified number and returns this pack layout.
+     * Returns the current padding accessor, which defaults to the constant zero.
+     *
+     * When siblings are packed, tangent siblings will be separated by approximately the specified padding;
+     * the enclosing parent circle will also be separated from its children by approximately the specified padding.
+     * If an explicit radius is not specified, the padding is approximate because a two-pass algorithm
+     * is needed to fit within the layout size: the circles are first packed without padding;
+     * a scaling factor is computed and applied to the specified padding; and lastly the circles are re-packed with padding.
+     *
+     * @param padding The specified padding value.
+     */
     padding(padding: number): this;
+    /**
+     * Sets this pack layout’s padding accessor to the specified function and returns this pack layout.
+     * Returns the current padding accessor, which defaults to the constant zero.
+     *
+     * When siblings are packed, tangent siblings will be separated by approximately the specified padding;
+     * the enclosing parent circle will also be separated from its children by approximately the specified padding.
+     * If an explicit radius is not specified, the padding is approximate because a two-pass algorithm
+     * is needed to fit within the layout size: the circles are first packed without padding;
+     * a scaling factor is computed and applied to the specified padding; and lastly the circles are re-packed with padding.
+     *
+     * @param padding The specified padding function.
+     */
     padding(padding: (node: HierarchyCircularNode) => number): this;
 }
 
+/**
+ * Creates a new pack layout with the default settings.
+ */
 export function pack(): PackLayout;
 
 // -----------------------------------------------------------------------
@@ -299,8 +803,19 @@ export function pack(): PackLayout;
 // -----------------------------------------------------------------------
 
 export interface PackCircle {
+    /**
+     * The radius of the circle.
+     */
     r: number;
+
+    /**
+     * The x-coordinate of the circle’s center.
+     */
     x?: number;
+
+    /**
+     * The y-coordinate of the circle’s center.
+     */
     y?: number;
 }
 
@@ -309,6 +824,19 @@ export interface PackCircle {
 // For invocation of packEnclose the x and y coordinates are mandatory. It seems easier to just comment
 // on the mandatory nature, then to create separate interfaces and having to deal with recasting.
 
+/**
+ * Packs the specified array of circles, each of which must have a `circle.r` property specifying the circle’s radius.
+ * The circles are positioned according to the front-chain packing algorithm by Wang et al.
+ *
+ * @param circles The specified array of circles to pack.
+ */
 export function packSiblings(circles: Datum[]): Datum[];
 
+/**
+ * Computes the smallest circle that encloses the specified array of circles, each of which must have
+ * a `circle.r` property specifying the circle’s radius, and `circle.x` and `circle.y` properties specifying the circle’s center.
+ * The enclosing circle is computed using the Matoušek-Sharir-Welzl algorithm. (See also Apollonius’ Problem.)
+ *
+ * @param circles The specified array of circles to pack.
+ */
 export function packEnclose(circles: Datum[]): { r: number, x: number, y: number };
diff --git a/types/d3-quadtree/d3-quadtree-tests.ts b/types/d3-quadtree/d3-quadtree-tests.ts
index eda00fe130..8180bc0f44 100644
--- a/types/d3-quadtree/d3-quadtree-tests.ts
+++ b/types/d3-quadtree/d3-quadtree-tests.ts
@@ -13,19 +13,21 @@ import * as d3Quadtree from 'd3-quadtree';
 // ---------------------------------------------------------------------------
 
 // custom type guard
-function isLeaf(a: any): a is d3Quadtree.QuadtreeLeaf {
-    return a.data !== undefined;
+function isLeaf(a: d3Quadtree.QuadtreeInternalNode | d3Quadtree.QuadtreeLeaf): a is d3Quadtree.QuadtreeLeaf {
+    return a.length === undefined;
 }
 
 let num: number;
-let extent: [[number, number], [number, number]];
+let num4: 4;
+let undef: undefined;
+let extent: [[number, number], [number, number]] | undefined;
 
 interface TestDatum {
     x: number;
     y: number;
 }
 
-let testDatum: TestDatum;
+let testDatum: TestDatum | undefined;
 
 let testData: TestDatum[] = [
     { x: 10, y: 20 },
@@ -83,7 +85,6 @@ quadtree = d3Quadtree.quadtree(testData); // explicitly typed to Test
 
 // test without data
 quadtree = d3Quadtree.quadtree();
-// quadtree = d3Quadtree.quadtree(); fails, wrong underlying data type
 
 // Configure Quadtree ========================================================
 
@@ -111,12 +112,14 @@ quadtree = quadtree.cover(50, 90);
 // add(...) ------------------------------------------------------------------
 
 quadtree = quadtree.add({ x: 35, y: 35 });
-// quadtree = quadtree.add({x: 35}); // fails, incompatible data type
+// $ExpectError
+quadtree = quadtree.add({x: 35}); // fails, incompatible data type
 
 // addAll(...) ---------------------------------------------------------------
 
 quadtree = quadtree.addAll(testData);
-// quadtree = quadtree.addAll([{x: 35}, {x: 55, y: 13}]); // fails, incompatible data type
+// $ExpectError
+quadtree = quadtree.addAll([{x: 35}, {x: 55, y: 13}]); // fails, incompatible data type
 
 // remove(...) ---------------------------------------------------------------
 
@@ -191,9 +194,10 @@ quadtree = quadtree.visit((node, x0, y0, x1, y1) => {
     }
 });
 
-// quadtree = quadtree.visit(function (node, x0, y0, x1, y1) {
-//     return 10; // fails wrong return type
-// });
+// $ExpectError
+quadtree = quadtree.visit((node, x0, y0, x1, y1) => {
+    return 10; // fails wrong return type
+});
 
 // visitAfter() ---------------------------------------------------------------
 
@@ -232,3 +236,15 @@ quadNode = internalNode[0];
 quadNode = internalNode[1];
 quadNode = internalNode[2];
 quadNode = internalNode[3];
+
+num = internalNode.length;
+num4 = internalNode.length;
+
+quadtree = quadtree.visit((node, x0, y0, x1, y1) => {
+    if (isLeaf(node)) {
+        undef = node.length;
+    } else {
+        num = node.length;
+        num4 = node.length;
+    }
+});
diff --git a/types/d3-quadtree/index.d.ts b/types/d3-quadtree/index.d.ts
index 8128c9e306..8e66ba411c 100644
--- a/types/d3-quadtree/index.d.ts
+++ b/types/d3-quadtree/index.d.ts
@@ -1,17 +1,34 @@
 // Type definitions for D3JS d3-quadtree module 1.0
 // Project: https://github.com/d3/d3-quadtree/
-// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov 
+// Definitions by: Tom Wanzek 
+//                 Alex Ford 
+//                 Boris Yankov 
+//                 denisname 
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.3
 
-// Last module patch version validated against: 1.0.1
+// Last module patch version validated against: 1.0.3
 
 /**
  * Leaf node of the quadtree.
  */
 export interface QuadtreeLeaf {
+    /**
+     * The data associated with this point, as passed to quadtree.add.
+     */
     data: T;
+
+    /**
+     * The next datum in this leaf, if any.
+     */
     next?: QuadtreeLeaf;
+
+    /**
+     * The length property may be used to distinguish leaf nodes from internal nodes: it is undefined for leaf nodes, and 4 for internal nodes.
+     */
+    length?: undefined;
 }
+
 /**
  * Internal nodes of the quadtree are represented as four-element arrays in left-to-right, top-to-bottom order:
  *
@@ -22,32 +39,170 @@ export interface QuadtreeLeaf {
  *
  * A child quadrant may be undefined if it is empty.
  */
-export interface QuadtreeInternalNode extends Array | QuadtreeLeaf | undefined> { }
+export interface QuadtreeInternalNode extends Array | QuadtreeLeaf | undefined> {
+    /**
+     * The length property may be used to distinguish leaf nodes from internal nodes: it is undefined for leaf nodes, and 4 for internal nodes.
+     */
+    length: 4;
+}
 
 export interface Quadtree {
+    /**
+     * Returns the current x-accessor, which defaults to: `x(d) => d[0]`.
+     */
     x(): (d: T) => number;
+    /**
+     * Sets the current x-coordinate accessor and returns the quadtree.
+     * The x-accessors must be consistent, returning the same value given the same input.
+     *
+     * @param x The x-coordinate accessor.
+     */
     x(x: (d: T) => number): this;
+
+    /**
+     * Returns the current y-accessor, which defaults to: `y(d) => d[1]`.
+     */
     y(): (d: T) => number;
+    /**
+     * Sets the current y-coordinate accessor and returns the quadtree.
+     * The y-accessors must be consistent, returning the same value given the same input.
+     *
+     * @param y The y-coordinate accessor.
+     */
     y(y: (d: T) => number): this;
+
+    /**
+     * Returns the quadtree's current extent `[[x0, y0], [x1, y1]]`,
+     * where `x0` and `y0` are the inclusive lower bounds and `x1` and `y1` are the inclusive upper bounds,
+     * or `undefined` if the quadtree has no extent.
+     */
     extent(): [[number, number], [number, number]] | undefined;
+    /**
+     * Expands the quadtree to cover the specified points `[[x0, y0], [x1, y1]]` and returns the quadtree.
+     * The extent may also be expanded by calling `quadtree.cover` or `quadtree.add`.
+     *
+     * @param extend The specified points to cover.
+     */
     extent(extend: [[number, number], [number, number]]): this;
+
+    /**
+     * Expands the quadtree to cover the specified point ⟨x,y⟩, and returns the quadtree.
+     * * If the quadtree’s extent already covers the specified point, this method does nothing.
+     * * If the quadtree has an extent, the extent is repeatedly doubled to cover the specified point, wrapping the root node as necessary.
+     * * If the quadtree is empty, the extent is initialized to the extent `[[⌊x⌋, ⌊y⌋], [⌈x⌉, ⌈y⌉]]`.
+     * Rounding is necessary such that if the extent is later doubled, the boundaries of existing quadrants do not change due to floating point error.
+     *
+     * @param x The x-coordinate for the specified point to cover.
+     * @param y The y-coordinate for the specified point to cover.
+     */
     cover(x: number, y: number): this;
+
+    /**
+     * Adds the specified datum to the quadtree, deriving its coordinates ⟨x,y⟩ using the current x- and y-accessors, and returns the quadtree.
+     * If the new point is outside the current extent of the quadtree, the quadtree is automatically expanded to cover the new point.
+     *
+     * @param datum The specified datum to add.
+     */
     add(datum: T): this;
+
+    /**
+     * Adds the specified array of data to the quadtree, deriving each element’s coordinates ⟨x,y⟩ using the current x- and y-accessors, and return this quadtree.
+     * This is approximately equivalent to calling quadtree.add repeatedly.
+     * However, this method results in a more compact quadtree because the extent of the data is computed first before adding the data.
+     *
+     * @param data The specified array of data to add.
+     */
     addAll(data: T[]): this;
+
+    /**
+     * Removes the specified datum to the quadtree, deriving its coordinates ⟨x,y⟩ using the current x- and y-accessors, and returns the quadtree.
+     * If the specified datum does not exist in this quadtree, this method does nothing.
+     *
+     * @param datum The specified datum to remove.
+     */
     remove(datum: T): this;
+
+    /**
+     * Removes the specified data to the quadtree, deriving their coordinates ⟨x,y⟩ using the current x- and y-accessors, and returns the quadtree.
+     * If a specified datum does not exist in this quadtree, it is ignored.
+     *
+     * @param data The specified array of data to remove.
+     */
     removeAll(data: T[]): this;
+
+    /**
+     * Returns a copy of the quadtree. All nodes in the returned quadtree are identical copies of the corresponding node in the quadtree;
+     * however, any data in the quadtree is shared by reference and not copied.
+     */
     copy(): Quadtree;
+
+    /**
+     * Returns the root node of the quadtree.
+     */
     root(): QuadtreeInternalNode | QuadtreeLeaf;
+
+    /**
+     * Returns an array of all data in the quadtree.
+     */
     data(): T[];
+
+    /**
+     * Returns the total number of data in the quadtree.
+     */
     size(): number;
+
+    /**
+     * Returns the datum closest to the position ⟨x,y⟩ with the given search radius. If radius is not specified, it defaults to infinity.
+     * If there is no datum within the search area, returns undefined.
+     *
+     * @param x The x-coordinate for the search position.
+     * @param y The y-coordinate for the search position.
+     * @param radius The optional search radius.
+     */
     find(x: number, y: number, radius?: number): T | undefined;
-    // TODO: Review below, when validating to strictNullChecks.
-    // tslint:disable-next-line:void-return
-    visit(callback: (node: QuadtreeInternalNode | QuadtreeLeaf, x0: number, y0: number, x1: number, y1: number) => (void | boolean)): this;
+
+    /**
+     * Visits each node in the quadtree in pre-order traversal, invoking the specified callback with arguments `node`, `x0`, `y0`, `x1`, `y1` for each node,
+     * where `node` is the node being visited, ⟨x0, y0⟩ are the lower bounds of the node, and ⟨x1, y1⟩ are the upper bounds, and returns the quadtree.
+     *
+     * If the callback returns true for a given node, then the children of that node are not visited; otherwise, all child nodes are visited.
+     * This can be used to quickly visit only parts of the tree.
+     * Note, however, that child quadrants are always visited in sibling order: top-left, top-right, bottom-left, bottom-right.
+     * In cases such as search, visiting siblings in a specific order may be faster.
+     *
+     * @param callback The callback invoked for each node.
+     */
+    visit(callback: (node: QuadtreeInternalNode | QuadtreeLeaf, x0: number, y0: number, x1: number, y1: number) => void | boolean): this;
+
+    /**
+     * Visits each node in the quadtree in post-order traversal, invoking the specified callback with arguments `node`, `x0`, `y0`, `x1`, `y1` for each node,
+     * where `node` is the node being visited, ⟨x0, y0⟩ are the lower bounds of the node, and ⟨x1, y1⟩ are the upper bounds, and returns the quadtree.
+     *
+     * @param callback The callback invoked for each node.
+     */
     visitAfter(callback: (node: QuadtreeInternalNode | QuadtreeLeaf, x0: number, y0: number, x1: number, y1: number) => void): this;
 }
 
-export function quadtree(): Quadtree<[number, number]>;
-export function quadtree(data: Array<[number, number]>): Quadtree<[number, number]>;
-export function quadtree(): Quadtree;
-export function quadtree(data: T[], x?: (d: T) => number, y?: (d: T) => number): Quadtree;
+/**
+ * Creates a new, empty quadtree with an empty extent and the default x- and y-accessors.
+ *
+ * The generic refers to the data type. If omitted, the default setting assumes that,
+ * the data used with the quadtree are two-element arrays.
+ * The first element corresponds to the x-dimension, the second to the y-dimension.
+ * When using another type, The x- and y-accessors must be specified.
+ */
+export function quadtree(): Quadtree;
+/**
+ * Creates a new quadtree with the specified array of data.
+ * If `x` and `y` are also specified, sets the x- and y- accessors to the specified functions before adding the specified array of data to the quadtree, otherwise use the default x- and y-accessors.
+ *
+ * The generic refers to the data type. If omitted, the default setting assumes that,
+ * the data used with the quadtree are two-element arrays.
+ * The first element corresponds to the x-dimension, the second to the y-dimension.
+ * When using another type, The x- and y-accessors must be specified.
+ *
+ * @param data The specified array of data to add.
+ * @param x The x-coordinate accessor.
+ * @param y The y-coordinate accessor.
+ */
+export function quadtree(data: T[], x?: (d: T) => number, y?: (d: T) => number): Quadtree;
diff --git a/types/d3-quadtree/tsconfig.json b/types/d3-quadtree/tsconfig.json
index cbbb70a658..0f4239c3a6 100644
--- a/types/d3-quadtree/tsconfig.json
+++ b/types/d3-quadtree/tsconfig.json
@@ -7,7 +7,7 @@
         ],
         "noImplicitAny": true,
         "noImplicitThis": true,
-        "strictNullChecks": false,
+        "strictNullChecks": true,
         "strictFunctionTypes": true,
         "baseUrl": "../",
         "typeRoots": [
diff --git a/types/d3-selection/d3-selection-tests.ts b/types/d3-selection/d3-selection-tests.ts
index 54ddb5ea11..b99c81e39a 100644
--- a/types/d3-selection/d3-selection-tests.ts
+++ b/types/d3-selection/d3-selection-tests.ts
@@ -796,7 +796,7 @@ newDiv2 = body.append(function(d, i, g) {
     const index: number = i;
     const group: HTMLBodyElement[] | d3Selection.ArrayLike = g;
     console.log('Body element foo property: ', d.foo); // data of type BodyDatum
-    return this.ownerDocument.createElement('div'); // this-type HTMLBodyElement
+    return this.ownerDocument!.createElement('div'); // this-type HTMLBodyElement
 });
 
 // newDiv2 = body.append(function(d) {
@@ -828,7 +828,7 @@ const typeValueFunction = function(
   i: number,
   g: HTMLBodyElement[] | d3Selection.ArrayLike
 ) {
-    return this.ownerDocument.createElement('p'); // this-type HTMLParagraphElement
+    return this.ownerDocument!.createElement('p'); // this-type HTMLParagraphElement
 };
 
 const beforeValueFunction = function(
diff --git a/types/d3-selection/index.d.ts b/types/d3-selection/index.d.ts
index d1e127dfdf..d9988636fd 100644
--- a/types/d3-selection/index.d.ts
+++ b/types/d3-selection/index.d.ts
@@ -22,7 +22,7 @@ export type BaseType = Element | EnterElement | Document | Window | null;
  */
 export interface ArrayLike {
     length: number;
-    item(index: number): T;
+    item(index: number): T | null;
     [index: number]: T;
 }
 
diff --git a/types/datatables.net/datatables.net-tests.ts b/types/datatables.net/datatables.net-tests.ts
index d22e878d34..de739a673a 100644
--- a/types/datatables.net/datatables.net-tests.ts
+++ b/types/datatables.net/datatables.net-tests.ts
@@ -1073,3 +1073,92 @@ const util_1: boolean = dt.any();
 const util_2: number = dt.count();
 
 //#endregion "Methods-Util"
+
+//#region "ExtSettings"
+
+const ext_classes_settings: DataTables.ExtClassesSettings = {
+};
+const ext_classes_settings_full: DataTables.ExtClassesSettings = {
+    sFilter: "",
+    sFilterInput: "",
+    sFooterTH: "",
+    sHeaderTH: "",
+    sInfo: "",
+    sJUIFooter: "",
+    sJUIHeader: "",
+    sLength: "",
+    sLengthSelect: "",
+    sNoFooter: "",
+    sPageButton: "",
+    sPageButtonActive: "",
+    sPageButtonDisabled: "",
+    sPaging: "",
+    sProcessing: "",
+    sRowEmpty: "",
+    sScrollBody: "",
+    sScrollFoot: "",
+    sScrollFootInner: "",
+    sScrollHead: "",
+    sScrollHeadInner: "",
+    sScrollWrapper: "",
+    sSortable: "",
+    sSortableAsc: "",
+    sSortableDesc: "",
+    sSortableNone: "",
+    sSortAsc: "",
+    sSortColumn: "",
+    sSortDesc: "",
+    sSortIcon: "",
+    sSortJUI: "",
+    sSortJUIAsc: "",
+    sSortJUIAscAllowed: "",
+    sSortJUIDesc: "",
+    sSortJUIDescAllowed: "",
+    sSortJUIWrapper: "",
+    sStripeEven: "",
+    sStripeOdd: "",
+    sTable: "",
+    sWrapper: ""
+};
+
+const ext_type_settings: DataTables.ExtTypeSettings = {
+    detect: [],
+    search: {},
+    order: {}
+};
+ext_type_settings.detect.push((d: string, s: DataTables.Settings) => {
+    return null;
+});
+ext_type_settings.detect.push((d: string, s: DataTables.Settings) => {
+    return "";
+});
+
+const ext_settings: DataTables.ExtSettings = {
+    aTypes: [],
+    afnFiltering: [],
+    afnSortData: {},
+    aoFeatures: [],
+    builder: "",
+    classes: ext_classes_settings,
+    errMode: "",
+    feature: [],
+    fnVersionCheck: (version: string) => "",
+    iApiIndex: 0,
+    internal: {},
+    legacy: {},
+    oApi: {},
+    oJUIClasses: {},
+    oPagination: {},
+    oSort: {},
+    oStdClasses: ext_classes_settings,
+    ofnSearch: {},
+    order: {},
+    pager: {},
+    renderer: {},
+    sVersion: "",
+    search: [],
+    selector: {},
+    type: ext_type_settings
+};
+
+ //#endregion "ExtSettings"
diff --git a/types/datatables.net/index.d.ts b/types/datatables.net/index.d.ts
index ae7edf755a..ed87028502 100644
--- a/types/datatables.net/index.d.ts
+++ b/types/datatables.net/index.d.ts
@@ -2026,7 +2026,10 @@ declare namespace DataTables {
         sVersion: string;
         search: any[];
         selector: object;
-        type: object;
+        /**
+         * Type based plug-ins.
+         */
+        type: ExtTypeSettings;
     }
 
     interface ExtClassesSettings {
@@ -2208,4 +2211,36 @@ declare namespace DataTables {
         sJUIFooter?: string;
     }
     //#endregion "ext internal"
+
+    interface ExtTypeSettings {
+        /**
+         * Type detection functions for plug-in development.
+         *
+         * @see https://datatables.net/manual/plug-ins/type-detection
+         */
+        detect: FunctionExtTypeSettingsDetect[];
+        /**
+         * Type based ordering functions for plug-in development.
+         *
+         * @see https://datatables.net/manual/plug-ins/sorting
+         * @default {}
+         */
+        order: object;
+        /**
+         * Type based search formatting for plug-in development.
+         *
+         * @default {}
+         * @example
+         *   $.fn.dataTable.ext.type.search['title-numeric'] = function ( d ) {
+         *     return d.replace(/\n/g," ").replace( /<.*?>/g, "" );
+         *   }
+         */
+        search: object;
+    }
+
+    /**
+     * @param data Data from the column cell to be analysed.
+     * @param DataTables settings object.
+     */
+    type FunctionExtTypeSettingsDetect = (data: any, settings: Settings) => (string | null);
 }
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/dd-trace/package.json b/types/dd-trace/package.json
new file mode 100644
index 0000000000..90deb3c97b
--- /dev/null
+++ b/types/dd-trace/package.json
@@ -0,0 +1,6 @@
+{
+    "private": true,
+    "dependencies": {
+        "opentracing": ">=0.14.1"
+    }
+}
diff --git a/types/dd-trace/src/opentracing/reference.d.ts b/types/dd-trace/src/opentracing/reference.d.ts
deleted file mode 100644
index 57def49166..0000000000
--- a/types/dd-trace/src/opentracing/reference.d.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import Span = require('./span');
-import SpanContext = require('./span_context');
-
-declare class Reference {
-    /**
-     * @return The Reference type (e.g., REFERENCE_CHILD_OF or
-     *         REFERENCE_FOLLOWS_FROM).
-     */
-    type(): string;
-
-    /**
-     * @return The SpanContext being referred to (e.g., the
-     *         parent in a REFERENCE_CHILD_OF Reference).
-     */
-    referencedContext(): SpanContext;
-
-    /**
-     * Initialize a new Reference instance.
-     *
-     * @param type - the Reference type constant (e.g.,
-     *        REFERENCE_CHILD_OF or REFERENCE_FOLLOWS_FROM).
-     * @param referencedContext - the SpanContext being referred
-     *        to. As a convenience, a Span instance may be passed in instead
-     *        (in which case its .context() is used here).
-     */
-    constructor(type: string, referencedContext: SpanContext | Span);
-}
-
-export = Reference;
\ No newline at end of file
diff --git a/types/dd-trace/src/opentracing/span.d.ts b/types/dd-trace/src/opentracing/span.d.ts
index e61a611efd..cf9286210b 100644
--- a/types/dd-trace/src/opentracing/span.d.ts
+++ b/types/dd-trace/src/opentracing/span.d.ts
@@ -1,7 +1,8 @@
 import Tracer = require('./tracer');
 import SpanContext = require('./span_context');
+import { Span } from 'opentracing';
 
-declare class Span {
+declare class DatadogSpan extends Span {
     /**
      * Returns the SpanContext object associated with this Span.
      */
@@ -117,4 +118,4 @@ declare class Span {
     finish(finishTime?: number): void;
 }
 
-export = Span;
+export = DatadogSpan;
diff --git a/types/dd-trace/src/opentracing/span_context.d.ts b/types/dd-trace/src/opentracing/span_context.d.ts
index 4e3b532649..cf9565d5a5 100644
--- a/types/dd-trace/src/opentracing/span_context.d.ts
+++ b/types/dd-trace/src/opentracing/span_context.d.ts
@@ -1,3 +1,5 @@
+import { SpanContext } from 'opentracing';
+
 /**
  * SpanContext represents Span state that must propagate to descendant Spans
  * and across process boundaries.
@@ -8,7 +10,7 @@
  * identify or otherwise contextualize the associated Span instance (e.g., a
  *  tuple).
  */
-declare class SpanContext {
+declare class DatadogSpanContext extends SpanContext {
     /**
      * Use to create references to parent spans.
      */
@@ -35,4 +37,4 @@ interface SpanContextLike {
     spanId: number;
 }
 
-export = SpanContext;
+export = DatadogSpanContext;
diff --git a/types/dd-trace/src/opentracing/span_options.d.ts b/types/dd-trace/src/opentracing/span_options.d.ts
deleted file mode 100644
index 054d9024d1..0000000000
--- a/types/dd-trace/src/opentracing/span_options.d.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import Span = require('./span');
-import Reference = require('./reference');
-import SpanContext = require('./span_context');
-
-interface SpanOptions {
-    /**
-     * a parent SpanContext (or Span, for convenience) that the newly-started
-     * span will be the child of (per REFERENCE_CHILD_OF). If specified,
-     * `references` must be unspecified.
-     */
-    childOf?: Span | SpanContext;
-
-    /**
-     * an array of Reference instances, each pointing to a causal parent
-     * SpanContext. If specified, `fields.childOf` must be unspecified.
-     */
-    references?: Reference[];
-
-    /**
-     * set of key-value pairs which will be set as tags on the newly created
-     * Span. Ownership of the object is passed to the created span for
-     * efficiency reasons (the caller should not modify this object after
-     * calling startSpan).
-     */
-    tags?: {
-        [key: string]: any;
-    };
-
-    /**
-     * a manually specified start time for the created Span object. The time
-     * should be specified in milliseconds as Unix timestamp. Decimal value are
-     * supported to represent time values with sub-millisecond accuracy.
-     */
-    startTime?: number;
-}
-
-export = SpanOptions;
diff --git a/types/dd-trace/src/opentracing/tracer.d.ts b/types/dd-trace/src/opentracing/tracer.d.ts
index a40559dbcd..252a0d558c 100644
--- a/types/dd-trace/src/opentracing/tracer.d.ts
+++ b/types/dd-trace/src/opentracing/tracer.d.ts
@@ -1,91 +1,11 @@
-import SpanOptions = require('./span_options');
-import Span = require('./span');
-import SpanContext = require('./span_context');
+import { Tracer } from 'opentracing';
 
 /**
  * Tracer is the entry-point between the instrumentation API and the tracing
  * implementation.
  */
-declare class Tracer {
-    /**
-     * Starts and returns a new Span representing a logical unit of work.
-     *
-     * For example:
-     *
-     *     // Start a new (parentless) root Span:
-     *     var parent = Tracer.startSpan('DoWork');
-     *
-     *     // Start a new (child) Span:
-     *     var child = Tracer.startSpan('load-from-db', {
-     *         childOf: parent.context(),
-     *     });
-     *
-     *     // Start a new async (FollowsFrom) Span:
-     *     var child = Tracer.startSpan('async-cache-write', {
-     *         references: [
-     *             opentracing.followsFrom(parent.context())
-     *         ],
-     *     });
-     *
-     * @param name - the name of the operation (REQUIRED).
-     * @param options - options for the newly created span.
-     * @return A new Span object.
-     */
-    startSpan(name: string, options?: SpanOptions): Span;
+declare class DatadogTracer extends Tracer {
 
-    /**
-     * Injects the given SpanContext instance for cross-process propagation
-     * within `carrier`. The expected type of `carrier` depends on the value of
-     * `format.
-     *
-     * OpenTracing defines a common set of `format` values (see
-     * FORMAT_TEXT_MAP, FORMAT_HTTP_HEADERS, and FORMAT_BINARY), and each has
-     * an expected carrier type.
-     *
-     * Consider this pseudocode example:
-     *
-     *     var clientSpan = ...;
-     *     ...
-     *     // Inject clientSpan into a text carrier.
-     *     var headersCarrier = {};
-     *     Tracer.inject(clientSpan.context(), Tracer.FORMAT_HTTP_HEADERS, headersCarrier);
-     *     // Incorporate the textCarrier into the outbound HTTP request header
-     *     // map.
-     *     Object.assign(outboundHTTPReq.headers, headersCarrier);
-     *     // ... send the httpReq
-     *
-     * @param  spanContext - the SpanContext to inject into the
-     *         carrier object. As a convenience, a Span instance may be passed
-     *         in instead (in which case its .context() is used for the
-     *         inject()).
-     * @param  format - the format of the carrier.
-     * @param  carrier - see the documentation for the chosen `format`
-     *         for a description of the carrier object.
-     */
-    inject(spanContext: SpanContext | Span, format: string, carrier: any): void;
-
-    /**
-     * Returns a SpanContext instance extracted from `carrier` in the given
-     * `format`.
-     *
-     * OpenTracing defines a common set of `format` values (see
-     * FORMAT_TEXT_MAP, FORMAT_HTTP_HEADERS, and FORMAT_BINARY), and each has
-     * an expected carrier type.
-     *
-     * Consider this pseudocode example:
-     *
-     *     // Use the inbound HTTP request's headers as a text map carrier.
-     *     var headersCarrier = inboundHTTPReq.headers;
-     *     var wireCtx = Tracer.extract(Tracer.FORMAT_HTTP_HEADERS, headersCarrier);
-     *     var serverSpan = Tracer.startSpan('...', { childOf : wireCtx });
-     *
-     * @param  format - the format of the carrier.
-     * @param  carrier - the type of the carrier object is determined by
-     *         the format.
-     * @return The extracted SpanContext, or null if no such SpanContext could
-     *         be found in `carrier`
-     */
-    extract(format: string, carrier: any): SpanContext | null;
 }
 
-export = Tracer;
+export = DatadogTracer;
diff --git a/types/detect-node/detect-node-tests.ts b/types/detect-node/detect-node-tests.ts
new file mode 100644
index 0000000000..01a81a356b
--- /dev/null
+++ b/types/detect-node/detect-node-tests.ts
@@ -0,0 +1,3 @@
+import isNode = require("detect-node");
+
+isNode;
diff --git a/types/detect-node/index.d.ts b/types/detect-node/index.d.ts
new file mode 100644
index 0000000000..38fd280f1e
--- /dev/null
+++ b/types/detect-node/index.d.ts
@@ -0,0 +1,8 @@
+// Type definitions for detect-node 2.0
+// Project: https://github.com/iliakan/detect-node
+// Definitions by: Leonid Logvinov 
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.4
+
+declare const isNode: boolean;
+export = isNode;
diff --git a/types/detect-node/tsconfig.json b/types/detect-node/tsconfig.json
new file mode 100644
index 0000000000..e853bcf92c
--- /dev/null
+++ b/types/detect-node/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", "detect-node-tests.ts"]
+}
diff --git a/types/detect-node/tslint.json b/types/detect-node/tslint.json
new file mode 100644
index 0000000000..3db14f85ea
--- /dev/null
+++ b/types/detect-node/tslint.json
@@ -0,0 +1 @@
+{ "extends": "dtslint/dt.json" }
diff --git a/types/di/di-tests.ts b/types/di/di-tests.ts
new file mode 100644
index 0000000000..4cfd3de5e7
--- /dev/null
+++ b/types/di/di-tests.ts
@@ -0,0 +1,21 @@
+import * as di from "di";
+
+const emptyInjector = new di.Injector();
+const moduleSpecifications = [{}];
+const fullInjector = new di.Injector(moduleSpecifications);
+const childInjector = new di.Injector(moduleSpecifications, emptyInjector);
+
+const dep: {} = fullInjector.get('foo');
+
+const factory = (context: {}, deps: Array<{}>) => {
+	return {};
+};
+
+const invoked: {} = fullInjector.invoke(factory, {});
+
+const oldTimeyClass = {prototype: {}};
+
+const instance: {} = fullInjector.instantiate(oldTimeyClass);
+
+const anotherChildInjector: di.Injector =
+		fullInjector.createChild(moduleSpecifications);
diff --git a/types/di/index.d.ts b/types/di/index.d.ts
new file mode 100644
index 0000000000..ea1d596017
--- /dev/null
+++ b/types/di/index.d.ts
@@ -0,0 +1,15 @@
+// Type definitions for di 0.0
+// Project: https://github.com/vojtajina/node-di
+// Definitions by: John J Barton 
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.8
+
+/// 
+
+export class Injector {
+    get(dep: string): {};
+    invoke(fn: (context: {}, deps: Array<{}>) => {}, context: {}): {};
+    instantiate({prototype: {}}): {};
+    createChild(modules: Array<{}>): Injector;
+    constructor(modules?: Array<{}>, parent?: Injector);
+}
diff --git a/types/di/tsconfig.json b/types/di/tsconfig.json
new file mode 100644
index 0000000000..c7e591ab5a
--- /dev/null
+++ b/types/di/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",
+        "di-tests.ts"
+    ]
+}
diff --git a/types/di/tslint.json b/types/di/tslint.json
new file mode 100644
index 0000000000..3db14f85ea
--- /dev/null
+++ b/types/di/tslint.json
@@ -0,0 +1 @@
+{ "extends": "dtslint/dt.json" }
diff --git a/types/dnssd/dnssd-tests.ts b/types/dnssd/dnssd-tests.ts
index 14b637d384..0fa7498bb2 100644
--- a/types/dnssd/dnssd-tests.ts
+++ b/types/dnssd/dnssd-tests.ts
@@ -1,6 +1,6 @@
 import * as dnssd from 'dnssd';
 
-const serviceType = new dnssd.ServiceType(dnssd.tcp('_mqtt'), dnssd.udp('_mqtt'));
+const serviceType = dnssd.ServiceType.tcp('_mqtt', '_mqtt._udp');
 
 const advertisement = new dnssd.Advertisement(serviceType, 1883, { name: 'broker' });
 const browser: dnssd.Browser = new dnssd.Browser(serviceType);
diff --git a/types/dnssd/index.d.ts b/types/dnssd/index.d.ts
index 9c66a6d6a4..8ef8aa84fd 100644
--- a/types/dnssd/index.d.ts
+++ b/types/dnssd/index.d.ts
@@ -1,30 +1,40 @@
-// Type definitions for dnssd 0.3
+// Type definitions for dnssd 0.4
 // Project: https://github.com/DeMille/dnssd.js#readme
 // Definitions by: Angel Merino 
+//                 Max Rumpf 
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.2
 
 /// 
 import { EventEmitter } from 'events';
 
 /** Declaration file generated by dts-gen */
 
-export class Advertisement {
-    constructor(type: any, port: any, ...args: any[]);
+export class Advertisement extends EventEmitter {
+    constructor(type: string | string[] | ServiceType, port: number, ...args: any[]);
 
-    start(): any;
+    start(): Advertisement;
 
-    stop(forceImmediate: any, callback: any): void;
+    stop(forceImmediate?: boolean, callback?: () => any): void;
 
     updateTXT(txtObj: any): void;
 }
 
+export class Options {
+    name?: string;
+    host?: string;
+    txt?: any;
+    subtypes?: string[];
+    interface?: string;
+}
+
 /**
  * A service entry as returned by serviceUp
  */
 export class Service {
     fullname: string;         // 'InstanceName._googlecast._tcp.local.'
     name: string;             // 'InstanceName'
-    type: SType;              // { name: 'googlecast'; protocol: 'tcp' }
+    type: ServiceType;        // { name: 'googlecast'; protocol: 'tcp' }
     domain: string;           // 'local'
     host: string;             // 'Hostname.local.'
     port: number;             // 8009
@@ -33,47 +43,47 @@ export class Service {
     txtRaw: any;
 }
 
-export class SType {
+export class ServiceType {
+    constructor(...args: Array)
+    constructor(args: ServiceType);
+
     name: string;
     protocol: string;
+    subtypes: string[];
+
+    toString(): string;
+
+    static all(): ServiceType;
+
+    static tcp(...args: string[]): ServiceType;
+
+    static udp(...args: string[]): ServiceType;
 }
 
 export class Browser extends EventEmitter {
-    constructor(type: any, ...args: any[]);
+    constructor(type: string | string[] | ServiceType, ...args: any[]);
 
-    list(): any;
+    start(): Browser;
 
-    start(): any;
+    stop(): void;
 
-    stop(): any;
+    list(): any[];
 }
 
-export class ServiceType {
-    constructor(...args: any[]);
+export function resolve(name: string, type: string, args: object): Promise;
 
-    toString(): any;
+export function resolve4(name: string, type: string, args: object): Promise;
 
-    static all(): any;
+export function resolve6(name: string, type: string, args: object): Promise;
 
-    static tcp(...args: any[]): any;
+export function resolveSRV(name: string, args: object): Promise;
 
-    static udp(...args: any[]): any;
-}
+export function resolveTXT(name: string, args: object): Promise;
 
-export const resolveA: any;
+export function resolveService(name: string, args: object): Promise;
 
-export const resolveAAAA: any;
+export function tcp(...args: string[]): ServiceType;
 
-export function all(): any;
+export function udp(...args: string[]): ServiceType;
 
-export function resolve(name: any, type: any, ...args: any[]): any;
-
-export function resolveSRV(name: any, opts: any): any;
-
-export function resolveService(name: any, ...args: any[]): any;
-
-export function resolveTXT(name: any, opts: any): any;
-
-export function tcp(...args: any[]): any;
-
-export function udp(...args: any[]): any;
+export function all(): ServiceType;
diff --git a/types/document-ready/document-ready-tests.ts b/types/document-ready/document-ready-tests.ts
new file mode 100644
index 0000000000..17c522f1a3
--- /dev/null
+++ b/types/document-ready/document-ready-tests.ts
@@ -0,0 +1,4 @@
+import ready = require("document-ready");
+ready(() => {
+    // on load
+});
diff --git a/types/document-ready/index.d.ts b/types/document-ready/index.d.ts
new file mode 100644
index 0000000000..6d8c6d7499
--- /dev/null
+++ b/types/document-ready/index.d.ts
@@ -0,0 +1,7 @@
+// Type definitions for document-ready 2.0
+// Project: https://github.com/bendrucker/document-ready#readme
+// Definitions by: Jack Works 
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+declare function ready(callback: () => void): void;
+export = ready;
diff --git a/types/document-ready/tsconfig.json b/types/document-ready/tsconfig.json
new file mode 100644
index 0000000000..15ce7ad650
--- /dev/null
+++ b/types/document-ready/tsconfig.json
@@ -0,0 +1,23 @@
+{
+    "compilerOptions": {
+        "module": "commonjs",
+        "lib": [
+            "es6"
+        ],
+        "noImplicitAny": true,
+        "noImplicitThis": true,
+        "strictNullChecks": true,
+        "baseUrl": "../",
+        "strictFunctionTypes": true,
+        "typeRoots": [
+            "../"
+        ],
+        "types": [],
+        "noEmit": true,
+        "forceConsistentCasingInFileNames": true
+    },
+    "files": [
+        "index.d.ts",
+        "document-ready-tests.ts"
+    ]
+}
diff --git a/types/document-ready/tslint.json b/types/document-ready/tslint.json
new file mode 100644
index 0000000000..3db14f85ea
--- /dev/null
+++ b/types/document-ready/tslint.json
@@ -0,0 +1 @@
+{ "extends": "dtslint/dt.json" }
diff --git a/types/dom4/index.d.ts b/types/dom4/index.d.ts
index 90c9c29966..47a7080a0c 100644
--- a/types/dom4/index.d.ts
+++ b/types/dom4/index.d.ts
@@ -60,11 +60,11 @@ interface Element extends ParentNode {
     matches(selectors: string): boolean;
 }
 
-interface Elements extends ElementTraversal, ParentNode, Array {
+interface Elements extends ParentNode, Array {
 }
 
-interface Document extends ElementTraversal, ParentNode {
+interface Document extends ParentNode {
 }
 
-interface DocumentFragment extends ElementTraversal, ParentNode {
+interface DocumentFragment extends ParentNode {
 }
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/downloadjs/downloadjs-tests.ts b/types/downloadjs/downloadjs-tests.ts
index 00bb5395ef..da110af46d 100644
--- a/types/downloadjs/downloadjs-tests.ts
+++ b/types/downloadjs/downloadjs-tests.ts
@@ -7,6 +7,6 @@ download(new Blob(['hello world']), 'dlTextBlob.txt', 'text/plain');
 
 download('/robots.txt');
 
-download(document.documentElement.outerHTML, 'dlHTML.html', 'text/html');
+download(document.documentElement!.outerHTML, 'dlHTML.html', 'text/html');
 download(new Blob(['hello world'.bold()]), 'dlHtmlBlob.html', 'text/html');
 download('/diff6.png');
diff --git a/types/draft-js/index.d.ts b/types/draft-js/index.d.ts
index 4064c9b8a0..06cb8f55f2 100644
--- a/types/draft-js/index.d.ts
+++ b/types/draft-js/index.d.ts
@@ -9,7 +9,7 @@
 //                 Santiago Vilar 
 //                 Ulf Schwekendiek 
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-// TypeScript Version: 2.6
+// TypeScript Version: 2.8
 
 import * as React from 'react';
 import * as Immutable from 'immutable';
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/echarts/index.d.ts b/types/echarts/index.d.ts
index 15892864e5..bfbd7af809 100644
--- a/types/echarts/index.d.ts
+++ b/types/echarts/index.d.ts
@@ -1,122 +1,414 @@
-// Type definitions for echarts
+// Type definitions for echarts 4.1.0
 // Project: http://echarts.baidu.com/
 // Definitions by: Xie Jingyang 
 //                 AntiMoron 
 //                 Liveangela 
+//                 Ovilia 
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
 // TypeScript Version: 2.3
 
 declare namespace echarts {
-    function init(dom: HTMLDivElement | HTMLCanvasElement, theme?: object | string, opts?: {
-        devicePixelRatio?: number
-        renderer?: string
-        width?: number | string
-        height?: number | string
-    }): ECharts;
+    /**
+     * Creates an ECharts instance, and returns an echartsInstance. You shall
+     *     not initialize multiple ECharts instances on a single container.
+     *
+     * @param {HTMLDivElement | HTMLCanvasElement} dom Instance container,
+     *     usually is a `div` element with height and width defined.
+     * @param {object | string} [theme] Theme to be applied.
+     *     This can be a configuring object of a theme, or a theme name
+     *     registered through [echarts.registerTheme](https://echarts.apache.org/api.html#echarts.registerTheme).
+     * @param {object} [opts] Chart configurations.
+     * @param {number} [opts.devicePixelRatio] Ratio of one physical pixel to
+     *     the size of one device independent pixels. Browser's
+     *     `window.devicePixelRatio` is used by default.
+     * @param {string} [opts.renderer] Supports `'canvas'` or `'svg'`.
+     *     See [Render by Canvas or SVG](https://echarts.apache.org/tutorial.html#Render%20by%20Canvas%20or%20SVG).
+     * @param {number} [opts.width] Specify width explicitly, in pixel.
+     *     If setting to `null`/`undefined`/`'auto'`, width of `dom`
+     *     (instance container) will be used.
+     * @param {number} [opts.height] Specify height explicitly, in pixel.
+     *     If setting to `null`/`undefined`/`'auto'`, height of `dom`
+     *     (instance container) will be used.
+     */
+    function init(
+        dom: HTMLDivElement | HTMLCanvasElement,
+        theme?: object | string,
+        opts?: {
+            devicePixelRatio?: number
+            renderer?: string
+            width?: number | string
+            height?: number | string
+        }
+    ): ECharts
 
-    const graphic: Graphic;
+    /**
+     * Connects interaction of multiple chart series. For example:
+     *
+        ```js
+        // set group id of each instance respectively.
+        chart1.group = 'group1';
+        chart2.group = 'group1';
+        echarts.connect('group1');
+        // or incoming instance array that need to be linked.
+        echarts.connect([chart1, chart2]);
+        ```
+     *
+     * @param group Group id in string, or array of chart instance.
+     */
+    function connect(group: string | ECharts[]): void
 
-    interface Graphic {
-        clipPointsByRect(points: number[][], rect: ERectangle): number[][];
-        clipRectByRect(targetRect: ERectangle, rect: ERectangle): ERectangle;
-        LinearGradient: { new(x: number, y: number, x2: number, y2: number, colorStops: object[], globalCoord?: boolean): LinearGradient }
-    }
+    /**
+     * Disconnects interaction of multiple chart series. To have one single
+     * instance to be removed, you can set `group` of chart instance to be null.
+     *
+     * @param {string} group Group id in string.
+     */
+    function disConnect(group: string): void
 
-    function connect(group: string | string[]): void;
+    /**
+     * Destroys chart instance, after which the instance cannot be used any
+     *     more.
+     *
+     * @param target Chart instance or container.
+     */
+    function dispose(target: ECharts | HTMLDivElement | HTMLCanvasElement)
+        : void
 
-    function disConnect(group: string): void;
+    /**
+     * Returns chart instance of dom container.
+     *
+     * @param target Chart container.
+     */
+    function getInstanceByDom(target: HTMLDivElement | HTMLCanvasElement)
+        : ECharts
 
-    function dispose(target: ECharts | HTMLDivElement | HTMLCanvasElement): void;
+    /**
+     * Registers available maps. This can only be used after including
+     * [geo](https://echarts.apache.org/option.html#geo)
+     * component or chart series of
+     * [map](https://echarts.apache.org/option.html#series-map).
+     *
+     * @param {string} mapName Map name, referring to `map` value set in
+     *     [geo](https://echarts.apache.org/option.html#geo)
+     *     component or
+     *     [map](https://echarts.apache.org/option.html#series-map).
+     * @param {object} geoJson Data in GeoJson format. See
+     *     [http://geojson.org/](http://geojson.org/) for more format information.
+     * @param {object} [specialAreas] Zoomed part of a specific area in the map
+     *     for better visual effect.
+     *     See [USA Population Estimates example](https://ecomfe.github.io/echarts-examples/public/editor.html?c=map-usa).
+     */
+    function registerMap(
+        mapName: string,
+        geoJson: object,
+        specialAreas?: object
+    ): void
 
-    function getInstanceByDom(target: HTMLDivElement | HTMLCanvasElement): ECharts;
-
-    function registerMap(mapName: string, geoJson: object, specialAreas?: object): void;
-
-    function registerTheme(themeName: string, theme: object): void;
+    /**
+     * Registers a theme, should be specified when
+     * [initialize the chart instance](https://echarts.apache.org/api.html#echarts.init).
+     *
+     * @param {string} themeName Theme name.
+     * @param {object} theme Theme configurations.
+     */
+    function registerTheme(themeName: string, theme: object): void
 
     interface MapObj {
-        /** geoJson data for map */
+        /**
+         * geoJson data for map
+         */
         geoJson: object,
-        /** special areas fro map */
+        /**
+         * special areas fro map
+         */
         specialAreas: object
     }
 
-    function getMap(mapName: string): MapObj;
+    /**
+     * Get a registed map.
+     *
+     * @param {string} mapName Map name.
+     * @return {MapObj} Map data.
+     */
+    function getMap(mapName: string): MapObj
 
-    interface LinearGradient {
-        colorStops: object[];
-        global: boolean;
-        type: string;
-        x: number
-        x2: number
-        y: number
-        y2: number
+    /**
+     * Util methods about graphics.
+     */
+    const graphic: Graphic;
+
+    interface Graphic {
+        /**
+         * Clip the given points by the given rectangular.
+         *
+         * @param {number[][]} points The points to be clipped,
+         *     like [[23, 44], [12, 15], ...].
+         * @param {ERectangle} rect The rectangular that is used to clip points.
+         */
+        clipPointsByRect(points: number[][], rect: ERectangle): number[][];
+
+        /**
+         * Clip the first input rectangular by the second input rectangular.
+         *
+         * @param {ERectangle} targetRect The rectangular to be clipped.
+         * @param {ERectangle} rect The rectangular that is used to clip
+         *     targetRect.
+         */
+        clipRectByRect(targetRect: ERectangle, rect: ERectangle): ERectangle;
     }
 
     interface ECharts {
+        /**
+         * Group name to be used in chart connection
+         */
         group: string
 
-        setOption(option: EChartOption, notMerge?: boolean, notRefreshImmediately?: boolean): void
+        /**
+         * Configuration item, data, universal interface, all parameters and
+         *     data can all be modified through `setOption`. ECharts will merge
+         *     new parameters and data, and then refresh chart.
+         *
+         * @param {EChartOption} option Configuration item and data. Please
+         *     refer to [configuration item manual](https://echarts.apache.org/option.html)
+         *     for more information.
+         * @param {boolean} [notMerge=false] Whether not to merge with previous
+         *     `option`
+         * @param {boolean} [lazyUpdate=false] Whether not to update chart
+         *     immediately
+         */
+        setOption(
+            option: EChartOption,
+            notMerge?: boolean,
+            lazyUpdate?: boolean
+        ) : void
 
+        /**
+         * Configuration item, data, universal interface, all parameters and
+         *     data can all be modified through `setOption`. ECharts will merge
+         *     new parameters and data, and then refresh chart.
+         *
+         * @param {EChartOption} option Configuration item and data. Please
+         *     refer to [configuration item manual](https://echarts.apache.org/option.html)
+         *     for more information.
+         * @param {EChartsOptionConfig} [opts] Options about how to setOption
+         */
+        setOption(option: EChartOption, opts?: EChartsOptionConfig): void
+
+        /**
+         * Gets width of ECharts instance container.
+         *
+         * @return {number} Width.
+         */
         getWidth(): number
 
+        /**
+         * Gets height of ECharts instance container.
+         *
+         * @return {number} Height.
+         */
         getHeight(): number
 
+        /**
+         * Gets DOM element of ECharts instance container.
+         *
+         * @return {HTMLCanvasElement|HTMLDivElement} DOM container.
+         */
         getDom(): HTMLCanvasElement | HTMLDivElement
 
-        getOption(): object
+        /**
+         * Gets `option` object maintained in current instance, which contains
+         *     configuration item and data merged from previous `setOption`
+         *     operations by users, along with user interaction states.
+         *     For example, switching of legend, zooming area of data zoom,
+         *     and so on. Therefore, a new instance that is exactly the same
+         *     can be recovered from this option.
+         */
+        getOption(): EChartOption
 
-        resize(): void
+        /**
+         * Resizes chart, which should be called manually when container size
+         *     changes. When `opts` is not provided, DOM size is used.
+         *
+         * @param {EChartsResizeOption} opts Specify parameters explicitly.
+         */
+        resize(opts?: EChartsResizeOption): void
 
+        /**
+         * Triggers chart action, like chart switch `legendToggleSelect`,
+         *     zoom data area `dataZoom`, show tooltip `showTip` and so on.
+         *     See [action](https://echarts.apache.org/api.html#action) and
+         *     [events](https://echarts.apache.org/api.html#events)
+         *     for more information.
+         *
+         * @param payload Trigger multiple actions through `batch` attribute.
+         */
         dispatchAction(payload: object): void
 
+        /**
+         * Binds event-handling function.
+         *     There are two kinds of events in ECharts, one of which is mouse
+         *     events, which will be triggered when the mouse clicks certain
+         *     element in the chart, the other kind will be triggered after
+         *     `dispatchAction` is called. Every action has a corresponding
+         *     event.
+         *     If event is triggered externally by `dispatchAction`, and there
+         *     is batch attribute in action to trigger batch action, then the
+         *     corresponding response event parameters be in batch.
+         *
+         * @param {string} eventName Event names are all in lower-cases,
+         *     for example, `'click'`, `'mousemove'`, `'legendselected'`
+         * @param {Function} handler Event-handling function, whose format
+         *     is as following:
+            ```js
+            (event: object)
+            ```
+         * @param {object} [context] context of callback function, what
+         *     `this` refers to.
+         */
         on(eventName: string, handler: Function, context?: object): void
 
+        /**
+         * Unbind event-handler function.
+         *
+         * @param {string} eventName Event names are all in lower-cases,
+         *     for example, `'click'`, `'mousemove'`, `'legendselected'`
+         * @param {Function} [handler] The function to be unbound could be
+         *     passed. Otherwise, all event functions of this type will be
+         *     unbound.
+         */
         off(eventName: string, handler?: Function): void
 
-        showLoading(type?: string, opts?: object): void
+        /**
+         * Convert a point from logical coordinate (e.g., in geo, cartesian,
+         *     graph, ...) to pixel coordinate.
+         *
+         * @param {EChartsConvertFinder} finder Indicate in which coordinate
+         *     system conversion is performed.
+         *     Generally, index or id or name can be used to specify
+         *     coordinate system.
+         * @param {string | any[]} value The value to be converted.
+         */
+        convertToPixel(finder: EChartsConvertFinder, value: string | any[])
+            : string | any[]
 
+        /**
+         * Convert a point from pixel coordinate to logical coordinate
+         *     (e.g., in geo, cartesian, graph, ...).
+         *
+         * @param {EChartsConvertFinder} finder Indicate in which coordinate
+         *     system conversion is performed.
+         *     Generally, index or id or name can be used to specify
+         *     coordinate system.
+         * @param {string | any[]} value The value to be converted.
+         */
+        convertFromPixel(finder: EChartsConvertFinder, value: any[] | string)
+            : any[] | string
+
+        /**
+         * Determine whether the given point is in the given coordinate systems or series.
+         *
+         * @param {EChartsConvertFinder} finder Indicate in which coordinate
+         *     system conversion is performed.
+         *     Generally, index or id or name can be used to specify
+         *     coordinate system.
+         * @param {string | any[]} value The value to be judged, in pixel
+         *     coordinate system.
+         */
+        containPixel(finder: EChartsConvertFinder, value: any[]): boolean
+
+        /**
+         * Shows loading animation. You can call this interface manually before
+         *     data is loaded, and call `hideLoading` to hide loading animation
+         *     after data is loaded.
+         *
+         * @param {string} [type='default']
+         * @param {EChartsLoadingOption} [opts]
+         */
+        showLoading(type?: string, opts?: EChartsLoadingOption): void
+
+        /**
+         * Hides animation loading effect.
+         */
         hideLoading(): void
 
+        /**
+         * Exports chart image; returns a base64 URL; can be set to `src` of
+         *      `Image`.
+         *
+         * @param opts Options.
+         */
         getDataURL(opts: {
-            /** 导出的格式,可选 png, jpeg */
+            // Exporting format, can be either png, or jpeg
             type?: string,
-            /** 导出的图片分辨率比例,默认为 1。*/
+            // Resolution ratio of exporting image, 1 by default.
             pixelRatio?: number,
-            /** 导出的图片背景色,默认使用 option 里的 backgroundColor */
-            backgroundColor?: string
+            // Background color of exporting image, use backgroundColor in
+            // option by default.
+            backgroundColor?: string,
+            // Excluded components list. e.g. ['toolbox']
+            excludeComponents?: string[]
         }): string
 
+        /**
+         * Exports connected chart image; returns a base64 url; can be set to
+         *     `src` of `Image`. Position of charts in exported image are
+         *     related to that of the container.
+         *
+         * @param opts Options.
+         */
         getConnectedDataURL(opts: {
-            /** 导出的格式,可选 png, jpeg */
+            // Exporting format, can be either png, or jpeg
             type: string,
-            /** 导出的图片分辨率比例,默认为 1。 */
+            // Resolution ratio of exporting image, 1 by default.
             pixelRatio: number,
-            /** 导出的图片背景色,默认使用 option 里的 backgroundColor */
-            backgroundColor: string
+            // Background color of exporting image, use backgroundColor in
+            // option by default.
+            backgroundColor: string,
+            // Excluded components list. e.g. ['toolbox']
+            excludeComponents?: string[]
         }): string
 
+        /**
+         * The method is used in rendering millions of data
+         *     (e.g. rendering geo data). In these scenario, the entire size of
+         *     data is probably up to 10 or 100 MB, even using binary format.
+         *     So chunked load data and rendering is required. When using
+         *     `appendData`, the graphic elements that have been rendered will
+         *     not be cleared, but keep rendering new graphic elements.
+         *
+         * @param opts Data options.
+         */
+        appendData(opts: {
+            // Specify which series the data will be appended to.
+            seriesIndex?: string,
+            // The data to be appended.
+            data?: any[]|TypedArray,
+        }): void
+
+        /**
+         * Clears current instance; removes all components and charts in
+         *     current instance.
+         */
         clear(): void
 
+        /**
+         * Returns whether current instance has been disposed.
+         *
+         * @return {boolean} Whether has been disposed.
+         */
         isDisposed(): boolean
 
+        /**
+         * Disposes instance. Once disposed, the instance can not be used again.
+         */
         dispose(): void
-
-        /** 转换逻辑点到像素 */
-        convertToPixel(finder: ConvertFinder | string, value: string | any[]): string | any[]
-
-        convertFromPixel(finder: ConvertFinder | string, value: any[] | string): any[] | string
-
-        containPixel(finder: ConvertFinder | string,
-            /** 要被判断的点,为像素坐标值,以 echarts 实例的 dom 节点的左上角为坐标 [0, 0] 点。*/
-            value: any[]): boolean
-
-        getModel(): {
-            getComponent(finder: string): any;
-        }
     }
 
-    interface ConvertFinder {
+    type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array
+        | Int32Array | Uint32Array | Uint8ClampedArray | Float32Array
+        | Float64Array;
+
+    interface EChartsConvertFinder {
         seriesIndex?: number,
         seriesId?: string,
         seriesName?: string,
@@ -193,6 +485,29 @@ declare namespace echarts {
         zAxis3D?: object
     }
 
+    interface EChartsOptionConfig {
+        notMerge?: boolean,
+        lazyUpdate?: boolean,
+        silent?: boolean
+    }
+
+    interface EChartsResizeOption {
+        /**
+         * Chart width.
+         */
+        width?: number | string,
+
+        /**
+         * Chart height.
+         */
+        heiight?: number | string,
+
+        /**
+         * Specify whether or not to prevent triggering events.
+         */
+        silent?: boolean
+    }
+
     interface EChartTitleOption {
         show?: boolean;
         text?: string;
@@ -219,6 +534,38 @@ declare namespace echarts {
         shadowOffsetX?: number,
         shadowOffsetY?: number,
     }
+
+    interface EChartsLoadingOption {
+        /**
+         * Loading text.
+         * @default 'loading'
+         */
+        text?: string,
+
+        /**
+         * Loading circle color.
+         * @default '#c23531'
+         */
+        color?: string,
+
+        /**
+         * Loading text color.
+         * @default '#000'
+         */
+        textColor?: string,
+
+        /**
+         * Mask background color.
+         * @default 'rgba(255, 255, 255, 0.8)'
+         */
+        maskColor?: string,
+
+        /**
+         * Zlevel of loading. If not 0, it creates a new canvas for loading.
+         * @default 0
+         */
+        zlevel?: 0
+    }
 }
 
 declare module 'echarts' {
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/react-dnd-html5-backend/tsconfig.json b/types/ecma-proposal-math-extensions/tsconfig.json
similarity index 79%
rename from types/react-dnd-html5-backend/tsconfig.json
rename to types/ecma-proposal-math-extensions/tsconfig.json
index dca11ac9e1..52115765eb 100644
--- a/types/react-dnd-html5-backend/tsconfig.json
+++ b/types/ecma-proposal-math-extensions/tsconfig.json
@@ -5,9 +5,10 @@
             "es6",
             "dom"
         ],
+        "target": "es2017",
         "noImplicitAny": true,
         "noImplicitThis": true,
-        "strictNullChecks": false,
+        "strictNullChecks": true,
         "strictFunctionTypes": true,
         "baseUrl": "../",
         "typeRoots": [
@@ -19,6 +20,6 @@
     },
     "files": [
         "index.d.ts",
-        "react-dnd-html5-backend-tests.ts"
+        "ecma-proposal-math-extensions-tests.ts"
     ]
-}
\ No newline at end of file
+}
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-devtools-installer/electron-devtools-installer-tests.ts b/types/electron-devtools-installer/electron-devtools-installer-tests.ts
index 798e6ad223..ddc7711afe 100644
--- a/types/electron-devtools-installer/electron-devtools-installer-tests.ts
+++ b/types/electron-devtools-installer/electron-devtools-installer-tests.ts
@@ -7,7 +7,6 @@ import installExtension, {
     MOBX_DEVTOOLS
 } from 'electron-devtools-installer';
 
-
 installExtension(EMBER_INSPECTOR);
 installExtension(REACT_DEVELOPER_TOOLS);
 installExtension(BACKBONE_DEBUGGER);
@@ -19,4 +18,7 @@ installExtension(REACT_PERF);
 installExtension(CYCLEJS_DEVTOOL);
 installExtension(APOLLO_DEVELOPER_TOOLS);
 installExtension(MOBX_DEVTOOLS);
-installExtension('abcdefghijkl');
\ No newline at end of file
+installExtension('abcdefghijkl');
+installExtension([EMBER_INSPECTOR, JQUERY_DEBUGGER]);
+installExtension(['extension', 'another-extension']);
+installExtension([REACT_DEVELOPER_TOOLS, 'MOBX_DEVTOOLS']);
diff --git a/types/electron-devtools-installer/index.d.ts b/types/electron-devtools-installer/index.d.ts
index 88649cd0a8..92d94044d7 100644
--- a/types/electron-devtools-installer/index.d.ts
+++ b/types/electron-devtools-installer/index.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for electron-devtools-installer v2.0.1
+// Type definitions for electron-devtools-installer v2.2.4
 // Project: https://github.com/MarshallOfSound/electron-devtools-installer
 // Definitions by: Robin Van den Broeck 
 //                 M. Fatih Mar 
@@ -11,7 +11,7 @@ declare module "electron-devtools-installer" {
     }
 
     // Default installation function
-    export default function (extensionReference: ExtensionReference | string, forceDownload?: boolean): Promise;
+    export default function (extensionReference: ExtensionReference | string | Array, forceDownload?: boolean): Promise;
 
     // Devtools themself
     export const EMBER_INSPECTOR: ExtensionReference;
@@ -25,4 +25,4 @@ declare module "electron-devtools-installer" {
     export const CYCLEJS_DEVTOOL: ExtensionReference;
     export const APOLLO_DEVELOPER_TOOLS: ExtensionReference;
     export const MOBX_DEVTOOLS: ExtensionReference;
-}
\ No newline at end of file
+}
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/electron-unhandled/electron-unhandled-tests.ts b/types/electron-unhandled/electron-unhandled-tests.ts
new file mode 100644
index 0000000000..42444658f8
--- /dev/null
+++ b/types/electron-unhandled/electron-unhandled-tests.ts
@@ -0,0 +1,5 @@
+import * as unhandled from "electron-unhandled";
+
+unhandled({ logger: 'foo' }); // $ExpectError
+unhandled({ showDialog: 'bar' }); // $ExpectError
+unhandled({ logger: (err: Error) => {}, showDialog: true }); // $ExpectType void
diff --git a/types/electron-unhandled/index.d.ts b/types/electron-unhandled/index.d.ts
new file mode 100644
index 0000000000..d560e05b80
--- /dev/null
+++ b/types/electron-unhandled/index.d.ts
@@ -0,0 +1,15 @@
+// Type definitions for electron-unhandled 1.1
+// Project: https://github.com/sindresorhus/electron-unhandled
+// Definitions by: Olegs Jeremejevs 
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+declare namespace unhandled {
+  interface Options {
+    logger?: (err: Error) => void;
+    showDialog?: boolean;
+  }
+}
+
+declare function unhandled(options?: unhandled.Options): void;
+
+export = unhandled;
diff --git a/types/electron-unhandled/tsconfig.json b/types/electron-unhandled/tsconfig.json
new file mode 100644
index 0000000000..fa790385fe
--- /dev/null
+++ b/types/electron-unhandled/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",
+        "electron-unhandled-tests.ts"
+    ]
+}
diff --git a/types/electron-unhandled/tslint.json b/types/electron-unhandled/tslint.json
new file mode 100644
index 0000000000..3db14f85ea
--- /dev/null
+++ b/types/electron-unhandled/tslint.json
@@ -0,0 +1 @@
+{ "extends": "dtslint/dt.json" }
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/index.d.ts b/types/ember/index.d.ts
index a15987ae83..93babaa0a7 100755
--- a/types/ember/index.d.ts
+++ b/types/ember/index.d.ts
@@ -311,6 +311,10 @@ declare module 'ember' {
              * Given a fullName return a corresponding instance.
              */
             lookup(fullName: string, options?: {}): any;
+            /**
+             * Given a fullName return a corresponding factory.
+             */
+            factoryFor(fullName: string, options?: {}): any;
         }
         const _ContainerProxyMixin: Mixin<_ContainerProxyMixin>;
 
@@ -324,11 +328,11 @@ declare module 'ember' {
              */
             resolveRegistration(fullName: string): Function;
             /**
-             * Registers a factory that can be used for dependency injection (with
+             * Registers a factory or value that can be used for dependency injection (with
              * `inject`) or for service lookup. Each factory is registered with
              * a full name including two parts: `type:name`.
              */
-            register(fullName: string, factory: Function, options?: { singleton?: boolean, instantiate?: boolean }): any;
+            register(fullName: string, factory: any, options?: { singleton?: boolean, instantiate?: boolean }): any;
             /**
              * Unregister a factory.
              */
@@ -476,6 +480,11 @@ declare module 'ember' {
             **/
             Router: Router;
             registry: Registry;
+            /**
+             *  Initialize the application and return a promise that resolves with the `Application`
+             *  object when the boot process is complete.
+             */
+            boot(): Promise;
         }
         /**
         The `ApplicationInstance` encapsulates all of the stateful aspects of a
@@ -1107,6 +1116,12 @@ declare module 'ember' {
              * Unregister a factory.
              */
             unregister(fullName: string): any;
+
+            /**
+             *  Initialize the `EngineInstance` and return a promise that resolves
+             *  with the instance itself when the boot process is complete.
+             */
+            boot(): Promise;
         }
         /**
          * This mixin defines the common interface implemented by enumerable objects
@@ -3357,7 +3372,48 @@ declare module 'ember' {
     /**
      * The Router service is the public API that provides component/view layer access to the router.
      */
-    class RouterService extends Ember.Service {
+    export class RouterService extends Ember.Service {
+        //
+        /**
+             Name of the current route.
+            This property represent the logical name of the route,
+            which is comma separated.
+            For the following router:
+            ```app/router.js
+            Router.map(function() {
+            this.route('about');
+            this.route('blog', function () {
+                this.route('post', { path: ':post_id' });
+            });
+            });
+            ```
+            It will return:
+            * `index` when you visit `/`
+            * `about` when you visit `/about`
+            * `blog.index` when you visit `/blog`
+            * `blog.post` when you visit `/blog/some-post-id`
+        */
+        readonly currentRouteName: string;
+        //
+        /**
+             Current URL for the application.
+            This property represent the URL path for this route.
+            For the following router:
+            ```app/router.js
+            Router.map(function() {
+            this.route('about');
+            this.route('blog', function () {
+                this.route('post', { path: ':post_id' });
+            });
+            });
+            ```
+            It will return:
+            * `/` when you visit `/`
+            * `/about` when you visit `/about`
+            * `/blog` when you visit `/blog`
+            * `/blog/some-post-id` when you visit `/blog/some-post-id`
+        */
+        readonly currentURL: string;
         //
         /**
          * Determines whether a route is active.
@@ -3761,6 +3817,11 @@ declare module '@ember/routing/router' {
     export default class EmberRouter extends Ember.Router { }
 }
 
+declare module '@ember/routing/router-service' {
+    import { RouterService } from 'ember';
+    export default class extends RouterService { }
+}
+
 declare module '@ember/runloop' {
     import Ember from 'ember';
     export const begin: typeof Ember.run.begin;
diff --git a/types/ember/test/application-instance.ts b/types/ember/test/application-instance.ts
index dfda446463..9ae22e5f26 100644
--- a/types/ember/test/application-instance.ts
+++ b/types/ember/test/application-instance.ts
@@ -1,4 +1,5 @@
 import ApplicationInstance from '@ember/application/instance';
+import hbs from 'htmlbars-inline-precompile';
 
 const appInstance = ApplicationInstance.create();
 appInstance.register('some:injection', class Foo {});
@@ -11,7 +12,18 @@ appInstance.register('some:injection', class Foo {}, {
   instantiate: false,
 });
 
+appInstance.register('templates:foo/bar', hbs`

Hello World

`); + appInstance.register('some:injection', class Foo {}, { singleton: false, instantiate: true, }); + +appInstance.factoryFor('router:main'); +appInstance.lookup('route:basic'); + +appInstance.boot(); + +(async function() { + await appInstance.boot(); +}()); diff --git a/types/ember/test/engine-instance.ts b/types/ember/test/engine-instance.ts new file mode 100644 index 0000000000..c74914dea5 --- /dev/null +++ b/types/ember/test/engine-instance.ts @@ -0,0 +1,26 @@ +import EngineInstance from '@ember/engine/instance'; + +const engineInstance = EngineInstance.create(); +engineInstance.register('some:injection', class Foo {}); + +engineInstance.register('some:injection', class Foo {}, { + singleton: true, +}); + +engineInstance.register('some:injection', class Foo {}, { + instantiate: false, +}); + +engineInstance.register('some:injection', class Foo {}, { + singleton: false, + instantiate: true, +}); + +engineInstance.factoryFor('router:main'); +engineInstance.lookup('route:basic'); + +engineInstance.boot(); + +(async function() { + await engineInstance.boot(); +}()); diff --git a/types/ember/test/router.ts b/types/ember/test/router.ts index ff5f4c554f..760e9ed5bc 100755 --- a/types/ember/test/router.ts +++ b/types/ember/test/router.ts @@ -1,4 +1,5 @@ import Ember from 'ember'; +import { assertType } from './lib/assert'; const AppRouter = Ember.Router.extend({ }); @@ -25,6 +26,12 @@ AppRouter.map(function() { const RouterServiceConsumer = Ember.Service.extend({ router: Ember.inject.service('router'), + currentRouteName() { + const x: string = Ember.get(this, 'router').currentRouteName; + }, + currentURL() { + const x: string = Ember.get(this, 'router').currentURL; + }, transitionWithoutModel() { Ember.get(this, 'router') .transitionTo('some-route'); diff --git a/types/ember/tsconfig.json b/types/ember/tsconfig.json index b4bc966044..676c107f72 100755 --- a/types/ember/tsconfig.json +++ b/types/ember/tsconfig.json @@ -23,6 +23,7 @@ "test/lib/assert.ts", "test/application.ts", "test/application-instance.ts", + "test/engine-instance.ts", "test/ember-tests.ts", "test/error.ts", "test/event.ts", diff --git a/types/emoji-mart/dist-es/components/category.d.ts b/types/emoji-mart/dist-es/components/category.d.ts index 8cd4ceefbb..efa52e9988 100644 --- a/types/emoji-mart/dist-es/components/category.d.ts +++ b/types/emoji-mart/dist-es/components/category.d.ts @@ -1,12 +1,11 @@ import React = require('react'); -import { EmojiData } from '..'; - -import { Emoji, EmojiProps, I18n } from '.'; +import { Emoji, EmojiData, EmojiProps, I18n, CategoryName } from '..'; export interface Props { emojis?: Array; hasStickyPosition?: boolean; + id: CategoryName; name: string; native: boolean; perLine: number; diff --git a/types/emoji-mart/dist-es/components/emoji.d.ts b/types/emoji-mart/dist-es/components/emoji.d.ts deleted file mode 100644 index 030ff7ce12..0000000000 --- a/types/emoji-mart/dist-es/components/emoji.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import React = require('react'); - -import { EmojiData, EmojiSkin } from '..'; - -export type BackgroundImageFn = (set: EmojiSet, sheetSize: EmojiSheetSize) => string; -export type EmojiSet = 'apple'|'google'|'twitter'|'emojione'|'messenger'|'facebook'; -export type EmojiSheetSize = 16|20|32|64; - -export interface Props { - onOver?(emoji: EmojiData, e: React.MouseEvent): void; - onLeave?(emoji: EmojiData, e: React.MouseEvent): void; - onClick?(emoji: EmojiData, e: React.MouseEvent): void; - /** defaults to returning a png from unpkg.com-hosted emoji-datasource-${set} */ - backgroundImageFn?: BackgroundImageFn; - native?: boolean; - forceSize?: boolean; - tooltip?: boolean; - /** defaults to 1 */ - skin?: EmojiSkin; - /** defaults to 64 */ - sheetSize?: EmojiSheetSize; - /** defaults to 'apple' */ - set?: EmojiSet; - size: number; - emoji: string|EmojiData; -} - -// tslint:disable-next-line strict-export-declare-modifiers -declare const Emoji: React.SFC; - -export { Emoji as default }; diff --git a/types/emoji-mart/dist-es/components/emoji/emoji.d.ts b/types/emoji-mart/dist-es/components/emoji/emoji.d.ts new file mode 100644 index 0000000000..d86d2b686f --- /dev/null +++ b/types/emoji-mart/dist-es/components/emoji/emoji.d.ts @@ -0,0 +1,8 @@ +import React = require('react'); + +import { EmojiProps } from '../..'; + +// tslint:disable-next-line strict-export-declare-modifiers +declare const Emoji: React.StatelessComponent; + +export { Emoji as default }; diff --git a/types/emoji-mart/dist-es/components/emoji/nimble-emoji.d.ts b/types/emoji-mart/dist-es/components/emoji/nimble-emoji.d.ts new file mode 100644 index 0000000000..77888f5a94 --- /dev/null +++ b/types/emoji-mart/dist-es/components/emoji/nimble-emoji.d.ts @@ -0,0 +1,12 @@ +import React = require('react'); + +import { EmojiProps, Data } from '../..'; + +export interface NimbleEmojiProps extends EmojiProps { + data: Data; +} + +// tslint:disable-next-line strict-export-declare-modifiers +declare const NimbleEmoji: React.SFC; + +export { NimbleEmoji as default }; diff --git a/types/emoji-mart/dist-es/components/index.d.ts b/types/emoji-mart/dist-es/components/index.d.ts index 6fc29ecd54..3f05ca5c82 100644 --- a/types/emoji-mart/dist-es/components/index.d.ts +++ b/types/emoji-mart/dist-es/components/index.d.ts @@ -1,4 +1,6 @@ // The other exports on the components folder are not public API export { default as Category, Props as CategoryProps } from './category'; -export { default as Emoji, Props as EmojiProps, BackgroundImageFn, EmojiSet, EmojiSheetSize } from './emoji'; -export { default as Picker, Props as PickerProps, I18n, PartialI18n, CustomEmoji } from './picker'; +export { default as Emoji } from './emoji/emoji'; +export { default as NimbleEmoji, NimbleEmojiProps } from './emoji/nimble-emoji'; +export { default as Picker } from './picker/picker'; +export { default as NimblePicker, NimblePickerProps } from './picker/nimble-picker'; diff --git a/types/emoji-mart/dist-es/components/picker.d.ts b/types/emoji-mart/dist-es/components/picker.d.ts deleted file mode 100644 index 9f9132df05..0000000000 --- a/types/emoji-mart/dist-es/components/picker.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -import React = require('react'); - -import { EmojiData, EmojiSkin } from '..'; - -import { Category, Emoji, EmojiProps, BackgroundImageFn, EmojiSet, EmojiSheetSize } from '.'; - -// tslint:disable-next-line interface-name -export interface I18n { - search: string; - categories: Record<'search'|'recent'|'people'|'nature'|'foods'|'activity'|'places'|'objects'|'symbols'|'flags'|'custom', string>; - notfound: string; -} - -export type PartialI18n = Partial & { categories: Partial}>; - -export interface CustomEmoji { - // id is overridden by short_names[0] - name: string; - /** Must contain at least one name. The first name is used as the unique id. */ - short_names: string[]; - emoticons?: string[]; - keywords?: string[]; - imageUrl: string; -} - -export interface Props { - /** NOTE: default is not preventable */ - onClick?(emoji: EmojiData, e: React.MouseEvent): void; - perLine?: number; - emojiSize?: number; - i18n?: PartialI18n; - style?: React.CSSProperties; - title?: string; - emoji?: string; - color?: string; - set?: EmojiSet; - skin?: EmojiSkin; - native?: boolean; - backgroundImageFn?: BackgroundImageFn; - sheetSize?: EmojiSheetSize; - emojisToShowFilter?(emoji: EmojiData): boolean; - showPreview?: boolean; - emojiTooltip?: boolean; - include?: string[]; - exclude?: string[]; - recent?: string[]; - autoFocus?: boolean; - /** NOTE: custom emoji are copied into a singleton object on every new mount */ - custom: CustomEmoji[]; -} - -export default class Picker extends React.PureComponent { - // everything inside it is supposed to be private -} diff --git a/types/emoji-mart/dist-es/components/picker/nimble-picker.d.ts b/types/emoji-mart/dist-es/components/picker/nimble-picker.d.ts new file mode 100644 index 0000000000..cc564b2a5e --- /dev/null +++ b/types/emoji-mart/dist-es/components/picker/nimble-picker.d.ts @@ -0,0 +1,11 @@ +import React = require('react'); + +import { Data, PickerProps } from '../..'; + +export interface NimblePickerProps extends PickerProps { + data: Data; +} + +export default class NimblePicker extends React.PureComponent { + // everything inside it is supposed to be private +} diff --git a/types/emoji-mart/dist-es/components/picker/picker.d.ts b/types/emoji-mart/dist-es/components/picker/picker.d.ts new file mode 100644 index 0000000000..01f8a41f8b --- /dev/null +++ b/types/emoji-mart/dist-es/components/picker/picker.d.ts @@ -0,0 +1,7 @@ +import React = require('react'); + +import { PickerProps } from '../..'; + +export default class Picker extends React.PureComponent { + // everything inside it is supposed to be private +} diff --git a/types/emoji-mart/dist-es/index.d.ts b/types/emoji-mart/dist-es/index.d.ts index e49d37fcf6..bb0c79be3e 100644 --- a/types/emoji-mart/dist-es/index.d.ts +++ b/types/emoji-mart/dist-es/index.d.ts @@ -1,15 +1,30 @@ -export { default as emojiIndex, EmojiData, EmojiSkin } from './utils/emoji-index'; export { default as store, StoreHandlers } from './utils/store'; export { default as frequently } from './utils/frequently'; +export { Data } from './utils/data'; + +export { + PickerProps, + EmojiProps, + I18n, + PartialI18n, + CategoryName +} from './utils/shared-props'; + +export { + emojiIndex, + nimbleEmojiIndex, + EmojiData, + CustomEmoji, + EmojiSkin +} from './utils/emoji-index'; export { Picker, - PickerProps, - I18n, - PartialI18n, - CustomEmoji, + NimblePicker, + NimblePickerProps, Emoji, - EmojiProps, + NimbleEmoji, + NimbleEmojiProps, Category, CategoryProps } from './components'; diff --git a/types/emoji-mart/dist-es/utils/data.d.ts b/types/emoji-mart/dist-es/utils/data.d.ts new file mode 100644 index 0000000000..ad1bc0d229 --- /dev/null +++ b/types/emoji-mart/dist-es/utils/data.d.ts @@ -0,0 +1,73 @@ +export interface Data { + compressed: boolean; + categories: Category[]; + emojis: { [key: string]: Emoji }; + aliases: { [key: string]: string }; +} + +export interface Category { + id: string; + name: string; + emojis: string[]; +} + +export interface Emoji { + name?: string; + a?: string; + unified?: string; + b?: string; + non_qualified?: string; + c?: string; + has_img_apple?: boolean; + d?: boolean; + has_img_google?: boolean; + e?: boolean; + has_img_twitter?: boolean; + f?: boolean; + has_img_emojione?: boolean; + g?: boolean; + has_img_facebook?: boolean; + h?: boolean; + has_img_messenger?: boolean; + i?: boolean; + keywords?: string[]; + j?: string[]; + sheet?: number[]; + k?: number[]; + emoticons?: string[]; + l?: string[]; + text?: string; + m?: string; + short_names?: string[]; + n?: string[]; + added_in?: number; + o?: number; + sheet_x?: number; + sheet_y?: number; + skin_variations?: { [key: string]: SkinVariation }; + obsoleted_by?: string; + obsoletes?: string; +} + +export interface SkinVariation { + unified: string; + non_qualified: null | string; + image: string; + sheet_x: number; + sheet_y: number; + added_in: string; + has_img_apple: boolean; + has_img_google: boolean; + has_img_twitter: boolean; + has_img_emojione: boolean; + has_img_facebook: boolean; + has_img_messenger: boolean; + obsoleted_by?: string; + obsoletes?: string; +} + +export function buildSearch(emoji: Emoji): string; + +export function compress(emoji: Emoji): void; + +export function uncompress(data: Data): void; diff --git a/types/emoji-mart/dist-es/utils/emoji-index.d.ts b/types/emoji-mart/dist-es/utils/emoji-index.d.ts deleted file mode 100644 index c6499e663c..0000000000 --- a/types/emoji-mart/dist-es/utils/emoji-index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -export type EmojiSkin = 1|2|3|4|5|6; - -export interface EmojiData { - id: string; - name: string; - colons: string; - /** Reverse mapping to keyof emoticons */ - emoticons: string[]; - unified: string; - skin: EmojiSkin|null; - native: string; -} - -// tslint:disable-next-line strict-export-declare-modifiers -declare const _default: { - search(query: ''): null - search(query: string): EmojiData|null - - emojis: { [emoji: string]: EmojiData } - - /** Mapping of string to keyof emojis */ - emoticons: { [emoticon: string]: string } -}; - -export { _default as default }; diff --git a/types/emoji-mart/dist-es/utils/emoji-index/emoji-index.d.ts b/types/emoji-mart/dist-es/utils/emoji-index/emoji-index.d.ts new file mode 100644 index 0000000000..0d1d6b8881 --- /dev/null +++ b/types/emoji-mart/dist-es/utils/emoji-index/emoji-index.d.ts @@ -0,0 +1,14 @@ +import { EmojiData } from './nimble-emoji-index'; + +// tslint:disable-next-line strict-export-declare-modifiers +declare const _default: { + search(query: ''): null; + search(query: string): EmojiData|null; + + emojis: { [emoji: string]: EmojiData }; + + /** Mapping of string to keyof emojis */ + emoticons: { [emoticon: string]: string }; +}; + +export { _default as default }; diff --git a/types/emoji-mart/dist-es/utils/emoji-index/index.d.ts b/types/emoji-mart/dist-es/utils/emoji-index/index.d.ts new file mode 100644 index 0000000000..576a5d0cb7 --- /dev/null +++ b/types/emoji-mart/dist-es/utils/emoji-index/index.d.ts @@ -0,0 +1,2 @@ +export { default as emojiIndex } from './emoji-index'; +export { default as nimbleEmojiIndex, EmojiData, CustomEmoji, EmojiSkin } from './nimble-emoji-index'; diff --git a/types/emoji-mart/dist-es/utils/emoji-index/nimble-emoji-index.d.ts b/types/emoji-mart/dist-es/utils/emoji-index/nimble-emoji-index.d.ts new file mode 100644 index 0000000000..010c313d19 --- /dev/null +++ b/types/emoji-mart/dist-es/utils/emoji-index/nimble-emoji-index.d.ts @@ -0,0 +1,40 @@ +import { Data } from "../data"; + +import { CategoryName } from '../shared-props'; + +export type EmojiSkin = 1 | 2 | 3 | 4 | 5 | 6; + +export interface BaseEmoji { + id: string; + name: string; + colons: string; + /** Reverse mapping to keyof emoticons */ + emoticons: string[]; + unified: string; + skin: EmojiSkin | null; + native: string; +} + +export interface CustomEmoji { + // id is overridden by short_names[0] + id?: string; + // colons is overridden by :id: + colons?: string; + name: string; + /** Must contain at least one name. The first name is used as the unique id. */ + short_names: string[]; + emoticons?: string[]; + keywords?: string[]; + imageUrl: string; +} + +export type EmojiData = BaseEmoji | CustomEmoji; + +export default class NimbleEmojiIndex { + constructor(data: Data); + search(query: ''): null; + search(query: string): EmojiData[]|null; + emojis: { [emoji: string]: EmojiData }; + /** Mapping of string to keyof emojis */ + emoticons: { [emoticon: string]: string }; +} diff --git a/types/emoji-mart/dist-es/utils/shared-props.d.ts b/types/emoji-mart/dist-es/utils/shared-props.d.ts new file mode 100644 index 0000000000..c091e24556 --- /dev/null +++ b/types/emoji-mart/dist-es/utils/shared-props.d.ts @@ -0,0 +1,83 @@ +import React = require('react'); + +import { EmojiData, EmojiSkin, CustomEmoji } from './emoji-index/nimble-emoji-index'; + +export type BackgroundImageFn = (set: EmojiSet, sheetSize: EmojiSheetSize) => string; +export type EmojiSet = 'apple' | 'google' | 'twitter' | 'emojione' | 'messenger' | 'facebook'; +export type EmojiSheetSize = 16 | 20 | 32 | 64; + +export interface EmojiProps { + onOver?(emoji: EmojiData, e: React.MouseEvent): void; + onLeave?(emoji: EmojiData, e: React.MouseEvent): void; + onClick?(emoji: EmojiData, e: React.MouseEvent): void; + fallback?(emoji: EmojiData, props: EmojiProps): React.Component; + /** defaults to returning a png from unpkg.com-hosted emoji-datasource-${set} */ + backgroundImageFn?: BackgroundImageFn; + native?: boolean; + forceSize?: boolean; + tooltip?: boolean; + /** defaults to 1 */ + skin?: EmojiSkin; + /** defaults to 64 */ + sheetSize?: EmojiSheetSize; + /** defaults to 52 */ + sheetColumns?: number; + /** defaults to 52 */ + sheetRows?: number; + /** defaults to 'apple' */ + set?: EmojiSet; + size: number; + emoji: string | EmojiData; + html?: boolean; + /** data is omitted here as it should be used for NimbleEmoji only - not emoji */ +} + +export type CategoryName = 'search' | 'recent' | 'people' | 'nature' | 'foods' | 'activity' | 'places' | 'objects' | 'symbols' | 'flags' | 'custom'; + +// tslint:disable-next-line interface-name +export interface I18n { + search: string; + categories: Record; + notfound: string; + skintext: string; +} + +export type PartialI18n = Partial & { categories: Partial }>; + +export interface CustomIcons { + categories: Record React.Component>; +} + +export interface PickerProps { + /** NOTE: default is not preventable */ + onClick?(emoji: EmojiData, e: React.MouseEvent): void; + onSelect?(emoji: EmojiData): void; + onSkinChange?(skin: EmojiSkin): void; + perLine?: number; + emojiSize?: number; + i18n?: PartialI18n; + style?: React.CSSProperties; + title?: string; + emoji?: string; + color?: string; + set?: EmojiSet; + skin?: EmojiSkin; + defaultSkin?: EmojiSkin; + native?: boolean; + backgroundImageFn?: BackgroundImageFn; + sheetSize?: EmojiSheetSize; + emojisToShowFilter?(emoji: EmojiData): boolean; + showPreview?: boolean; + showSkinTones?: boolean; + emojiTooltip?: boolean; + include?: CategoryName[]; + exclude?: CategoryName[]; + recent?: string[]; + autoFocus?: boolean; + /** NOTE: custom emoji are copied into a singleton object on every new mount */ + custom: CustomEmoji[]; + skinEmoji?: string; + notFound?(): React.Component; + notFoundEmoji?: string; + icons?: CustomIcons; +} diff --git a/types/emoji-mart/emoji-mart-tests.tsx b/types/emoji-mart/emoji-mart-tests.tsx index 7b7b8d0471..56b05453a9 100644 --- a/types/emoji-mart/emoji-mart-tests.tsx +++ b/types/emoji-mart/emoji-mart-tests.tsx @@ -1,4 +1,4 @@ -// Port of https://github.com/missive/emoji-mart/blob/master/src/components/emoji.js +// Port of https://github.com/missive/emoji-mart/blob/v2.8.0/stories/index.js import React = require('react'); diff --git a/types/emoji-mart/index.d.ts b/types/emoji-mart/index.d.ts index 6a8ed65632..38acd9e021 100644 --- a/types/emoji-mart/index.d.ts +++ b/types/emoji-mart/index.d.ts @@ -1,9 +1,8 @@ -// Type definitions for emoji-mart 2.2 +// Type definitions for emoji-mart 2.8 // Project: https://github.com/missive/emoji-mart // Definitions by: Diogo Franco +// Nick Winans // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 - -// These definitions should work with 2.3, but the tests doesn't pass on 2.3. +// TypeScript Version: 2.8 export * from './dist-es'; diff --git a/types/emoji-mart/tsconfig.json b/types/emoji-mart/tsconfig.json index 6ecc944e77..d929a3cc01 100644 --- a/types/emoji-mart/tsconfig.json +++ b/types/emoji-mart/tsconfig.json @@ -20,11 +20,17 @@ "files": [ "index.d.ts", "dist-es/components/category.d.ts", - "dist-es/components/emoji.d.ts", + "dist-es/components/emoji/emoji.d.ts", + "dist-es/components/emoji/nimble-emoji.d.ts", "dist-es/components/index.d.ts", - "dist-es/components/picker.d.ts", - "dist-es/utils/emoji-index.d.ts", + "dist-es/components/picker/picker.d.ts", + "dist-es/components/picker/nimble-picker.d.ts", + "dist-es/utils/emoji-index/emoji-index.d.ts", + "dist-es/utils/emoji-index/nimble-emoji-index.d.ts", + "dist-es/utils/emoji-index/index.d.ts", + "dist-es/utils/data.d.ts", "dist-es/utils/frequently.d.ts", + "dist-es/utils/shared-props.d.ts", "dist-es/utils/store.d.ts", "dist-es/index.d.ts", "emoji-mart-tests.tsx" 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-adapter-react-15.4/index.d.ts b/types/enzyme-adapter-react-15.4/index.d.ts index 570cc22e99..2496fb1719 100644 --- a/types/enzyme-adapter-react-15.4/index.d.ts +++ b/types/enzyme-adapter-react-15.4/index.d.ts @@ -2,7 +2,7 @@ // Project: http://airbnb.io/enzyme/ // Definitions by: Nabeelah Ali // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { EnzymeAdapter } from 'enzyme'; diff --git a/types/enzyme-adapter-react-15/index.d.ts b/types/enzyme-adapter-react-15/index.d.ts index 90149cae55..06659d75b9 100644 --- a/types/enzyme-adapter-react-15/index.d.ts +++ b/types/enzyme-adapter-react-15/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/airbnb/enzyme // Definitions by: Tanguy Krotoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { EnzymeAdapter } from 'enzyme'; diff --git a/types/enzyme-adapter-react-16/index.d.ts b/types/enzyme-adapter-react-16/index.d.ts index 53f97ccce6..3e567d956b 100644 --- a/types/enzyme-adapter-react-16/index.d.ts +++ b/types/enzyme-adapter-react-16/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/airbnb/enzyme // Definitions by: Tanguy Krotoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { EnzymeAdapter } from 'enzyme'; diff --git a/types/enzyme-redux/index.d.ts b/types/enzyme-redux/index.d.ts index ad312d6d1f..e231119b89 100644 --- a/types/enzyme-redux/index.d.ts +++ b/types/enzyme-redux/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/Knegusen/enzyme-redux#readme // Definitions by: Dennis Axelsson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { ReactWrapper, ShallowWrapper } from 'enzyme'; import { ReactElement } from 'react'; diff --git a/types/enzyme-to-json/index.d.ts b/types/enzyme-to-json/index.d.ts index d2ba70fc8f..1a8cafb23a 100644 --- a/types/enzyme-to-json/index.d.ts +++ b/types/enzyme-to-json/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/adriantoine/enzyme-to-json#readme // Definitions by: Joscha Feth // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { ReactWrapper, ShallowWrapper } from 'enzyme'; 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..a91f60b3c6 100644 --- a/types/enzyme/index.d.ts +++ b/types/enzyme/index.d.ts @@ -9,7 +9,7 @@ // Torgeir Hovden // Martin Hochel // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// import { ReactElement, Component, AllHTMLAttributes as ReactHTMLAttributes, SVGAttributes as ReactSVGAttributes } from "react"; @@ -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/error-subclass/error-subclass-tests.ts b/types/error-subclass/error-subclass-tests.ts new file mode 100644 index 0000000000..9944bba159 --- /dev/null +++ b/types/error-subclass/error-subclass-tests.ts @@ -0,0 +1,7 @@ +import ErrorSubclass from 'error-subclass'; + +class ExampleError extends ErrorSubclass { + static displayName = 'ExampleError'; +} + +throw new ExampleError('Something went wrong!'); diff --git a/types/error-subclass/index.d.ts b/types/error-subclass/index.d.ts new file mode 100644 index 0000000000..55add2c057 --- /dev/null +++ b/types/error-subclass/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for error-subclass 2.2 +// Project: https://github.com/spudly/error-subclass#readme +// Definitions by: Fitbit +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export default class ErrorSubclass extends Error { + static displayName: string; +} diff --git a/types/error-subclass/tsconfig.json b/types/error-subclass/tsconfig.json new file mode 100644 index 0000000000..1574ebeea2 --- /dev/null +++ b/types/error-subclass/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", + "error-subclass-tests.ts" + ] +} diff --git a/types/error-subclass/tslint.json b/types/error-subclass/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/error-subclass/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/es-feature-detection/es-feature-detection-tests.ts b/types/es-feature-detection/es-feature-detection-tests.ts new file mode 100644 index 0000000000..13b779c1bb --- /dev/null +++ b/types/es-feature-detection/es-feature-detection-tests.ts @@ -0,0 +1,14 @@ +import * as es from "es-feature-detection"; + +const fns = es.builtins(); +if (fns["Array.prototype.includes"]) { + // [].includes +} +const syntax = es.syntax(); +if (syntax["Arrow function"]) { + new Function("() => {}"); +} + +if (fns.es2017.__all && syntax.es2017.__all) { + // support es2017! +} diff --git a/types/es-feature-detection/index.d.ts b/types/es-feature-detection/index.d.ts new file mode 100644 index 0000000000..7c4124ce73 --- /dev/null +++ b/types/es-feature-detection/index.d.ts @@ -0,0 +1,30 @@ +// Type definitions for es-feature-detection 2.0 +// Project: https://github.com/Tokimon/es-feature-detection#readme +// Definitions by: Jack Works +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.5 +export type ES2015Builtins = "__all" | "Array.from" | "Array.of" | "Array.prototype.fill" | "Array.prototype.find" | "Array.prototype.findIndex" | "Array.prototype.entries" | "Array.prototype.keys" | + "Array.prototype.copyWithin" | "base64" | "Map" | "Set" | "WeakMap" | "WeakSet" | "Math.imul" | "Math.clz32" | "Math.fround" | "Math.log10" | "Math.log2" | "Math.log1p" | "Math.expm1" | + "Math.cosh" | "Math.sinh" | "Math.tanh" | "Math.acosh" | "Math.asinh" | "Math.hypot" | "Math.trunc" | "Math.sign" | "Math.cbrt" | "Number.isNaN" | "Number.isFinite" | "Number.isInteger" | + "Number.parseInt" | "Number.parseFloat" | "Number.EPSILON" | "Number.MAX_SAFE_INTEGER" | "Number.MIN_SAFE_INTEGER" | "Number.isSafeInteger" | "Object.prototype.__proto__" | "Object.is" | + "Object.setPrototypeOf" | "Object.assign" | "Object.getOwnPropertySymbols" | "Promise" | "Proxy" | "Reflect" | "requestAnimationFrame" | "String.fromCodePoint" | "String.prototype.codePointAt" | + "String.prototype.startsWith" | "String.prototype.endsWith" | "String.prototype.includes" | "String.prototype.repeat" | "String.prototype.normalize" | "String.raw" | "Symbol" | "TypedArrays" | + "new.target"; +export type ES2016Builtins = "__all" | "Array.prototype.includes" | "TypedArray.prototype.includes"; +export type ES2017Builtins = "__all" | "Atomics" | "Object.values" | "Object.entries" | "Object.getOwnPropertyDescriptors" | + "String.prototype.padEnd" | "String.prototype.padStart" | "SharedArrayBuffer"; +export type ES2015Syntax = "__all" | "for...of" | "RegExp.prototype.sticky" | "RegExp.prototype.unicode" | "const" | "let" | "Destructuring" | "Spread Array" | "Spread Function call" | + "Rest parameters" | "Default parameters" | "Arrow function" | "Generator function" | "Binary literals" | "Octal literals" | "Template Strings" | "Shorthand property" | "Shorthand method" | + "Computed property" | "Block level function declaration" | "class"; +export type ES2016Syntax = "__all" | "Exponentiation operator" | "Rest destructuring"; +export type ES2017Syntax = "__all" | "async/await" | "Trailing parameter commas"; +export function builtins(): Record & { + es2015: Record; + es2016: Record; + es2017: Record; +}; +export function syntax(): Record & { + es2015: Record; + es2016: Record; + es2017: Record; +}; diff --git a/types/es-feature-detection/tsconfig.json b/types/es-feature-detection/tsconfig.json new file mode 100644 index 0000000000..1a348b7edc --- /dev/null +++ b/types/es-feature-detection/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", + "es-feature-detection-tests.ts" + ] +} diff --git a/types/es-feature-detection/tslint.json b/types/es-feature-detection/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/es-feature-detection/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/escape-string-regexp/index.d.ts b/types/escape-string-regexp/index.d.ts index 7a52a312b1..a0b218afe9 100644 --- a/types/escape-string-regexp/index.d.ts +++ b/types/escape-string-regexp/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for escape-string-regexp +// Type definitions for escape-string-regexp 1.0 // Project: https://github.com/sindresorhus/escape-string-regexp // Definitions by: kruncher // faergeek diff --git a/types/espruino/espruino-tests.ts b/types/espruino/espruino-tests.ts index 5e84a93e65..c1bafc9048 100644 --- a/types/espruino/espruino-tests.ts +++ b/types/espruino/espruino-tests.ts @@ -1,2 +1,17 @@ +import * as wifi from 'Wifi'; + +wifi.connect('ssid', { password: 'pass', authMode: 'wpa_wpa2' }, err => { + if (err) throw err; + console.log('connected'); +}); + +wifi.startAP('ssid', { password: 'pass', authMode: 'wpa_wpa2' }, err => { + if (err) throw err; + console.log("created"); +}); + +digitalWrite(D2, false); +digitalWrite(D2, true); + I2C1.setup({ scl: D4, sda: D0 }); Serial2.setup(9600, { rx: D16, tx: D17 }); diff --git a/types/espruino/index.d.ts b/types/espruino/index.d.ts index 43d1068230..cb6151e85a 100644 --- a/types/espruino/index.d.ts +++ b/types/espruino/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for Espruino 1.94 // Project: http://www.espruino.com/ // Definitions by: Stanislav Berkov +// Jurand Niemczycki // Definitions: https://github.com/borisyankov/DefinitelyTyped declare interface Object { @@ -9,6 +10,7 @@ declare interface Object { declare module "Wifi" { function connect(ssid: string, options: any, callback: (err: any) => any): any; + function startAP(ssid: string, options: any, callback: (err: any) => any): any; } declare module "InfluxDB" { @@ -391,10 +393,10 @@ declare interface Timer { } - // write(data: any[]): any; - // on(event: string, handler: (data: any) => any): any; - // setup(boudrate: number, options: any): any; - // read(chars?: number): string; +// write(data: any[]): any; +// on(event: string, handler: (data: any) => any): any; +// setup(boudrate: number, options: any): any; +// read(chars?: number): string; /** @@ -3598,7 +3600,7 @@ declare function digitalPulse(pin: Pin, value: boolean, time: any): void; * @param value * @url http://www.espruino.com/Reference#l__global_digitalWrite */ -declare function digitalWrite(pin: Pin, value: number): void; +declare function digitalWrite(pin: Pin, value: number | boolean): void; /** *

Get the digital value of the given pin.

diff --git a/types/eth-lightwallet/eth-lightwallet-tests.ts b/types/eth-lightwallet/eth-lightwallet-tests.ts new file mode 100644 index 0000000000..4907c73cbf --- /dev/null +++ b/types/eth-lightwallet/eth-lightwallet-tests.ts @@ -0,0 +1,3 @@ +import * as lw from "eth-lightwallet"; + +lw.keystore.createVault({}); diff --git a/types/eth-lightwallet/index.d.ts b/types/eth-lightwallet/index.d.ts new file mode 100644 index 0000000000..f55e71884e --- /dev/null +++ b/types/eth-lightwallet/index.d.ts @@ -0,0 +1,64 @@ +// Type definitions for eth-lightwallet 3.0 +// Project: https://github.com/ConsenSys/eth-lightwallet#readme +// Definitions by: Leonid Logvinov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +export interface ECSignatureBuffer { + v: number; + r: Buffer; + s: Buffer; +} +export namespace signing { + function signTx( + keystore: keystore, + pwDerivedKey: Uint8Array, + rawTx: string, + signingAddress: string + ): string; + function signMsg( + keystore: keystore, + pwDerivedKey: Uint8Array, + rawMsg: string, + signingAddress: string + ): ECSignatureBuffer; + function signMsgHash( + keystore: keystore, + pwDerivedKey: Uint8Array, + msgHash: string, + signingAddress: string + ): ECSignatureBuffer; + function concatSig(signature: any): string; +} + +export class keystore { + static createVault( + options: any, + callback?: (error: Error, keystore: keystore) => void + ): keystore; + static generateRandomSeed(): string; + static isSeedValid(seed: string): boolean; + static deserialize(keystore: string): keystore; + serialize(): string; + keyFromPassword( + password: string, + callback?: (error: Error, pwDerivedKey: Uint8Array) => void + ): Uint8Array; + isDerivedKeyCorrect(pwDerivedKey: Uint8Array): boolean; + generateNewAddress( + pwDerivedKey: Uint8Array, + numberOfAddresses: number + ): void; + getSeed(pwDerivedKey: Uint8Array): string; + exportPrivateKey(address: string, pwDerivedKey: Uint8Array): string; + getAddresses(): string[]; +} + +export interface VaultOptions { + password: string; + seedPhrase: string; + salt?: string; + hdPathString: string; +} diff --git a/types/eth-lightwallet/tsconfig.json b/types/eth-lightwallet/tsconfig.json new file mode 100644 index 0000000000..80eab8563a --- /dev/null +++ b/types/eth-lightwallet/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", + "eth-lightwallet-tests.ts" + ] +} diff --git a/types/eth-lightwallet/tslint.json b/types/eth-lightwallet/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/eth-lightwallet/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ethereumjs-abi/index.d.ts b/types/ethereumjs-abi/index.d.ts index 4314e46cbd..9208712d59 100644 --- a/types/ethereumjs-abi/index.d.ts +++ b/types/ethereumjs-abi/index.d.ts @@ -8,3 +8,5 @@ export function soliditySHA3(argTypes: string[], args: any[]): Buffer; export function soliditySHA256(argTypes: string[], args: any[]): Buffer; export function methodID(name: string, types: string[]): Buffer; +export function simpleEncode(signature: string, ...args: any[]): Buffer; +export function rawDecode(signature: string[], data: Buffer): any[]; 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/expo/expo-tests.tsx b/types/expo/expo-tests.tsx index 210c3400a9..0098a14489 100644 --- a/types/expo/expo-tests.tsx +++ b/types/expo/expo-tests.tsx @@ -374,9 +374,12 @@ async () => { }; async () => { - const result = await ImageManipulator.manipulate('url', [{ - rotate: 90 - }], { + const result = await ImageManipulator.manipulate('url', [ + { rotate: 90 }, + { resize: { width: 300 } }, + { resize: { height: 300 } }, + { resize: { height: 300, width: 300 } }, + ], { compress: 0.75 }); diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 2ad6a8d1aa..868afd5e56 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -11,7 +11,7 @@ // Tina Roh // Nathan Phillip Brink // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { EventSubscription } from 'fbemitter'; import { Component, ComponentClass, Ref, ComponentType } from 'react'; @@ -1519,7 +1519,7 @@ export namespace ImageManipulator { type Action = Resize | Rotate | Flip | Crop; interface Resize { - resize: { width: number, height: number }; + resize: { width?: number, height?: number }; } interface Rotate { diff --git a/types/expo/v23/index.d.ts b/types/expo/v23/index.d.ts index 4c33d8b13f..b5c327f6a1 100644 --- a/types/expo/v23/index.d.ts +++ b/types/expo/v23/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/expo/expo-sdk // Definitions by: Konstantin Kai // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { EventSubscription } from 'fbemitter'; import { Component, Ref } from 'react'; diff --git a/types/expo/v24/index.d.ts b/types/expo/v24/index.d.ts index 803ecccf32..35d1e9be92 100644 --- a/types/expo/v24/index.d.ts +++ b/types/expo/v24/index.d.ts @@ -6,7 +6,7 @@ // Sergio Sánchez // Fernando Helwanger // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { EventSubscription } from 'fbemitter'; import { Component, ComponentClass, Ref, ComponentType } from 'react'; diff --git a/types/expo/v25/index.d.ts b/types/expo/v25/index.d.ts index 0a7093e2b7..766c055911 100644 --- a/types/expo/v25/index.d.ts +++ b/types/expo/v25/index.d.ts @@ -7,7 +7,7 @@ // Fernando Helwanger // Umidbek Karimov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { EventSubscription } from 'fbemitter'; import { Component, ComponentClass, Ref, ComponentType } from 'react'; diff --git a/types/expo/v26/index.d.ts b/types/expo/v26/index.d.ts index 9b65002305..9804579e66 100644 --- a/types/expo/v26/index.d.ts +++ b/types/expo/v26/index.d.ts @@ -8,7 +8,7 @@ // Umidbek Karimov // Tina Roh // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { EventSubscription } from 'fbemitter'; import { Component, ComponentClass, Ref, ComponentType } from 'react'; diff --git a/types/expo__vector-icons/index.d.ts b/types/expo__vector-icons/index.d.ts index 19aadf2a33..529142c0e9 100644 --- a/types/expo__vector-icons/index.d.ts +++ b/types/expo__vector-icons/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/expo/vector-icons // Definitions by: Hyeonsu Lee // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from 'react'; import { TextProps } from 'react-native'; diff --git a/types/express-fileupload/index.d.ts b/types/express-fileupload/index.d.ts index 89331c066a..060476b109 100644 --- a/types/express-fileupload/index.d.ts +++ b/types/express-fileupload/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for express-fileupload 0.1 +// Type definitions for express-fileupload 0.4 // Project: https://github.com/richardgirges/express-fileupload#readme // Definitions by: Gintautas Miselis +// Sefa Ilkimen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -28,13 +29,16 @@ declare namespace fileUpload { encoding: string; mimetype: string; data: Buffer; + truncated: boolean; mv(path: string, callback: (err: any) => void): void; + mv(path: string): Promise; } interface Options { debug?: boolean; safeFileNames?: boolean; preserveExtension?: boolean | string | number; + abortOnLimit?: boolean; [property: string]: any; } } diff --git a/types/extsprintf/extsprintf-tests.ts b/types/extsprintf/extsprintf-tests.ts new file mode 100644 index 0000000000..4b45462487 --- /dev/null +++ b/types/extsprintf/extsprintf-tests.ts @@ -0,0 +1,8 @@ +import { sprintf, fprintf, printf } from "extsprintf"; + +fprintf({write: (s: string) => {}}, ''); +fprintf({write: (s: string) => {}}, '', {}, [], null, 0, ''); +printf(''); +printf('', {}, [], null, 0, ''); +sprintf(''); // $ExpectType string +sprintf('', {}, [], null, 0, ''); // $ExpectType string diff --git a/types/extsprintf/index.d.ts b/types/extsprintf/index.d.ts new file mode 100644 index 0000000000..29d073b4c5 --- /dev/null +++ b/types/extsprintf/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for extsprintf 1.4 +// Project: https://github.com/joyent/node-extsprintf#readme +// Definitions by: Alex Hankins +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface Stream { + write(str: string): void; +} + +export function fprintf(stream: Stream, format: string, ...args: any[]): any; +export function printf(format: string, ...args: any[]): any; +export function sprintf(format: string, ...args: any[]): string; diff --git a/types/extsprintf/tsconfig.json b/types/extsprintf/tsconfig.json new file mode 100644 index 0000000000..bc9783f347 --- /dev/null +++ b/types/extsprintf/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", + "extsprintf-tests.ts" + ] +} diff --git a/types/extsprintf/tslint.json b/types/extsprintf/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/extsprintf/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/fabric/fabric-impl.d.ts b/types/fabric/fabric-impl.d.ts index 4d01868b59..e5cbfc2432 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 */ @@ -1644,11 +1650,6 @@ export class Group { * @chainable */ destroy(): Group; - /** - * Returns requested property - * @param prop Property to get - */ - get(prop: string): any; /** * Checks whether this group was moved (since `saveCoords` was called last) * @return true if an object was moved (since fabric.Group#saveCoords was called) @@ -2678,9 +2679,11 @@ export class Object { setCoords(): this; /** * Returns coordinates of object's bounding rectangle (left, top, width, height) + * @param absoluteopt use coordinates without viewportTransform + * @param calculateopt use coordinates of current position instead of .oCoords / .aCoords * @return Object with left, top, width, height properties */ - getBoundingRect(): { left: number; top: number; width: number; height: number }; + getBoundingRect(absoluteopt?: boolean, calculateopt?: boolean): { left: number; top: number; width: number; height: number }; /** * Checks if object is fully contained within area of another object * @param other Object to test diff --git a/types/faker/index.d.ts b/types/faker/index.d.ts index 552e7d3eeb..248a0ba96c 100644 --- a/types/faker/index.d.ts +++ b/types/faker/index.d.ts @@ -11,7 +11,8 @@ declare const fakerStatic: Faker.FakerStatic; declare namespace Faker { interface FakerStatic { locale: string; - + setLocale(locale: string): void; + address: { zipCode(format?: string): string; city(format?: number): string; diff --git a/types/figlet/figlet-tests.ts b/types/figlet/figlet-tests.ts new file mode 100644 index 0000000000..676fb9003f --- /dev/null +++ b/types/figlet/figlet-tests.ts @@ -0,0 +1,95 @@ +import figlet = require('figlet'); + +figlet('abc', (err, str) => { + // $ExpectType Error | null + err; + // $ExpectType string | undefined + str; +}); +figlet('My World', '1Row', (err, str) => { + // $ExpectType Error | null + err; + // $ExpectType string | undefined + str; +}); +// $ExpectError +figlet('fweGWEPewfe', 'What is the font? I cannot get it'); +// $ExpectError +figlet('qweoqw'); +// $ExpectError +figlet('qweoqw', '1Row'); +// $ExpectError +figlet('qweoqw', '1Row', undefined as any, undefined as any); + +figlet.text('tokiyo tomare', (err, str) => { + // $ExpectType Error | null + err; + // $ExpectType string | undefined + str; +}); +figlet.text('Hi', 'Flower Power', (err, str) => { + // $ExpectType Error | null + err; + // $ExpectType string | undefined + str; +}); +figlet.text('Annyeong', { + font: 'Fun Face', + horizontalLayout: 'full', + verticalLayout: 'fitted', +}, (err, str) => { + // $ExpectType Error | null + err; + // $ExpectType string | undefined + str; +}); +figlet.text('Oreehe', { + font: 'Fun Face', + // $ExpectError + value: 'abc', +}, undefined as any); +// $ExpectError +figlet.text('It cannot make sense'); + +// $ExpectType string +figlet.textSync('test text'); +// $ExpectType string +figlet.textSync('text desu', 'Fuzzy'); +// $ExpectType string +figlet.textSync('oho', { + font: 'Invita', +}); +// $ExpectError +figlet.textSync(); + +figlet.metadata('JS Block Letters', (err, fontOptions, headerComment) => { + // $ExpectType Error | null + err; + // $ExpectType FontOptions | undefined + fontOptions; + // $ExpectType string | undefined + headerComment; +}); +// $ExpectError +figlet.metadata('This is random font name which cannot make sense', undefined as any); +// $ExpectError +figlet.metadata('Alligator', undefined as any, undefined as any); + +// $ExpectType Defaults +figlet.defaults(); +// $ExpectType Defaults +figlet.defaults({}); +// $ExpectType Defaults +figlet.defaults({ + font: 'Patorjk\'s Cheese' +}); + +figlet.fonts((err, fonts) => { + // $ExpectType Error | null + err; + // $ExpectType Fonts[] | undefined + fonts; +}); + +// $ExpectType Fonts[] +figlet.fontsSync(); diff --git a/types/figlet/index.d.ts b/types/figlet/index.d.ts new file mode 100644 index 0000000000..07bb706066 --- /dev/null +++ b/types/figlet/index.d.ts @@ -0,0 +1,406 @@ +// Type definitions for figlet 1.2 +// Project: https://github.com/patorjk/figlet.js +// Definitions by: Junyoung Clare Jang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// TypeScript Version: 2.1 + +declare namespace figlet { + type Fonts = + | '1Row' + | '3-D' + | '3D Diagonal' + | '3D-ASCII' + | '3x5' + | '4Max' + | '5 Line Oblique' + | 'AMC 3 Line' + | 'AMC 3 Liv1' + | 'AMC AAA01' + | 'AMC Neko' + | 'AMC Razor' + | 'AMC Razor2' + | 'AMC Slash' + | 'AMC Slider' + | 'AMC Thin' + | 'AMC Tubes' + | 'AMC Untitled' + | 'ANSI Shadow' + | 'ASCII New Roman' + | 'Acrobatic' + | 'Alligator' + | 'Alligator2' + | 'Alpha' + | 'Alphabet' + | 'Arrows' + | 'Avatar' + | 'B1FF' + | 'B1FF' + | 'Banner' + | 'Banner3-D' + | 'Banner3' + | 'Banner4' + | 'Barbwire' + | 'Basic' + | 'Bear' + | 'Bell' + | 'Benjamin' + | 'Big Chief' + | 'Big Money-ne' + | 'Big Money-nw' + | 'Big Money-se' + | 'Big Money-sw' + | 'Big' + | 'Bigfig' + | 'Binary' + | 'Block' + | 'Blocks' + | 'Bloody' + | 'Bolger' + | 'Braced' + | 'Bright' + | 'Broadway KB' + | 'Broadway' + | 'Bubble' + | 'Bulbhead' + | 'Caligraphy' + | 'Caligraphy2' + | 'Calvin S' + | 'Cards' + | 'Catwalk' + | 'Chiseled' + | 'Chunky' + | 'Coinstak' + | 'Cola' + | 'Colossal' + | 'Computer' + | 'Contessa' + | 'Contrast' + | 'Cosmike' + | 'Crawford' + | 'Crawford2' + | 'Crazy' + | 'Cricket' + | 'Cursive' + | 'Cyberlarge' + | 'Cybermedium' + | 'Cybersmall' + | 'Cygnet' + | 'DANC4' + | 'DOS Rebel' + | 'DWhistled' + | 'Dancing Font' + | 'Decimal' + | 'Def Leppard' + | 'Delta Corps Priest 1' + | 'Diamond' + | 'Diet Cola' + | 'Digital' + | 'Doh' + | 'Doom' + | 'Dot Matrix' + | 'Double Shorts' + | 'Double' + | 'Dr Pepper' + | 'Efti Chess' + | 'Efti Font' + | 'Efti Italic' + | 'Efti Piti' + | 'Efti Robot' + | 'Efti Wall' + | 'Efti Water' + | 'Electronic' + | 'Elite' + | 'Epic' + | 'Fender' + | 'Filter' + | 'Fire Font-k' + | 'Fire Font-s' + | 'Flipped' + | 'Flower Power' + | 'Four Tops' + | 'Fraktur' + | 'Fun Face' + | 'Fun Faces' + | 'Fuzzy' + | 'Georgi16' + | 'Georgia11' + | 'Ghost' + | 'Ghoulish' + | 'Glenyn' + | 'Goofy' + | 'Gothic' + | 'Graceful' + | 'Gradient' + | 'Graffiti' + | 'Greek' + | 'Heart Left' + | 'Heart Right' + | 'Henry 3D' + | 'Hex' + | 'Hieroglyphs' + | 'Hollywood' + | 'Horizontal Left' + | 'Horizontal Right' + | 'ICL-1900' + | 'Impossible' + | 'Invita' + | 'Isometric1' + | 'Isometric2' + | 'Isometric3' + | 'Isometric4' + | 'Italic' + | 'Ivrit' + | 'JS Block Letters' + | 'JS Bracket Letters' + | 'JS Capital Curves' + | 'JS Cursive' + | 'JS Stick Letters' + | 'Jacky' + | 'Jazmine' + | 'Jerusalem' + | 'Katakana' + | 'Kban' + | 'Keyboard' + | 'Knob' + | 'Konto Slant' + | 'Konto' + | 'LCD' + | 'Larry 3D 2' + | 'Larry 3D' + | 'Lean' + | 'Letters' + | 'Lil Devil' + | 'Line Blocks' + | 'Linux' + | 'Lockergnome' + | 'Madrid' + | 'Marquee' + | 'Maxfour' + | 'Merlin1' + | 'Merlin2' + | 'Mike' + | 'Mini' + | 'Mirror' + | 'Mnemonic' + | 'Modular' + | 'Morse' + | 'Morse2' + | 'Moscow' + | 'Mshebrew210' + | 'Muzzle' + | 'NScript' + | 'NT Greek' + | 'NV Script' + | 'Nancyj-Fancy' + | 'Nancyj-Improved' + | 'Nancyj-Underlined' + | 'Nancyj' + | 'Nipples' + | 'O8' + | 'OS2' + | 'Octal' + | 'Ogre' + | 'Old Banner' + | 'Patorjk\'s Cheese' + | 'Patorjk-HeX' + | 'Pawp' + | 'Peaks Slant' + | 'Peaks' + | 'Pebbles' + | 'Pepper' + | 'Poison' + | 'Puffy' + | 'Puzzle' + | 'Pyramid' + | 'Rammstein' + | 'Rectangles' + | 'Red Phoenix' + | 'Relief' + | 'Relief2' + | 'Reverse' + | 'Roman' + | 'Rot13' + | 'Rot13' + | 'Rotated' + | 'Rounded' + | 'Rowan Cap' + | 'Rozzo' + | 'Runic' + | 'Runyc' + | 'S Blood' + | 'SL Script' + | 'Santa Clara' + | 'Script' + | 'Serifcap' + | 'Shadow' + | 'Shimrod' + | 'Short' + | 'Slant Relief' + | 'Slant' + | 'Slide' + | 'Small Caps' + | 'Small Isometric1' + | 'Small Keyboard' + | 'Small Poison' + | 'Small Script' + | 'Small Shadow' + | 'Small Slant' + | 'Small Tengwar' + | 'Small' + | 'Soft' + | 'Speed' + | 'Spliff' + | 'Stacey' + | 'Stampate' + | 'Stampatello' + | 'Standard' + | 'Star Strips' + | 'Star Wars' + | 'Stellar' + | 'Stforek' + | 'Stick Letters' + | 'Stop' + | 'Straight' + | 'Stronger Than All' + | 'Sub-Zero' + | 'Swamp Land' + | 'Swan' + | 'Sweet' + | 'THIS' + | 'Tanja' + | 'Tengwar' + | 'Term' + | 'Test1' + | 'The Edge' + | 'Thick' + | 'Thin' + | 'Thorned' + | 'Three Point' + | 'Ticks Slant' + | 'Ticks' + | 'Tiles' + | 'Tinker-Toy' + | 'Tombstone' + | 'Train' + | 'Trek' + | 'Tsalagi' + | 'Tubular' + | 'Twisted' + | 'Two Point' + | 'USA Flag' + | 'Univers' + | 'Varsity' + | 'Wavy' + | 'Weird' + | 'Wet Letter' + | 'Whimsy' + | 'Wow' + ; + + type KerningMethods = + | 'default' + | 'full' + | 'fitted' + | 'controlled smushing' + | 'universal smushing' + ; + type PrintDirection = number; + + interface FittingRules { + vLayout: number; + vRule5: boolean; + vRule4: boolean; + vRule3: boolean; + vRule2: boolean; + vRule1: boolean; + hLayout: number; + hRule6: boolean; + hRule5: boolean; + hRule4: boolean; + hRule3: boolean; + hRule2: boolean; + hRule1: boolean; + } + + interface Options { + font?: Fonts; + horizontalLayout?: KerningMethods; + verticalLayout?: KerningMethods; + printDirection?: PrintDirection; + showHardBlanks?: boolean; + } + interface FontOptions { + hardBlank: string; + height: number; + baseline: number; + maxLength: number; + oldLayout: number; + numCommentLines: number; + printDirection: PrintDirection; + fullLayout: number | null; + codeTagCount: number | null; + fittingRules: FittingRules; + } + interface Defaults { + font: Fonts; + fontPath: string; + } + + function text(txt: string, cb: (error: Error | null, result?: string) => void): void; + function text(txt: string, font: Fonts, cb: (error: Error | null, result?: string) => void): void; + /** + * @desc + * This `unified-signatures` is disabled because `Fonts` type is too long + */ + // tslint:disable-next-line: unified-signatures + function text(txt: string, options: Options | undefined, cb: (error: Error | null, result?: string) => void): void; + + function textSync(txt: string, font?: Fonts): string; + /** + * @desc + * This `unified-signatures` is disabled because `Fonts` type is too long + */ + // tslint:disable-next-line: unified-signatures + function textSync(txt: string, options: Options): string; + + function metadata(font: Fonts, cb: (error: Error | null, fontOptions?: FontOptions, headerComment?: string) => void): void; + + function defaults(opt?: Partial): Defaults; + + function loadFont(font: Fonts, cb: (error: Error | null, fontOptions?: FontOptions) => void): void; + /** + * @todo + * Use 'node' namespace to add following methods only in node environment. + */ + /** + * @warn + * This method works in node environment only. + * In browser environment, this method does not work. + */ + function loadFontSync(font: Fonts): FontOptions; + /** + * @warn + * This method exists in node environment only. + * In browser environment, this method does not exist. + */ + function fonts(cb: (error: Error | null, fontList?: Fonts[]) => void): void; + /** + * @warn + * This method exists in node environment only. + * In browser environment, this method does not exist. + */ + function fontsSync(): Fonts[]; +} + +declare function figlet(txt: string, cb: (error: Error | null, result?: string) => void): void; +declare function figlet(txt: string, font: figlet.Fonts, cb: (error: Error | null, result?: string) => void): void; +/** + * @desc + * This `unified-signatures` is disabled because `Fonts` type is too long + */ +// tslint:disable-next-line: unified-signatures +declare function figlet(txt: string, options: figlet.Options | undefined, cb: (error: Error | null, result?: string) => void): void; + +export as namespace figlet; +export = figlet; diff --git a/types/figlet/tsconfig.json b/types/figlet/tsconfig.json new file mode 100644 index 0000000000..946bec6c7d --- /dev/null +++ b/types/figlet/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", + "figlet-tests.ts" + ] +} diff --git a/types/figlet/tslint.json b/types/figlet/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/figlet/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} 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/find/find-tests.ts b/types/find/find-tests.ts index c6c1cd04f5..3ca401f69a 100644 --- a/types/find/find-tests.ts +++ b/types/find/find-tests.ts @@ -16,9 +16,9 @@ find.file(regexPattern, rootDir, (dirs: string[]): void => { }).error(errorCb); find.fileSync(rootDir); // $ExpectType string[] find.fileSync(stringPattern, rootDir); // $ExpectType string[] find.fileSync(regexPattern, rootDir); // $ExpectType string[] -find.eachFile(rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream -find.eachFile(stringPattern, rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream -find.eachFile(regexPattern, rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream +find.eachfile(rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream +find.eachfile(stringPattern, rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream +find.eachfile(regexPattern, rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream find.dir(stringPattern, rootDir, (dirs: string[]): void => { }).error(emptyCb); // $ExpectType void find.dir(stringPattern, rootDir, (dirs: string[]): void => { }).error(errorCb); // $ExpectType void @@ -27,6 +27,6 @@ find.dir(rootDir, (dirs: string[]): void => { }).error(errorCb); // $ExpectType find.dirSync(rootDir); // $ExpectType string[] find.dirSync(stringPattern, rootDir); // $ExpectType string[] find.dirSync(regexPattern, rootDir); // $ExpectType string[] -find.eachDir(rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream -find.eachDir(stringPattern, rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream -find.eachDir(regexPattern, rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream +find.eachdir(rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream +find.eachdir(stringPattern, rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream +find.eachdir(regexPattern, rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream diff --git a/types/find/index.d.ts b/types/find/index.d.ts index 61166669db..1ffb2f8aee 100644 --- a/types/find/index.d.ts +++ b/types/find/index.d.ts @@ -45,7 +45,7 @@ export function file(pattern: string | RegExp, root: string, callback: (files: s * @param root The root directory * @param callback A callback that accepts each file separately */ -export function eachFile(root: string, callback: (file: string) => void): FindEachStream; +export function eachfile(root: string, callback: (file: string) => void): FindEachStream; /** * Find all files that match a glob pattern in a given directory asynchronously. @@ -53,7 +53,7 @@ export function eachFile(root: string, callback: (file: string) => void): FindEa * @param root The root directory * @param callback A callback that accepts an array of the found files */ -export function eachFile(pattern: string | RegExp, root: string, callback: (file: string) => void): FindEachStream; +export function eachfile(pattern: string | RegExp, root: string, callback: (file: string) => void): FindEachStream; /** * Find all files in a given directory synchronously. @@ -105,7 +105,7 @@ export function dirSync(pattern: string | RegExp, root: string): string[]; * @param root The root directory * @param callback A callback that accepts each of the found directories separately */ -export function eachDir(root: string, callback: (directory: string) => void): FindEachStream; +export function eachdir(root: string, callback: (directory: string) => void): FindEachStream; /** * Find all directories that match a glob pattern in a given directory asynchronously. @@ -113,4 +113,4 @@ export function eachDir(root: string, callback: (directory: string) => void): Fi * @param root The root directory * @param callback A callback that accepts each of the found directories separately */ -export function eachDir(pattern: string | RegExp, root: string, callback: (directory: string) => void): FindEachStream; +export function eachdir(pattern: string | RegExp, root: string, callback: (directory: string) => void): FindEachStream; diff --git a/types/fixed-data-table-2/index.d.ts b/types/fixed-data-table-2/index.d.ts index 0b844ec194..16b0c0f3c5 100644 --- a/types/fixed-data-table-2/index.d.ts +++ b/types/fixed-data-table-2/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/schrodinger/fixed-data-table-2 // Definitions by: Ilya Petukhov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from "react"; diff --git a/types/fixed-data-table/index.d.ts b/types/fixed-data-table/index.d.ts index c8ee33a2a1..4c0b7f176f 100644 --- a/types/fixed-data-table/index.d.ts +++ b/types/fixed-data-table/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/facebook/fixed-data-table // Definitions by: Petar Paar , Stephen Jelfs // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// diff --git a/types/flush-write-stream/flush-write-stream-tests.ts b/types/flush-write-stream/flush-write-stream-tests.ts new file mode 100644 index 0000000000..3f308d2f88 --- /dev/null +++ b/types/flush-write-stream/flush-write-stream-tests.ts @@ -0,0 +1,18 @@ +import writer = require("flush-write-stream"); + +const stream = writer(write, flush); + +stream.on("finish", () => console.log("finished")); + +stream.write("hello"); +stream.write("world"); +stream.end(); + +function write(data: any, encoding: string, callback: (error?: Error) => void): void { + console.log("Writing", data.toString()); + callback(); +} + +function flush(callback: (error?: Error) => void): void { + setTimeout(callback, 1000); +} diff --git a/types/flush-write-stream/index.d.ts b/types/flush-write-stream/index.d.ts new file mode 100644 index 0000000000..3faae23da2 --- /dev/null +++ b/types/flush-write-stream/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for flush-write-stream 1.0 +// Project: https://github.com/mafintosh/flush-write-stream +// Definitions by: Daniel Cassidy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { Writable, WritableOptions } from "stream"; + +type Callback = (error?: Error) => void; +type Write = (chunk: any, encoding: string, callback: Callback) => void; +type Flush = (callback: Callback) => void; + +declare const WriteStream: { + (opts: WritableOptions, write: Write, flush?: Flush): Writable; + (write: Write, flush?: Flush): Writable; + new(opts: WritableOptions, write: Write, flush?: Flush): Writable; + new(write: Write, flush?: Flush): Writable; + obj(opts: WritableOptions, write: Write, flush?: Flush): Writable; + obj(write: Write, flush?: Flush): Writable; +}; + +export = WriteStream; diff --git a/types/flush-write-stream/tsconfig.json b/types/flush-write-stream/tsconfig.json new file mode 100644 index 0000000000..95d5eca832 --- /dev/null +++ b/types/flush-write-stream/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", + "flush-write-stream-tests.ts" + ] +} diff --git a/types/flush-write-stream/tslint.json b/types/flush-write-stream/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/flush-write-stream/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/flux/index.d.ts b/types/flux/index.d.ts index ffc0330228..cafb6a5a0b 100644 --- a/types/flux/index.d.ts +++ b/types/flux/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Steve Baker // Giedrius Grabauskas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import Dispatcher = require("./lib/Dispatcher"); diff --git a/types/fluxible-router/index.d.ts b/types/fluxible-router/index.d.ts index 2dea024107..097c2b3c2d 100644 --- a/types/fluxible-router/index.d.ts +++ b/types/fluxible-router/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/yahoo/fluxible#readme // Definitions by: xbim // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// import * as React from 'react'; import { FluxibleContext } from 'fluxible'; diff --git a/types/fluxxor/index.d.ts b/types/fluxxor/index.d.ts index 3457dba949..191332fa7a 100644 --- a/types/fluxxor/index.d.ts +++ b/types/fluxxor/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/BinaryMuse/fluxxor // Definitions by: Yuichi Murata // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as EventEmitter3 from 'eventemitter3'; import * as React from "react"; diff --git a/types/fork-ts-checker-webpack-plugin/fork-ts-checker-webpack-plugin-tests.ts b/types/fork-ts-checker-webpack-plugin/fork-ts-checker-webpack-plugin-tests.ts deleted file mode 100644 index 78ead793b4..0000000000 --- a/types/fork-ts-checker-webpack-plugin/fork-ts-checker-webpack-plugin-tests.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Configuration } from 'webpack'; -import * as ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'; - -let config: Configuration = { - plugins: [ - new ForkTsCheckerWebpackPlugin() - ] -}; - -config = { - plugins: [ - new ForkTsCheckerWebpackPlugin({}) - ] -}; - -config = { - plugins: [ - new ForkTsCheckerWebpackPlugin({ - vue: true - }) - ] -}; - -export default config; diff --git a/types/fork-ts-checker-webpack-plugin/index.d.ts b/types/fork-ts-checker-webpack-plugin/index.d.ts deleted file mode 100644 index ace3db5b24..0000000000 --- a/types/fork-ts-checker-webpack-plugin/index.d.ts +++ /dev/null @@ -1,104 +0,0 @@ -// Type definitions for fork-ts-checker-webpack-plugin 0.4 -// Project: https://github.com/Realytics/fork-ts-checker-webpack-plugin#readme -// Definitions by: JounQin -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -/// - -import { RuleFailure } from 'tslint'; -import { Diagnostic } from 'typescript'; -import { Plugin } from 'webpack'; - -declare namespace ForkTsCheckerWebpackPlugin { - type ErrorType = 'diagnostic' | 'lint'; - type Severity = 'error' | 'warning'; - - interface NormalizedMessageJson { - type: ErrorType; - code: string | number; - severity: Severity; - content: string; - file: string; - line: number; - character: number; - } - - class NormalizedMessage { - static TYPE_DIAGNOSTIC: ErrorType; - static TYPE_LINT: ErrorType; - static SEVERITY_ERROR: Severity; - static SEVERITY_WARNING: Severity; - type: ErrorType; - code: string | number; - severity: Severity; - content: string; - file: string; - line: number; - character: number; - constructor(data: NormalizedMessageJson); - static createFromDiagnostic(diagnostic: Diagnostic): NormalizedMessage; - static createFromLint(lint: RuleFailure): NormalizedMessage; - static createFromJSON(json: NormalizedMessageJson): NormalizedMessage; - static compare( - messageA: NormalizedMessage, - messageB: NormalizedMessage, - ): number; - static equals( - messageA: NormalizedMessage, - messageB: NormalizedMessage, - ): boolean; - static deduplicate(messages: NormalizedMessage[]): NormalizedMessage[]; - static compareTypes(typeA: ErrorType, typeB: ErrorType): number; - static compareSeverities( - severityA: Severity, - severityB: Severity, - ): number; - static compareOptionalStrings(stringA: string, stringB: string): number; - static compareNumbers(numberA: number, numberB: number): number; - toJSON(): NormalizedMessageJson; - getType(): ErrorType; - isDiagnosticType(): boolean; - isLintType(): boolean; - getCode(): string | number; - getFormattedCode(): string | number; - getSeverity(): Severity; - isErrorSeverity(): boolean; - isWarningSeverity(): boolean; - getContent(): string; - getFile(): string; - getLine(): number; - getCharacter(): number; - } - - type Formatter = (message: NormalizedMessage, useColors: boolean) => string; - - interface Options { - tsconfig?: string; - tslint?: string | true; - watch?: string | string[]; - async?: boolean; - ignoreDiagnostics?: number[]; - ignoreLints?: string[]; - colors?: boolean; - logger?: Console; - formatter?: 'default' | 'codeframe' | Formatter; - formatterOptions?: { - highlightCode?: boolean - linesAbove?: number - linesBelow?: number - forceColor?: boolean - }; - silent?: boolean; - checkSyntacticErrors?: boolean; - memoryLimit?: number; - workers?: number; - vue?: boolean; - } -} - -declare class ForkTsCheckerWebpackPlugin extends Plugin { - constructor(options?: ForkTsCheckerWebpackPlugin.Options); -} - -export = ForkTsCheckerWebpackPlugin; diff --git a/types/form-serialize/form-serialize-tests.ts b/types/form-serialize/form-serialize-tests.ts new file mode 100644 index 0000000000..42b587dd80 --- /dev/null +++ b/types/form-serialize/form-serialize-tests.ts @@ -0,0 +1,17 @@ +import serialize = require("form-serialize"); + +const form = document.createElement("form"); +serialize(form, { hash: true }); // $ExpectType ResultHash +serialize(form, true); // $ExpectType ResultHash +serialize(form, { hash: false }); // $ExpectType string +serialize(form, false); // $ExpectType string +serialize(form); // $ExpectType string + +interface CustomResult { + foo: string; +} + +// $ExpectType CustomResult +serialize(form, { + serializer: (): CustomResult => ({ foo: "bar" }) +}); diff --git a/types/form-serialize/index.d.ts b/types/form-serialize/index.d.ts new file mode 100644 index 0000000000..b433f6b81b --- /dev/null +++ b/types/form-serialize/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for form-serialize 0.7 +// Project: https://github.com/defunctzombie/form-serialize#readme +// Definitions by: Tyler Johnson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +interface ResultHash { + [key: string]: string | string[] | ResultHash; +} + +interface Options { + /** Configure the output type. If true, the output will be a js object. */ + hash?: boolean; + /** + * Optional serializer function to override the default one. The function takes 3 arguments (result, key, + * value) and should return new result hash and url encoded str serializers are provided with this module + */ + serializer?: (result: Result, key: string, value: string) => Result; + /** If true serialize disabled fields. */ + disabled?: boolean; + /** If true serialize empty fields */ + empty?: boolean; +} + +interface OptionsHash extends Options { + hash: true; +} + +interface OptionsString extends Options { + hash: false; +} + +declare function serialize(form: HTMLFormElement, options: OptionsHash | true): ResultHash; +declare function serialize(form: HTMLFormElement, options?: OptionsString | false): string; +declare function serialize(form: HTMLFormElement, options?: Options | boolean): Result; + +export = serialize; diff --git a/types/form-serialize/tsconfig.json b/types/form-serialize/tsconfig.json new file mode 100644 index 0000000000..b37dff4ca2 --- /dev/null +++ b/types/form-serialize/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", + "form-serialize-tests.ts" + ] +} diff --git a/types/form-serialize/tslint.json b/types/form-serialize/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/form-serialize/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/frctl__fractal/frctl__fractal-tests.ts b/types/frctl__fractal/frctl__fractal-tests.ts new file mode 100644 index 0000000000..b641563a45 --- /dev/null +++ b/types/frctl__fractal/frctl__fractal-tests.ts @@ -0,0 +1,198 @@ +// Source: https://fractal.build/guide + +/* Create a new Fractal instance and export it for use elsewhere if required */ +import { create } from '@frctl/fractal'; + +const fractal = create(); + +/* Set the title of the project */ +fractal.set('project.title', 'FooCorp Component Library'); +fractal.set('project.version', 'v1.0'); +fractal.set('project.author', 'Mickey Mouse'); + +/* Tell Fractal where the components will live */ +fractal.components.set('path', __dirname + '/src/components'); + +/* Tell Fractal where the documentation pages will live */ +fractal.docs.set('path', __dirname + '/src/docs'); + +/* Specify a directory of static assets */ +fractal.web.set('static.path', __dirname + '/public'); + +/* Set the static HTML build destination */ +fractal.web.set('builder.dest', __dirname + '/build'); + +// Source: https://fractal.build/guide/components/configuration + +fractal.components.set('default.collated', true); +fractal.components.set('default.collator', (markup: string, item: any) => { + return `\n${markup}\n\n`; +}); +fractal.components.set('default.context', { + 'site-name': 'FooCorp' +}); +fractal.components.set('default.display', { + 'max-width': '400px' +}); +fractal.components.set('default.prefix', 'foobar'); +fractal.components.set('default.preview', '@my-preview-layout'); +fractal.components.set('default.status', 'wip'); +fractal.components.set('ext', '.handlebars'); +fractal.components.set('label', 'Patterns'); +fractal.components.set('path', __dirname + '/src/components'); +fractal.components.set('statuses', { + doing: { + label: "Doing", + description: "I'm doing it.", + color: '#F00' + }, + done: { + label: "Done", + description: "I'm done with this.", + color: "green" + } +}); +fractal.components.set('title', 'Patterns'); +fractal.components.set('yield', 'rendered_content'); + +// Source: https://fractal.build/guide/docs/configuration + +fractal.docs.set('default.context', { + 'site-name': 'FooCorp' +}); +fractal.docs.set('default.prefix', 'foobar'); +fractal.docs.set('default.status', 'wip'); +fractal.docs.set('ext', '.html'); +fractal.docs.set('indexLabel', 'Listing'); +fractal.docs.set('label', 'Pages'); +fractal.docs.set('markdown', false); +fractal.docs.set('markdown.smartypants', false); +fractal.docs.set('path', __dirname + '/src/docs'); +fractal.docs.set('statuses', { + doing: { + label: "Doing", + description: "I'm doing it.", + color: '#F00' + }, + done: { + label: "Done", + description: "I'm done with this.", + color: "green" + } +}); +fractal.docs.set('title', 'Pages'); + +// Source: https://fractal.build/guide/web/configuration + +fractal.web.set('builder.concurrency', 5); +fractal.web.set('builder.dest', __dirname + '/export'); +fractal.web.set('builder.ext', '.php'); +fractal.web.set('builder.urls.ext', null); +fractal.web.set('server.sync', true); +fractal.web.set('server.syncOptions', { + open: true, + browser: ['google chrome', 'firefox'], + notify: true +}); +fractal.web.set('server.port', 4444); +fractal.web.set('server.watch', true); +fractal.web.set('static.path', __dirname + '/public'); +fractal.web.set('static.mount', 'project-assets'); + +// Source: https://fractal.build/guide/cli/custom-commands + +{ + const config = { + description: 'Lists components in the project' + }; + + fractal.cli.command('list-components', function(args, done) { + const app = this.fractal; + for (const item of app.components.flatten()) { + this.log(`${item.handle} - ${item.status.label}`); + } + done(); + }, config); +} + +fractal.cli.exec('list-components'); + +fractal.cli.command('foo [optionalArg] [anotherOptionalArg]', (args, done) => { + console.log(args.requiredArg); + done(); +}); + +{ + const config = { + options: [ + ['-p, --port ', 'The port to use.'], + ] + }; + + fractal.cli.command('foo', (args, done) => { + // do something + console.log(`Something was started on port ${args.options.port}`); + done(); + }, config); +} + +// Source: https://fractal.build/guide/integration/build-tools + +import * as gulp from 'gulp'; +{ + /* + * Configure a Fractal instance. + * + * This configuration could also be done in a separate file, provided that this file + * then imported the configured fractal instance from it to work with in your Gulp tasks. + * i.e. const fractal = require('./my-fractal-config-file'); + */ + + fractal.set('project.title', 'FooCorp Component Library'); // title for the project + fractal.web.set('builder.dest', 'build'); // destination for the static export + fractal.docs.set('path', `${__dirname}/docs`); // location of the documentation directory. + fractal.components.set('path', `${__dirname}/components`); // location of the component directory. + + // any other configuration or customisation here + + const logger = fractal.cli.console; // keep a reference to the fractal CLI console utility + + /* + * Start the Fractal server + * + * In this example we are passing the option 'sync: true' which means that it will + * use BrowserSync to watch for changes to the filesystem and refresh the browser automatically. + * Obviously this is completely optional! + * + * This task will also log any errors to the console. + */ + + gulp.task('fractal:start', () => { + const server = fractal.web.server({ + sync: true + }); + server.on('error', err => logger.error(err.message)); + return server.start().then(() => { + logger.success(`Fractal server is now running at ${server.url}`); + }); + }); + + /* + * Run a static export of the project web UI. + * + * This task will report on progress using the 'progress' event emitted by the + * builder instance, and log any errors to the terminal. + * + * The build destination will be the directory specified in the 'builder.dest' + * configuration option set above. + */ + + gulp.task('fractal:build', () => { + const builder = fractal.web.builder(); + builder.on('progress', (completed, total) => logger.update(`Exported ${completed} of ${total} items`, 'info')); + builder.on('error', err => logger.error(err.message)); + return builder.build().then(() => { + logger.success('Fractal build completed!'); + }); + }); +} diff --git a/types/frctl__fractal/index.d.ts b/types/frctl__fractal/index.d.ts new file mode 100644 index 0000000000..8e88f82948 --- /dev/null +++ b/types/frctl__fractal/index.d.ts @@ -0,0 +1,700 @@ +// Type definitions for @frctl/fractal 1.x +// Project: https://github.com/frctl/fractal +// Definitions by: Phil McCloghry-Laing +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { EventEmitter } from 'events'; +import { Stats as FileStats } from 'fs'; +import { Server as HttpServer } from 'http'; +import { Readable as ReadableStream } from 'stream'; +import * as VinylFile from 'vinyl'; + +export namespace fractal { + namespace core { + interface StatusInfo { + label: string; + description?: string; + color?: string; + } + namespace entities { + abstract class Entity extends mixins.Entity { + readonly isComponent?: true; + readonly isCollection?: true; + readonly isDoc?: true; + readonly isVariant?: true; + readonly status: StatusInfo; + getResolvedContext(): any; + hasContext(): Promise; + setContext(data: any): void; + getContext(): any; + toJSON(): {}; + } + interface EntitySource extends mixins.Source { + entities(): T[]; + + engine(adapterFactory?: string | { + register(source: EntitySource, app: any): Adapter; + } | (() => ({ + register(source: EntitySource, app: any): Adapter; + }))): Adapter; + + getProp(key: string): string | {}; + statusInfo(handle: string): StatusInfo | null; + toJSON(): {}; + } + interface EntityCollection extends mixins.Entity, mixins.Collection { + readonly entities: this; + toJSON(): {}; + } + } + + namespace mixins { + abstract class Configurable { + config(): T; + config(config: T): this; + set(path: K, value: T[K] | null): this; + get(path: K, defaultValue?: V): T[K] | V | null | undefined; + } + /** + * Combined EventEmitter and Configurable mixins + */ + abstract class ConfigurableEmitter extends EventEmitter { } + interface ConfigurableEmitter extends Configurable { } + interface Collection { + readonly isAsset: undefined; + readonly isComponent: undefined; + readonly isCollection: true; + readonly isDoc: undefined; + readonly isFile: undefined; + readonly isVariant: undefined; + readonly size: number; + readonly items: T[]; + toArray(): T[]; + setItems(items: T[]): this; + pushItem(item: T): this; + removeItem(item: T): this; + toJSON(): {}; + toStream(): ReadableStream; + each(fn: (item: T) => void): this; + forEach(fn: (item: T) => void): this; + map(fn: (item: T) => T): this; + first(): T | undefined; + last(): T | undefined; + eq(pos: number): T | undefined; + collections(): this; + orderBy(): this; + find(handle: string): T; + find(name: TKey, value: T[TKey]): T; + findCollection(handle: string): Collection; + findCollection(name: TKey, value: T[TKey]): Collection; + flatten(): this; + flattenDeep(): this; + squash(): this; + filter(handle: string): T[]; + filter(name: TKey, value: T[TKey]): T[]; + filterItems(items: T[], handle: string): T[]; + filterItems(items: T[], name: TKey, value: T[TKey]): T[]; + flattenItems(items: T[], deep?: boolean): T[]; + squashItems(items: T[]): T[]; + newSelf(items: T[]): this; + [Symbol.iterator](): IterableIterator; + } + abstract class Entity { + initEntity(name: string, config: any, parent: Entity): void; + name: string; + handle: string; + label: string; + title: string; + order: number; + id: string; + config: any; + readonly alias: string | null; + readonly source: entities.EntitySource; + readonly parent: Entity; + readonly isHidden: boolean; + toJSON(): {}; + } + interface Source extends ConfigurableEmitter, Collection { + readonly label: string; + readonly title: string; + readonly source: this; + readonly isWatching: boolean; + readonly fullPath: string | null; + readonly relPath: string; + toStream(): ReadableStream; + exists(): boolean; + load(force?: boolean): Promise; + refresh(): Promise; + watch(): void; + unwatch(): void; + isConfig(file: string): boolean; + } + } + } + + namespace api { + namespace assets { + class Asset extends core.entities.Entity { + readonly isAsset: true; + readonly isComponent: undefined; + readonly isCollection: undefined; + readonly isDoc: undefined; + readonly isFile: undefined; + readonly isVariant: undefined; + toVinyl(): VinylFile; + } + interface AssetCollection extends core.entities.EntityCollection { + assets(): this; + toVinylArray(): VinylFile[]; + } + interface AssetSource extends core.mixins.Source { + assets(): VinylFile[]; + toVinylArray(): VinylFile[]; + toVinylStream(): ReadableStream; + gulpify(): ReadableStream; + } + interface AssetSourceCollection extends core.mixins.ConfigurableEmitter { + readonly label: string; + readonly title: string; + add(name: string, config: any): AssetSource; + remove(name: string): this; + find(name: string): AssetSource | undefined; + sources(): AssetSource[]; + toArray(): AssetSource[]; + visible(): AssetSource[]; + watch(): this; + unwatch(): this; + load(): Promise; + toJSON(): {}; + [Symbol.iterator](): IterableIterator; + } + } + + namespace components { + class Component extends core.entities.Entity { + constructor(config: {}, files: files.FileCollection, resources: assets.AssetCollection, parent: core.entities.Entity); + readonly isAsset: undefined; + readonly isComponent: true; + readonly isCollection: undefined; + readonly isDoc: undefined; + readonly isFile: undefined; + readonly isVariant: undefined; + defaultName: string; + lang: string; + editorMode: string; + editorScope: string; + viewPath: string; + viewDir: string; + configData: string; + relViewPath: string; + isCollated(): boolean; + readonly content: string; + readonly references: any[]; + readonly referencedBy: any[]; + readonly baseHandle: string; + readonly notes: string; + render(context: any, env: any, opts: any): Promise; + getPreviewContext(): Promise; + getPreviewContent(): Promise; + setVariants(variantCollection: variants.VariantCollection): void; + hasTag(tag: string): boolean; + resources(): assets.AssetCollection; + resourcesJSON(): {}; + flatten(): variants.VariantCollection; + component(): this; + variants(): variants.VariantCollection; + static create(config: {}, files: files.FileCollection, resources: assets.AssetCollection, parent: core.entities.Entity): IterableIterator<{} | variants.VariantCollection | Component>; + } + interface ComponentCollection extends core.entities.EntityCollection { + components(): this; + variants(): this; + } + type Collator = (markup: string, item: { handle: string; }) => string; + interface ComponentDefaultConfig { + collated?: boolean; + collator?: Collator; + context?: any; + display?: any; + prefix?: string; + preview?: string; + status?: string; + } + interface ComponentConfig { + path?: string; + ext?: string; + default?: ComponentDefaultConfig; + label?: string; + statuses?: { + [status: string]: core.StatusInfo; + }; + title?: string; + yield?: string; + 'default.collated'?: boolean; + 'default.collator'?: Collator; + 'default.context'?: any; + 'default.display'?: any; + 'default.prefix'?: string; + 'default.preview'?: string; + 'default.status'?: string; + } + interface ComponentSource extends core.entities.EntitySource { + resources(): files.FileCollection; + components(): Component[]; + getReferencesOf(target: { id: string; handle: string; alias: string; }): any[]; + variants(): this; + find(): any; + findFile(filePath: string): files.File | undefined; + resolve(context: any): any; + renderString(str: string, context: any, env: any): Promise; + renderPreview(entity: string | core.entities.Entity, preview?: boolean, env?: any): Promise; + render(entity: string | core.entities.Entity, context: any, env?: any, opts?: {}): Promise; + } + } + namespace docs { + class Doc extends core.entities.Entity { + constructor(config: any, content: string, parent: core.entities.Entity); + readonly isAsset: undefined; + readonly isComponent: undefined; + readonly isCollection: undefined; + readonly isDoc: true; + readonly isFile: undefined; + readonly isVariant: undefined; + readonly isIndex: boolean; + getContent(): Promise; + getContentSync(): string; + render(context: any, env?: any, opts?: any): Promise; + toc(maxDepth?: number): Promise; + static create(config: any, content: string, parent: core.entities.Entity): Doc; + } + interface DocCollection extends core.entities.EntityCollection { + pages(): this; + } + interface DocDefaultConfig { + context?: any; + prefix?: string; + status?: string; + } + interface DocMarkdownConfig { + gfm?: boolean; + tables?: boolean; + breaks?: boolean; + pedantic?: boolean; + sanitize?: boolean; + smartLists?: boolean; + smartypants?: boolean; + } + interface DocConfig { + default?: DocDefaultConfig; + ext?: string; + indexLabel?: string; + label?: string; + markdown?: boolean | DocMarkdownConfig; + path?: string; + statuses?: { + [status: string]: core.StatusInfo; + }; + title?: string; + 'default.context'?: any; + 'default.prefix'?: string; + 'default.status'?: string; + 'markdown.gfm'?: boolean; + 'markdown.tables'?: boolean; + 'markdown.breaks'?: boolean; + 'markdown.pedantic'?: boolean; + 'markdown.sanitize'?: boolean; + 'markdown.smartLists'?: boolean; + 'markdown.smartypants'?: boolean; + } + interface DocSource extends core.entities.EntitySource { + pages(): this; + docs(): this; + resolve(context: any): any; + toc(page: files.File, maxDepth?: number): Promise; + render(page: string | files.File, context?: any, env?: any, opts?: {}): Promise; + renderString(str: string, context: any, env?: any): Promise; + isPage(file: string): boolean; + isTemplate(file: string): boolean; + } + } + namespace files { + interface FileCollection extends core.mixins.Collection { + files(): this; + match(test: string | RegExp | Array): this; + matchItems(items: core.mixins.Collection, test: string | RegExp | Array): File; + toVinylArray(): VinylFile[]; + toVinylStream(): ReadableStream; + gulpify(): ReadableStream; + } + interface File { + readonly isAsset: undefined; + readonly isComponent: undefined; + readonly isCollection: undefined; + readonly isDoc: undefined; + readonly isFile: true; + readonly isVariant: undefined; + id: string; + path: string; + cwd: string; + relPath: string; + base: string; + dir: string; + handle: string; + name: string; + ext: string; + stat: FileStats | null; + lang: string; + editorMode: string; + editorScope: string; + githubColor: string; + isBinary: boolean; + mime: string; + getContext(): any; + readonly contents: Buffer; + readonly isImage: boolean; + getContent(): Promise; + getContentSync(): string; + read(): Promise; + readSync(): string; + toVinyl(): VinylFile; + } + } + namespace variants { + class Variant extends core.entities.Entity { + constructor(config: {}, view: any, resources: assets.AssetCollection, parent: components.Component); + readonly isAsset: undefined; + readonly isComponent: undefined; + readonly isCollection: undefined; + readonly isDoc: undefined; + readonly isFile: true; + readonly isVariant: true; + view: any; + viewPath: string; + viewDir: string; + relViewPath: string; + isDefault: boolean; + lang: string; + editorMode: string; + editorScope: string; + readonly notes: string; + readonly alias: string | null; + readonly siblings: VariantCollection; + readonly content: string; + readonly baseHandle: string; + readonly references: any[]; + readonly referencedBy: any[]; + render(context: any, env?: any, opts?: any): Promise; + getPreviewContext(): Promise; + getPreviewContent(): Promise; + component(): components.Component; + variant(): this; + defaultVariant(): this; + resources(): assets.AssetCollection; + resourcesJSON(): {}; + getContent(): Promise; + getContentSync(): string; + static create(config: {}, view: any, resources: assets.AssetCollection, parent: components.Component): Variant; + } + interface VariantCollection extends core.entities.EntityCollection { + default(): Variant; + getCollatedContent(): Promise; + getCollatedContentSync(): string; + getCOllatedContext(): Promise; + readonly references: any[]; + readonly referencedBy: any[]; + } + } + } + + namespace cli { + class Cli { + console: Console; + notify: Notifier; + has(command: string): boolean; + get(command: string): any; + isInteractive(): boolean; + command( + commandString: string, + callback: (this: Cli & { fractal: Fractal }, args: any, done: () => void) => void, opts?: string | { + description?: string; + options?: string[][]; + }): void; + exec(command: string): void; + log(message: string): void; + error(message: string): void; + } + class Console { + theme: CliTheme; + br(): this; + log(text: string): this; + debug(text: string, data?: any): this; + success(text: string): this; + warn(text: string): this; + update(text: string, type?: string): this; + clear(): this; + persist(): this; + error(err: Error): this; + error(err: string, data: Error): this; + dump(data: any): void; + box(header?: string, body?: string[], footer?: string): this; + write(str: string, type?: string): void; + columns(data: any, options?: any): this; + slog(): this; + unslog(): this; + isSlogging(): boolean; + debugMode(status: boolean): void; + } + class Notifier { + updateAvailable(details: { + current: string; + latest: string; + name: string; + }): void; + versionMismatch(details: { + cli: string; + local: string; + }): void; + } + } + + namespace web { + class Builder extends EventEmitter { + /** + * @deprecated Use start() instead. + */ + build(): Promise<{ errorCount: number; }>; + start(): Promise<{ errorCount: number; }>; + stop(): void; + use(): void; + } + class Server extends EventEmitter { + readonly isSynced: boolean; + readonly port?: number; + readonly ports: { + sync?: number; + server?: number; + }; + readonly url?: string; + readonly urls: { + sync?: { + local?: string; + external?: string; + ui?: string; + }; + server?: string; + }; + start(sync?: boolean): Promise; + stop(): void; + use(mount: string, middleware: any): void; + } + interface WebServerSyncOptions { + open?: boolean; + browser?: string[]; + notify?: boolean; + } + interface WebServerConfig { + sync?: boolean; + syncOptions?: WebServerSyncOptions; + port?: number; + watch?: boolean; + theme?: WebTheme | string; + } + interface WebBuilderUrls { + ext?: string; + } + interface WebBuilderConfig { + concurrency?: number; + dest?: string; + ext?: string; + urls?: WebBuilderUrls; + theme?: WebTheme | string; + } + interface WebStaticConfig { + path?: string; + mount?: string; + } + interface WebConfig { + builder?: WebBuilderConfig; + server?: WebServerConfig; + static?: WebStaticConfig; + 'builder.concurrency'?: number; + 'builder.dest'?: string; + 'builder.ext'?: string; + 'builder.urls'?: WebBuilderUrls; + 'builder.urls.ext'?: string; + 'builder.theme'?: WebTheme | string; + 'server.sync'?: boolean; + 'server.syncOptions'?: WebServerSyncOptions; + 'server.syncOptions.open'?: boolean; + 'server.syncOptions.browser'?: string[]; + 'server.syncOptions.notify'?: boolean; + 'server.port'?: number; + 'server.watch'?: boolean; + 'server.theme'?: WebTheme | string; + 'static.path'?: string; + 'static.mount'?: string; + } + class Web extends core.mixins.ConfigurableEmitter { + server(config?: WebServerConfig): Server; + builder(config?: WebBuilderConfig): Builder; + theme(name: string, instance?: WebTheme): this; + defaultTheme(): WebTheme; + defaultTheme(instance: WebTheme): this; + } + } + + const Fractal: { + new: Fractal; + }; +} + +export interface FractalConfig { + project?: { + title?: string; + version?: string; + author?: string; + }; + 'project.title'?: string; + 'project.version'?: string; + 'project.author'?: string; +} + +export function create(config?: FractalConfig): Fractal; + +export class Fractal extends fractal.core.mixins.ConfigurableEmitter { + constructor(config?: FractalConfig); + readonly components: fractal.api.components.ComponentSource; + readonly docs: fractal.api.docs.DocSource; + readonly assets: fractal.api.assets.AssetSourceCollection; + readonly cli: fractal.cli.Cli; + readonly web: fractal.web.Web; + readonly version: string; + readonly debug: boolean; + + extend(plugin: string | ((this: this, core: any) => void)): this; + + watch(): this; + unwatch(): this; + + load(): Promise; +} + +export interface CliThemeConfig { + delimiter?: { + text?: string; + format?: (str: string) => string; + }; + styles?: { + [key: string]: any; + }; + 'delimiter.text'?: string; + 'delimiter.format'?: (str: string) => string; +} +export class CliTheme extends fractal.core.mixins.ConfigurableEmitter { + constructor(config?: CliThemeConfig); + setDelimiter(text: string, formatter: (str: string) => string): void; + delimiter(): string; + setStyle(name: string, opts: any): void; + style(name: string): any; + format(str: string, style?: string, strip?: boolean): string; +} + +export interface WebThemeOptions { + skin?: string; + panels?: string[]; + rtl: boolean; + lang?: string; + styles?: string[]; + scripts?: string[]; + format?: string; + static?: { + mount?: string; + }; + version?: string; + favicon?: string; + nav?: string[]; + 'static.mount': string; +} +export class WebTheme extends fractal.core.mixins.ConfigurableEmitter { + constructor(viewPaths: string[], options?: WebThemeOptions); + options(): WebThemeOptions; + options(value: WebThemeOptions): this; + setOption(key: K, value: WebThemeOptions[K]): this; + getOption(key: K): WebThemeOptions[K]; + addLoadPath(path: string): this; + loadPaths(): string[]; + setErrorView(view: string): void; + errorView(): string; + setRedirectView(view: string): void; + redirectView(): string; + addStatic(path: string, mount: string): void; + static(): Array<{ path: string; mount: string; }>; + addRoute(path: string, opts: { + handle?: string; + }, resolver?: any): this; + addResolver(handle: string, resolvers: any): this; + routes(): any[]; + resolvers(): any; + matchRoute(urlPath: string): { + route: { + handle: string; + view: string; + }; + params: any; + } | false; + urlFromRoute(handle: string, params: any, noRedirect?: boolean): string | null; +} + +export abstract class Adapter extends EventEmitter { + constructor(engine: TEngine, source: fractal.core.entities.EntitySource); + protected _source: fractal.core.entities.EntitySource; + readonly engine: TEngine; + readonly views: Array<{ + handle: string; + path: string; + content: string; + }>; + setHandlePrefix(prefix: string): this; + load(): void; + getReferencesForView(handle: string): any[]; + getView(handle: string): any; + + protected _resolve(value: PromiseLike | T): Promise; + + abstract render(path: string, str: string, context: any, meta: any): Promise; +} + +export namespace utils { + function lang(filePath: string): { + name: string, + mode: string, + scope: string | null, + color: string | null, + }; + function titlize(str: string): string; + function slugify(str: string): string; + function toJSON(item: any): {}; + function escapeForRegexp(str: string): string; + function parseArgv(): { + command: string; + args: string[]; + opts: any; + }; + function stringify(data: any, indent?: number): string; + function fileExistsSync(path: string): boolean; + function isPromise(value: T | PromiseLike): value is PromiseLike; + function isPromise(value: any): value is PromiseLike; + function md5(str: string): string; + function mergeProp(prop: any, upstream: any): any; + function defaultsDeep(...args: T[]): T; + function relUrlPath(toPath: string, fromPath: string, opts?: any): string; +} + +export namespace core { + type Component = fractal.api.components.Component; + const Component: typeof fractal.api.components.Component; + type Variant = fractal.api.variants.Variant; + const Variant: typeof fractal.api.variants.Variant; + type Doc = fractal.api.docs.Doc; + const Doc: typeof fractal.api.docs.Doc; +} diff --git a/types/frctl__fractal/tsconfig.json b/types/frctl__fractal/tsconfig.json new file mode 100644 index 0000000000..7ef7117640 --- /dev/null +++ b/types/frctl__fractal/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "@frctl/fractal": ["frctl__fractal"] + } + }, + "files": [ + "index.d.ts", + "frctl__fractal-tests.ts" + ] +} diff --git a/types/frctl__fractal/tslint.json b/types/frctl__fractal/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/frctl__fractal/tslint.json @@ -0,0 +1 @@ +{ "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/fuzzaldrin-plus/fuzzaldrin-plus-tests.ts b/types/fuzzaldrin-plus/fuzzaldrin-plus-tests.ts index 97730fe2e5..b5d83d4e9c 100644 --- a/types/fuzzaldrin-plus/fuzzaldrin-plus-tests.ts +++ b/types/fuzzaldrin-plus/fuzzaldrin-plus-tests.ts @@ -1,4 +1,8 @@ -import * as fz from "fuzzaldrin-plus"; +import * as fz from 'fuzzaldrin-plus' + +// +// Simple use cases +// ---------------------------------------------------------------------- const candidates = [ 'Find And Replace: Select All', @@ -7,14 +11,201 @@ const candidates = [ 'Application: Install Update', 'Install' ] -const objectCandidates = candidates.map(s => ({ foo: s })); +const objectCandidates = candidates.map(s => ({ foo: s })) +const options: fz.IOptions = { allowErrors: true } +const filterOptions: fz.IFilterOptions = { + allowErrors: true, + key: 'foo' +} -fz.filter(candidates, 'install'); -fz.filter(objectCandidates, 'install', { key: 'foo' }); +fz.filter(candidates, 'install') +fz.filter(candidates, 'install', options) +fz.filter(candidates, 'install', filterOptions) +fz.filter(objectCandidates, 'install', { key: 'foo' }) -const prepQuery = fz.prepQuery('install'); -fz.score('Application: Install Update', 'install'); -fz.score('Application: Install Update', 'install', prepQuery); +const preparedQuery: fz.Query = fz.prepareQuery('install') -fz.match('Application: Install Update', 'install'); -fz.match('Application: Install Update', 'install', prepQuery); +fz.score('Maybe', 'me') +fz.score('Maybe', 'me', undefined) +fz.score('Maybe', 'me', null) +fz.score('Maybe', 'me', {}) +fz.score('Maybe', 'me', { allowErrors: true }) +fz.score('Application: Install Update', 'install') +fz.score('Application: Install Update', 'install', { preparedQuery }) + +fz.match('Maybe', 'me') +fz.match('Application: Install Update', 'install') +fz.match('Application: Install Update', 'install', { preparedQuery }) + +fz.wrap('Maybe', 'me') + +// +// Complex filter cases, using all the options +// ---------------------------------------------------------------------- + +fz.filter(['Maybe', 'Me'], 'me') +fz.filter(['Maybe', 'Me'], 'me', undefined) +fz.filter(['Maybe', 'Me'], 'me', null) +fz.filter(['Maybe', 'Me'], 'me', {}) +fz.filter(['Maybe', 'Me'], 'me', { allowErrors: true }) +fz.filter(['Maybe', 'Me'], 'me', { key: 'key' }) +fz.filter(['Maybe', 'Me'], 'me', { + preparedQuery: fz.prepareQuery('me') +}) +fz.filter(['Maybe', 'Me'], 'me', { + allowErrors: true, + usePathScoring: true +}) +fz.filter(['Maybe', 'Me'], 'me', { + allowErrors: true, + usePathScoring: true, + useExtensionBonus: true +}) +fz.filter(['Maybe', 'Me'], 'me', { + allowErrors: true, + usePathScoring: true, + useExtensionBonus: true, + pathSeparator: '/' +}) +fz.filter(['Maybe', 'Me'], 'me', { + allowErrors: true, + usePathScoring: true, + useExtensionBonus: true, + pathSeparator: '\\', + optCharRegEx: new RegExp('') +}) +fz.filter(['Maybe', 'Me'], 'me', { + allowErrors: true, + usePathScoring: true, + useExtensionBonus: true, + pathSeparator: '\\', + optCharRegEx: new RegExp(''), + wrap: { + tagOpen: '', + tagClass: '', + tagClose: '' + } +}) +fz.filter(['Maybe', 'Me'], 'me', { + allowErrors: true, + usePathScoring: true, + useExtensionBonus: true, + pathSeparator: '\\', + optCharRegEx: new RegExp(''), + wrap: { + tagOpen: '', + tagClass: '', + tagClose: '' + }, + maxResults: 10 +}) +fz.filter(['Maybe', 'Me'], 'me', { + allowErrors: true, + usePathScoring: true, + useExtensionBonus: true, + pathSeparator: '\\', + optCharRegEx: new RegExp(''), + wrap: { + tagOpen: '', + tagClass: '', + tagClose: '' + }, + maxResults: 10, + maxInners: 10 +}) +fz.filter([{ title: 'Maybe' }, { title: 'Me' }], 'me', { + allowErrors: true, + usePathScoring: true, + useExtensionBonus: true, + pathSeparator: '\\', + optCharRegEx: new RegExp(''), + wrap: { + tagOpen: '', + tagClass: '', + tagClose: '' + }, + maxResults: 10, + maxInners: 10, + key: 'title' +}) +fz.filter([{ title: 'Maybe' }, { title: 'Me' }], 'me', { + allowErrors: true, + key: 'title' +}) +fz.filter([{ title: 'Maybe' }, { title: 'Me' }], 'me', { + key: 'title' +}) + +/** + * ====================================================================== + * Incorrect Usage: + * ====================================================================== + */ + +// $ExpectError +fz.score() +// $ExpectError +fz.match() +// $ExpectError +fz.wrap() +// $ExpectError +fz.prepareQuery() +// $ExpectError +fz.score('Maybe', 'me', true) +// $ExpectError +fz.score('Maybe', 'me', 'string') +// $ExpectError +fz.score('Maybe', 'me', 1) + +const items = ['Maybe', 'Me'] +// $ExpectError +fz.score(items, 'me') +// $ExpectError +fz.score('Maybe', 'me', { unknownProperty: true }) +// $ExpectError +fz.match(items, 'me') +// $ExpectError +fz.wrap(items, 'me') +// $ExpectError +fz.prepareQuery() + +// $ExpectError +const incorrectOptions: fz.IFilterOptions = { allowErrors: 'not a boolean' } + +// $ExpectError +fz.filter(candidates, 'install', { allowErrors: 'not a boolean' }) +fz.filter([{ title: 'Maybe' }, { title: 'Me' }], 'me', { + // $ExpectError + incorrectProperty: true, + key: 'title' +}) + +// $ExpectError +fz.score('Maybe', 'me', undefined, options) +// $ExpectError +fz.match('Maybe', 'me', undefined, options) + +// $ExpectError +fz.filter() +// $ExpectError +fz.filter('not an array', 'query') +// $ExpectError +fz.filter(['Maybe', 'Me'], 'me', { allowErrors: 'not a boolean' }) +// $ExpectError +fz.filter(['Maybe', 'Me'], 'me', { key: true }) +// $ExpectError +fz.filter(['Maybe', 'Me'], 'me', { preparedQuery: {} }) +// $ExpectError +fz.filter([{ title: 'Maybe' }, { title: 'Me' }], 'me', { + key: 1 +}) +// $ExpectError +fz.filter([{ title: 'Maybe' }, { title: 'Me' }], 'me', { + allowErrors: 'not a boolean', + key: 1 +}) +// $ExpectError +fz.filter([{ title: 'Maybe' }, { title: 'Me' }], 'me', { + allowErrors: 'not a boolean', + key: 'title' +}) diff --git a/types/fuzzaldrin-plus/index.d.ts b/types/fuzzaldrin-plus/index.d.ts index 34d6949ace..cd52c501d4 100644 --- a/types/fuzzaldrin-plus/index.d.ts +++ b/types/fuzzaldrin-plus/index.d.ts @@ -1,29 +1,39 @@ -// Type definitions for fuzzaldrin-plus +// Type definitions for fuzzaldrin-plus 0.6.0 // Project: https://github.com/jeancroy/fuzzaldrin-plus/ -// Definitions by: Jean Christophe Roy , Jason Killian +// Definitions by: Jean Christophe Roy , +// Jason Killian +// Ronald Rey // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 -export as namespace fuzzaldrin; +export as namespace fuzzaldrin -export interface IQueryOptions { - pathSeparator?: string; - optCharRegEx?: RegExp; +export class Query { + $$__internal: Symbol } -export interface IScoringOptions extends IQueryOptions { - allowErrors?: boolean; - isPath?: boolean; - useExtensionBonus?: boolean; +export interface IOptions { + allowErrors?: boolean + usePathScoring?: boolean + useExtensionBonus?: boolean + pathSeparator?: '/' | '\\' | string + optCharRegEx?: RegExp + wrap?: { tagOpen?: string; tagClass?: string; tagClose?: string } + preparedQuery?: Query } -export interface IFilterOptions extends IScoringOptions { - key?: string; - maxResults?: number; +export type IFilterOptions = IOptions & { + key?: string + maxResults?: number + maxInners?: number } -export type PreparedQuery = { __internalAPIBrand: string; }; - -export function filter(data: T[], query: string, options?: IFilterOptions): T[]; -export function score(str: string, query: string, preparedQuery?: PreparedQuery, options?: IScoringOptions): number; -export function match(str: string, query: string, preparedQuery?: PreparedQuery, options?: IScoringOptions): number[]; -export function prepQuery(query: string, options?: IQueryOptions): PreparedQuery; +export function filter( + data: T[], + query: string, + options?: IFilterOptions +): T[] +export function score(str: string, query: string, options?: IOptions): number +export function match(str: string, query: string, options?: IOptions): number[] +export function wrap(str: string, query: string, options?: IOptions): string +export function prepareQuery(query: string, options?: IOptions): Query diff --git a/types/ganache-core/ganache-core-tests.ts b/types/ganache-core/ganache-core-tests.ts new file mode 100644 index 0000000000..c0a6121c34 --- /dev/null +++ b/types/ganache-core/ganache-core-tests.ts @@ -0,0 +1,3 @@ +import { provider } from "ganache-core"; + +provider({ verbose: true }); diff --git a/types/ganache-core/index.d.ts b/types/ganache-core/index.d.ts new file mode 100644 index 0000000000..9297848806 --- /dev/null +++ b/types/ganache-core/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for ganache-core 2.1 +// Project: https://github.com/trufflesuite/ganache-core#readme +// Definitions by: Leonid Logvinov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +import { Provider } from "ethereum-protocol"; +export interface GanacheOpts { + verbose?: boolean; + logger?: { + log(msg: string): void; + }; + port?: number; + network_id?: number; + networkId?: number; + mnemonic?: string; + gasLimit?: number; +} +export function provider(opts: GanacheOpts): Provider; diff --git a/types/ganache-core/tsconfig.json b/types/ganache-core/tsconfig.json new file mode 100644 index 0000000000..ecbab1915e --- /dev/null +++ b/types/ganache-core/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", + "ganache-core-tests.ts" + ] +} diff --git a/types/ganache-core/tslint.json b/types/ganache-core/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ganache-core/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/gapi/index.d.ts b/types/gapi/index.d.ts index 38bf7f07b4..7ab0dfd1e6 100644 --- a/types/gapi/index.d.ts +++ b/types/gapi/index.d.ts @@ -247,11 +247,7 @@ declare namespace gapi.client { } interface HttpRequestRejected { - result: { - error: { - message: string; - } - }; + result: any | boolean; body: string; headers?: any[]; status?: number; diff --git a/types/generic-pool/generic-pool-tests.ts b/types/generic-pool/generic-pool-tests.ts index 6cf0292709..09a1e611ea 100644 --- a/types/generic-pool/generic-pool-tests.ts +++ b/types/generic-pool/generic-pool-tests.ts @@ -41,6 +41,8 @@ const opts = { const pool = genericPool.createPool(factory, opts); +pool.start(); + pool.use((conn: Connection) => 'test') .then((result: string) => { }); diff --git a/types/generic-pool/index.d.ts b/types/generic-pool/index.d.ts index 8cae9ce37c..e50682ab12 100644 --- a/types/generic-pool/index.d.ts +++ b/types/generic-pool/index.d.ts @@ -17,6 +17,7 @@ export class Pool extends EventEmitter { max: number; min: number; + start(): void; acquire(priority?: number): PromiseLike; release(resource: T): void; destroy(resource: T): void; diff --git a/types/gestalt/gestalt-tests.tsx b/types/gestalt/gestalt-tests.tsx new file mode 100644 index 0000000000..6445062d1a --- /dev/null +++ b/types/gestalt/gestalt-tests.tsx @@ -0,0 +1,28 @@ +import * as React from "react"; +import { + Avatar, + Box, + Button, + Card, + Checkbox, + Column, + Container, + GroupAvatar, + Icon, + IconButton +} from "gestalt"; + +; +; +