diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e377cd02ab..f4f973d6c8 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -6,6 +6,7 @@ /types/abbrev/ @BendingBender /types/abs/ @AyaMorisawa /types/absolute/ @AyaMorisawa +/types/abstract-leveldown/ @MeirionHughes @danwbyrne /types/acc-wizard/ @cyrilschumacher /types/accept-language-parser/ @kampfgnom /types/accepts/ @bomret @brikou @@ -16,6 +17,7 @@ /types/acorn/ @RReverser @e-cloud /types/actioncable/ @zhu1230 /types/actions-on-google/ @joelhegg +/types/activedirectory2/ @pasthelod /types/activex-access/ @zspitz /types/activex-adodb/ @zspitz /types/activex-adox/ @zspitz @@ -46,6 +48,7 @@ /types/adone/ @s0m3on3 @maxveres /types/aframe/ @devpaul @bertoritger @twastvedt /types/agenda/ @meirgottlieb @princjef +/types/agent-base/ @Shinigami92 /types/aggregate-error/ @BendingBender /types/agora-rtc-sdk/ @menthays /types/ajv-errors/ @afshawnlotfi @@ -55,6 +58,7 @@ /types/algebra.js/ @CaselIT /types/algoliasearch/ @cbaptiste @haroenv @aherve @samouss /types/allure-js-commons/ @zaqqaz +/types/almost-equal/ @cmaddalozzo /types/alt/ @Shearerbeard /types/amazon-cognito-auth-js/ @scottescue /types/amazon-product-api/ @MattiLehtinen @alien35 @@ -74,7 +78,7 @@ /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 +/types/angular-block-ui/ @lassebn @sclassen @renjfk /types/angular-bootstrap-calendar/ @Odrin /types/angular-bootstrap-lightbox/ @rolandzwaga /types/angular-breadcrumb/ @marctalary @@ -109,15 +113,16 @@ /types/angular-material/ @blbigelow @PeterHajdu @Dona278 @geertjansen @eknowles /types/angular-media-queries/ @jpmnteiro /types/angular-meteor/ @pgrm -/types/angular-mocks/ @diegovilar @daltin +/types/angular-mocks/ @diegovilar @daltin @thorn0 /types/angular-modal/ @paullessing /types/angular-oauth2/ @anteriovieira /types/angular-pdfjs-viewer/ @bastienmoulia /types/angular-permission/ @vmishevski /types/angular-promise-tracker/ @rufusl +/types/angular-q-extras/ @mistic100 /types/angular-q-spread/ @rafw87 /types/angular-resource/ @diegovilar @miffels -/types/angular-route/ @park9140 +/types/angular-route/ @park9140 @gkalpak /types/angular-sanitize/ @diegovilar /types/angular-scenario/ @RomanoLindano /types/angular-scroll/ @samherrmann @@ -129,7 +134,7 @@ /types/angular-toasty/ @muenchdo /types/angular-tooltips/ @leonard-thieu /types/angular-translate/ @michelsalib @GabrielGil -/types/angular-ui-bootstrap/ @xt0rted @ry8806 +/types/angular-ui-bootstrap/ @xt0rted @ry8806 @alfiej /types/angular-ui-router/ @michelsalib @matiishyn @mikehaas763 /types/angular-ui-scroll/ @marknadig /types/angular-ui-sortable/ @thgreasi @@ -145,6 +150,7 @@ /types/animejs/ @A-Babin /types/annyang/ @hisham @theluk /types/ansi-colors/ @rogierschouten +/types/ansi-escape-sequences/ @aomarks /types/ansi-escapes/ @jacobbubu /types/ansi-regex/ @mvachhar /types/ansi-styles/ @brynbellomy @plylrnsdy @@ -167,7 +173,7 @@ /types/appframework/ @kyo-ago /types/applepayjs/ @martincostello /types/appletvjs/ @brainded -/types/applicationinsights-js/ @kamilszostak +/types/applicationinsights-js/ @kamilszostak @markwolff /types/aqb/ @Athenkosi-Mase /types/arangodb/ @pluma /types/arbiter/ @arash16 @@ -185,6 +191,7 @@ /types/arr-union/ @mrmlnc /types/array-find-index/ @samverschueren /types/array-foreach/ @skysteve +/types/array-sort/ @DanielMSchmidt /types/array-uniq/ @DanielRosenwasser /types/array-unique/ @CSLTech /types/arrify/ @wanganjun @@ -223,8 +230,9 @@ /types/auth0-angular/ @homesar /types/auth0-js/v7/ @advancedrei /types/auth0-js/ @adrianchia @mdurrant @peterblazejewicz -/types/auth0-lock/ @carusology @goldcaddy77 @lfaudreejr +/types/auth0-lock/ @carusology @goldcaddy77 @lfaudreejr @willcaul /types/auth0.widget/ @advancedrei +/types/auto-bind/ @sseppola /types/auto-launch/ @rhysd @unindented /types/auto-sni/ @janwo /types/autobahn/ @darkl @valepu @@ -234,7 +242,7 @@ /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 @jeznag +/types/aws-lambda/ @skarum @tobyhede @buggy @y13i @wwwy3y3 @OrthoDex @MichaelMarner @daniel-cottone @kostya-misura @coderbyheart @palmithor @daniloraisi @simonbuchan @Haydabase @repl-chris @aneilbaboo @jeznag @louislarry @dpapukchiev /types/aws-serverless-express/ @threesquared @jcaffey @mattmeye @albertovasquez /types/aws4/ @ajcrites /types/axe-webdriverjs/ @JoshuaKGoldberg @@ -255,6 +263,11 @@ /types/babel-types/ @yortus @baxtersa @marvinhagemeister @bcherny /types/babel-webpack-plugin/ @j-f1 /types/babel__code-frame/ @mohsen1 @ForbesLindesay +/types/babel__core/ @yortus @marvinhagemeister @mgroenhoff +/types/babel__generator/ @yortus @johnnyestilles @mgroenhoff +/types/babel__parser/ @yortus @marvinhagemeister @mgroenhoff +/types/babel__template/ @yortus @marvinhagemeister @mgroenhoff +/types/babel__traverse/ @yortus @marvinhagemeister @rpetrich @mgroenhoff /types/babelify/ @TeamworkGuy2 @marvinhagemeister /types/babylon/ @yortus @marvinhagemeister /types/babylon-walk/ @czbuchi @@ -265,7 +278,7 @@ /types/backbone-relational/ @eirikhm /types/backbone.layoutmanager/ @hejiang2000 /types/backbone.localstorage/ @lgrignon -/types/backbone.marionette/ @zhamid @nvivo @sventschui @razorness +/types/backbone.marionette/ @zhamid @nvivo @sventschui @razorness @confususs /types/backbone.paginator/ @Nyamazing /types/backbone.radio/ @alphaleonis /types/backgrid/ @jlujan @@ -274,6 +287,7 @@ /types/backoff/ @BendingBender /types/baconjs/ @alexander-matsievsky @gekkio /types/bagpipes/ @micmro +/types/barbellweights/ @evelijn /types/barcode/ @pvomhoff /types/bardjs/ @TepigMC /types/base-64/ @dolanmiu @@ -290,6 +304,7 @@ /types/bazinga-translator/ @alexndlm /types/bcrypt/ @codeanimal @IOAyman @dstapleton92 /types/bcryptjs/ @RafaelKr +/types/bdfjs/ @jeremejevs /types/beats/ @urish /types/bech32/ @micksatana /types/behavior3/ @carrrywu @@ -297,6 +312,8 @@ /types/bem-cn/ @selkinvitaly /types/bencode/ @tobenna /types/better-curry/ @pocesar +/types/better-queue/ @maozedong +/types/better-scroll/ @stoneChen /types/better-sqlite3/ @Morfent @matrumz /types/bezier-easing/ @ptlis /types/bezier-js/ @danmarshall @@ -331,6 +348,7 @@ /types/blocked/ @l-jonas /types/blockies/ @LogvinovLeon /types/blocks/ @ksmigiel +/types/bloem/ @danwbyrne /types/bloomfilter/ @slawiko /types/blue-tape/ @sodatea /types/bluebird/v1/ @Bartvds @@ -378,6 +396,7 @@ /types/braintree-web/ @chlela /types/breeze/ @borisyankov /types/bricks.js/ @kondi +/types/bro-fs/ @ffflorian /types/brorand/ @chrootsu /types/browser-bunyan/ @PaulLockwood @kryops /types/browser-fingerprint/ @LKay @@ -399,7 +418,7 @@ /types/bufferstream/ @Bartvds /types/builtin-modules/ @ajafff /types/bull/v2/ @bgrieder @JProgrammer -/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold @iamolegga @koblas +/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold @iamolegga @koblas @bondz @wuha-team @aleccool213 /types/bump-regex/ @silkentrance /types/bunnymq/ @cyrilschumacher /types/bunyan/ @amikhalev @@ -431,6 +450,7 @@ /types/canvas-gauges/ @Mikhus /types/canvasjs/ @brutalimp /types/capitalize/ @frederickfogerty +/types/capture-console/ @AustonZ /types/card-validator/ @ChanceM /types/case-sensitive-paths-webpack-plugin/ @r3nya /types/caseless/ @downace @mastermatt @@ -439,14 +459,15 @@ /types/cassandra-driver/ @Svjard @pc-jedi /types/catbox/v7/ @jasonswearingen @AJamesPhillips /types/catbox/ @jasonswearingen @AJamesPhillips @saboya +/types/catbox-redis/ @SimonSchick /types/cbor/ @pushplay /types/ccap/ @taoqf -/types/cesium/ @Zuzon @hnipps @szechyjs +/types/cesium/ @Zuzon @hnipps @szechyjs @golyalpha /types/chai/v2/ @Bartvds @AGBrown /types/chai/ @jedmao @Bartvds @AGBrown @olivr70 @mwistrand @joshuakgoldberg @shaunluttin @Naktibalda @micksatana @ErikSchierboom /types/chai-arrays/ @clementprevot /types/chai-as-promised/ @jt000 @Kuniwak @leonard-thieu @lazerwalker @mattbishop -/types/chai-datetime/ @cliffburger +/types/chai-datetime/ @cliffburger @mattbishop /types/chai-dom/ @mattlewis92 /types/chai-enzyme/ @asvetliakov /types/chai-fuzzy/ @Bartvds @@ -455,6 +476,7 @@ /types/chai-jquery/ @kazimanzurrashid /types/chai-json-schema/ @ulrichheiniger /types/chai-oequal/ @mizunashi-mana +/types/chai-roughly/ @swist /types/chai-spies/ @kuzn-ilya @harm-less @jounisuo /types/chai-string/ @nmalaguti /types/chai-subset/ @delta62 @AGBrown @@ -466,8 +488,9 @@ /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 @gebeto @frabnt @alexdor +/types/chart.js/ @anuti @FabienLavocat @KentarouTakeda @larrybahr @mernen @josefpaij @danmana @guillaume-ro-fr @chicoxyzzy @archy-bold @braincore @gebeto @frabnt @alexdor @mahnuh /types/chartist/ @mtgibbs @psimonski @clottman @affilnost @sunnyrjuneja +/types/chartmogul-node/ @chartmogul /types/chayns/ @HenningKuehl /types/check-sum/ @BendingBender /types/check-types/ @idchlife @@ -508,6 +531,7 @@ /types/cli-spinner/ @janslow /types/cli-table/ @arylo /types/cli-table2/ @mgroenhoff +/types/cli-truncate/ @danwbyrne /types/client-sessions/ @netroy /types/clientjs/ @icopp /types/cliff/ @brynbellomy @@ -558,6 +582,7 @@ /types/common-errors/ @icopp /types/common-prefix/ @seangenabe /types/common-tags/ @zuzusik @tzupengwang +/types/commondir/ @leonard-thieu /types/commonmark/ @nicojs @leonard-thieu /types/compare-version/ @jpevarnek /types/compare-versions/ @LogvinovLeon @@ -591,7 +616,8 @@ /types/connect-redis/ @xstoudi @morcerf /types/connect-slashes/ @samherrmann /types/connect-timeout/ @cyrilschumacher -/types/console-stamp/ @ericbyers +/types/console-log-level/ @ofrobots +/types/console-stamp/ @ericbyers @guusdegraeve /types/consolidate/ @soywiz @theosherry @nicolashenry /types/consul/ @chrootsu /types/content-disposition/ @bomret @@ -641,7 +667,7 @@ /types/cosmiconfig/v4/ @ozum /types/cosmiconfig/ @ozum @szeck87 @saadq @jinwoo /types/cote/ @makepost -/types/couchbase/ @maouida +/types/couchbase/ @maouida @fluggo /types/countdown/ @gjuchault /types/counterpart/ @santiagodoldan /types/countries-and-timezones/ @zero51 @@ -669,6 +695,7 @@ /types/crossroads/ @diullei /types/cryptiles/ @awendland /types/crypto-js/ @misak113 +/types/crypto-random-string/ @MrManny /types/cryptojs/ @giabao /types/cson/ @stpettersens /types/csprng/ @winksaville @@ -676,7 +703,9 @@ /types/css/ @ilich /types/css-font-loading-module/ @slikts /types/css-modules/ @NeekSandhu +/types/css-to-style/ @bengry /types/cssbeautify/ @rictic +/types/cssnano/ @odnamrataizem /types/csso/ @screendriver /types/csurf/ @horiuchi /types/csv-parse/ @davidm77 @obi-jan-kenobi @@ -714,12 +743,12 @@ /types/d3-format/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-geo/ @ledragon @tomwanzek @gustavderdrache @borisyankov /types/d3-hexbin/ @uncovertruth @tomwanzek -/types/d3-hierarchy/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-hierarchy/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-hsv/ @arrayjam @denisname /types/d3-interpolate/ @tomwanzek @gustavderdrache @borisyankov /types/d3-path/ @tomwanzek @gustavderdrache @borisyankov /types/d3-polygon/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-quadtree/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-quadtree/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-queue/ @tomwanzek @gustavderdrache @borisyankov /types/d3-random/ @tomwanzek @gustavderdrache @borisyankov /types/d3-request/ @Ledragon @gustavderdrache @borisyankov @tomwanzek @@ -764,11 +793,12 @@ /types/dateformat/ @aicest /types/datejs/ @rupertavery /types/daterangepicker/ @SirMartin @smasala @nertzy +/types/dav/ @ToastHawaii /types/db-migrate-base/ @nickiannone /types/db-migrate-pg/ @nickiannone /types/db.js/ @cgwrench /types/dc/ @hansrwindhoff @mtraynham @MatthiasJobst -/types/dd-trace/ @ColinBradley +/types/dd-trace/ @ColinBradley @alloy /types/deasync/ @Sicilica /types/debessmann/ @vkorehov /types/debounce/ @denis-sokolov @@ -814,6 +844,7 @@ /types/detect-indent/ @Bartvds @BendingBender /types/detect-it/ @thomastilkema /types/detect-newline/ @BendingBender +/types/detect-node/ @LogvinovLeon /types/detect-passive-events/ @thomastilkema /types/detect-pointer/ @thomastilkema /types/detect-port/ @lith-light-g @@ -823,8 +854,10 @@ /types/df-visible/ @Litee /types/dhtmlxgantt/ @mkozhukh @chriscamicas /types/dhtmlxscheduler/ @mkozhukh +/types/di/ @johnjbarton /types/di-lite/ @dcrusader /types/diacritics/ @otociulis +/types/dialogflow/ @dyladan /types/diff/ @vvakame @szdc /types/diff2html/ @rtfpessoa /types/dir-resolve/ @andy-ms @@ -832,16 +865,18 @@ /types/discourse-sso/ @championswimmer /types/dispatchr/ @Ragg- /types/disposable-email-domains/ @geoffreak -/types/dnssd/ @angelmerino +/types/dnssd/ @angelmerino @Maxr1998 /types/doccookies/ @jonegerton /types/dockerode/ @seikho @nlaplante @isac322 @lazarusx @meisenzahl @thegecko /types/docopt/ @giggio /types/doctrine/ @rictic /types/document-promises/ @NotWoods +/types/document-ready/ @Jack-Works /types/documentdb/ @NoelAbrahams @brettferdosi @ctstone @yifanwu /types/documentdb-server/ @lith-light-g /types/documentdb-session/ @DanielRosenwasser /types/dojo/ @vansimke +/types/dom-clipboard-api/ @43081j /types/dom-inputevent/ @diagramatics /types/dom-to-image/ @JipSterk /types/dom4/ @adidahiya @giladgray @@ -902,7 +937,7 @@ /types/easy-xapi/ @DeadAlready /types/easy-xapi-utils/ @DeadAlready /types/ebongarde-root/ @Ebongarde -/types/echarts/ @xieisabug @AntiMoron @liveangela +/types/echarts/ @xieisabug @AntiMoron @liveangela @Ovilia /types/ecma-proposal-math-extensions/ @ksm2 /types/ecurve/ @mhegazy /types/ed25519/ @erikma @@ -928,19 +963,22 @@ /types/electron-settings/ @icopp @nrlquaker /types/electron-spellchecker/ @unindented /types/electron-store/ @unindented @jsynowiec +/types/electron-unhandled/ @jeremejevs /types/electron-util/ @kputh /types/electron-window-state/ @rhysd /types/electron-winstaller/ @shiftkey @unindented +/types/elegant-spinner/ @danwbyrne /types/element-ready/ @BendingBender /types/element-resize-detector/ @saranshkataria /types/element-resize-event/ @rogierschouten @plgregoire +/types/elementtree/ @dwieeb /types/elm/ @thSoft /types/email-templates/ @cyrilschumacher @gurisko @blankstar85 /types/ember/v1/ @jedmao /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-mocha/ @dwickern @simonihmig /types/ember-modal-dialog/ @tansongyang /types/ember-qunit/v2/ @dwickern /types/ember-qunit/ @dwickern @@ -949,7 +987,7 @@ /types/ember-testing-helpers/ @chriskrycho /types/ember__test-helpers/ @dfreeman @jamescdavis /types/emissary/ @vvakame -/types/emoji-mart/ @Kovensky +/types/emoji-mart/ @Kovensky @Nicell /types/emoji-regex/ @iKBAHT /types/emojione/ @dbrgn /types/empower/ @vvakame @@ -962,6 +1000,7 @@ /types/enquire.js/ @screendriver /types/ent/ @rogierschouten /types/entities/ @aliceklipper +/types/env-paths/ @danwbyrne /types/env-to-object/ @MugeSo /types/envify/ @tkQubo /types/enzyme/ @MarianPalkus @NoHomey @jwbay @huhuanming @MartynasZilinskas @thovden @hotell @@ -975,7 +1014,9 @@ /types/epilogue/ @micksatana /types/epub/ @julien-c /types/eq.js/ @stephenlautier +/types/error-subclass/ @fitbit /types/errorhandler/ @santialbo +/types/es-feature-detection/ @Jack-Works /types/es6-collections/ @rbuckton /types/es6-promisify/ @harryshipton @bschlenk /types/es6-shim/ @rbuckton @@ -992,12 +1033,13 @@ /types/esprima/v2/ @teppeis @RReverser /types/esprima/ @teppeis @RReverser @peter-scott /types/esprima-walk/ @tswaters -/types/espruino/ @stasberkov +/types/espruino/ @stasberkov @createdbyjurand /types/esri-leaflet/ @strajuser /types/esri-leaflet-geocoder/ @BendingBender /types/estraverse/ @sanex3339 /types/estree/ @RReverser /types/etag/ @BendingBender +/types/eth-lightwallet/ @LogvinovLeon /types/ethereum-protocol/ @LogvinovLeon /types/ethereumjs-abi/ @LogvinovLeon /types/ethereumjs-tx/ @LogvinovLeon @@ -1027,6 +1069,7 @@ /types/expect-puppeteer/ @JoshuaKGoldberg @tkrotoff /types/expect.js/ @teppeis /types/expectations/ @vvakame +/types/expired-storage/ @intolerance /types/expo/v23/ @KonstantinKai /types/expo/v24/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger /types/expo/v25/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @@ -1047,7 +1090,7 @@ /types/express-domain-middleware/ @hookclaw /types/express-ejs-layouts/ @erikma /types/express-enforces-ssl/ @kevinstubbs -/types/express-fileupload/ @Naktibalda +/types/express-fileupload/ @Naktibalda @silkimen /types/express-flash/ @iMobs /types/express-flash-2/ @mathsalmi /types/express-flash-notification/ @Mister4Eyes @@ -1077,6 +1120,7 @@ /types/express-socket.io-session/ @AylaJK /types/express-to-koa/ @xiaohanzhang /types/express-unless/ @wokim +/types/express-wechat-access/ @simmons8616 /types/express-winston/ @bricka /types/express-ws/ @ajliv /types/express-xml-bodyparser/ @noticeMaker @macedigital @@ -1086,6 +1130,7 @@ /types/extract-stack/ @BendingBender /types/extract-text-webpack-plugin/ @flying-sheep @katyo /types/extract-zip/ @mizunashi-mana +/types/extsprintf/ @AlexHankins /types/eyes/ @brynbellomy /types/ez-plus/ @AndersonFriaca /types/f1/ @neolwc @@ -1138,11 +1183,13 @@ /types/fetch-mock/ @asvetliakov @tamird @merrywhether @chrissinclair @matttennison @quentinbouygues /types/fetch.io/ @newraina /types/ffi/ @loyd @waitingsong +/types/ffi-napi/ @keerthi16 @KiranNiranjan /types/ffmpeg-static/ @iamstevetran /types/ffprobe-static/ @iamstevetran /types/fhir-js-client/ @rmchndrng /types/fibers/ @soywiz /types/fibjs/ @richardo2016 +/types/figlet/ @Ailrun /types/figures/ @BendingBender /types/file-exists/ @BendingBender /types/file-saver/ @cyrilschumacher @DaIgeb @chrismbarr @@ -1155,6 +1202,8 @@ /types/finalhandler/ @chrootsu /types/finch/ @DavidSichau /types/find/ @andypyrope +/types/find-parent-dir/ @ikatyang +/types/find-project-root/ @ikatyang /types/find-root/ @Alorel /types/find-up/ @BendingBender /types/find-versions/ @LogvinovLeon @@ -1180,6 +1229,7 @@ /types/flot/ @burlandm @Anticom @admiralsmaster /types/flowjs/ @ryan10132 /types/fluent-ffmpeg/ @tcaesvk @DingWeizhe +/types/flush-write-stream/ @djcsdy /types/flux/ @stkb @GiedriusGrabauskas /types/fluxible/ @xbim /types/fluxible-router/ @xbim @@ -1192,8 +1242,8 @@ /types/forever-agent/ @yavanosta /types/forever-monitor/ @shuntksh @wrboyce /types/forge-di/ @adamcarr -/types/fork-ts-checker-webpack-plugin/ @JounQin /types/form-data/ @soywiz @leonyu @BendingBender +/types/form-serialize/ @tyler-johnson /types/form-serializer/ @flqw /types/form-urlencoded/ @alepee /types/format-duration/ @Roaders @@ -1206,6 +1256,7 @@ /types/foundation/ @borisyankov /types/fpsmeter/ @alampros /types/framebus/ @kbukum +/types/frctl__fractal/ @pmccloghrylaing /types/freedom/ @jpevarnek /types/freeport/ @atd-schubert /types/fresh/ @BendingBender @@ -1229,7 +1280,7 @@ /types/fs-promise/ @tarruda /types/fs-readdir-recursive/ @pscanf /types/fs-readfile-promise/ @mtsg -/types/fscreen/ @joscha +/types/fscreen/ @joscha @terrymun /types/fsevents/ @BendingBender /types/ftdomdelegate/ @dotnetnerd /types/ftp/ @rogierschouten @@ -1238,12 +1289,14 @@ /types/fullpage.js/ @jodiwarren /types/fusioncharts/ @rohitkr @shivarajkv /types/fuzzaldrin/ @mhegazy -/types/fuzzaldrin-plus/ @jeancroy @jkillian +/types/fuzzaldrin-plus/ @jeancroy @jkillian @reyronald /types/fuzzyset/ @lgrignon @narainsagar /types/fuzzyset.js/ @lgrignon @narainsagar /types/fxn/ @charrondev /types/gae.channel.api/ @vvakame +/types/gamedig/ @ivansieder /types/gamequery/ @Laubi +/types/ganache-core/ @LogvinovLeon /types/gandi-livedns/ @xstoudi /types/gapi/ @sgtfrankieboy /types/gapi.analytics/ @gatsbimantico @@ -1383,6 +1436,7 @@ /types/gapi.youtube/ @sgtfrankieboy /types/gapi.youtubeanalytics/ @sgtfrankieboy /types/gaussian/ @scttcper +/types/gc-stats/ @vfernandestoptal /types/geetest/ @plantain-00 /types/gen-readlines/ @CodeAnimal /types/generate-changelog/ @ffflorian @@ -1396,6 +1450,7 @@ /types/geokdbush/ @DenisCarriere /types/geometry-dom/ @nakakura /types/geopattern/ @Gaelan +/types/gestalt/ @serranoarevalo /types/get-caller-file/ @ajafff /types/get-folder-size/ @mszczepanczyk /types/get-node-dimensions/ @vincekovacs @@ -1412,6 +1467,8 @@ /types/git-branch/ @rynclark /types/git-config/ @stpettersens /types/git-remote-origin-url/ @janslow +/types/git-url-parse/ @ajafff +/types/github-url-to-object/ @ajafff /types/github-username-regex/ @BehindTheMath /types/gitlab/ @yanqing6628780 @Arylo /types/gl-matrix/ @mattijskneppers @tatchx @nbabanov @auzmartist @surtr-isaz @@ -1426,7 +1483,7 @@ /types/glob-stream/ @Bartvds @mrmlnc /types/glob-to-regexp/ @whatasoda /types/global-tunnel-ng/ @BendingBender -/types/globalize/ @gcastre @afromogli +/types/globalize/ @gcastre @afromogli @bryanforbes /types/globalize-compiler/ @iclanton /types/globby/ @douglasduteil @ikatyang /types/globule/ @durad @@ -1436,9 +1493,9 @@ /types/google-adwords-scripts/ @jafaircl /types/google-apps-script/ @motemen @grant /types/google-apps-script-oauth2/ @dhayab -/types/google-cloud__datastore/ @beaulac -/types/google-cloud__pubsub/ @pheromonez @LunaPg -/types/google-cloud__storage/ @blove @nbperry @welkie +/types/google-cloud__datastore/ @beaulac @ogawa0071 @ThomasdenH +/types/google-cloud__pubsub/ @pheromonez @LunaPg @msiviero +/types/google-cloud__storage/ @blove @nbperry @welkie @ogawa0071 /types/google-earth/ @icholy /types/google-images/ @dolanmiu /types/google-libphonenumber/ @leonyu @winfinit @@ -1451,12 +1508,13 @@ /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 @bolatovumar +/types/googlemaps/ @cgwrench @nertzy @xaolas @mrmcnerd @martincostello @svenkreiss @bolatovumar @gauthierm /types/googlemaps.infobubble/ @Dashue -/types/googlepay/ @Fluccioni +/types/googlepay/ @Fluccioni @Radu-Raicea /types/got/ @BendingBender @LinusU @ikokostya /types/graceful-fs/v2/ @Bartvds /types/graceful-fs/ @Bartvds @BendingBender +/types/gradient-string/ @Ailrun /types/graham_scan/ @hberntsen /types/gramps__rest-helpers/ @claude /types/graphite-udp/ @EricByers @@ -1516,6 +1574,7 @@ /types/gulp-if/ @joeskeen /types/gulp-image/ @Aankhen /types/gulp-image-resize/ @Aankhen +/types/gulp-imagemin/ @romain-faust /types/gulp-inject/ @k-kagurazaka /types/gulp-insert/ @shantmarouti /types/gulp-install/ @peterjuras @@ -1523,6 +1582,7 @@ /types/gulp-jasmine/ @andypyrope /types/gulp-jasmine-browser/ @tkrotoff /types/gulp-json-editor/ @peterjuras +/types/gulp-jsonmin/ @romain-faust /types/gulp-jsonminify/ @pine /types/gulp-jspm/ @peterjuras /types/gulp-less/ @k-kagurazaka @@ -1536,6 +1596,7 @@ /types/gulp-plumber/ @joeskeen /types/gulp-protractor/ @tkrotoff /types/gulp-pug/ @remisery +/types/gulp-pug-i18n/ @romain-faust /types/gulp-remember/ @tomc974 /types/gulp-responsive-images/ @aankhen /types/gulp-rev/ @tkrotoff @@ -1549,6 +1610,7 @@ /types/gulp-svg-sprite/ @tkqubo /types/gulp-svgmin/ @Aankhen /types/gulp-task-listing/ @joeskeen +/types/gulp-template/ @pe8ter /types/gulp-tsd/ @k-kagurazaka /types/gulp-uglify/ @ChristopherHaws @leonard-thieu /types/gulp-useref/ @tkrotoff @@ -1579,10 +1641,12 @@ /types/has-ansi/ @BendingBender /types/hash-file/ @HiromiShikata /types/hash-stream/ @BendingBender +/types/hash-sum/ @DanielRosenwasser /types/hasha/ @BendgingBender /types/hasher/ @flyfishMT /types/hashids/ @pocesar /types/hashmap/ @outring +/types/hat/ @tup1tsa /types/haversine/ @screendriver /types/hbs/ @davidm77 /types/hdkey/ @LogvinovLeon @@ -1616,6 +1680,7 @@ /types/hjson/ @crunchie84 /types/hls.js/ @jgainfort /types/hoek/ @prashaantt +/types/hoist-non-react-statics/ @JounQin /types/holderjs/ @renjfk /types/hooker/ @misak113 /types/hopscotch/ @pimterry @Aurimas1 @@ -1672,6 +1737,7 @@ /types/i18next-sprintf-postprocessor/ @cyrilschumacher /types/i18next-xhr-backend/ @jamuhl @GiedriusGrabauskas /types/i2c-bus/ @101100 +/types/iarna__toml/ @ajafff /types/iban/ @cyrilschumacher /types/ibm-mobilefirst/ @nacho4d /types/ibm_db/ @agov @@ -1686,11 +1752,16 @@ /types/iframe-resizer/ @arminbaljic /types/ignite-ui/ @IgniteUI /types/ignore-styles/ @tai2 -/types/iltorb/ @Alorel +/types/iltorb/ @Alorel @reconbot /types/image-size/ @elisee /types/imagemagick/ @soywiz /types/imagemagick-native/ @horiuchi /types/imagemapster/ @delphinus35 +/types/imagemin/ @romain-faust +/types/imagemin-gifsicle/ @romain-faust +/types/imagemin-jpegtran/ @romain-faust +/types/imagemin-optipng/ @romain-faust +/types/imagemin-svgo/ @romain-faust /types/images/ @DingWeizhe /types/imagesloaded/ @coldacid @apexskier /types/imap/ @psnider @@ -1712,11 +1783,10 @@ /types/iniparser/ @chrootsu /types/inline-css/ @philipisapain /types/inline-style-prefixer/ @ahz @dpetrezselyova -/types/inquirer/ @tkQubo @ppathan @jouderianjr @bang88 @bitjson @synarque @jrockwood @kwkelly +/types/inquirer/ @tkQubo @ppathan @jouderianjr @bang88 @bitjson @synarque @jrockwood @kwkelly @Ailrun /types/insert-module-globals/ @leonard-thieu /types/insight/ @vvakame /types/integer/ @Morfent -/types/interact.js/ @dduugg @adidahiya @thasner /types/intercom-client/ @jineshshah36 @peping /types/intercom-web/ @fongandrew @salbahra @onatm /types/intercomjs/ @spencerwi @@ -1724,16 +1794,20 @@ /types/intl/ @RagibHasin /types/intl-locales-supported/ @Slessi /types/intl-messageformat/ @mhegazy +/types/intl-relativeformat/ @mohsen1 /types/intl-tel-input/ @fdnhkj @leonard-thieu /types/into-stream/ @BendingBender +/types/intrinsic-scale/ @shalomdotnet /types/intro.js/ @anahkiasen /types/invariant/ @bennett000 /types/inversify-devtools/ @inversify /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/ioredis/v3/ @plantain-00 @chrisleck @aliarham11 @br8h @shaharmor @palindrom615 @reconbot +/types/ioredis/ @plantain-00 @chrisleck @aliarham11 @br8h @shaharmor @palindrom615 @reconbot /types/iota.lib.js/ @fogsh /types/ip/ @codeanimal +/types/ip-address/ @danwbyrne /types/ip-regex/ @unindented /types/ipcheck/ @bengry /types/irc/ @phillips1012 @@ -1744,6 +1818,7 @@ /types/is-archive/ @mhegazy /types/is-array/ @pine /types/is-binary-path/ @DanielRosenwasser +/types/is-callable/ @nieltg /types/is-ci/ @atd-schubert /types/is-color/ @VitorLuizC /types/is-compressed/ @mhegazy @@ -1763,6 +1838,7 @@ /types/is-relative-url/ @mhegazy /types/is-root/ @mhegazy /types/is-root-path/ @mhegazy +/types/is-running/ @danwbyrne /types/is-scoped/ @postcrafter /types/is-stream/ @me /types/is-svg/ @BendingBender @@ -1770,6 +1846,7 @@ /types/is-touch-device/ @screendriver /types/is-url/ @RyotaMurohoshi /types/is-url-superb/ @kryops +/types/is-uuid/ @tedre191 /types/is-windows/ @mizunashi-mana /types/isbn-utils/ @elhaard /types/iscroll/ @csrakowski @devlato @@ -1805,7 +1882,7 @@ /types/jasmine-promise-matchers/ @matthewjh /types/jasmine_dom_matchers/ @devoto13 /types/jasminewd2/ @sjelin -/types/java/ @jimlloyd @hrl7 +/types/java/ @jimlloyd @hrl7 @darti /types/java-applet/ @cyrilschumacher /types/javascript-astar/ @ptlis /types/javascript-bignum/ @sandersn @@ -1816,7 +1893,7 @@ /types/jdataview/ @RReverser /types/jdenticon/ @mtr /types/jest/v16/ @NoHomey @jwbay -/types/jest/ @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil @ahnpnl @joshuakgoldberg @UselessPickles @r3nya @hotell +/types/jest/ @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil @ahnpnl @joshuakgoldberg @UselessPickles @r3nya @hotell @sebald /types/jest-axe/ @JoshuaKGoldberg /types/jest-diff/ @myabc /types/jest-docblock/ @ikatyang @@ -1830,7 +1907,9 @@ /types/jest-matchers/ @joscha /types/jest-specific-snapshot/ @dawnmist /types/jest-validate/ @ikatyang +/types/jexl/ @m-tomczyk /types/jfs/ @tlaziuk +/types/jira-client/ @KOPTE3 @orta /types/jjv/ @Nemo157 /types/jjve/ @Nemo157 /types/jmespath/ @pushplay @@ -1887,7 +1966,7 @@ /types/jquery-sticky/ @maixiu /types/jquery-tags-input/ @AndersonFriaca /types/jquery-timeentry/ @marknadig -/types/jquery-toast-plugin/ @viqashussain +/types/jquery-toast-plugin/ @viqashussain @astegmaier /types/jquery-toastmessage-plugin/ @joeskeen /types/jquery-truncate-html/ @abraaoalves /types/jquery-urlparam/ @stpettersens @@ -1994,6 +2073,7 @@ /types/jsesc/ @Bartvds /types/jsfl/ @soywiz /types/jsforce/ @dolanmiu @netes @amphro @tnoonan-salesforce @whiteabelincoln +/types/jsgraph/ @rosinbum /types/jshamcrest/ @dharkness /types/jsmockito/ @shiver-me-timbers /types/jsnox/ @stkb @DovydasNavickas @@ -2005,15 +2085,16 @@ /types/json-pointer/ @Bartvds /types/json-query/ @mtraynham /types/json-rpc-ws/ @npenin @mlamp -/types/json-schema/ @bcherny @cyrilletuzi @lucianbuzzo +/types/json-schema/ @bcherny @cyrilletuzi @lucianbuzzo @rolandjitsu /types/json-socket/ @svi3c /types/json-stable-stringify/ @mhfrantz /types/json-stringify-safe/ @BendingBender /types/json2csv/ @juanjoDiaz /types/json2md/ @MartynasZilinskas /types/json3/ @NN--- +/types/json5/ @Esemesek /types/jsonata/ @nick121212 -/types/jsoneditor/ @alejo90 +/types/jsoneditor/ @alejo90 @errietta /types/jsoneditor-for-react/ @joshuakgoldberg /types/jsoneditoronline/ @vbortone /types/jsonfile/ @dbowring @@ -2037,7 +2118,7 @@ /types/jsreport-phantom-pdf/ @taoqf /types/jsreport-xlsx/ @taoqf /types/jsrp/ @harryshipton -/types/jss/ @appsforartists @kof @pelotom +/types/jss/ @appsforartists @kof @pelotom @eps1lon /types/jssha/ @randombk @SrTobi /types/jstimezonedetect/ @olamothe /types/jstorage/ @dflor003 @@ -2089,7 +2170,7 @@ /types/klaw/ @mceachen /types/klaw-sync/ @shiftkey /types/kms-json/ @sunnyone -/types/knex/ @tkQubo @baronfel @MeLlamoPablo @mastermatt @micksatana @shreyjain1994 +/types/knex/ @tkQubo @MeLlamoPablo @mastermatt @micksatana @shreyjain1994 /types/knex-postgis/ @vesse /types/knockback/ @borisyankov /types/knockout/ @borisyankov @Igorbek @moonpyk @EnableSoftware @BenjaminEckardt @ffMathy @@ -2112,18 +2193,22 @@ /types/ko.plus/ @conficient /types/koa/ @DavidCai1993 @jkeylu @brikou /types/koa-basic-auth/ @Tobias4872 +/types/koa-better-body/ @danwbyrne /types/koa-bodyparser/ @hellopao @anup-2s /types/koa-cache-control/ @pe8ter /types/koa-compose/ @jkeylu /types/koa-compress/ @hellopao /types/koa-conditional-get/ @wingsbob +/types/koa-convert/ @danwbyrne +/types/koa-cors/ @romain-faust /types/koa-csrf/ @haskaalo /types/koa-etag/ @wingsbob /types/koa-favicon/ @hellopao /types/koa-generic-session/ @nsimmons @Ragg- /types/koa-hbs/ @jcbmln @mudkipme /types/koa-helmet/ @me -/types/koa-joi-router/ @wingsbob +/types/koa-html-minifier/ @romain-faust +/types/koa-joi-router/ @wingsbob @move-zig /types/koa-json/ @brooklyndev /types/koa-json-error/ @mudkipme /types/koa-logger/ @geoffreak @tlaziuk @@ -2136,9 +2221,10 @@ /types/koa-pug/ @Xstoudi /types/koa-range/ @strax /types/koa-redis/ @nsimmons -/types/koa-response-time/ @thorsedeke +/types/koa-redis-cache/ @dimamukhin +/types/koa-response-time/ @thorsedeke @sjmcdowall /types/koa-route/ @migstopheles @jacogr -/types/koa-router/ @hellopao @schfkt @JounQin +/types/koa-router/ @hellopao @schfkt @JounQin @romain-faust /types/koa-send/ @pe8ter @tlaziuk /types/koa-session/ @kerol2r20 @tlaziuk /types/koa-session-minimal/ @longztian @@ -2147,10 +2233,11 @@ /types/koa-static-cache/ @JounQin /types/koa-views/ @brooklyndev /types/koa-webpack/ @malj @leebenson @miZyind @tlaziuk -/types/koa-websocket/ @moimael @jacogr +/types/koa-websocket/ @moimael @jacogr @zdila /types/koa-xml-body/ @uwinkelvos /types/koa2-cors/ @xialeistudio -/types/koa__cors/ @Xstoudi @izayoiko @stevehipwell +/types/koa2-session-redis/ @DimaMukhin +/types/koa__cors/ @Xstoudi @izayoiko @stevehipwell @sjmcdowall /types/kolite/ @borisyankov /types/konami.js/ @mareek /types/kraken-js/ @darkwebdev @micksatana @@ -2206,11 +2293,12 @@ /types/less2sass/ @gatimus /types/lestate/ @thelambdaparty /types/level-sublevel/ @basp -/types/leveldown/ @tarruda +/types/leveldown/ @tarruda @LinusU /types/levelup/ @blittle @tarruda /types/leven/ @jmalonzo /types/levenshtein/ @geoffreak /types/libpq/ @Lodin +/types/libsodium-wrappers/ @ffflorian /types/libxmljs/ @fdecampredon @ComFreek /types/libxslt/ @alejo90 /types/license-checker/ @rogierschouten @unindented @@ -2218,6 +2306,7 @@ /types/lime-js/ @arthur-xavier /types/line-by-line/ @etomsen /types/line-reader/ @stpettersens +/types/linear-gradient/ @Jack-Works /types/lingui__core/ @huan086 /types/lingui__react/ @huan086 /types/linkify-it/ @praxxis @@ -2230,6 +2319,7 @@ /types/loadware/ @ALyman /types/lobibox/ @itboy87 /types/local-dynamo/ @Sicilica +/types/local-storage/ @tup1tsa /types/localized-countries/ @coderslagoon /types/localizejs-library/ @salbahra /types/locate-path/ @me @@ -2566,12 +2656,15 @@ /types/main-bower-files/ @k-kagurazaka /types/make-dir/ @ikatyang @BendingBender /types/maker.js/ @danmarshall +/types/mali/ @danwbyrne /types/mandrill-api/ @pocesar /types/map-obj/ @BendingBender /types/mapbox/ @anahkiasen /types/mapbox-gl/ @dobrud @patrickr /types/mapbox-gl-leaflet/ @agorshkov23 +/types/mapbox__geo-viewport/ @fnberta /types/mapbox__geojson-area/ @n0nick +/types/mapbox__polyline/ @Kern0 @mklopets /types/mapbox__shelf-pack/ @Perlmint /types/mapnik/ @ipv4sec /types/mapsjs/ @davismj @@ -2580,6 +2673,7 @@ /types/markdown-it/ @rapropos /types/markdown-it-anchor/ @seryl /types/markdown-it-container/ @hronex +/types/markdown-pdf/ @MonsieurMan /types/markdownlint/ @ark120202 /types/marked/ @worr @BendingBender @CrossR /types/marker-animate-unobtrusive/ @viskin @@ -2639,6 +2733,7 @@ /types/mem-fs/ @MyFoodBag /types/mem-fs-editor/ @MyFoodBag /types/memcached/ @KentarouTakeda +/types/memjs/ @leizongmin /types/memoize-one/ @karol-majewski @franklixuefei /types/memoizee/ @juanpicado /types/memory-cache/ @jedigo @thieman @@ -2646,7 +2741,7 @@ /types/memwatch-next/ @cyrilschumacher /types/meow/ @KnisterPeter @praxxis @bitjson /types/merge-descriptors/ @danny8002 -/types/merge-stream/ @k-kagurazaka @daniel-zazula +/types/merge-stream/ @k-kagurazaka @tomxtobin @daniel-zazula @djcsdy /types/merge2/ @tkrotoff @smac89 /types/merkle/ @kerol2r20 /types/mermaid/ @ggilmore @@ -2662,7 +2757,7 @@ /types/meteor-prime8consulting-oauth2/ @vangorra /types/meteor-publish-composite/ @vangorra /types/meteor-roles/ @vangorra @mattmm3d -/types/meteor-univserse-i18n/ @mathewmeconry +/types/meteor-universe-i18n/ @mathewmeconry /types/method-override/ @santialbo /types/methods/ @cprecioso /types/metric-suffix/ @davidm77 @@ -2685,6 +2780,7 @@ /types/mimos/ @AJamesPhillips /types/mina/ @lhk @mattanja @kant2002 /types/mini-css-extract-plugin/ @JounQin +/types/minimal-bit-array/ @jeremejevs /types/minimatch/ @vvakame @shantmarouti /types/minimist/ @Bartvds @Necroskillz @kamranayub /types/minimist-options/ @ikatyang @@ -2728,13 +2824,14 @@ /types/moment-shortformat/ @whatasoda /types/moment-strftime2/ @dex4er /types/moment-timezone/ @michelsalib @alanblins +/types/money-math/ @taoqf /types/mongo-sanitize/ @CedricCazin -/types/mongodb/v2/ @CaselIT @alanmarcell @kikar @bitjson @dante-101 @mcortesi -/types/mongodb/ @CaselIT @alanmarcell @bitjson @dante-101 @mcortesi @EnricoPicci @AJCStriker @julien-c @daprahamian @denys-bushulyak @BastienAr @sindbach +/types/mongodb/v2/ @CaselIT @alanmarcell @bitjson @dante-101 @mcortesi +/types/mongodb/ @CaselIT @alanmarcell @bitjson @dante-101 @mcortesi @EnricoPicci @AJCStriker @julien-c @daprahamian @denys-bushulyak @BastienAr @sindbach @geraldinelemeur @jishi /types/mongodb-memory-server/ @dmitryrogozhny /types/mongodb-uri/ @mernxl /types/mongoose/v4/ @simonxca @horiuchi @sindrenm @lukasz-zak -/types/mongoose/ @horiuchi @sindrenm @lukasz-zak @Alorel @jendrikw @ethanresnick @vologab @jussikinnula +/types/mongoose/ @horiuchi @sindrenm @lukasz-zak @Alorel @jendrikw @ethanresnick @vologab @jussikinnula @ondratra @alfirin @idandrd /types/mongoose-auto-increment/ @AyaMorisawa /types/mongoose-deep-populate/ @AyaMorisawa /types/mongoose-geojson-schema/ @bondz @@ -2751,7 +2848,7 @@ /types/morgan/ @staticfunction @pscanf /types/morphdom/ @arvitaly /types/morris.js/ @mareek @sindilevich -/types/mosca/ @GabrielGouv +/types/mosca/ @GabrielGouv @jerray /types/motor-hat/ @muntyan /types/mousetrap/ @qcz /types/move-concurrently/ @mgroenhoff @@ -2788,13 +2885,14 @@ /types/mv/ @nenadalm /types/mysql/ @wjohnsto @kacepe @kpping @jdmunro /types/mz/ @ThomasHickman -/types/n3/ @phreed +/types/n3/ @phreed @rubensworks /types/named-regexp-groups/ @jewbre /types/named-routes/ @qqilihq /types/nano/ @timjacobi @vincekovacs /types/nanoajax/ @nathancahill +/types/nanoevents/ @nju33 /types/nanographql/ @cdaringe -/types/nanoid/ @bash +/types/nanoid/ @bash @fadezhanger /types/nanomsg/ @titan /types/nanoscroller/ @zihark17 /types/nanp/ @karn @@ -2819,6 +2917,7 @@ /types/negotiator/ @BendingBender /types/neo4j/ @cyrilschumacher /types/nes/ @NoHomey @saboya +/types/nested-error-stacks/ @woutervh- /types/net-keepalive/ @hertzg /types/netmask/ @mhfrantz /types/network-interfaces/ @anderswestberg @@ -2828,7 +2927,7 @@ /types/newrelic/ @mastermatt /types/nexpect/ @vvakame /types/next/ @dru89 @brikou @jthegedus @resir014 @scottdj92 @joaovieira -/types/next-redux-wrapper/ @stevegeek +/types/next-redux-wrapper/ @stevegeek @Jungwoo-An /types/ng-command/ @stephenlautier /types/ng-cordova/ @ksachdeva /types/ng-dialog/ @stephenlautier @@ -2861,8 +2960,8 @@ /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/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 @eyqs +/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 @ThomasdenH @eyqs @matthieusieben /types/node-7z/ @erkie /types/node-array-ext/ @Beng89 /types/node-cache/ @chrootsu @dthunell @useltmann @@ -2875,7 +2974,7 @@ /types/node-emoji/ @jonestristand @styu /types/node-fetch/ @torstenwerner @nikcorg /types/node-fibers/ @caryhaynie -/types/node-forge/ @westy92 @flynetworks @a-k-g @rafal2228 +/types/node-forge/ @westy92 @flynetworks @a-k-g @rafal2228 @beenotung /types/node-gcm/ @horiuchi /types/node-geocoder/ @rosek86 /types/node-getopt/ @kcauchy @@ -2911,6 +3010,7 @@ /types/node-xmpp-core/ @PJakcson /types/node-zookeeper-client/ @plantain-00 @jessezhang91 /types/node-zopfli/ @Alorel +/types/node-zopfli-es/ @Alorel /types/node_redis/ @borisyankov /types/nodecredstash/ @migstopheles /types/nodegit/ @dolanmiu @tniessen @@ -2941,15 +3041,15 @@ /types/npm/ @SomaticIT /types/npm-package-arg/ @mgroenhoff /types/npm-packlist/ @ajafff -/types/npmlog/ @DanielMSchmidt +/types/npmlog/ @DanielMSchmidt @littlepiggy03 /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 -/types/numjs/ @taoqf +/types/numeral/ @vbortone @BehindTheMath @klujanrosas +/types/numjs/ @taoqf @mattmm3d /types/nunjucks/ @RubenSlabbert /types/nunjucks-date/ @kruncher /types/nvd3/ @PjMitchell @@ -2958,7 +3058,7 @@ /types/o.js/ @IceOnFire @bradzacher @janhommes @jcchalte /types/oauth/ @nonAlgebraic /types/oauth.js/ @nobuoka -/types/oauth2-server/ @vangorra @cirick +/types/oauth2-server/ @vangorra @cirick @d-fischer /types/oauth2orize/ @wokim @heycalmdown @stevehipwell /types/obelisk.js/ @bdrupieski /types/obj-file-parser/ @benc-uk @@ -2966,10 +3066,12 @@ /types/object-diff/ @rogierschouten /types/object-hash/ @misak113 /types/object-inspect/ @demurgos +/types/object-keys/ @VitorLuizC /types/object-map/ @wolfgang42 /types/object-merge/ @OpenByteDev /types/object-path/ @pocesar /types/object-refs/ @3fd +/types/object.getownpropertydescriptors/ @VitorLuizC /types/oblo-util/ @Oblosys /types/oboe/ @optical /types/observe-js/ @herrmanno @@ -2980,8 +3082,10 @@ /types/offline-js/ @cgwrench /types/oibackoff/ @geoffreak /types/oidc-token-manager/ @rosieks +/types/oja/ @buffcode /types/okta__okta-vue/ @innovation-team /types/ol/ @yairtawil +/types/omggif/ @ffflorian /types/on-finished/ @czechboy0 @BendingBender /types/on-headers/ @jjeffery @BendingBender /types/once/ @denis-sokolov @BendingBender @@ -2996,7 +3100,7 @@ /types/openjscad/ @danmarshall /types/openlayers/v2/ @bolhovsky /types/openlayers/v3/ @osechet @matthiasdailey-ccri -/types/openlayers/ @osechet @wb14123 @ailrun @mylen @iamthechad @danmana @yairtawil @pierremarc @hauke96 +/types/openlayers/ @osechet @wb14123 @ailrun @mylen @iamthechad @danmana @yairtawil @pierremarc @hauke96 @gberaudo /types/openpgp/ @errietta /types/openstack-wrapper/ @sanjaymadane /types/opentok/ @westy92 @CatGuardian @@ -3005,7 +3109,7 @@ /types/optics-agent/ @crevil /types/optimist/ @soywiz @chbrown /types/optimize-css-assets-webpack-plugin/ @odnamrataizem -/types/ora/v0/ @screendriver +/types/ora/v0/ @basarat @screendriver /types/ora/ @basarat @screendriver @BendingBender @azasypkin /types/oracledb/ @Bigous /types/orchestrator/ @tkQubo @TeamworkGuy2 @@ -3061,11 +3165,13 @@ /types/package-json/ @jinwoo /types/packery/ @piraveen @hanssens /types/pad/ @mhegazy +/types/page/ @43081j /types/paho-mqtt/ @amikhalev /types/pako/ @cappellin @calebegg /types/pangu/ @plantain-00 -/types/papaparse/ @torpedro @rainshen49 @jfloff @johnnyreilly @albertorestifo -/types/paper/ @clark-stevenson @Xakaloz @sebaswebdev +/types/papaparse/ @torpedro @rainshen49 @jfloff @johnnyreilly @albertorestifo @BehindTheMath @3af +/types/paper/ @clark-stevenson @Xakaloz @sebaswebdev @rfried +/types/parallel-transform/ @djcsdy /types/paralleljs/ @jbaldwin /types/parcel-env/ @fathyb /types/parent-package-json/ @sgmccli @@ -3074,6 +3180,7 @@ /types/parity-poe/ @leovujanic /types/parse/ @dpoetzsch @jaeggerr @flavionegrao @wesleygrimes @owsas /types/parse-git-config/ @leonard-thieu @deltaidea +/types/parse-github-url/ @ajafff /types/parse-glob/ @glen-84 /types/parse-json/ @mrmlnc /types/parse-link-header/ @zelein @@ -3089,11 +3196,13 @@ /types/parse5-plain-text-conversion-stream/ @inikulin /types/parse5-sax-parser/ @inikulin /types/parse5-serializer-stream/ @inikulin +/types/parsecurrency/ @cristianrgreco /types/parseurl/ @bomret /types/parsimmon/ @Bartvds @mizunashi-mana @bcherny @bvanreeven @leonard-thieu @MrJohz /types/passport/ @horiuchi @enaeseth @theigor @tlaziuk @danielpa9708 /types/passport-anonymous/ @0x6368656174 /types/passport-beam/ @AtlasDev +/types/passport-cognito/ @mbutsykin /types/passport-discord/ @kzay /types/passport-facebook/ @staticfunction @lucasmacosta /types/passport-facebook-token/ @rmartone @mrand01 @@ -3111,7 +3220,7 @@ /types/passport-oauth2/ @pasieronen @WangZishi /types/passport-oauth2-client-password/ @akaNightmare /types/passport-remember-me-extended/ @AylaJK -/types/passport-saml/ @cjbarth +/types/passport-saml/ @cjbarth @dassennato /types/passport-steam/ @kzay /types/passport-strategy/ @liorm /types/passport-twitter/ @staticfunction @@ -3130,6 +3239,7 @@ /types/paypal-cordova-plugin/ @Justin-Credible /types/paypal-rest-sdk/ @trainerbill /types/pbf/ @cschwarz +/types/pbkdf2/ @timonegk /types/pdfjs-dist/ @jbaldwin /types/pdfkit/ @erichillah /types/pdfmake/ @m1llen1um @radziksh @@ -3147,6 +3257,7 @@ /types/pg-ears/ @bradleyayers /types/pg-escape/ @khell /types/pg-format/ @zopf +/types/pg-large-object/ @mateuszkrupa /types/pg-pool/ @aleung /types/pg-query-stream/ @asmarques /types/pg-types/ @waratuman @@ -3168,20 +3279,21 @@ /types/pick-weight/ @rsxdalv /types/pickadate/ @theodorejb @leonard-thieu /types/picturefill/ @alaz -/types/pidusage/ @cyrilschumacher +/types/pidusage/ @cyrilschumacher @mx601595686 /types/pify/ @samverschueren @mad-mike @c7hm4r /types/pigpio/ @manerfan /types/pikaday/ @MidnightDesign @wake42 /types/pikaday-time/ @Sayan751 /types/pinkyswear/ @chances /types/pino/v3/ @psnider -/types/pino/ @psnider @BendingBender @screendriver +/types/pino/ @psnider @BendingBender @screendriver @paambaati /types/pino-multi-stream/ @JakeGinnivan /types/pinterest-sdk/ @adamburmister /types/pinyin/ @wanganjun /types/piwik-tracker/ @lbguilherme /types/pixelmatch/ @iamolegga /types/pixi.js/ @clark-stevenson +/types/pkg-conf/ @jorgegonzalez /types/pkg-dir/ @NK-WEB-Git /types/pkijs/ @microshine /types/platform/ @JakeH @@ -3189,12 +3301,13 @@ /types/playerframework/ @ricardosabino /types/playmusic/ @nickp10 /types/pleasejs/ @nakakura -/types/plotly.js/ @chrisgervang @martinduparc @frederikaalund @taoqf @Dadstart @szechyjs @MercifulCode @soorajpudiyadath +/types/plotly.js/ @chrisgervang @martinduparc @frederikaalund @taoqf @Dadstart @szechyjs @MercifulCode @soorajpudiyadath @jonfreedman @meganrm /types/plugapi/ @BNedry /types/plugin-error/ @rogierschouten /types/plupload/ @patrickbussmann /types/pluralize/ @ukyo @karol-majewski /types/png-async/ @kanreisa +/types/png.js/ @ffflorian /types/pngjs/ @jason0x43 /types/pngquant-bin/ @hikoma /types/podcast/ @nikeee @@ -3227,7 +3340,7 @@ /types/pouchdb-mapreduce/ @spaulg @geppy @fredgalvao /types/pouchdb-node/ @spaulg @geppy @fredgalvao /types/pouchdb-replication/ @trubit @tiangolo -/types/pouchdb-upsert/ @keithdmoore @hotforfeature @apolkingg8 +/types/pouchdb-upsert/ @keithdmoore @hotforfeature @apolkingg8 @zamb3zi /types/power-assert/ @vvakame /types/power-assert-formatter/ @vvakame /types/powerbi-visuals-tools/ @zBritva @Microsoft @@ -3239,7 +3352,7 @@ /types/pretty-bytes/v4/ @plantain-00 /types/pretty-bytes/ @plantain-00 @danielasy /types/pretty-format/ @ikatyang -/types/pretty-ms/ @BendingBender +/types/pretty-ms/ @BendingBender @ocboogie /types/printf/ @AluisioASG /types/priorityqueuejs/ @geoffreak /types/prismic-dom/ @nickw444 @sbilstein @@ -3270,7 +3383,7 @@ /types/prompt-sync/ @MugeSo /types/prompt-sync-history/ @MugeSo /types/promptly/ @danrspencer -/types/prop-types/ @DovydasNavickas +/types/prop-types/ @DovydasNavickas @ferdaber /types/proper-lockfile/ @qlonik /types/properties-reader/ @Goldsmith42 /types/prosemirror-collab/ @bradleyayers @davidka @timjb @patsimm @@ -3320,6 +3433,7 @@ /types/q-io/ @Bartvds /types/q-retry/ @vilic /types/qhistory/ @Kovensky +/types/qiniu-js/ @taoqf /types/qlik/ @RubenSlabbert @AginicX /types/qlik-engineapi/ @konne /types/qlik-visualizationextensions/ @konne @@ -3331,18 +3445,18 @@ /types/query-string/ @SamVerschueren @tkrotoff @huhuanming @MadaraUchiha @shssoichiro /types/querystringify/ @ilich /types/quick-lru/ @BendingBender -/types/quill/ @sumitkm @guillaume-ro-fr @43081j @AnielloFalcone +/types/quill/ @sumitkm @guillaume-ro-fr @43081j @AnielloFalcone @mhamri /types/quixote/ @greybax /types/qunit/v1/ @diullei -/types/qunit/ @waratuman +/types/qunit/ @waratuman @mike-north /types/qunit-dom/ @happycollision /types/quoted-printable/ @pushplay /types/qwest/ @lindsayevans /types/r-script/ @NaridaL /types/rabbit.js/ @wokim -/types/radium/ @alexgorbatchev @nupplaphil @asvetliakov @mihe +/types/radium/ @alexgorbatchev @nupplaphil @asvetliakov /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 @rayhaneh +/types/ramda/ @donnut @tycho01 @mdekrey @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg @samsonkeung @angeloocana @raynerd @googol @moshensky @ethanresnick @leighman @CaptJakk @deftomat @deptno @blimusiek @biern @rayhaneh @rgm /types/random-js/ @pistacchio /types/random-number/ @OpenByteDev /types/random-seed/ @endel @@ -3370,28 +3484,32 @@ /types/rbac-a/ @tlaziuk /types/rc/ @DanielRosenwasser /types/rc-select/ @DenisTirilis -/types/rc-slider/ @mantasmarcinkus @mattoni @paustint @j-fro +/types/rc-slider/ @mantasmarcinkus @mattoni @paustint @j-fro @Deanna2 /types/rc-tree/ @johnnyreilly @Methuselah96 /types/rcloader/ @panuhorsmalahti /types/rdf-data-model/ @rubensworks /types/rdf-js/ @rubensworks +/types/rdflib/ @cenotelie /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 @pascaloliv @hotell +/types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa @pascaloliv @hotell @franklixuefei +/types/react-adal/ @dkorolev1 +/types/react-albus/ @sseppola /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-aria-modal/ @forabi /types/react-autocomplete/ @lstanden /types/react-autosuggest/ @nicolas-schmitt @pjo256 @robessog @tbayne @cdeutsch @rosskevin /types/react-avatar-editor/ @diogocorrea @gabsprates /types/react-beautiful-dnd/ @varHarrie @bradleyayers @paustint @marknelissen /types/react-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 @r3nya +/types/react-bootstrap/ @walkerburgin @vsiao @danilojrr @Batbold-Gansukh @octatone @chengsieuly @mretolaza @katbusch @vitosamson @LKay @aaronbeall @jrakotoharisoa @r3nya @t49tran /types/react-bootstrap-date-picker/ @LKay @ssi-hu-antal-bodnar /types/react-bootstrap-daterangepicker/ @ianks /types/react-bootstrap-table/v2/ @flaub @alelode @UJosue10 @@ -3415,7 +3533,7 @@ /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-credit-cards/ @vstrimaitis @olefrank /types/react-cropper/ @stepancar /types/react-css-modules/ @KostyaEsmukov @skirsdeda /types/react-css-transition-replace/ @LKay @@ -3429,17 +3547,16 @@ /types/react-daterange-picker/ @uncovertruth @MartynasZilinskas /types/react-dates/ @ArturAmpilogov @NathanNZ /types/react-daum-postcode/ @Sa-ryong -/types/react-dnd-html5-backend/ @oizie -/types/react-dnd-multi-backend/ @dawnmist -/types/react-dnd-test-backend/ @gustavohenke -/types/react-dnd-touch-backend/ @mleko @dawnmist +/types/react-dnd-multi-backend/ @dawnmist @beeequeue +/types/react-dnd-touch-backend/ @mleko @dawnmist @beeequeue /types/react-document-title/ @cleverguy25 /types/react-dom/v15/ @MartynasZilinskas /types/react-dom/ @MartynasZilinskas @theruther4d /types/react-dom-factories/ @jgoz +/types/react-dragtastic/ @nscarcella /types/react-dropzone/v2/ @matdube @LynxEyes @goblindegook @benbayard /types/react-dropzone/v3/ @matdube @LynxEyes @goblindegook @benbayard @LKay -/types/react-dropzone/ @matdube @LynxEyes @goblindegook @benbayard @LKay @codeaid @jurosh +/types/react-dropzone/ @matdube @LynxEyes @goblindegook @benbayard @LKay @codeaid @jurosh @ekilah /types/react-dynamic-number/ @eugrdn /types/react-easy-chart/ @danzel /types/react-event-listener/ @asvetliakov @@ -3448,6 +3565,7 @@ /types/react-faux-dom/ @alitaheri @cleverguy25 @deviousm @hanai /types/react-file-input/ @dmitryrogozhny /types/react-file-reader-input/ @dmitryrogozhny @alitaheri +/types/react-flag-icon-css/ @jonfreedman /types/react-flags-select/ @senukartur /types/react-flatpickr/ @begincalendar /types/react-flex/ @pushplay @@ -3468,14 +3586,15 @@ /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/ @joshuakgoldberg /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 @beheh +/types/react-i18next/v4/ @GiedriusGrabauskas @netanelgilad +/types/react-i18next/ @GiedriusGrabauskas @chnoch @beheh @whtsky /types/react-icon-base/ @apare @LKay /types/react-icons/ @apare @johnnyreilly @LKay /types/react-image-crop/ @danielasy @@ -3483,10 +3602,12 @@ /types/react-imageloader/ @stephenjelfs /types/react-infinite/ @rhysd /types/react-infinite-calendar/ @christianchown -/types/react-infinite-scroll-component/ @sroy3 +/types/react-infinite-scroll-component/ @sroy3 @burtek @davidkevork /types/react-infinite-scroller/ @Lapanti @psrebniak +/types/react-input-autosize/ @jsonunger @franklixuefei /types/react-input-calendar/ @stepancar -/types/react-input-mask/ @apare +/types/react-input-mask/v1/ @apare +/types/react-input-mask/ @apare @dima7a14 /types/react-intl/v1/ @bgrieder /types/react-intl/ @bgrieder @cdroulers @gyzerok @tillwolff @LKay @bhouser @kristerkari @formatlos /types/react-intl-redux/ @LKay @@ -3505,7 +3626,7 @@ /types/react-loadable/ @Kovensky @odensc @ianks @tlaziuk @iMobs /types/react-loader/ @artfuldev /types/react-mailchimp-subscribe/ @osdiab -/types/react-map-gl/ @rimig +/types/react-map-gl/ @rimig @fnberta /types/react-maskedinput/ @LKay @lavoaster @CarlosBonetti /types/react-mce/ @morphologue /types/react-mdl/ @bradzacher @@ -3515,16 +3636,18 @@ /types/react-motion/ @stepancar @asvetliakov @dimitarnestorov /types/react-motion-slider/ @asvetliakov /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/ @alloy @huhuanming @iRoachie @timwangdev @kamal @nelyousfi @alexdunne @swissmanu @bm-software @tkrotoff @a-tarasyuk @mvdam /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-calendars/ @Tyler-Zhang @DavidNorena /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-dialogflow/ @jasonmerino /types/react-native-doc-viewer/ @iRoachie /types/react-native-document-picker/ @plantain-00 /types/react-native-drawer/ @jnbt @suniahk @@ -3549,6 +3672,7 @@ /types/react-native-mixpanel/ @r3nya /types/react-native-modalbox/ @iRoachie /types/react-native-multi-slider/ @Slessi +/types/react-native-navbar/ @ryokik /types/react-native-orientation/ @MoLow /types/react-native-permissions/ @vincentlanglet /types/react-native-photo-view/ @christianchown @@ -3560,7 +3684,7 @@ /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-snap-carousel/ @jnbt @j-fro @gazaret @VitorLuizC /types/react-native-sortable-grid/ @j-fro /types/react-native-sortable-list/ @sivolobov @RookY2K /types/react-native-sqlite-storage/ @dryganets @cavarzan @@ -3576,24 +3700,30 @@ /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 @TizioFittizio @stigi +/types/react-navigation/v1/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi +/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi @magrinj @TizioFittizio @stigi @LinusU @jshosomichi @jakebooyah @brunoro @DenisFrezzato +/types/react-navigation-material-bottom-tabs/ @iRoachie +/types/react-no-ssr/ @rafalfilipek /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-numeric-input/ @heatherbooker @akx /types/react-onclickoutside/v5/ @LKay /types/react-onclickoutside/ @LKay /types/react-onsenui/ @salim7 @jemmyw /types/react-overlays/ @aaronbeall @vitosamson /types/react-owl-carousel/ @tbounsiar @igorissen @KennethanCeyer -/types/react-paginate/ @deevus @wouterhardeman @pegel03 @archy-bold +/types/react-paginate/v4/ @deevus @wouterhardeman @pegel03 @archy-bold +/types/react-paginate/ @deevus @wouterhardeman @pegel03 @archy-bold @yasupeke /types/react-places-autocomplete/ @guilhermehubner @r3nya +/types/react-plotly.js/ @jonfreedman /types/react-pointable/ @istefo @mdibyo /types/react-popover/ @jacoporicare -/types/react-portal/ @shuntksh +/types/react-portal/v3/ @shuntksh +/types/react-portal/ @shuntksh @HorusGoul /types/react-primitives/ @aghoneim92 /types/react-props-decorators/ @tkqubo +/types/react-qr-reader/ @davidkevork /types/react-radio-group/ @jsonunger /types/react-recaptcha/ @mhegazy @zzanol /types/react-redux/v5/ @tkqubo @thasner @kenzierocks @clayne11 @tansongyang @nicholasboll @mdibyo @pdeva @@ -3601,8 +3731,9 @@ /types/react-redux-epic/ @forabi /types/react-redux-i18n/ @clementdevos /types/react-redux-toastr/ @Smiche @artyomsv @kulmajaba -/types/react-relay/ @graphcool @voxmatt @alloy @npirotte @ckknight -/types/react-resize-detector/ @matthew-matvei @aMoniker +/types/react-relay/ @graphcool @voxmatt @alloy @npirotte @ckknight @kastermester +/types/react-request/ @dannycochran +/types/react-resize-detector/ @matthew-matvei @aMoniker @rdrgn /types/react-resolver/ @forabi /types/react-responsive/v1/ @asvetliakov /types/react-responsive/ @asvetliakov @alechill @xaviergonz @@ -3613,6 +3744,7 @@ /types/react-router-bootstrap/ @vlesierse @LKay @olmobrutall /types/react-router-config/ @lith-light-g /types/react-router-dom/ @tkrotoff @huy-nguyen @p-jackson +/types/react-router-hash-link/ @zoompie /types/react-router-native/ @ezintz @fhelwanger /types/react-router-navigation/ @kaoDev /types/react-router-navigation-core/ @kaoDev @@ -3623,10 +3755,11 @@ /types/react-s-alert/ @mitsuruog /types/react-scroll/ @sudoplz @GiedriusGrabauskas /types/react-scrollbar/ @stephenjelfs -/types/react-select/ @Hesquibet @giladgray @iebaker @skirsdeda @vujevits @devrelm @MartynasZilinskas @onatm @ninjaferret @tehbi4 @misantronic @darkartur +/types/react-select/v1/ @Hesquibet @giladgray @iebaker @skirsdeda @vujevits @devrelm @MartynasZilinskas @onatm @ninjaferret @tehbi4 @misantronic @darkartur @eps1lon @endurance @RCGuillaume +/types/react-select/ @claasahl @jonfreedman /types/react-share/ @icopp /types/react-show-more/ @naortor -/types/react-side-effect/ @remojansen +/types/react-side-effect/ @remojansen @0xcaff /types/react-sidebar/ @jeroenvervaeke /types/react-sketchapp/ @ricokahler @DomiR /types/react-slick/ @andrewBalekha @GiedriusGrabauskas @r3nya @@ -3634,14 +3767,14 @@ /types/react-smooth-scrollbar/ @asvetliakov /types/react-sortable-hoc/ @NoHomey @charlesrey /types/react-sortable-pane/ @rhysd -/types/react-sortable-tree/ @wouterhardeman @jzoric @kevinsperrine +/types/react-sortable-tree/ @wouterhardeman @jzoric @kevinsperrine @acemac +/types/react-sound/ @koss-lebedev /types/react-spinkit/v1/ @tkqubo @mleko @pelotom /types/react-spinkit/ @tkqubo @mleko @pelotom @zzanol -/types/react-sticky/ @curtisw0 +/types/react-sticky/ @curtisw0 @ajhyndman /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 @@ -3658,24 +3791,25 @@ /types/react-test-renderer/v15/ @arvitaly @lochbrunner @lochbrunner @johnnyreilly /types/react-test-renderer/ @arvitaly @lochbrunner @johnnyreilly @jgoz /types/react-tether/ @ryprice -/types/react-text-mask/ @guilhermehubner @cavarzan +/types/react-text-mask/ @guilhermehubner @cavarzan @needpower /types/react-textarea-autosize/ @asvetliakov @zry656565 /types/react-timeout/ @kerwynrg /types/react-toastify/ @icopp /types/react-toastr/ @shssoichiro @DanRegazzi -/types/react-toggle/v2/ @LKay +/types/react-toggle/v2/ @LKay @jsonunger /types/react-toggle/ @LKay /types/react-tooltip/ @DeividasBakanas /types/react-touch/ @grzesie2k /types/react-tracking/ @alloy /types/react-transition-group/v1/ @LKay -/types/react-transition-group/ @LKay @Epskampie +/types/react-transition-group/ @LKay @Epskampie @ybiquitous /types/react-treeview/ @janslow /types/react-truncate/ @mattvperry -/types/react-twitter-auth/ @paulfasola +/types/react-twitter-auth/ @paulfasola @loginwashere /types/react-user-tour/ @ccancellieri +/types/react-vertical-timeline-component/ @stephane-monnot /types/react-virtual-keyboard/ @bsurai -/types/react-virtualized/ @kaoDev @guntherjh @wasd171 @szabolcsx @kraenhansen @Stevearzh @mgoszcz2 +/types/react-virtualized/ @kaoDev @guntherjh @wasd171 @szabolcsx @kraenhansen @Stevearzh @mgoszcz2 @brandonhall /types/react-virtualized-select/ @seansfkelley /types/react-webcam/ @squat /types/react-weui/ @tairan @@ -3699,9 +3833,10 @@ /types/reapop/ @Barrokgl /types/recaptcha2/ @l-jonas /types/recase/ @18steps -/types/recharts/ @mthmulders @rapmue @royxue @ZheyangSong @richbai90 @caspeco-dan @pkeuter @jrsaunde @paulmelnikow +/types/recharts/ @mthmulders @rapmue @royxue @ZheyangSong @richbai90 @caspeco-dan @pkeuter @jrsaunde @paulmelnikow @crusectrl @apalugniok /types/recluster/ @dex4er /types/recompose/ @iskandersierra @mrapogee @clayne11 @Pajn @lucasterra +/types/reconnect-core/ @thw0rted /types/reconnectingwebsocket/ @nguarracino /types/recursive-readdir/v1/ @elisee /types/recursive-readdir/ @elisee @MicahZoltu @@ -3712,11 +3847,12 @@ /types/redis-scripto/ @westy92 /types/redlock/v2/ @chrootsu /types/redlock/ @chrootsu @BendingBender -/types/redom/ @RauliL +/types/redom/ @RauliL @nemoinho /types/reduce-reducers/ @huy-nguyen /types/redux-action/ @newraina /types/redux-action-utils/ @tkqubo /types/redux-actions/ @jaysoo @alexgorbatchev @alechill @alexey-pelykh +/types/redux-async-queue/ @andreiho /types/redux-auth-wrapper/v1/ @LKay /types/redux-auth-wrapper/ @LKay /types/redux-batched-subscribe/ @mDibyo @@ -3731,7 +3867,7 @@ /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 @reggino @maddijoyce +/types/redux-form/ @carsonf @aikoven @LKay @bancek @alsiola @tehbi4 @huwmartin @ethanresnick @reggino @maddijoyce /types/redux-immutable/ @oizie @sebald @gavingregory /types/redux-immutable-state-invariant/ @remojansen @highflying /types/redux-infinite-scroll/ @silkyfray @@ -3752,6 +3888,7 @@ /types/redux-promise-middleware/ @ianks /types/redux-recycle/ @LKay /types/redux-router/ @stepancar +/types/redux-saga-tester/ @BenLorantfy /types/redux-shortcuts/ @tstirrat /types/redux-socket.io/ @snakeego /types/redux-storage/ @asvetliakov @@ -3762,10 +3899,15 @@ /types/redux-ui/ @andyshuxin /types/ref/ @loyd /types/ref-array/ @loyd +/types/ref-array-di/ @keerthi16 @KiranNiranjan +/types/ref-napi/ @keerthi16 @KiranNiranjan /types/ref-struct/ @loyd +/types/ref-struct-di/ @keerthi16 @KiranNiranjan /types/ref-union/ @loyd +/types/ref-union-di/ @keerthi16 @KiranNiranjan /types/reflux/v0/ @mauricedb /types/reflux/ @mauricedb @LiangZugeng +/types/registry-auth-token/ @mauricedb @LiangZugeng /types/relateurl/ @tkrotoff /types/relaxed-json/ @18steps /types/relay-runtime/ @voxmatt @alloy @@ -3774,11 +3916,13 @@ /types/remove-markdown/ @RagibHasin /types/rename/ @Aankhen /types/replace-ext/ @DeividasBakanas +/types/req-cwd/ @Alorel /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 /types/request-promise-native/ @gustavohenke @mastermatt +/types/requestidlecallback/ @hax /types/requestretry/ @EricByers @trainerbill /types/require-dir/ @weekens /types/require-directory/ @Igmat @@ -3831,11 +3975,12 @@ /types/roads-server/ @dancespiele /types/roll/ @icopp /types/rolling-rate-limiter/ @l-jonas -/types/rollup-plugin-json/ @asmockler +/types/rollup-plugin-json/ @asmockler @hotell /types/ronomon__crypto-async/ @BendingBender /types/rosie/ @abner @subvertallchris @abukurov /types/roslib/ @Pro @skycoop @dgorobopec /types/rot-js/ @atiaxi +/types/round-to/ @seangenabe /types/route-parser/ @ianks @bobbuehler /types/routie/ @Adilson /types/royalslider/ @csrakowski @@ -3884,8 +4029,9 @@ /types/sanctuary/ @davidchambers @cortopy @piq9117 /types/sandboxed-module/ @svi3c /types/sane/ @BendingBender +/types/sane-email-validation/ @ForbesLindesay /types/sanitize-filename/ @Nemo157 -/types/sanitize-html/ @rogierschouten @afshin @BehindTheMath +/types/sanitize-html/ @rogierschouten @afshin @BehindTheMath @biermeester /types/sap__xsenv/ @mad-mike /types/sass-graph/ @marvinhagemeister /types/sass-webpack-plugin/ @AepKill @@ -3904,8 +4050,10 @@ /types/scroller/ @haskellcamargo /types/scrollreveal/ @Davidblkx /types/scrolltofixed/ @bmdixon +/types/scrypt/ @WhiteAbeLincoln /types/scrypt-async/ @xStrom @stesix /types/scryptsy/ @micksatana +/types/sdp-transform/ @loc /types/seamless/ @danmana /types/seamless-immutable/ @alex3165 @xsburg @geirsagberg /types/secp256k1/ @anler @@ -3951,6 +4099,7 @@ /types/seneca/ @psnider @kevynb /types/sequelize/v3/ @samuelneff @codeanimal @drinchev @morpheusxaut @torhal /types/sequelize/ @samuelneff @codeanimal @drinchev @babolivier @kukoo1 @oktapodia @morpheusxaut @TitaneBoy @zjy01 @nidzov @Raigen @todd @nrschultz @thomas-b +/types/sequelize-cursor-pagination/ @pilagod /types/sequelize-fixtures/ @cschwarz /types/sequencify/ @npenin /types/sequester/ @Strate @@ -3961,6 +4110,7 @@ /types/serve-favicon/ @urossmolnik /types/serve-index/ @tkrotoff /types/serve-static/ @urossmolnik @LinusU +/types/server/ @sant123 @iddan /types/server-destroy/ @gyszalai /types/servicenow/ @bryceg /types/session-file-store/ @blendsdk @rokt33r @@ -3968,8 +4118,10 @@ /types/set-value/ @DanielRosenwasser /types/settings/ @shreyjain1994 /types/sha1/ @arcdev1 +/types/shallow-equals/ @rsolomon /types/shallowequal/ @seansfkelley -/types/shapefile/ @DenisCarriere +/types/shapefile/ @DenisCarriere @Thw0rted +/types/sharedb/ @soney /types/sharedworker/ @nakakura /types/sharepoint/ @gandjustas @andrei-markeev @baywet @teroarvola @dennispg /types/sharp/ @lith-light-g @wooseopkim @@ -3981,7 +4133,7 @@ /types/shimmer/ @kjin /types/shipit/ @cyrilschumacher /types/shipit-utils/ @cyrilschumacher -/types/shopify-buy/ @openminder @straiforos +/types/shopify-buy/ @openminder @straiforos @totemika /types/shortid/ @stpettersens @despairblue /types/shot/ @AJamesPhillips /types/should-sinon/ @Arylo @@ -4000,7 +4152,8 @@ /types/simple-cw-node/ @vvakame /types/simple-lru/ @NN--- /types/simple-mock/ @leonyu -/types/simple-oauth2/ @mad-mike @troy-lamerton +/types/simple-oauth2/v1/ @mad-mike @troy-lamerton @netux +/types/simple-oauth2/ @mad-mike @troy-lamerton @netux /types/simple-peer/ @tlaziuk /types/simple-url-cache/ @a-lucas /types/simple-websocket/ @dex4er @@ -4011,6 +4164,7 @@ /types/simplesmtp/ @rogierschouten /types/simplestorage.js/ @axelcostaspena @mxl /types/single-line-log/ @ffflorian +/types/single-spa-react/ @Garrett-Smith-iq /types/sinon/ @mrbigdog2u @rationull @lumaxis @nicojs @43081j @joshuakgoldberg /types/sinon-as-promised/ @igrayson /types/sinon-chai/v2/ @kazimanzurrashid @jedmao @@ -4029,11 +4183,12 @@ /types/skatejs/ @Hotell /types/ski/ @AyaMorisawa /types/skyway/ @nakakura +/types/slack-mock/ @kkalavantavanich /types/slack-node/ @geoffreak /types/slack-winston/ @BlueHatbRit /types/slackdown/ @nju33 /types/slackify-html/ @hypexr -/types/slate/ @andykent @majelbstoat @JanLoebel @YangusKhan +/types/slate/ @andykent @majelbstoat @JanLoebel @YangusKhan @kalley @Kornil /types/slate-base64-serializer/ @YangusKhan /types/slate-html-serializer/ @YangusKhan /types/slate-irc/ @elisee @@ -4050,6 +4205,7 @@ /types/smtp-server/v1/ @markisme @Taisiias /types/smtp-server/ @markisme @Taisiias @dex4er /types/smtpapi/ @a-morales +/types/snappy/ @reconbot /types/snapsvg/ @lhk @mattanja @kant2002 /types/snazzy-info-window/ @milosd92 /types/snekfetch/ @ANekoIsFineToo @ShayBox @Dev-Yukine @@ -4088,7 +4244,7 @@ /types/speakeasy/ @legendecas @mrOlorin @xeoneux /types/speakingurl/ @Goldsmith42 /types/spectacle/ @zmaybury -/types/spectrum/ @M-Zuber +/types/spectrum/ @M-Zuber @Ailrun /types/split/ @marcinporebski /types/split.js/ @icholy /types/split2/ @mugeso @@ -4100,13 +4256,14 @@ /types/sprintf-js/ @jasonswearingen @BendingBender /types/sql-bricks/ @adn05 @paleo /types/sql.js/ @Hozuki +/types/sqlanywhere/ @pkeuter /types/sqlite3/ @nmalaguti @dpyro @BehindTheMath /types/sqlstring/ @marvinhagemeister /types/squirejs/ @bradleyayers /types/srp/ @Patman64 /types/ssh-key-decrypt/ @BendingBender /types/ssh2/ @tkQubo @rbuckton -/types/ssh2-sftp-client/ @igrayson @ascariandrea +/types/ssh2-sftp-client/ @igrayson @ascariandrea @kartik2406 /types/ssh2-streams/ @rbuckton /types/sshpk/ @mabels /types/stack-mapper/ @rogierschouten @@ -4125,33 +4282,39 @@ /types/std-mocks/ @jdxcode /types/steam/ @kant2002 /types/steam-client/ @Slessi +/types/steam-login/ @Nicell /types/steam-totp/ @phenomax /types/steamid/ @Slessi /types/steed/ @Paul-Isache -/types/stellar-sdk/ @carl-foster @tristonj @pselden +/types/stellar-sdk/ @carl-foster @tristonj @pselden @maxbause /types/stemmer/ @will-ockmore /types/sticky-cluster/ @paustint /types/stompjs/ @jimic @Dr4k4n /types/stoppable/ @EricByers -/types/storejs/ @vbortone @harry0000 +/types/store/ @vbortone @harry0000 @Ky6uk +/types/storybook-addon-jsx/ @jameslnewell /types/storybook__addon-a11y/ @hyunseob -/types/storybook__addon-actions/ @joscha +/types/storybook__addon-actions/ @joscha @jicjjang /types/storybook__addon-backgrounds/ @hyunseob +/types/storybook__addon-centered/ @kiyopikko /types/storybook__addon-info/ @mkornblum @fyrkant -/types/storybook__addon-knobs/ @joscha @martynaskadisa +/types/storybook__addon-jest/ @halfmatthalfcat +/types/storybook__addon-knobs/ @joscha @martynaskadisa @amacleay /types/storybook__addon-links/ @joscha @jessepinho /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__react-native/ @joscha @wapgear @alechill @iRoachie /types/storybook__vue/ @pntgupta /types/stream-buffers/ @Jason3S /types/stream-chain/ @uhop /types/stream-csv-as-json/ @uhop +/types/stream-each/ @djcsdy /types/stream-json/ @uhop /types/stream-meter/ @mugeso /types/stream-series/ @k-kagurazaka +/types/stream-shift/ @djcsdy /types/stream-to-array/v0/ @Bartvds /types/stream-to-array/ @Bartvds @BendingBender /types/stream-to-promise/ @Alorel @@ -4161,6 +4324,7 @@ /types/strftime/ @cyrilschumacher /types/strict-uri-encode/ @hoishin /types/string/ @basp +/types/string-format/ @lal12 /types/string-hash/ @ethanrubio /types/string-similarity/ @ragtime /types/string-template/ @TonyPythoneer @@ -4170,7 +4334,7 @@ /types/strip-ansi/ @mhegazy /types/strip-bom/ @mhegazy /types/strip-json-comments/ @dmoonfire -/types/stripe/ @wjohnsto @codeanimal @sampsonjoliver @LinusU @brannon @kkamperschroer @starhoshi @bruun @galtalmor @htunnicliff @squirly +/types/stripe/ @wjohnsto @codeanimal @sampsonjoliver @LinusU @brannon @kkamperschroer @starhoshi @bruun @galtalmor @htunnicliff @squirly @tzarger /types/stripe-checkout/ @cgwrench /types/stripe-v2/ @ejsmith @amritk @adamcmiel @jleider @galuszkak /types/stripe-v3/ @ejsmith @amritk @adamcmiel @jleider @galuszkak @@ -4179,8 +4343,10 @@ /types/strong-log-transformer/ @azasypkin /types/strophe/ @DavidKDeutsch /types/structured-source/ @azu +/types/styled-components/ @Igorbek /types/styled-jsx/ @R1ZZU -/types/styled-system/ @maxdeviant @phobon @zephraph @damassi @alloy @maoueh +/types/styled-system/ @maxdeviant @phobon @zephraph @damassi @alloy @maoueh @lavoaster +/types/stylelint/v7/ @alan-agius4 /types/stylelint/ @alan-agius4 /types/stylelint-webpack-plugin/ @bahlo /types/stylus/ @SomaticIT @@ -4193,10 +4359,12 @@ /types/sumo-logger/ @forabi @clementallen /types/suncalc/ @horiuchi /types/superagent/v2/ @varju @NicoZelaya @mxl -/types/superagent/ @NicoZelaya @mxl @paplorinc @shreyjain1994 @zopf +/types/superagent/ @NicoZelaya @mxl @paplorinc @shreyjain1994 @zopf @beeequeue +/types/superagent-bunyan/ @bricka /types/superagent-no-cache/ @mxl /types/superagent-prefix/ @mxl /types/supercluster/ @DenisCarriere +/types/superstruct/ @edwardsnare /types/supertest/ @varju /types/supertest-as-promised/ @tkrotoff /types/supports-color/v3/ @mgroenhoff @@ -4204,6 +4372,7 @@ /types/svg-injector/ @poke /types/svg-parser/ @mrmlnc /types/svg-path-bounding-box/ @NotWoods +/types/svg-path-parser/ @tyru /types/svg-sprite/ @tkqubo /types/svg-sprite-loader/ @rynclark /types/svg2png/ @hansrwindhoff @sccgithub @@ -4255,7 +4424,9 @@ /types/tar/ @SomaticIT @connor4312 /types/tar-fs/ @Umoxfo /types/tar-stream/ @glicht +/types/task-graph-runner/ @mgroenhoff /types/tcp-ping/ @stegano +/types/teddy/ @lannonbr /types/tedious/ @rogierschouten @cjthompson @v-suhame /types/tedious-connection-pool/ @sandorfr /types/telebot/ @mariotsi @@ -4274,9 +4445,12 @@ /types/text-encoding-utf-8/ @trxcllnt /types/text-table/ @saadq /types/textarea-caret/ @shiftkey +/types/textract/ @lal12 /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/theming/ @eps1lon +/types/thepiratebay/ @jsorrell +/types/three/ @gyohk @florentpoujol @SereznoKot @omni360 @ivoisbelongtous @piranha771 @qszhusightp @nakakura @s093294 @Pro @efokschaner @PsychoSTS @dhritzkiv @apurvaojas @NotWoods @sethk @elk941 @Methuselah96 /types/thrift/ @kamek-pf @kevin-greene-ck @jessezhang91 /types/throng/ @cyrilschumacher @tatethurston /types/throttle/ @BendingBender @@ -4295,8 +4469,9 @@ /types/tinajs__tina/ @Jimexist /types/tinajs__tina-redux/ @Jimexist /types/tinder/ @pingec +/types/tingle.js/ @ajafff /types/tiny-slider-react/ @screendriver -/types/tinycolor2/ @M-Zuber @geertjansen @nvh +/types/tinycolor2/ @M-Zuber @geertjansen @nvh @Ailrun /types/tinycon/ @dwaxweiler /types/tinycopy/ @vvatanabe /types/tinymce/ @martinduparc @ipoul @nicohartto @@ -4319,6 +4494,7 @@ /types/topojson-client/ @denisname @ricardo-mello /types/topojson-simplify/ @denisname @ricardo-mello /types/topojson-specification/ @denisname +/types/toposort/ @danwbyrne /types/torrent-stream/ @xstoudi /types/touch/ @mizunashi-mana @BendingBender /types/touch-events/ @kevinb7 @@ -4335,10 +4511,12 @@ /types/trayballoon/ @korve /types/tress/ @sindilevich /types/trim/ @skysteve +/types/triple-beam/ @danwbyrne /types/triplesec/ @threesquared /types/trunk8/ @niemyjski /types/tryer/ @bengry /types/tspromise/ @soywiz +/types/ttf2woff2/ @ThomasdenH /types/tunnel/ @BendingBender /types/tus-js-client/ @kevhiggins /types/tv4/ @Bartvds @psnider @@ -4347,7 +4525,8 @@ /types/tweezer.js/ @praxxis /types/twig/ @soywiz @enko /types/twilio/ @nickiannone @ashleybrener -/types/twit/ @Volox @lostfictions @sapphiredev @abraham +/types/twit/ @Volox @sapphiredev @abraham @siwalikm @plhery +/types/twitch-ext/ @beheh /types/twitter/ @chitoku-k /types/twitter-stream-channels/ @adrianbardan /types/twitter-text/ @rhysd @@ -4358,12 +4537,12 @@ /types/type-is/ @BendingBender /types/type-name/ @armorik83 /types/typeahead/ @igochkov @gjunge -/types/typed.js/ @Dona278 /types/typedarray-pool/ @pawsong /types/typeof/ @OpenByteDev /types/typescript-deferred/ @DirtyHairy /types/tz-format/ @samverschueren /types/ua-parser-js/ @superduper @legendecas @MeLlamoPablo +/types/uglify-es/ @alan-agius4 /types/uglify-js/v2/ @tkrotoff /types/uglify-js/ @alan-agius4 @tkrotoff @johnnyreilly /types/uglifycss/ @blendsdk @@ -4377,12 +4556,13 @@ /types/ultra-strftime/ @dex4er /types/umbraco/ @DeCareSystemsIreland /types/umd/ @TeamworkGuy2 -/types/umzug/ @drinchev @mlamp @trodi -/types/underscore/ @borisyankov @jbaldwin @ccurrens @clottman +/types/umzug/ @drinchev @mlamp @trodi @emmanuelgautier +/types/underscore/ @borisyankov @jbaldwin @ccurrens @clottman @confususs /types/underscore-ko/ @MagicMau /types/underscore.string/ @rygine /types/undertaker/ @tkqubo @GiedriusGrabauskas /types/undertaker-registry/ @GiedriusGrabauskas +/types/unidecode/ @vfernandestoptal /types/uniq/ @hansrwindhoff /types/uniqid/ @idchlife /types/unique-hash-stream/ @BendingBender @@ -4390,6 +4570,7 @@ /types/unist/ @bizen241 /types/unity-webapi/ @jmvrbanac /types/universal-analytics/ @Bartvds @DarkerTV +/types/universal-cookie/ @tomi /types/universal-router/ @jtmthf @tlaziuk @Lodin /types/unorm/ @chbrown /types/untildify/ @BendingBender @@ -4401,15 +4582,15 @@ /types/upng-js/ @plantain-00 /types/uppercamelcase/ @plantain-00 /types/urbanairship-cordova/ @Justin-Credible -/types/uri-templates/ @Bartvds +/types/uri-templates/ @Bartvds @barnski /types/urijs/ @RodneyJT @xt0rted @petejohanson /types/uritemplate/ @teyc @rubensworks /types/url-assembler/ @wolfgang42 /types/url-join/ @rogierschouten @devrelm /types/url-metadata/ @mrkmg /types/url-params/ @danielsogl -/types/url-parse/ @ChernenkoPaul @harisiva -/types/url-regex/ @unindented +/types/url-parse/ @ChernenkoPaul @harisiva @DimitryDushkin +/types/url-regex/ @unindented @sosukesuzuki /types/url-safe-base64/ @johngeorgewright /types/url-search-params/ @nick121212 @nrathi /types/url-template/ @marcinporebski @@ -4436,11 +4617,13 @@ /types/valdr-message/ @ilbertz /types/valerie/ @conficient /types/vali-date/ @SamVerschueren +/types/valiant/ @whatasoda /types/valid-url/ @stevehipwell /types/validator/ @tgfjt @chrootsu @IOAyman @louy @kacepe @deptno @builtinnya @qqilihq /types/validatorjs/ @LKay @danmana /types/vanilla-modal/ @samnau /types/vanilla-tilt/ @BrunnerLivio +/types/varint/ @dbrockman /types/vary/ @BendingBender /types/vast-client/ @jgainfort /types/vec3/ @xstoudi @@ -4451,16 +4634,17 @@ /types/vertx3-eventbus-client/ @oddeirik /types/vex-js/ @gdcohan /types/vexdb/ @MayorMonty -/types/vexflow/ @rquiring @sebastianhaas @bohoffi +/types/vexflow/ @rquiring @sebastianhaas @bohoffi @sschmidTU /types/vfile/ @bizen241 @rokt33r /types/vfile-location/ @ikatyang /types/victory/ @asvetliakov @snerks @Havret @alredyExist -/types/video.js/ @vbortone @scleriot @SWBennett06 @IgelCampus @giofreitas @gjanblaszczyk @sroucheray +/types/video.js/ @vbortone @scleriot @SWBennett06 @IgelCampus @giofreitas @gjanblaszczyk @sroucheray @AkxeOne /types/viewability-helper/ @lironzluf /types/viewerjs/ @lrh3321 +/types/viewport-mercator-project/ @fnberta /types/viewporter/ @borisyankov /types/vimeo/ @DazWilkin -/types/vimeo__player/ @denisyilmaz @timc13 +/types/vimeo__player/ @denisyilmaz @timc13 @terrymun /types/vinyl/v0/ @jedmao /types/vinyl/ @vvakame @jedmao @thorn0 /types/vinyl-buffer/ @tkQubo @@ -4468,7 +4652,7 @@ /types/vinyl-paths/ @tkQubo /types/virtual-dom/ @chbrown /types/virtual-keyboard/ @bsurai -/types/vis/ @MichaelBitard @macleodbroad-wf @adripanico @seveves @kaktus40 @mmaitre314 @supercargo @takato1314 @alex-kachura +/types/vis/ @MichaelBitard @macleodbroad-wf @adripanico @seveves @kaktus40 @mmaitre314 @supercargo @takato1314 @alex-kachura @dcop @avrahamcool /types/vision/v4/ @jasonswearingen @AJamesPhillips /types/vision/ @jasonswearingen @AJamesPhillips @lenovouser /types/vitalsigns/ @cyrilschumacher @@ -4484,6 +4668,7 @@ /types/vue-markdown/ @neodon /types/vue-resource/ @kaorun343 /types/vue-scrollto/ @vincekovacs +/types/vue-select/ @silh /types/vue2-datepicker/ @ChristianStornowski /types/vuex-i18n/ @jaeggerr @noamkfir /types/w2ui/ @Ptival @@ -4509,10 +4694,12 @@ /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/ @simon-jentzsch @nitzantomer @zurbo @yxliang01 @phra @naddison36 @icaroharry @linusnorton @jpeletier @anneau @matrushka @andrevmatos @levino @zlumer @archangel-irk /types/web3-eth-abi/ @LogvinovLeon +/types/web3-provider-engine/ @LogvinovLeon /types/webappsec-credential-management/ @iainmcgin /types/webassembly-js-api/ @periklis +/types/webassembly-web-api/ @jhenninger /types/webcl/ @NCARalph /types/webcomponents.js/ @adidahiya /types/webcrypto/ @iislucas @@ -4522,8 +4709,9 @@ /types/webgl2/ @nkemnitz @karhu /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 @ZSkycat @johnnyreilly +/types/webpack/v3/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @alan-agius4 @elliottsj @jason0x43 @christophehurpeau +/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @alan-agius4 @elliottsj @jason0x43 @dennispg @christophehurpeau @ZSkycat @johnnyreilly +/types/webpack-assets-manifest/ @FranklinWhale /types/webpack-bundle-analyzer/ @kryops /types/webpack-chain/ @eirikurn @psachs21 /types/webpack-chunk-hash/ @mtraynham @@ -4548,16 +4736,20 @@ /types/webpack-stream/ @iclanton @bumbleblym /types/webpack-validator/ @deevus /types/webpackbar/ @rynclark +/types/webpagetest/ @ksm2 /types/webrtc/ @nakakura +/types/webscopeio__react-textarea-autocomplete/ @michauzo +/types/websequencediagrams/ @ffflorian /types/website-scraper/ @screendriver /types/websocket/ @loyd @flynetworks @zhaoleimxd @jdneo -/types/webspeechapi/ @saschanaz +/types/websocket-async/ @bigbeno37 /types/websql/ @TeamworkGuy2 /types/webtorrent/ @niieani @tlaziuk /types/webvr-api/ @efokschaner /types/week/ @sindrenm +/types/wegame-api/ @jcyuan /types/weighted/ @ccitro -/types/weixin-app/ @taoqf @AlexStacker +/types/weixin-app/ @taoqf @AlexStacker @Jimexist /types/wellknown/ @yairtawil /types/wepy/ @Jimexist /types/wepy-redux/ @Jimexist @@ -4567,7 +4759,9 @@ /types/wheel/ @BTOdell /types/when/ @derekcicerone @Nemo157 /types/which/ @vvakame @cspotcode +/types/which-pm/ @jorgegonzalez /types/wicg-mediasession/ @jucrouzet +/types/wif/ @danwbyrne /types/wiiu/ @mzsm /types/window-or-global/ @vvakame /types/window-size/ @pmkary @@ -4577,11 +4771,13 @@ /types/winjs/v1/ @adamhewitt627 @craigktreasure @xirzec /types/winjs/v2/ @adamhewitt627 @craigktreasure @xirzec /types/winjs/ @adamhewitt627 @craigktreasure @xirzec +/types/wink-tokenizer/ @lal12 /types/winreg/ @RX14 @BobBuehler /types/winrt-uwp/ @saschanaz @taylor224 /types/winston-dynamodb/ @nickiannone /types/winston-mail/ @idono87 -/types/winston-syslog/ @cjbarth +/types/winston-syslog/v1/ @cjbarth +/types/winston-syslog/ @cjbarth @felix-hoc /types/wiring-pi/ @NoHomey /types/wnumb/ @acoreyj /types/wonder.js/ @yyc-git @@ -4642,9 +4838,11 @@ /types/yeoman-generator/ @armorik83 @janslow @ikatyang /types/yeoman-test/ @ikatyang /types/yesql/ @Sumolari +/types/yoctodelay/ @seangenabe /types/yog-bigpipe/ @ssddi456 /types/yog-log/ @ssddi456 /types/yog2-kernel/ @ssddi456 +/types/yoga-layout/ @tnobody /types/yosay/ @armorik83 /types/youtube/ @DazWilkin @JoshuaKGoldberg @eliotfallon213 /types/youtube-dl/ @bsurai @@ -4662,10 +4860,11 @@ /types/zeromq/ @davemckeown @erikma @TitaneBoy /types/zip-webpack-plugin/ @blaise-io /types/zip.js/ @lgrignon -/types/zipcodes/ @headdetect +/types/zipcodes/ @headdetect @dobesv /types/zipkin-context-cls/ @plantain-00 /types/zipkin-instrumentation-express/ @plantain-00 /types/zipkin-instrumentation-fetch/ @plantain-00 +/types/zipkin-javascript-opentracing/ @laurentgilly /types/zipkin-transport-http/ @plantain-00 /types/zmq/ @davemckeown /types/zookeeper/ @xialeistudio diff --git a/notNeededPackages.json b/notNeededPackages.json index 4e66976014..f3f09c0f7b 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -390,6 +390,12 @@ "sourceRepoURL": "https://github.com/MikeMcl/decimal.js", "asOfVersion": "7.4.0" }, + { + "libraryName": "delay", + "typingsPackageName": "delay", + "sourceRepoURL": "https://github.com/sindresorhus/delay", + "asOfVersion": "3.1.0" + }, { "libraryName": "DevExtreme", "typingsPackageName": "devextreme", diff --git a/types/abstract-leveldown/abstract-leveldown-tests.ts b/types/abstract-leveldown/abstract-leveldown-tests.ts new file mode 100644 index 0000000000..c5edadf069 --- /dev/null +++ b/types/abstract-leveldown/abstract-leveldown-tests.ts @@ -0,0 +1,13 @@ +import { AbstractLevelDOWN } from 'abstract-leveldown'; + +const test = (levelDown: AbstractLevelDOWN) => { + levelDown.put("key", "value", (err?) => { }); + levelDown.put(1, "value", { something: true }, (err?) => { }); + + levelDown.get("key", (err?) => { }); + levelDown.get(1, { something: true }, (err?) => { }); +}; +// $ExpectType void +test(new AbstractLevelDOWN('here')); +// $ExpectType void +test(AbstractLevelDOWN('there')); diff --git a/types/abstract-leveldown/index.d.ts b/types/abstract-leveldown/index.d.ts new file mode 100644 index 0000000000..2caf073432 --- /dev/null +++ b/types/abstract-leveldown/index.d.ts @@ -0,0 +1,103 @@ +// Type definitions for abstract-leveldown 5.0 +// Project: https://github.com/Level/abstract-leveldown +// Definitions by: Meirion Hughes +// Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface AbstractOptions { + readonly [k: string]: any; +} + +export type ErrorCallback = (err: Error | undefined) => void; +export type ErrorValueCallback = (err: Error | undefined, value: V) => void; +export type ErrorKeyValueCallback = (err: Error | undefined, key: K, value: V) => void; + +export interface AbstractOpenOptions extends AbstractOptions { + createIfMissing?: boolean; + errorIfExists?: boolean; +} + +export interface AbstractGetOptions extends AbstractOptions { + asBuffer?: boolean; +} + +export interface AbstractLevelDOWN extends AbstractOptions { + open(cb: ErrorCallback): void; + open(options: AbstractOpenOptions, cb: ErrorCallback): void; + + close(cb: ErrorCallback): void; + + get(key: K, cb: ErrorValueCallback): void; + get(key: K, options: AbstractGetOptions, cb: ErrorValueCallback): void; + + put(key: K, value: V, cb: ErrorCallback): void; + put(key: K, value: V, options: AbstractOptions, cb: ErrorCallback): void; + + del(key: K, cb: ErrorCallback): void; + del(key: K, options: AbstractOptions, cb: ErrorCallback): void; + + batch(): AbstractChainedBatch; + batch(array: ReadonlyArray>, cb: ErrorCallback): AbstractChainedBatch; + batch(array: ReadonlyArray>, options: AbstractOptions, cb: ErrorCallback): AbstractChainedBatch; + + iterator(options?: AbstractIteratorOptions): AbstractIterator; +} + +export interface AbstractLevelDOWNConstructor { + new (location: string): AbstractLevelDOWN; + (location: string): AbstractLevelDOWN; +} + +export interface AbstractIteratorOptions extends AbstractOptions { + gt?: K; + gte?: K; + lt?: K; + lte?: K; + reverse?: boolean; + limit?: number; + keys?: boolean; + values?: boolean; + keyAsBuffer?: boolean; + valueAsBuffer?: boolean; +} + +export type AbstractBatch = PutBatch | DelBatch; + +export interface PutBatch { + readonly type: 'put'; + readonly key: K; + readonly value: V; +} + +export interface DelBatch { + readonly type: 'del'; + readonly key: K; +} + +export interface AbstractChainedBatch extends AbstractChainedBatchConstructor, AbstractOptions { + put: (key: K, value: V) => this; + del: (key: K) => this; + clear: () => this; + write(cb: ErrorCallback): any; + write(options: any, cb: ErrorCallback): any; +} + +export interface AbstractChainedBatchConstructor { + new(db: any): AbstractChainedBatch; + (db: any): AbstractChainedBatch; +} + +export interface AbstractIterator extends AbstractChainedBatchConstructor { + db: AbstractLevelDOWN; + next(cb: ErrorKeyValueCallback): this; + end(cb: ErrorCallback): void; +} + +export interface AbstractIteratorConstructor { + new(db: any): AbstractIterator; + (db: any): AbstractIterator; +} + +export const AbstractLevelDOWN: AbstractLevelDOWNConstructor; +export const AbstractIterator: AbstractIteratorConstructor; +export const AbstractChainedBatch: AbstractChainedBatchConstructor; diff --git a/types/abstract-leveldown/tsconfig.json b/types/abstract-leveldown/tsconfig.json new file mode 100644 index 0000000000..286b867f00 --- /dev/null +++ b/types/abstract-leveldown/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", + "abstract-leveldown-tests.ts" + ] +} diff --git a/types/abstract-leveldown/tslint.json b/types/abstract-leveldown/tslint.json new file mode 100644 index 0000000000..256ee54775 --- /dev/null +++ b/types/abstract-leveldown/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/agenda/agenda-tests.ts b/types/agenda/agenda-tests.ts index 8e0e8b9fb6..aef7ecd7d6 100644 --- a/types/agenda/agenda-tests.ts +++ b/types/agenda/agenda-tests.ts @@ -1,10 +1,14 @@ import Agenda = require("agenda"); -import { Db, Server } from "mongodb"; +import { Db, Server, MongoClient } from "mongodb"; var mongoConnectionString = "mongodb://127.0.0.1/agenda"; (async () => { var agenda = new Agenda({ db: { address: mongoConnectionString } }); + var agenda = new Agenda({ + mongo: (await MongoClient.connect(mongoConnectionString)).db(), + db: { collection: 'agenda-jobs' }, + }); agenda.define<{ foo: Error }>('delete old users', (job, done) => { done(job.attrs.data.foo) diff --git a/types/agenda/index.d.ts b/types/agenda/index.d.ts index 206d40daf3..75246ecda3 100644 --- a/types/agenda/index.d.ts +++ b/types/agenda/index.d.ts @@ -203,17 +203,7 @@ declare namespace Agenda { /** * Specifies that Agenda should be initialized using and existing MongoDB connection. */ - mongo?: { - /** - * The MongoDB database connection to use. - */ - db: Db; - - /** - * The name of the collection to use. - */ - collection?: string; - } + mongo?: Db; /** * Specifies that Agenda should connect to MongoDB. @@ -221,8 +211,10 @@ declare namespace Agenda { db?: { /** * The connection URL. + * Required when using `db` option to connect. + * Not required when an existing connection is passed as `mongo` property. */ - address: string; + address?: string; /** * The name of the collection to use. @@ -231,6 +223,7 @@ declare namespace Agenda { /** * Connection options to pass to MongoDB. + * Not required when an existing connection is passed as `mongo` property. */ options?: any; } diff --git a/types/angular-block-ui/angular-block-ui-tests.ts b/types/angular-block-ui/angular-block-ui-tests.ts index 58547fff4d..4446e73234 100644 --- a/types/angular-block-ui/angular-block-ui-tests.ts +++ b/types/angular-block-ui/angular-block-ui-tests.ts @@ -38,4 +38,9 @@ app.controller('Ctrl', ($scope: ng.IScope, blockUI: angular.blockUI.BlockUIServi blockUI.message("Hello Types"); blockUI.done(); const b: boolean = blockUI.isBlocking(); + + const myBlockUI = blockUI.instances.get("myBlockUI"); + myBlockUI.start(); + myBlockUI.reset(); + myBlockUI.stop(); }); diff --git a/types/angular-block-ui/index.d.ts b/types/angular-block-ui/index.d.ts index f415d386e9..f0dcdcd076 100644 --- a/types/angular-block-ui/index.d.ts +++ b/types/angular-block-ui/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for angular-block-ui 0.2 // Project: https://github.com/McNull/angular-block-ui -// Definitions by: Lasse Nørregaard , Stephan Classen +// Definitions by: Lasse Nørregaard , Stephan Classen , Soner Köksal // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -164,6 +164,12 @@ declare module 'angular' { * Returns whether currently a block is shown for the instance or not. */ isBlocking(): boolean; + + instances: BlockUIInstances; + } + + interface BlockUIInstances { + get(id: string): BlockUIService; } } } diff --git a/types/angular-q-extras/angular-q-extras-tests.ts b/types/angular-q-extras/angular-q-extras-tests.ts new file mode 100644 index 0000000000..0832b6dae0 --- /dev/null +++ b/types/angular-q-extras/angular-q-extras-tests.ts @@ -0,0 +1,34 @@ +interface MyService { + getFirstname(): ng.IPromise; + getLastname(): ng.IPromise; +} + +function TestCtrl($q: ng.IQService, MyService: MyService) { + function arrayCallback(result: [ng.PromiseValue, ng.PromiseValue]) { + const firstnameOk: boolean = $q.isFulfilledState(result[0]); + const lastnameOk: boolean = $q.isFulfilledState(result[1]); + } + + function objectCallback(result: {firstname: ng.PromiseValue, lastname: ng.PromiseValue}) { + const firstnameOk: boolean = $q.isFulfilledState(result.firstname); + const lastnameOk: boolean = $q.isFulfilledState(result.lastname); + } + + $q + .allSettled([ + MyService.getFirstname(), + MyService.getLastname() + ]) + .then(arrayCallback); + + $q + .allSettled({ + firstname: MyService.getFirstname(), + lastname: MyService.getLastname() + }) + .then(objectCallback); +} + +TestCtrl.$inject = ['$q', 'MyService']; + +angular.module('test').controller('TestCtrl', TestCtrl); diff --git a/types/angular-q-extras/index.d.ts b/types/angular-q-extras/index.d.ts new file mode 100644 index 0000000000..f73724ab43 --- /dev/null +++ b/types/angular-q-extras/index.d.ts @@ -0,0 +1,42 @@ +// Type definitions for angular-q-extras 1.1 +// Project: https://github.com/niqdev/angular-q-extras +// Definitions by: Damien Sorel +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +declare var _: string; +export = _; + +import * as angular from 'angular'; + +declare module 'angular' { + type PromiseState = 'fulfilled' | 'rejected'; + + interface PromiseValue { + state: PromiseState; + value?: T; + reason?: any; + } + + // tslint:disable-next-line interface-name + interface IQService { + // tslint:disable:max-line-length + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise, T5 | IPromise, T6 | IPromise, T7 | IPromise, T8 | IPromise, T9 | IPromise, T10 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise, T5 | IPromise, T6 | IPromise, T7 | IPromise, T8 | IPromise, T9 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise, T5 | IPromise, T6 | IPromise, T7 | IPromise, T8 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise, T5 | IPromise, T6 | IPromise, T7 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise, T5 | IPromise, T6 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise, T5 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise]): IPromise<[PromiseValue, PromiseValue]>; + // tslint:enable:max-line-length + + allSettled(promises: Array>): IPromise>>; + + allSettled(promises: { [K in keyof T]: (T[K] | IPromise); }): IPromise<{ [K in keyof T]: PromiseValue; }>; + + isFulfilledState(promise: PromiseValue): boolean; + isRejectedState(promise: PromiseValue): boolean; + } +} diff --git a/types/angular-q-extras/tsconfig.json b/types/angular-q-extras/tsconfig.json new file mode 100644 index 0000000000..3047a809eb --- /dev/null +++ b/types/angular-q-extras/tsconfig.json @@ -0,0 +1,23 @@ +{ + "files": [ + "index.d.ts", + "angular-q-extras-tests.ts" + ], + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/angular-q-extras/tslint.json b/types/angular-q-extras/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/angular-q-extras/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/ansi-escape-sequences/ansi-escape-sequences-tests.ts b/types/ansi-escape-sequences/ansi-escape-sequences-tests.ts new file mode 100644 index 0000000000..ae27a57146 --- /dev/null +++ b/types/ansi-escape-sequences/ansi-escape-sequences-tests.ts @@ -0,0 +1,50 @@ +import * as ansi from 'ansi-escape-sequences'; + +// $ExpectType string +ansi.style.red; +// $ExpectError +ansi.style.invalidStyle; + +// $ExpectType string +ansi.styles('green'); +// $ExpectType string +ansi.styles(['green', 'underline']); +// $ExpectError +ansi.styles('invalidStyle'); +// $ExpectError +ansi.styles(['invalidStyle']); + +// $ExpectType string +ansi.format('what?', 'green'); +// $ExpectType string +ansi.format('what?', ['green', 'bold']); +// $ExpectType string +ansi.format('[green bold]{what?}'); +// $ExpectError +ansi.styles('what?', 'invalidStyle'); +// $ExpectError +ansi.styles('what?', ['invalidStyle']); + +// $ExpectType string +ansi.cursor.up(); +// $ExpectType string +ansi.cursor.up(1); + +// $ExpectType string +ansi.cursor.hide; +// $ExpectType string +ansi.cursor.show; + +// $ExpectType string +ansi.erase.display(); +// $ExpectType string +ansi.erase.display(3); +// $ExpectError +ansi.erase.display(4); + +// $ExpectType string +ansi.erase.inLine(); +// $ExpectType string +ansi.erase.inLine(2); +// $ExpectError +ansi.erase.inLine(3); diff --git a/types/ansi-escape-sequences/index.d.ts b/types/ansi-escape-sequences/index.d.ts new file mode 100644 index 0000000000..437841aefa --- /dev/null +++ b/types/ansi-escape-sequences/index.d.ts @@ -0,0 +1,148 @@ +// Type definitions for ansi-escape-sequences 4.0 +// Project: https://github.com/75lb/ansi-escape-sequences#readme +// Definitions by: Alexander Marks +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +export type Style = 'reset'|'bold'|'italic'|'underline'|'fontDefault'|'font2'| + 'font3'|'font4'|'font5'|'font6'|'imageNegative'|'imagePositive'|'black'| + 'red'|'green'|'yellow'|'blue'|'magenta'|'cyan'|'white'|'grey'|'gray'| + 'bg-black'|'bg-red'|'bg-green'|'bg-yellow'|'bg-blue'|'bg-magenta'|'bg-cyan'| + 'bg-white'|'bg-grey'|'bg-gray'; + +/** + * Various formatting styles (aka Select Graphic Rendition codes). + * + * @example + * console.log(ansi.style.red + 'this is red' + ansi.style.reset) + */ +export const style: {[K in Style]: string}; + +/** + * Returns an ansi sequence setting one or more effects. + * + * @param styles a style, or list or styles + * + * @example + * > ansi.styles('green') + * '\u001b[32m' + * + * > ansi.styles([ 'green', 'underline' ]) + * '\u001b[32;4m' + */ +export function styles(styles: Style|ReadonlyArray\n' + + '\n' + + ' \n' + + ' \n' + + ' \n' + + '\n'; + + return webview; +} + +onload = () => { + var webview = CreateWebViewAndGuest(); + document.body.appendChild(webview); +}; + +// #endregion + +// #region Embedding & AppView +chrome.app.runtime.onEmbedRequested.addListener((request) => { + request.allow('foobar.html'); +}); +// Creates an element. +let appview = document.createElement('appview'); +appview = new AppView() || new window.AppView(); +// Appends the element to the document body. +document.body.appendChild(appview); +// Connects the appview to appToEmbed. +appview.connect('id of app'); +document.appendChild(appview); +//#endregion + -chrome.desktopCapture.chooseDesktopMedia(["screen", "window", "tab"], () => { }); -chrome.desktopCapture.chooseDesktopMedia([chrome.desktopCapture.DesktopCaptureSourceType.AUDIO], () => { }); diff --git a/types/chrome-apps/tsconfig.json b/types/chrome-apps/tsconfig.json index 50a50c3193..6e00d1a959 100644 --- a/types/chrome-apps/tsconfig.json +++ b/types/chrome-apps/tsconfig.json @@ -1,10 +1,6 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es2017", - "dom" - ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, @@ -13,6 +9,10 @@ "typeRoots": [ "../" ], + "lib": [ + "es2017", + "dom" + ], "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/cleave.js/options/index.d.ts b/types/cleave.js/options/index.d.ts index 65d87d79e1..b1dc95920b 100644 --- a/types/cleave.js/options/index.d.ts +++ b/types/cleave.js/options/index.d.ts @@ -51,4 +51,5 @@ export interface CleaveOptions { noImmediatePrefix?: boolean; rawValueTrimPrefix?: boolean; uppercase?: boolean; + onValueChanged?(event: any): void; } diff --git a/types/cli-truncate/cli-truncate-tests.ts b/types/cli-truncate/cli-truncate-tests.ts new file mode 100644 index 0000000000..677108e6ad --- /dev/null +++ b/types/cli-truncate/cli-truncate-tests.ts @@ -0,0 +1,19 @@ +import cliTruncate = require('cli-truncate'); + +// Truncate at different positions +// $ExpectType string +cliTruncate('unicorn', 4); // default position: 'end' + +// $ExpectType string +cliTruncate('unicorn', 4, {position: 'start'}); + +// $ExpectType string +cliTruncate('unicorn', 4, {position: 'middle'}); + +// Truncate Unicode surrogate pairs +// $ExpectType string +cliTruncate('uni\uD83C\uDE00corn', 5); + +// Truncate full-width characters +// $ExpectType string +cliTruncate('안녕하세요', 3); diff --git a/types/cli-truncate/index.d.ts b/types/cli-truncate/index.d.ts new file mode 100644 index 0000000000..f02ec427b8 --- /dev/null +++ b/types/cli-truncate/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for cli-truncate 1.1 +// Project: https://github.com/sindresorhus/cli-truncate +// Definitions by: Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = cliTruncate; + +declare function cliTruncate( + input: string, + columns: number, + options?: {position?: 'start' | 'middle' | 'end'}, +): string; diff --git a/types/cli-truncate/tsconfig.json b/types/cli-truncate/tsconfig.json new file mode 100644 index 0000000000..efc2a3a1c7 --- /dev/null +++ b/types/cli-truncate/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cli-truncate-tests.ts" + ] +} diff --git a/types/cli-truncate/tslint.json b/types/cli-truncate/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/cli-truncate/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/codemirror/index.d.ts b/types/codemirror/index.d.ts index 5ece4f497e..729b8a86d7 100644 --- a/types/codemirror/index.d.ts +++ b/types/codemirror/index.d.ts @@ -17,9 +17,17 @@ declare namespace CodeMirror { export var Pos: CodeMirror.PositionConstructor; export var Pass: {toString(): "CodeMirror.PASS"}; + /** Find the column position at a given string index using a given tabsize. */ function countColumn(line: string, index: number | null, tabSize: number): number; function fromTextArea(host: HTMLTextAreaElement, options?: EditorConfiguration): CodeMirror.EditorFromTextArea; + /** Compare two positions, return 0 if they are the same, a negative number when a is less, and a positive number otherwise. */ + function cmpPos(a: Position, b: Position): number; + + /** Utility function that computes an end position from a change (an object with from, to, and text properties, as passed to various event handlers). + The returned position will be the end of the changed range, after the change is applied. */ + function changeEnd(change: EditorChange): Position; + /** It contains a string that indicates the version of the library. This is a triple of integers "major.minor.patch", where patch is zero for releases, and something else (usually one) for dev snapshots. */ var version: string; @@ -51,6 +59,14 @@ declare namespace CodeMirror { CodeMirror.registerHelper("hint", "foo", myFoo), the value CodeMirror.hint.foo will point to myFoo. */ function registerHelper(namespace: string, name: string, helper: any): void; + /** Given a state object, returns a {state, mode} object with the inner mode and its state for the current position. */ + function innerMode(mode: Mode, state: any): { state: any, mode: Mode }; + + /** Sometimes, it is useful to add or override mode object properties from external code. + The CodeMirror.extendMode function can be used to add properties to mode objects produced for a specific mode. + Its first argument is the name of the mode, its second an object that specifies the properties that should be added. + This is mostly useful to add utilities that can later be looked up through getMode. */ + function extendMode(name: string, properties: Mode): void; function on(element: any, eventName: string, handler: Function): void; function off(element: any, eventName: string, handler: Function): void; @@ -324,6 +340,9 @@ declare namespace CodeMirror { you should probably follow up by calling this method to ensure CodeMirror is still looking as intended. */ refresh(): void; + /** Gets the inner mode at a given position. This will return the same as getMode for simple modes, but will return an inner mode for nesting modes (such as htmlmixed). */ + getModeAt(pos: Position): any; + /** Retrieves information about the token the current mode found before the given position (a {line, ch} object). */ getTokenAt(pos: CodeMirror.Position, precise?: boolean): Token; @@ -555,8 +574,10 @@ declare namespace CodeMirror { /** Return true if any text is selected. */ somethingSelected(): boolean; - /** Set the cursor position.You can either pass a single { line , ch } object , or the line and the character as two separate parameters. */ - setCursor(pos: CodeMirror.Position): void; + /** Set the cursor position. You can either pass a single {line, ch} object, or the line and the character as two separate parameters. + Will replace all selections with a single, empty selection at the given position. + The supported options are the same as for setSelection */ + setCursor(pos: CodeMirror.Position | number, ch?: number, options?: { bias?: number, origin?: string, scroll?: boolean }): void; /** Set a single selection range. anchor and head should be {line, ch} objects. head defaults to anchor when not given. */ setSelection(anchor: CodeMirror.Position, head: CodeMirror.Position, options?: { bias?: number, origin?: string, scroll?: boolean }): void; @@ -709,9 +730,9 @@ declare namespace CodeMirror { /** Array of strings representing the text that replaced the changed range (split by line). */ text: string[]; /** Text that used to be between from and to, which is overwritten by this change. */ - removed: string[]; + removed?: string[]; /** String representing the origin of the change event and wether it can be merged with history */ - origin: string; + origin?: string; } interface EditorChangeLinkedList extends CodeMirror.EditorChange { @@ -1083,7 +1104,7 @@ declare namespace CodeMirror { * This function should read one token from the stream it is given as an argument, optionally update its state, * and return a style string, or null for tokens that do not have to be styled. Multiple styles can be returned, separated by spaces. */ - token(stream: StringStream, state: T): string | null; + token?: (stream: StringStream, state: T) => string | null; /** * A function that produces a state object to be used at the start of a document. diff --git a/types/cometd/index.d.ts b/types/cometd/index.d.ts index 0ac377c241..cc97b304fe 100644 --- a/types/cometd/index.d.ts +++ b/types/cometd/index.d.ts @@ -21,12 +21,16 @@ declare namespace CometD { } interface CometD { + + websocketEnabled?: boolean; onListenerException: (exception: any, subscriptionHandle: any, isListener: boolean, message: string) => void; init(options: CometD.ConfigurationOptions): void; configure(config: CometD.ConfigurationOptions): void; + + subscribe(channel: string, listener: (message: any) => void): void; addListener(channel: string, listener: (message: any) => void): void; removeListener(listener: (message: any) => void): void; diff --git a/types/commonmark/index.d.ts b/types/commonmark/index.d.ts index 01b9541efa..96bb2774c5 100644 --- a/types/commonmark/index.d.ts +++ b/types/commonmark/index.d.ts @@ -64,7 +64,7 @@ export class Node { /** * either Bullet or Ordered (or undefined). */ - listType: 'Bullet' | 'Ordered'; + listType: 'bullet' | 'ordered'; /** * true if list is tight */ diff --git a/types/compute-quantile/compute-quantile-tests.ts b/types/compute-quantile/compute-quantile-tests.ts new file mode 100644 index 0000000000..8a4c51ea3d --- /dev/null +++ b/types/compute-quantile/compute-quantile-tests.ts @@ -0,0 +1,13 @@ +import quantile = require('compute-quantile'); + +// $ExpectType number +quantile([1, 2, 3], 0.5); + +// $ExpectType number +quantile([1, 2, 3], 0.5, undefined); + +// $ExpectType number +quantile([1, 2, 3], 0.5, {}); + +// $ExpectType number +quantile([1, 2, 3], 0.5, { sorted: true }); diff --git a/types/compute-quantile/index.d.ts b/types/compute-quantile/index.d.ts new file mode 100644 index 0000000000..05d83b65f4 --- /dev/null +++ b/types/compute-quantile/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for compute-quantile 1.0 +// Project: https://github.com/compute-io/quantile +// Definitions by: mrmlnc +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Computes a quantile for a numeric array. + */ +declare function quantile(array: ArrayLike, quantile: number, options?: quantile.Options): number; + +declare namespace quantile { + interface Options { + /** + * If the input `array` is already sorted in `__ascending__` order, you can set the `sorted` option to `true`. + * + * @default + * false + */ + sorted?: boolean; + } +} + +export = quantile; diff --git a/types/compute-quantile/tsconfig.json b/types/compute-quantile/tsconfig.json new file mode 100644 index 0000000000..29d10580e3 --- /dev/null +++ b/types/compute-quantile/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", + "compute-quantile-tests.ts" + ] +} diff --git a/types/compute-quantile/tslint.json b/types/compute-quantile/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/compute-quantile/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/crossfilter/crossfilter-tests.ts b/types/crossfilter/crossfilter-tests.ts index 5d9981b6d1..e96d83a7e2 100644 --- a/types/crossfilter/crossfilter-tests.ts +++ b/types/crossfilter/crossfilter-tests.ts @@ -1,4 +1,4 @@ - +import * as crossfilter from 'crossfilter'; interface Payment { diff --git a/types/crossfilter/index.d.ts b/types/crossfilter/index.d.ts index a009e920dd..bae8a06565 100644 --- a/types/crossfilter/index.d.ts +++ b/types/crossfilter/index.d.ts @@ -110,7 +110,6 @@ declare namespace CrossFilter { } } -declare var crossfilter: CrossFilter.CrossFilterStatic; declare module "crossfilter" { var crossfilter: CrossFilter.CrossFilterStatic; export = crossfilter; diff --git a/types/dc/dc-tests.ts b/types/dc/dc-tests.ts index 7e1a49727e..c431e3c714 100644 --- a/types/dc/dc-tests.ts +++ b/types/dc/dc-tests.ts @@ -1,4 +1,4 @@ -import * as CrossFilter from 'crossfilter'; +import * as crossfilter from 'crossfilter'; import * as d3 from "d3"; import * as dc from "dc"; diff --git a/types/delay/delay-tests.ts b/types/delay/delay-tests.ts deleted file mode 100644 index 9714bfd86d..0000000000 --- a/types/delay/delay-tests.ts +++ /dev/null @@ -1,47 +0,0 @@ -import delay = require('delay'); - -delay(200) - .then(() => { - }); - -let str: string; -let num: number; -Promise.resolve(delay(100)) - .then(() => { - }); - -Promise.resolve("foo") - .then(delay(100)) - .then(result => { - str = result; - }); - -Promise.resolve('foo') - .then(delay(100, 10)) - .then(result => { - num = result; - }); - -Promise.resolve('foo') - .then(delay.reject(100)) - .then(x => 10) - .catch(err => { - }); - -Promise.resolve('foo') - .then(delay.reject(100, 'bar')) - .then(x => 10) - .catch(err => { - }); - -(async () => { - const delaying = delay(1000); - delaying.cancel(); - try { - await delaying; - } catch (err) { - // `err` is an instance of `delay.CancelError` - } -})(); - -throw new delay.CancelError('bar'); diff --git a/types/delay/index.d.ts b/types/delay/index.d.ts deleted file mode 100644 index 0ec894f1e1..0000000000 --- a/types/delay/index.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Type definitions for delay 2.0 -// Project: https://github.com/sindresorhus/delay#readme -// Definitions by: BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -export = delay; - -declare function delay(ms: number): delay.PDelayedPassThroughThunk; -declare function delay(ms: number, value: T): delay.PDelayedThunk; - -declare namespace delay { - function reject(ms: number, rejectionValue?: any): PDelayedThunk; - - class CancelError extends Error { - readonly name: 'CancelError'; - constructor(message?: string); - } - - type PDelayedThunk = ((value: any) => DelayedPromiseLike) & DelayedPromiseLike; - - type PDelayedPassThroughThunk = ((value: TValue) => DelayedPromiseLike) & DelayedPromiseLike; - - interface DelayedPromiseLike { - then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onrejected?: ((reason: any) => TResult2 | PromiseLike) | null): Promise; - catch(onrejected?: ((reason: any) => TResult | PromiseLike) | null): Promise; - cancel(): void; - } -} diff --git a/types/dialogflow/index.d.ts b/types/dialogflow/index.d.ts index c847b662c2..c421c47f68 100644 --- a/types/dialogflow/index.d.ts +++ b/types/dialogflow/index.d.ts @@ -550,7 +550,7 @@ export interface DetectIntentResponse { export interface QueryResult { queryText: string; - laugnageCode: string; + languageCode: string; speechRecognitionConfidence: number; action: string; parameters: any; @@ -562,6 +562,12 @@ export interface QueryResult { outputContexts: Context[]; intent: Intent; intentDetectionConfidence: number; + sentimentAnalysisResult?: { + queryTextSentiment: { + magnitude: number; + score: number; + }; + }; diagnosticInfo: any; } @@ -760,8 +766,8 @@ export enum MatchMode { } export interface Credentials { - clientEmail?: string; - privateKey?: string; + client_email: string; + private_key: string; } export interface ClientOptions { diff --git a/types/doubleclick-gpt/doubleclick-gpt-tests.ts b/types/doubleclick-gpt/doubleclick-gpt-tests.ts index 5865ed02dd..9218408268 100644 --- a/types/doubleclick-gpt/doubleclick-gpt-tests.ts +++ b/types/doubleclick-gpt/doubleclick-gpt-tests.ts @@ -69,6 +69,10 @@ googletag.pubads().definePassback("/1234567/sports", [468, 60]) .setTagForChildDirectedTreatment(1) .display(); +googletag.pubads().definePassback('/1234567/sports', [468, 60]) + .setTagForUnderAgeOfConsent(1) + .display(); + googletag.pubads().definePassback("/1234567/sports", [468, 60]). setTargeting("color", "red"). setTargeting("sport", ["rugby", "rowing"]). @@ -79,6 +83,13 @@ googletag.pubads().definePassback("/1234567/sports", [160, 600]). "interests": ["sports", "music", "movies"]}). display(); +googletag.pubads().enableLazyLoad(); +googletag.pubads().enableLazyLoad({ + fetchMarginPercent: 500, + renderMarginPercent: 200, + mobileScaling: 2.0 +}); + // The calls to construct an ad and display contents. slot1 = googletag.pubads().display("/1234567/sports", [728, 90], "div-1"); slot2 = googletag.pubads().display("/1234567/news", [160, 600], "div-2"); @@ -107,6 +118,13 @@ googletag.pubads().setTagForChildDirectedTreatment(1); // Clear child-directed setting and return to initial not-set value. googletag.pubads().clearTagForChildDirectedTreatment(); +// Mark ad requests as coming from users under the age of consent. +googletag.pubads().setTagForUnderAgeOfConsent(1); + +// Clear the tag value that configures whether to mark ad requests as +// coming from users under the age of consent. +googletag.pubads().setTagForUnderAgeOfConsent(); + googletag.pubads().setTargeting("interests", "sports"); googletag.pubads().setTargeting("colors", "blue"); googletag.pubads().setTargeting("fruits", "apple"); diff --git a/types/doubleclick-gpt/index.d.ts b/types/doubleclick-gpt/index.d.ts index 545f534e79..ab71cdc99a 100644 --- a/types/doubleclick-gpt/index.d.ts +++ b/types/doubleclick-gpt/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Publisher Tag v199 +// Type definitions for Google Publisher Tag v238 // Project: https://developers.google.com/doubleclick-gpt/reference // Definitions by: John Wright // Steven Joyce @@ -40,6 +40,12 @@ declare namespace googletag { setContent(slot: Slot, content: String): void; } + export interface LazyLoadOptionsConfig { + fetchMarginPercent?: number, + renderMarginPercent?: number, + mobileScaling?: number + } + export interface ResponseInformation { advertiserId: string; campaignId: string; @@ -101,6 +107,7 @@ declare namespace googletag { setClickUrl(url: string): PassbackSlot; setForceSafeFrame(forceSafeFrame: boolean): PassbackSlot; setTagForChildDirectedTreatment(value: number): PassbackSlot; + setTagForUnderAgeOfConsent(value: number): PassbackSlot; setTargeting(key: string, value: string | string[]): PassbackSlot; updateTargetingFromMap(map: Object): PassbackSlot; } @@ -116,6 +123,7 @@ declare namespace googletag { disableInitialLoad(): void; display(adUnitPath: string, size: GeneralSize, opt_div?: string | Element, opt_clickUrl?: string): Slot; enableAsyncRendering(): boolean; + enableLazyLoad(opt_config?: LazyLoadOptionsConfig): void; enableSingleRequest(): boolean; enableSyncRendering(): boolean; enableVideoAds(): void; @@ -134,6 +142,7 @@ declare namespace googletag { setRequestNonPersonalizedAds(nonPersonalizedAds: 0 | 1): PubAdsService; setSafeFrameConfig(config: SafeFrameConfig): PubAdsService; setTagForChildDirectedTreatment(value: number): PubAdsService; + setTagForUnderAgeOfConsent(opt_value?: number): PubAdsService; setTargeting(key: string, value: string | string[]): PubAdsService; setVideoContent(videoContentId: string, videoCmsId: string): void; updateCorrelator(): PubAdsService; diff --git a/types/elasticsearch/elasticsearch-tests.ts b/types/elasticsearch/elasticsearch-tests.ts index 85574e3c91..68625bd5bb 100644 --- a/types/elasticsearch/elasticsearch-tests.ts +++ b/types/elasticsearch/elasticsearch-tests.ts @@ -37,6 +37,21 @@ client.search({ }, (error) => { }); +client.search({ + body: { + query: { + match_all: { + _name: 'test' + } + } + } +} +).then((body) => { + const hit = body.hits.hits[0]; + const names = hit && hit.matched_queries; +}, (error) => { +}); + client.indices.delete({ index: 'test_index', ignore: [404] diff --git a/types/elasticsearch/index.d.ts b/types/elasticsearch/index.d.ts index c791db72c3..a9dc133545 100644 --- a/types/elasticsearch/index.d.ts +++ b/types/elasticsearch/index.d.ts @@ -645,6 +645,7 @@ export interface SearchResponse { fields?: any; highlight?: any; inner_hits?: any; + matched_queries?: string[]; sort?: string[]; }>; }; diff --git a/types/elegant-spinner/elegant-spinner-tests.ts b/types/elegant-spinner/elegant-spinner-tests.ts new file mode 100644 index 0000000000..5d2ddb9dc7 --- /dev/null +++ b/types/elegant-spinner/elegant-spinner-tests.ts @@ -0,0 +1,8 @@ +import elegantSpinner = require('elegant-spinner'); + +const frameFunction = elegantSpinner(); + +// $ExpectType string +frameFunction(); + +const frames = elegantSpinner.frames; diff --git a/types/elegant-spinner/index.d.ts b/types/elegant-spinner/index.d.ts new file mode 100644 index 0000000000..fbb8d4710a --- /dev/null +++ b/types/elegant-spinner/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for elegant-spinner 1.0 +// Project: https://github.com/sindresorhus/elegant-spinner +// Definitions by: Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = elegantSpinner; + +declare function elegantSpinner(): () => string; + +declare namespace elegantSpinner { + const frames: ReadonlyArray; +} diff --git a/types/elegant-spinner/tsconfig.json b/types/elegant-spinner/tsconfig.json new file mode 100644 index 0000000000..cdd768d4c6 --- /dev/null +++ b/types/elegant-spinner/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "elegant-spinner-tests.ts" + ] +} diff --git a/types/elegant-spinner/tslint.json b/types/elegant-spinner/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/elegant-spinner/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/elementtree/elementtree-tests.ts b/types/elementtree/elementtree-tests.ts new file mode 100644 index 0000000000..630a17f6c6 --- /dev/null +++ b/types/elementtree/elementtree-tests.ts @@ -0,0 +1,56 @@ +import * as et from 'elementtree'; + +// Example 1 +// https://github.com/racker/node-elementtree#example-1--creating-an-xml-document + +const XML = et.XML; +const ElementTree = et.ElementTree; +const element = et.Element; +const subElement = et.SubElement; + +const root = element('entry'); +root.set('xmlns', 'http://www.w3.org/2005/Atom'); + +const tenantId = subElement(root, 'TenantId'); +tenantId.text = '12345'; + +const serviceName = subElement(root, 'ServiceName'); +serviceName.text = 'MaaS'; + +const resourceId = subElement(root, 'ResourceID'); +resourceId.text = 'enAAAA'; + +const usageId = subElement(root, 'UsageID'); +usageId.text = '550e8400-e29b-41d4-a716-446655440000'; + +const eventType = subElement(root, 'EventType'); +eventType.text = 'create'; + +const category = subElement(root, 'category'); +category.set('term', 'monitoring.entity.create'); + +const dataCenter = subElement(root, 'DataCenter'); +dataCenter.text = 'global'; + +const region = subElement(root, 'Region'); +region.text = 'global'; + +const startTime = subElement(root, 'StartTime'); +startTime.text = new Date(); + +const resourceName = subElement(root, 'ResourceName'); +resourceName.text = 'entity'; + +const etree1 = new ElementTree(root); +const xml = etree1.write({ xml_declaration: false }); + +// Example 2 +// https://github.com/racker/node-elementtree#example-2--parsing-an-xml-document + +const data = ''; +const etree2 = et.parse(data); + +etree2.findall('./entry/TenantId').length; // 2 +etree2.findtext('./entry/ServiceName'); // MaaS +etree2.findall('./entry/category')[0].get('term'); // monitoring.entity.create +etree2.findall('*/category/[@term="monitoring.entity.update"]').length; // 1 diff --git a/types/elementtree/index.d.ts b/types/elementtree/index.d.ts new file mode 100644 index 0000000000..8019797b4a --- /dev/null +++ b/types/elementtree/index.d.ts @@ -0,0 +1,88 @@ +// Type definitions for elementtree 0.1 +// Project: https://github.com/racker/node-elementtree +// Definitions by: Daniel Imhoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface ElementTreeWriteOptions { + default_namespace?: string; + encoding?: string; // default is 'utf-8' + indent?: number; + method?: 'xml' | 'text'; // default is 'xml' + xml_declaration?: boolean; // on by default +} + +export class ElementTree { + constructor(element: Element); + + getroot(): Element; + _setroot(element: Element): void; + + parse(source: string): Element; + find(path: string): Element | null; + findtext(path: string): ElementText | undefined; + findall(path: string): Element[]; + write(options?: ElementTreeWriteOptions): string; +} + +export interface Attributes { + [key: string]: string | undefined; +} + +export type ElementTag = typeof Comment | typeof CData | typeof ProcessingInstruction | string; + +export type ElementText = { toString(): string; } | string; + +export interface Element { + tag: ElementTag; + attrib: Attributes; + text: ElementText | null; + tail: string | null; + + toString(): string; + makeelement(tag: ElementTag, attrib?: Attributes): Element; + len(): number; + + getItem(index: number): Element | undefined; + setItem(index: number, element: Element): void; + delItem(index: number): void; + getSlice(start: number, stop: number): Element[]; + setSlice(start: number, stop: number, elements: ReadonlyArray): void; + delSlice(start: number, stop: number): void; + + append(element: Element): void; + extend(elements: ReadonlyArray): void; + insert(index: number, element: Element): void; + remove(element: Element): void; + getchildren(): Element[]; + + find(path: string): Element | null; + findtext(path: string): ElementText | undefined; + findall(path: string): Element[]; + + clear(): void; + + get(k: string): string | undefined; + set(k: string, v?: string): string; + keys(): string[]; + items(): Array<[string, string]>; +} + +export class QName { + text: string; + + constructor(text_or_uri: string, tag?: string); + toString(): string; +} + +// special tags +export function CData(text?: ElementText): Element; +export function Comment(text?: ElementText): Element; +export function ProcessingInstruction(target: ElementText, text?: ElementText): Element; + +export function XML(data: string): Element; +export function Element(ElementTag: string, attrib?: Attributes): Element; +export function SubElement(parent: Element, ElementTag: string, attrib?: Attributes): Element; + +export function parse(source: string): ElementTree; +export function register_namespace(prefix: string, uri: string): void; +export function tostring(element: Element, options: ElementTreeWriteOptions): string; diff --git a/types/elementtree/tsconfig.json b/types/elementtree/tsconfig.json new file mode 100644 index 0000000000..9f9991fb4e --- /dev/null +++ b/types/elementtree/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", + "elementtree-tests.ts" + ] +} diff --git a/types/elementtree/tslint.json b/types/elementtree/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/elementtree/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ember-mocha/ember-mocha-tests.ts b/types/ember-mocha/ember-mocha-tests.ts index 75d1154a87..09662096b6 100644 --- a/types/ember-mocha/ember-mocha-tests.ts +++ b/types/ember-mocha/ember-mocha-tests.ts @@ -1,7 +1,8 @@ import { describeComponent, describeModel, describeModule, setResolver, setupAcceptanceTest, setupComponentTest, - setupModelTest, setupTest + setupModelTest, setupTest, setupRenderingTest, + setupApplicationTest } from 'ember-mocha'; import { describe, it, beforeEach, afterEach, before, after } from 'mocha'; import chai = require('chai'); @@ -96,8 +97,6 @@ describeModule('component:x-foo', 'TestModule callbacks', function() { }); describe('setupTest', function() { - setupTest(); - setupTest('service:ajax'); setupTest('service:ajax', { @@ -193,3 +192,62 @@ it('can calculate the result', function(assert) { it.skip('disabled test'); it.skip('disabled test', function() { }); + +// New testing APIs of ember-mocha 0.14 + +describe('setupTest', function() { + setupTest(); + + setupTest({ resolver: Ember.DefaultResolver.create() }); + + const hooks = setupTest(); + hooks.beforeEach(function() { + this.owner.lookup('service:foo'); + }); + hooks.afterEach(function() { + this.owner.factoryFor('service:foo'); + }); + + setupRenderingTest(); + + setupRenderingTest({ resolver: Ember.DefaultResolver.create() }); + + const hooks2 = setupRenderingTest(); + hooks2.beforeEach(function() { + this.owner.lookup('service:foo'); + }); + + hooks2.afterEach(function() { + this.owner.factoryFor('service:foo'); + }); + + setupApplicationTest(); + + setupApplicationTest({ resolver: Ember.DefaultResolver.create() }); + + const hooks3 = setupApplicationTest(); + hooks3.beforeEach(function() { + this.owner.lookup('service:foo'); + }); + + hooks3.afterEach(function() { + this.owner.factoryFor('service:foo'); + }); + + it('test', function() { + }); +}); + +describe('rendering test', function() { + setupRenderingTest(); + + it('renders', async function() { + // setup the outer context + this.set('value', 'cat'); + + // render the component + await this.render(hbs`{{ x-foo value=value}}`); + + chai.expect(this.element.querySelector('div>.value').textContent.trim()).to.equal('cat', 'The component shows the correct value'); + }); +}); diff --git a/types/ember-mocha/index.d.ts b/types/ember-mocha/index.d.ts index 84510eee38..638edb8542 100644 --- a/types/ember-mocha/index.d.ts +++ b/types/ember-mocha/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for ember-mocha 0.12 +// Type definitions for ember-mocha 0.14 // Project: https://github.com/emberjs/ember-mocha#readme // Definitions by: Derek Wickern +// Simon Ihmig // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -36,6 +37,17 @@ declare module 'ember-mocha' { (callbacks: ModuleCallbacks): void; } + interface TestHooks { + beforeEach: mochaBeforeEach; + afterEach: mochaAfterEach; + } + + interface SetupOptions { + resolver: Ember.Resolver; + } + + type NewSetupTest = (options?: SetupOptions) => TestHooks; + /** @deprecated Use setupTest instead */ export const describeModule: ContextDefinition; @@ -45,11 +57,14 @@ declare module 'ember-mocha' { /** @deprecated Use setupModelTest instead */ export const describeModel: ContextDefinition; - export const setupTest: SetupTest; + export const setupTest: NewSetupTest & SetupTest; export const setupAcceptanceTest: SetupTest; export const setupComponentTest: SetupTest; export const setupModelTest: SetupTest; + export const setupRenderingTest: NewSetupTest; + export const setupApplicationTest: NewSetupTest; + export const it: typeof mochaIt; /** diff --git a/types/env-paths/env-paths-tests.ts b/types/env-paths/env-paths-tests.ts new file mode 100644 index 0000000000..b143fb47b5 --- /dev/null +++ b/types/env-paths/env-paths-tests.ts @@ -0,0 +1,4 @@ +import envPaths = require('env-paths'); + +// $ExpectType Paths +envPaths('./'); diff --git a/types/env-paths/index.d.ts b/types/env-paths/index.d.ts new file mode 100644 index 0000000000..c759f3875c --- /dev/null +++ b/types/env-paths/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for env-paths 1.0 +// Project: https://github.com/sindresorhus/env-paths +// Definitions by: Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = envPaths; + +declare function envPaths(name: string, opts?: { suffix: string; }): envPaths.Paths; + +declare namespace envPaths { + interface Paths { + readonly data: string; + readonly config: string; + readonly cache: string; + readonly log: string; + readonly temp: string; + } +} diff --git a/types/env-paths/tsconfig.json b/types/env-paths/tsconfig.json new file mode 100644 index 0000000000..62dcbca022 --- /dev/null +++ b/types/env-paths/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "env-paths-tests.ts" + ] +} diff --git a/types/env-paths/tslint.json b/types/env-paths/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/env-paths/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/evaporate/evaporate-tests.ts b/types/evaporate/evaporate-tests.ts index 3140cd9ea9..077cc2ebfd 100644 --- a/types/evaporate/evaporate-tests.ts +++ b/types/evaporate/evaporate-tests.ts @@ -25,3 +25,14 @@ Evaporate.create({ console.log(awsS3ObjectKey + '!!!'); }); }); + +Evaporate.create({ + bucket: 'test', + computeContentMd5: true, + cryptoMd5Method(data: ArrayBuffer) { + return ''; + }, + cryptoHexEncodedHash256(data: ArrayBuffer | string | null) { + return ''; + }, +}); diff --git a/types/evaporate/index.d.ts b/types/evaporate/index.d.ts index 8e959f6b64..8ae110416e 100644 --- a/types/evaporate/index.d.ts +++ b/types/evaporate/index.d.ts @@ -39,7 +39,7 @@ declare namespace Evaporate { onlyRetryForSameFileName?: boolean; timeUrl?: string; cryptoMd5Method?: null | ((data: ArrayBuffer) => string); - cryptoHexEncodedHash256?: null | ((data: ArrayBuffer) => string); + cryptoHexEncodedHash256?: null | ((data: string | ArrayBuffer | null) => string); aws_url?: string; aws_key?: string; awsRegion?: string; diff --git a/types/expired-storage/expired-storage-tests.ts b/types/expired-storage/expired-storage-tests.ts new file mode 100644 index 0000000000..5c1a814b23 --- /dev/null +++ b/types/expired-storage/expired-storage-tests.ts @@ -0,0 +1,69 @@ +import ExpiredStorage = require('expired-storage'); + +const expiredStorage = new ExpiredStorage(); + +const mjkModel = { + firstName: 'Maynard', + middleName: 'James', + familyName: 'Keenan', +}; + +expiredStorage.clear(); + +expiredStorage.setItem('tool', '46&2', 10); + +if (expiredStorage.getItem('tool') !== '46&2') { + throw new Error('.setItem method is not working!'); +} + +expiredStorage.setJson('mjk', mjkModel, 1); + +const mjkTest = expiredStorage.getJson('mjk'); + +if (typeof mjkTest === 'undefined' || mjkTest.firstName !== mjkModel.firstName || mjkTest.middleName !== mjkModel.middleName || mjkTest.familyName !== mjkModel.familyName) { + throw new Error('.setJson method is not working!'); +} + +const keyCheck = expiredStorage.keys(true); + +if (keyCheck && keyCheck.length === 2) { + throw new Error('.keys method has failed.'); +} + +expiredStorage.setItem('apc', 'brena', 2); + +const goBackToSleep = expiredStorage.peek('apc'); + +if (!goBackToSleep.isExpired && goBackToSleep.value !== 'brena') { + throw new Error('.peek -- we have expired early... or our value was incorrect...'); +} + +do { + // nothing here to see +} while (!expiredStorage.isExpired('apc')); + +const expiredKeys = expiredStorage.clearExpired(); + +if (expiredKeys.indexOf('apc') !== -1) { + throw new Error('.clearExpired did not work..'); +} + +if (expiredStorage.getItem('apc') !== null) { + throw new Error('Expiration as a whole does not work.'); +} + +expiredStorage.setItem('puscifer', 'the humbling river', 10000); + +expiredStorage.updateExpiration('puscifer', 5000); + +const checkKeyTime = expiredStorage.getTimeLeft('puscifer'); + +if (checkKeyTime && checkKeyTime >= 10000) { + throw new Error('.updateExpiration method is broken -- or .getTimeLeft method is broken.'); +} + +if (!expiredStorage.isExpired('mjk')) { + throw new Error('.isExpired or Expiration as a whole is not working...'); +} + +expiredStorage.clear(); diff --git a/types/expired-storage/index.d.ts b/types/expired-storage/index.d.ts new file mode 100644 index 0000000000..bc7f7eb0b5 --- /dev/null +++ b/types/expired-storage/index.d.ts @@ -0,0 +1,105 @@ +// Type definitions for extended-storage 1.0 +// Project: https://github.com/RonenNess/ExpiredStorage/ +// Definitions by: Allen Gammel +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export = ExpiredStorage; + +declare class ExpiredStorage { + constructor(localStorage?: any); + /** + * Clear the entire storage and all keys in it. + */ + clear(): void; + /** + * Get a json serializable value. This basically calls JSON.parse on the returned value. + * @param key Item key to get (string). + * @return Stored value (JSON.parsed), or undefined if not set / expired. + */ + getJson(key: string): any; + /** + * Get item. + * @param key: Item key to get (string). + * @return: Stored value, or undefined if not set / expired. + */ + getItem(key: string): string | null; + /** + * Remove an item. + * @param key Item key to remove (string). + * @return Storage.removeItem() return code. + */ + removeItem(key: string): any; + /** + * Set a json serializable value. This basically calls JSON.stringify on 'val' before setting it. + * @param key Item key to set (string). + * @param value Value to store (object, will be JSON.stringified). + * @param expiration Expiration time, in seconds. If not provided, will not set expiration time. + * @param return Storage.setItem() return code. + */ + setJson(key: string, value: object, expirationTime?: number): any; + /** + * Set item. + * @param key Item key to set (string). + * @param value Value to store (string). + * @param expiration Expiration time, in seconds. If not provided, will not set expiration time. + * @return Storage.setItem() return code. + */ + setItem(key: string, value: string, expiration?: number): any; + /** + * Get all keys in storage, not including internal keys used to store expiration. + * @param: includeExpired: if true, will also include expired keys. + * @return: Array with keys. + */ + keys(includeExpired: boolean): string[] | null; + /** + * Get item time left to live. + * @param key Item key to get (string). + * @return Time left to expire (in seconds), or null if don't have expiration date. + */ + getTimeLeft(key: string): number | null; + /** + * Clear expired keys. + * If you never call this function, expired keys will remain until you try to get them / reset a new value. + * + * @param return: List of removed keys due to expiration. + */ + clearExpired(): string[]; + /** + * Return if an item is expired (don't remove it, even if expired). + * @param key Item key to check (string). + * @return True if expired, False otherwise. + */ + isExpired(key: string): boolean; + /** + * Get item + metadata such as time left and if expired. + * Even if item expired, will not remove it. + * @param key Item key to get (string). + * @return PeekInterface with: {value, timeLeft, isExpired} + */ + peek(key: string): ExpiredStorage.PeekInterface; + /** + * Update expiration time for an item (note: doesn't validate that the item is set). + * @param key: Item key to update expiration for (string). + * @param expiration: New expiration time in seconds to set. + * @return: Storage.setItem() return code for setting new expiration. + */ + updateExpiration(key: string, expiration: number): any; +} + +declare namespace ExpiredStorage { + interface PeekInterface { + /** + * The value of a [key] + */ + value: string | null; + /** + * Time remaining until expiration + */ + timeLeft: number | null; + /** + * Has the [key] expired or not + */ + isExpired: boolean; + } +} diff --git a/types/expired-storage/tsconfig.json b/types/expired-storage/tsconfig.json new file mode 100644 index 0000000000..cd1454cca7 --- /dev/null +++ b/types/expired-storage/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", + "expired-storage-tests.ts" + ] +} \ No newline at end of file diff --git a/types/expired-storage/tslint.json b/types/expired-storage/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/expired-storage/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/express-wechat-access/express-wechat-access-tests.ts b/types/express-wechat-access/express-wechat-access-tests.ts new file mode 100644 index 0000000000..60cc5d9d88 --- /dev/null +++ b/types/express-wechat-access/express-wechat-access-tests.ts @@ -0,0 +1,18 @@ +import express = require('express'); +import * as weAccessMiddleware from 'express-wechat-access'; + +const app: express.Application = express(); + +const options: weAccessMiddleware.WeAccessMidOption = { + appId: 'xxxxx', + appSecret: 'xxxxx' +}; + +app.use( + weAccessMiddleware( + options, + e => { + console.error(e); + } + ) +); diff --git a/types/express-wechat-access/index.d.ts b/types/express-wechat-access/index.d.ts new file mode 100644 index 0000000000..fb0d58701d --- /dev/null +++ b/types/express-wechat-access/index.d.ts @@ -0,0 +1,38 @@ +// Type definitions for express-wechat-access 1.1 +// Project: https://github.com/simmons8616/express-wechat-access +// Definitions by: Simmons Zhang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +import { Response, NextFunction } from 'express'; +import * as http from 'http'; +import { EventEmitter } from 'events'; + +type WeMiddleware = (req: any, res: Response | http.ServerResponse, next: NextFunction) => any; + +declare function weAccessMiddleware( + options: { + accessTokenUrl?: string; + ticketUrl?: string; + appId: string; + appSecret: string; + https?: boolean; + }, + errorHandler?: (e: any) => any +): WeMiddleware; + +declare namespace weAccessMiddleware { + interface WeAccessMidOption { + accessTokenUrl?: string; + ticketUrl?: string; + appId: string; + appSecret: string; + https?: boolean; + } + + interface WeAccessMiddleware extends WeMiddleware, EventEmitter, Function {} +} + +export = weAccessMiddleware; diff --git a/types/express-wechat-access/tsconfig.json b/types/express-wechat-access/tsconfig.json new file mode 100644 index 0000000000..e24d740f2c --- /dev/null +++ b/types/express-wechat-access/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", + "express-wechat-access-tests.ts" + ] +} diff --git a/types/express-wechat-access/tslint.json b/types/express-wechat-access/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/express-wechat-access/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/express-winston/express-winston-tests.ts b/types/express-winston/express-winston-tests.ts index 57b93c14f8..f370abdb5d 100644 --- a/types/express-winston/express-winston-tests.ts +++ b/types/express-winston/express-winston-tests.ts @@ -34,9 +34,11 @@ app.use(expressWinston.logger({ ], })); +const logger = winston.createLogger(); + // Logger with minimum options (winstonInstance) app.use(expressWinston.logger({ - winstonInstance: winston, + winstonInstance: logger, })); // Error Logger with all options @@ -62,7 +64,7 @@ app.use(expressWinston.errorLogger({ // Error Logger with min options (winstonInstance) app.use(expressWinston.errorLogger({ - winstonInstance: winston, + winstonInstance: logger, })); expressWinston.bodyBlacklist.push('potato'); diff --git a/types/express-winston/index.d.ts b/types/express-winston/index.d.ts index a691000dd8..462f3df1b3 100644 --- a/types/express-winston/index.d.ts +++ b/types/express-winston/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for express-winston 2.4 +// Type definitions for express-winston 3.0 // Project: https://github.com/bithavoc/express-winston#readme // Definitions by: Alex Brick // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -44,7 +44,7 @@ export interface LoggerOptionsWithTransports extends BaseLoggerOptions { } export interface LoggerOptionsWithWinstonInstance extends BaseLoggerOptions { - winstonInstance: typeof winston; + winstonInstance: winston.Logger; } export type LoggerOptions = LoggerOptionsWithTransports | LoggerOptionsWithWinstonInstance; @@ -66,7 +66,7 @@ export interface ErrorLoggerOptionsWithTransports extends BaseErrorLoggerOptions } export interface ErrorLoggerOptionsWithWinstonInstance extends BaseErrorLoggerOptions { - winstonInstance: typeof winston; + winstonInstance: winston.Logger; } export type ErrorLoggerOptions = ErrorLoggerOptionsWithTransports | ErrorLoggerOptionsWithWinstonInstance; diff --git a/types/fabric/fabric-impl.d.ts b/types/fabric/fabric-impl.d.ts index e5cbfc2432..783a4f41f7 100644 --- a/types/fabric/fabric-impl.d.ts +++ b/types/fabric/fabric-impl.d.ts @@ -1998,7 +1998,17 @@ interface IObjectOptions { */ scaleY?: number; - /** + /** + * Object skew factor (horizontal) + */ + skewX?: number; + + /** + * Object skew factor (vertical) + */ + skewY?: number; + + /** * When true, an object is rendered as flipped horizontally */ flipX?: boolean; @@ -2308,7 +2318,13 @@ export class Object { getScaleY(): number; setScaleY(value: number): Object; - setShadow(options: any): Object; + getSkewX(): number; + setSkewX(value: number): Object; + + getSkewY(): number; + setSkewY(value: number): Object; + + setShadow(options: any): Object; getShadow(): Object; stateProperties: any[]; diff --git a/types/fabric/test/index.ts b/types/fabric/test/index.ts index 1060525a00..9a5c0b24d2 100644 --- a/types/fabric/test/index.ts +++ b/types/fabric/test/index.ts @@ -872,7 +872,7 @@ laboris nisi ut aliquip ex ea commodo consequat.`; const activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.textDecoration = (activeObject.textDecoration === 'underline' ? '' : 'underline'); - this.className = activeObject.textDecoration ? 'selected' : ''; + (this as HTMLElement).className = activeObject.textDecoration ? 'selected' : ''; canvas.renderAll(); } }; @@ -885,7 +885,7 @@ laboris nisi ut aliquip ex ea commodo consequat.`; const activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.textDecoration = (activeObject.textDecoration === 'line-through' ? '' : 'line-through'); - this.className = activeObject.textDecoration ? 'selected' : ''; + (this as HTMLElement).className = activeObject.textDecoration ? 'selected' : ''; canvas.renderAll(); } }; @@ -898,7 +898,7 @@ laboris nisi ut aliquip ex ea commodo consequat.`; const activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.textDecoration = (activeObject.textDecoration === 'overline' ? '' : 'overline'); - this.className = activeObject.textDecoration ? 'selected' : ''; + (this as HTMLElement).className = activeObject.textDecoration ? 'selected' : ''; canvas.renderAll(); } }; @@ -911,7 +911,7 @@ laboris nisi ut aliquip ex ea commodo consequat.`; const activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.fontWeight = (activeObject.fontWeight === 'bold' ? '' : 'bold'); - this.className = activeObject.fontWeight ? 'selected' : ''; + (this as HTMLElement).className = activeObject.fontWeight ? 'selected' : ''; canvas.renderAll(); } }; @@ -924,7 +924,7 @@ laboris nisi ut aliquip ex ea commodo consequat.`; const activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.fontStyle = (activeObject.fontStyle === 'italic' ? '' : 'italic'); - this.className = activeObject.fontStyle ? 'selected' : ''; + (this as HTMLElement).className = activeObject.fontStyle ? 'selected' : ''; canvas.renderAll(); } }; @@ -937,7 +937,7 @@ laboris nisi ut aliquip ex ea commodo consequat.`; const activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.shadow = !activeObject.shadow ? 'rgba(0,0,0,0.2) 2px 2px 10px' : ''; - this.className = activeObject.shadow ? 'selected' : ''; + (this as HTMLElement).className = activeObject.shadow ? 'selected' : ''; canvas.renderAll(); } }; diff --git a/types/filesystem/index.d.ts b/types/filesystem/index.d.ts index 93dbb35d61..76ac35668c 100644 --- a/types/filesystem/index.d.ts +++ b/types/filesystem/index.d.ts @@ -1,21 +1,21 @@ // Type definitions for File System API // Project: http://www.w3.org/TR/file-system-api/ -// Definitions by: Kon -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Definitions by: Kon +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// interface LocalFileSystem { - + /** * Used for storage with no guarantee of persistence. */ - TEMPORARY:number; + TEMPORARY: number; /** * Used for storage that should not be removed by the user agent without application or user permission. */ - PERSISTENT:number; + PERSISTENT: number; /** * Requests a filesystem in which to store application data. @@ -24,50 +24,50 @@ interface LocalFileSystem { * @param successCallback The callback that is called when the user agent provides a filesystem. * @param errorCallback A callback that is called when errors happen, or when the request to obtain the filesystem is denied. */ - requestFileSystem(type:number, size:number, successCallback:FileSystemCallback, errorCallback?:ErrorCallback):void; - + requestFileSystem(type: number, size: number, successCallback: FileSystemCallback, errorCallback?: ErrorCallback): void; + /** * Allows the user to look up the Entry for a file or directory referred to by a local URL. * @param url A URL referring to a local file in a filesystem accessable via this API. * @param successCallback A callback that is called to report the Entry to which the supplied URL refers. * @param errorCallback A callback that is called when errors happen, or when the request to obtain the Entry is denied. - */ - resolveLocalFileSystemURL(url:string, successCallback:EntryCallback, errorCallback?:ErrorCallback):void; + */ + resolveLocalFileSystemURL(url: string, successCallback: EntryCallback, errorCallback?: ErrorCallback): void; /** * see requestFileSystem. */ - webkitRequestFileSystem(type:number, size:number, successCallback:FileSystemCallback, errorCallback?:ErrorCallback):void; + webkitRequestFileSystem(type: number, size: number, successCallback: FileSystemCallback, errorCallback?: ErrorCallback): void; } interface LocalFileSystemSync { /** * Used for storage with no guarantee of persistence. */ - TEMPORARY:number; + TEMPORARY: number; /** * Used for storage that should not be removed by the user agent without application or user permission. */ - PERSISTENT:number; + PERSISTENT: number; /** * Requests a filesystem in which to store application data. * @param type Whether the filesystem requested should be persistent, as defined above. Use one of TEMPORARY or PERSISTENT. * @param size This is an indicator of how much storage space, in bytes, the application expects to need. */ - requestFileSystemSync(type:number, size:number):FileSystemSync; + requestFileSystemSync(type: number, size: number): FileSystemSync; /** * Allows the user to look up the Entry for a file or directory referred to by a local URL. * @param url A URL referring to a local file in a filesystem accessable via this API. */ - resolveLocalFileSystemSyncURL(url:string):EntrySync; + resolveLocalFileSystemSyncURL(url: string): EntrySync; /** * see requestFileSystemSync */ - webkitRequestFileSystemSync(type:number, size:number):FileSystemSync; + webkitRequestFileSystemSync(type: number, size: number): FileSystemSync; } interface Metadata { @@ -75,31 +75,31 @@ interface Metadata { * This is the time at which the file or directory was last modified. * @readonly */ - modificationTime:Date; + modificationTime: Date; /** * The size of the file, in bytes. This must return 0 for directories. * @readonly */ - size:number; + size: number; } interface Flags { /** * Used to indicate that the user wants to create a file or directory if it was not previously there. */ - create?:boolean; + create?: boolean; /** * By itself, exclusive must have no effect. Used with create, it must cause getFile and getDirectory to fail if the target path already exists. */ - exclusive?:boolean; + exclusive?: boolean; } -/** +/** * This interface represents a file system. */ -interface FileSystem{ +interface FileSystem { /** * This is the name of the file system. The specifics of naming filesystems is unspecified, but a name must be unique across the list of exposed file systems. * @readonly @@ -118,38 +118,38 @@ interface Entry { /** * Entry is a file. */ - isFile:boolean; + isFile: boolean; /** * Entry is a directory. */ - isDirectory:boolean; + isDirectory: boolean; /** * Look up metadata about this entry. * @param successCallback A callback that is called with the time of the last modification. * @param errorCallback ErrorCallback A callback that is called when errors happen. */ - getMetadata(successCallback:MetadataCallback, errorCallback?:ErrorCallback):void; - + getMetadata(successCallback: MetadataCallback, errorCallback?: ErrorCallback): void; + /** * The name of the entry, excluding the path leading to it. */ - name:string; + name: string; /** * The full absolute path from the root to the entry. */ - fullPath:string; + fullPath: string; /** * The file system on which the entry resides. */ - filesystem:FileSystem; + filesystem: FileSystem; /** * Move an entry to a different location on the file system. It is an error to try to: - * + * * *
  • move a directory inside itself or to any child at any depth;
  • *
  • move an entry into its parent if a name different from its current one isn't provided;
  • @@ -161,12 +161,12 @@ interface Entry { * A move of a file on top of an existing file must attempt to delete and replace that file. * A move of a directory on top of an existing empty directory must attempt to delete and replace that directory. */ - moveTo(parent:DirectoryEntry, newName?:string, successCallback?:EntryCallback, errorCallback?:ErrorCallback):void; - + moveTo(parent: DirectoryEntry, newName?: string, successCallback?: EntryCallback, errorCallback?: ErrorCallback): void; + /** * Copy an entry to a different location on the file system. It is an error to try to: - * - *
      + * + *
        *
      • copy a directory inside itself or to any child at any depth;
      • *
      • copy an entry into its parent if a name different from its current one isn't provided;
      • *
      • copy a file to a path occupied by a directory;
      • @@ -178,26 +178,26 @@ interface Entry { * * Directory copies are always recursive--that is, they copy all contents of the directory. */ - copyTo(parent:DirectoryEntry, newName?:string, successCallback?:EntryCallback, errorCallback?:ErrorCallback):void; - + copyTo(parent: DirectoryEntry, newName?: string, successCallback?: EntryCallback, errorCallback?: ErrorCallback): void; + /** * Returns a URL that can be used to identify this entry. Unlike the URN defined in [FILE-API-ED], it has no specific expiration; as it describes a location on disk, it should be valid at least as long as that location exists. */ - toURL():string; + toURL(): string; /** * Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. It is an error to attempt to delete the root directory of a filesystem. * @param successCallback A callback that is called on success. * @param errorCallback A callback that is called when errors happen. */ - remove(successCallback:VoidCallback, errorCallback?:ErrorCallback):void; - + remove(successCallback: VoidCallback, errorCallback?: ErrorCallback): void; + /** * Look up the parent DirectoryEntry containing this Entry. If this Entry is the root of its filesystem, its parent is itself. * @param successCallback A callback that is called to return the parent Entry. * @param errorCallback A callback that is called when errors happen. */ - getParent(successCallback:DirectoryEntryCallback, errorCallback?:ErrorCallback):void; + getParent(successCallback: DirectoryEntryCallback, errorCallback?: ErrorCallback): void; } /** @@ -207,13 +207,13 @@ interface DirectoryEntry extends Entry { /** * Creates a new DirectoryReader to read Entries from this Directory. */ - createReader():DirectoryReader; + createReader(): DirectoryReader; /** * Creates or looks up a file. * @param path Either an absolute path or a relative path from this DirectoryEntry to the file to be looked up or created. It is an error to attempt to create a file whose immediate parent does not yet exist. * @param options - *
          + *
            *
          • If create and exclusive are both true, and the path already exists, getFile must fail.
          • *
          • If create is true, the path doesn't exist, and no other error occurs, getFile must create it as a zero-length file and return a corresponding FileEntry.
          • *
          • If create is not true and the path doesn't exist, getFile must fail.
          • @@ -223,12 +223,12 @@ interface DirectoryEntry extends Entry { * @param successCallback A callback that is called to return the File selected or created. * @param errorCallback A callback that is called when errors happen. */ - getFile(path:string, options?:Flags, successCallback?:FileEntryCallback, errorCallback?:ErrorCallback):void; - + getFile(path: string, options?: Flags, successCallback?: FileEntryCallback, errorCallback?: ErrorCallback): void; + /** * Creates or looks up a directory. * @param path Either an absolute path or a relative path from this DirectoryEntry to the directory to be looked up or created. It is an error to attempt to create a directory whose immediate parent does not yet exist. - * @param options + * @param options *
              *
            • If create and exclusive are both true and the path already exists, getDirectory must fail.
            • *
            • If create is true, the path doesn't exist, and no other error occurs, getDirectory must create and return a corresponding DirectoryEntry.
            • @@ -238,16 +238,16 @@ interface DirectoryEntry extends Entry { *
            * @param successCallback A callback that is called to return the DirectoryEntry selected or created. * @param errorCallback A callback that is called when errors happen. - * + * */ - getDirectory(path:string, options?:Flags, successCallback?:DirectoryEntryCallback, errorCallback?:ErrorCallback):void; - + getDirectory(path: string, options?: Flags, successCallback?: DirectoryEntryCallback, errorCallback?: ErrorCallback): void; + /** * Deletes a directory and all of its contents, if any. In the event of an error [e.g. trying to delete a directory that contains a file that cannot be removed], some of the contents of the directory may be deleted. It is an error to attempt to delete the root directory of a filesystem. * @param successCallback A callback that is called on success. * @param errorCallback A callback that is called when errors happen. */ - removeRecursively(successCallback:VoidCallback, errorCallback?:ErrorCallback):void; + removeRecursively(successCallback: VoidCallback, errorCallback?: ErrorCallback): void; } /** @@ -265,7 +265,7 @@ interface DirectoryReader { * @param successCallback Called once per successful call to readEntries to deliver the next previously-unreported set of Entries in the associated Directory. If all Entries have already been returned from previous invocations of readEntries, successCallback must be called with a zero-length array as an argument. * @param errorCallback A callback indicating that there was an error reading from the Directory. */ - readEntries(successCallback:EntriesCallback, errorCallback?:ErrorCallback):void; + readEntries(successCallback: EntriesCallback, errorCallback?: ErrorCallback): void; } /** @@ -277,14 +277,14 @@ interface FileEntry extends Entry { * @param successCallback A callback that is called with the new FileWriter. * @param errorCallback A callback that is called when errors happen. */ - createWriter(successCallback:FileWriterCallback, errorCallback?:ErrorCallback):void; + createWriter(successCallback: FileWriterCallback, errorCallback?: ErrorCallback): void; /** * Returns a File that represents the current state of the file that this FileEntry represents. * @param successCallback A callback that is called with the File. * @param errorCallback A callback that is called when errors happen. */ - file(successCallback:FileCallback, errorCallback?:ErrorCallback):void; + file(successCallback: FileCallback, errorCallback?: ErrorCallback): void; } /** @@ -294,7 +294,7 @@ interface FileSystemCallback { /** * @param filesystem The file systems to which the app is granted access. */ - (filesystem:FileSystem):void; + (filesystem: FileSystem): void; } /** @@ -304,7 +304,7 @@ interface EntryCallback { /** * @param entry */ - (entry:Entry):void; + (entry: Entry): void; } /** @@ -314,7 +314,7 @@ interface FileEntryCallback { /** * @param entry */ - (entry:FileEntry):void; + (entry: FileEntry): void; } /** @@ -324,102 +324,102 @@ interface DirectoryEntryCallback { /** * @param entry */ - (entry:DirectoryEntry):void; + (entry: DirectoryEntry): void; } /** * When readEntries() succeeds, the following callback is made. */ interface EntriesCallback { - (entries:Entry[]):void; + (entries: Entry[]): void; } /** * This interface is the callback used to look up file and directory metadata. */ interface MetadataCallback { - (metadata:Metadata):void; + (metadata: Metadata): void; } /** * This interface is the callback used to create a FileWriter. - */ + */ interface FileWriterCallback { - (fileWriter:FileWriter):void; + (fileWriter: FileWriter): void; } /** * This interface is the callback used to obtain a File. */ interface FileCallback { - (file:File):void; + (file: File): void; } -/** +/** * This interface is the generic callback used to indicate success of an asynchronous method. - */ + */ interface VoidCallback { - ():void; + (): void; } /** * When an error occurs, the following callback is made. */ interface ErrorCallback { - (err:DOMError):void; + (err: DOMError): void; } -/** +/** * This interface represents a file system. */ interface FileSystemSync { /** * This is the name of the file system. The specifics of naming filesystems is unspecified, but a name must be unique across the list of exposed file systems. */ - name:string; + name: string; /** * root The root directory of the file system. */ - root:DirectoryEntrySync; + root: DirectoryEntrySync; } /** * An abstract interface representing entries in a file system, each of which may be a FileEntrySync or DirectoryEntrySync. */ -interface EntrySync{ +interface EntrySync { /** * EntrySync is a file. * @readonly */ - isFile:boolean; + isFile: boolean; /** * EntrySync is a directory. * @readonly */ - isDirectory:boolean; + isDirectory: boolean; /** * Look up metadata about this entry. */ - getMetadata():Metadata; - + getMetadata(): Metadata; + /** * The name of the entry, excluding the path leading to it. */ - name:string; + name: string; /** * The full absolute path from the root to the entry. */ - fullPath:string; + fullPath: string; /** * The file system on which the entry resides. */ - filesystem:FileSystemSync; + filesystem: FileSystemSync; /** * Move an entry to a different location on the file system. It is an error to try to: @@ -429,12 +429,12 @@ interface EntrySync{ *
          • move a file to a path occupied by a directory;
          • *
          • move a directory to a path occupied by a file;
          • *
          • move any element to a path occupied by a directory which is not empty.
          • - * + * * A move of a file on top of an existing file must attempt to delete and replace that file. A move of a directory on top of an existing empty directory must attempt to delete and replace that directory. * @param parent The directory to which to move the entry. * @param newName The new name of the entry. Defaults to the EntrySync's current name if unspecified. */ - moveTo(parent:DirectoryEntrySync, newName?:string):EntrySync; + moveTo(parent: DirectoryEntrySync, newName?: string): EntrySync; /** * Copy an entry to a different location on the file system. It is an error to try to: @@ -444,27 +444,27 @@ interface EntrySync{ *
          • copy a file to a path occupied by a directory;
          • *
          • copy a directory to a path occupied by a file;
          • *
          • copy any element to a path occupied by a directory which is not empty.
          • - * + * * A copy of a file on top of an existing file must attempt to delete and replace that file. * A copy of a directory on top of an existing empty directory must attempt to delete and replace that directory. * Directory copies are always recursive--that is, they copy all contents of the directory. */ - copyTo(parent:DirectoryEntrySync, newName?:string):EntrySync; + copyTo(parent: DirectoryEntrySync, newName?: string): EntrySync; /** * Returns a URL that can be used to identify this entry. Unlike the URN defined in [FILE-API-ED], it has no specific expiration; as it describes a location on disk, it should be valid at least as long as that location exists. */ - toURL():string; + toURL(): string; /** * Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. It is an error to attempt to delete the root directory of a filesystem. */ - remove ():void; + remove(): void; /** * Look up the parent DirectoryEntrySync containing this Entry. If this EntrySync is the root of its filesystem, its parent is itself. */ - getParent():DirectoryEntrySync; + getParent(): DirectoryEntrySync; } /** @@ -474,12 +474,12 @@ interface DirectoryEntrySync extends EntrySync { /** * Creates a new DirectoryReaderSync to read EntrySyncs from this DirectorySync. */ - createReader():DirectoryReaderSync; + createReader(): DirectoryReaderSync; - /** + /** * Creates or looks up a directory. * @param path Either an absolute path or a relative path from this DirectoryEntrySync to the file to be looked up or created. It is an error to attempt to create a file whose immediate parent does not yet exist. - * @param options + * @param options *
              *
            • If create and exclusive are both true and the path already exists, getFile must fail.
            • *
            • If create is true, the path doesn't exist, and no other error occurs, getFile must create it as a zero-length file and return a corresponding FileEntry.
            • @@ -488,12 +488,12 @@ interface DirectoryEntrySync extends EntrySync { *
            • Otherwise, if no other error occurs, getFile must return a FileEntrySync corresponding to path.
            • *
            */ - getFile(path:string, options?:Flags):FileEntrySync; + getFile(path: string, options?: Flags): FileEntrySync; - /** + /** * Creates or looks up a directory. * @param path Either an absolute path or a relative path from this DirectoryEntrySync to the directory to be looked up or created. It is an error to attempt to create a directory whose immediate parent does not yet exist. - * @param options + * @param options *
              *
            • If create and exclusive are both true and the path already exists, getDirectory must fail.
            • *
            • If create is true, the path doesn't exist, and no other error occurs, getDirectory must create and return a corresponding DirectoryEntry.
            • @@ -502,12 +502,12 @@ interface DirectoryEntrySync extends EntrySync { *
            • Otherwise, if no other error occurs, getDirectory must return a DirectoryEntrySync corresponding to path.
            • *
            */ - getDirectory(path:string, options?:Flags):DirectoryEntrySync; + getDirectory(path: string, options?: Flags): DirectoryEntrySync; /** * Deletes a directory and all of its contents, if any. In the event of an error [e.g. trying to delete a directory that contains a file that cannot be removed], some of the contents of the directory may be deleted. It is an error to attempt to delete the root directory of a filesystem. */ - removeRecursively():void; + removeRecursively(): void; } /** @@ -523,7 +523,7 @@ interface DirectoryReaderSync { /** * Read the next block of entries from this directory. */ - readEntries():EntrySync[]; + readEntries(): EntrySync[]; } /** @@ -533,16 +533,16 @@ interface FileEntrySync extends EntrySync { /** * Creates a new FileWriterSync associated with the file that this FileEntrySync represents. */ - createWriter():FileWriterSync; + createWriter(): FileWriterSync; /** * Returns a File that represents the current state of the file that this FileEntrySync represents. */ - file():File; + file(): File; } -interface Window extends LocalFileSystem, LocalFileSystemSync{ +interface Window extends LocalFileSystem, LocalFileSystemSync { } -interface WorkerGlobalScope extends LocalFileSystem, LocalFileSystemSync{ +interface WorkerGlobalScope extends LocalFileSystem, LocalFileSystemSync { } diff --git a/types/fscreen/index.d.ts b/types/fscreen/index.d.ts index dfe2f6117f..b818f2dd2f 100644 --- a/types/fscreen/index.d.ts +++ b/types/fscreen/index.d.ts @@ -1,9 +1,13 @@ // Type definitions for fscreen 1.0 // Project: https://github.com/rafrex/fscreen#readme // Definitions by: Joscha Feth +// Terry Mun // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 -type Handler = () => void; +type Handler = (e?: Event) => void; +type RequestFullScreenFunction = (element: Element) => void; +type EventName = 'fullscreenEnabled' | 'fullscreenElement' | 'requestFullscreen' | 'exitFullscreen' | 'fullscreenchange' | 'fullscreenerror'; declare class Fscreen { readonly fullscreenElement: Element | undefined; @@ -12,10 +16,10 @@ declare class Fscreen { onfullscreenchange: Handler; onfullscreenerror: Handler; - addEventListener(type: string, handler: Handler, useCapture?: boolean): void; - removeEventListener(type: string, handler: Handler): void; + addEventListener(type: EventName, handler: Handler, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: EventName, handler: Handler, options?: boolean | AddEventListenerOptions): void; requestFullscreen(element: Element): void; - requestFullscreenFunction(element: Element): void; + requestFullscreenFunction(element: Element): RequestFullScreenFunction; } declare const fscreen: Fscreen; diff --git a/types/gamedig/gamedig-tests.ts b/types/gamedig/gamedig-tests.ts new file mode 100644 index 0000000000..3af9334b70 --- /dev/null +++ b/types/gamedig/gamedig-tests.ts @@ -0,0 +1,18 @@ +import Gamedig = require("gamedig"); + +Gamedig.query({ + type: "tf2", + host: "127.0.0.1" +}, (error, state) => { + if (error) throw error(); + + const { + name, + map, + password, + maxplayers, + players, + bots, + notes + } = state; +}); diff --git a/types/gamedig/index.d.ts b/types/gamedig/index.d.ts new file mode 100644 index 0000000000..a2ccf75de9 --- /dev/null +++ b/types/gamedig/index.d.ts @@ -0,0 +1,285 @@ +// Type definitions for Gamedig 1.0 +// Project: https://github.com/sonicsnes/node-gamedig +// Definitions by: Ivan Sieder +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export type Type = + "7d2d" + | "ageofchivalry" + | "aoe2" + | "alienarena" + | "alienswarm" + | "arkse" + | "avp2" + | "avp2010" + | "americasarmy" + | "americasarmy2" + | "americasarmy3" + | "americasarmypg" + | "arma" + | "arma2" + | "arma3" + | "armagetron" + | "baldursgate" + | "bat1944" + | "bf1942" + | "bfv" + | "bf2" + | "bf2142" + | "bfbc2" + | "bf3" + | "bf4" + | "bfh" + | "breach" + | "breed" + | "brink" + | "buildandshoot" + | "cod" + | "coduo" + | "cod2" + | "cod3" + | "cod4" + | "codwaw" + | "codmw2" + | "codmw3" + | "callofjuarez" + | "chaser" + | "chrome" + | "codenameeagle" + | "commandos3" + | "cacrenegade" + | "conanexiles" + | "contactjack" + | "cs16" + | "cscz" + | "css" + | "csgo" + | "crossracing" + | "crysis" + | "crysiswars" + | "crysis2" + | "daikatana" + | "dmomam" + | "darkesthour" + | "dayz" + | "dayzmod" + | "deadlydozenpt" + | "dh2005" + | "descent3" + | "deusex" + | "devastation" + | "dinodday" + | "dirttrackracing2" + | "dnl" + | "dod" + | "dods" + | "doi" + | "doom3" + | "dota2" + | "drakan" + | "etqw" + | "fear" + | "f12002" + | "f1c9902" + | "farcry" + | "farcry2" + | "fortressforever" + | "flashpoint" + | "ffow" + | "fivem" + | "garrysmod" + | "graw" + | "graw2" + | "giantscitizenkabuto" + | "globaloperations" + | "geneshift" + | "ges" + | "gore" + | "gunmanchronicles" + | "hldm" + | "hl2dm" + | "halo" + | "halo2" + | "heretic2" + | "hexen2" + | "hidden" + | "had2" + | "homefront" + | "homeworld2" + | "hurtworld" + | "igi2" + | "il2" + | "insurgency" + | "ironstorm" + | "jamesbondnightfire" + | "jc2mp" + | "killingfloor" + | "killingfloor2" + | "kingpin" + | "kisspc" + | "kspdmp" + | "kzmod" + | "left4dead" + | "left4dead2" + | "m2mp" + | "medievalengineers" + | "mohaa" + | "mohpa" + | "mohab" + | "mohsh" + | "mohbt" + | "moh2010" + | "mohwf" + | "minecraft" + | "minecraftpe" + | "minecraftping" + | "mnc" + | "mtavc" + | "mtasa" + | "mumble" + | "mumbleping" + | "mutantfactions" + | "nascarthunder2004" + | "netpanzer" + | "nmrih" + | "ns" + | "ns2" + | "nfshp2" + | "nab" + | "nwn" + | "nwn2" + | "nexuiz" + | "nitrofamily" + | "nolf" + | "nolf2" + | "nucleardawn" + | "openarena" + | "openttd" + | "operationflashpoint" + | "painkiller" + | "postal2" + | "prey" + | "primalcarnage" + | "quake1" + | "quake2" + | "quake3" + | "quake4" + | "ragdollkungfu" + | "r6" + | "r6roguespear" + | "r6ravenshield" + | "rallisportchallenge" + | "rallymasters" + | "redorchestra" + | "redorchestraost" + | "redorchestra2" + | "redline" + | "rtcw" + | "ricochet" + | "riseofnations" + | "rune" + | "rust" + | "samp" + | "spaceengineers" + | "ss" + | "ss2" + | "shatteredhorizon" + | "ship" + | "shogo" + | "shootmania" + | "sin" + | "sinep" + | "soldat" + | "sof" + | "sof2" + | "stalker" + | "stbc" + | "stvef" + | "stvef2" + | "swbf" + | "swbf2" + | "swjk" + | "swjk2" + | "swrc" + | "starbound" + | "starmade" + | "suicidesurvival" + | "swat4" + | "svencoop" + | "synergy" + | "tacticalops" + | "teamfactor" + | "tfc" + | "tf2" + | "teamspeak2" + | "teamspeak3" + | "terminus" + | "terraria" + | "thps3" + | "thps4" + | "thu2" + | "towerunite" + | "trackmania2" + | "trackmaniaforever" + | "tremulous" + | "tribes1" + | "tribesvengeance" + | "tron20" + | "turok2" + | "universalcombat" + | "unreal" + | "unturned" + | "ut" + | "ut2003" + | "ut2004" + | "ut3" + | "urbanterror" + | "v8supercar" + | "ventrilo" + | "vietcong" + | "vietcong2" + | "warsow" + | "wheeloftime" + | "wolfenstein2009" + | "wolfensteinet" + | "xpandrally" + | "zombiemaster" + | "zps"; + +export interface Player { + name?: string; + ping?: number; + score?: number; + team?: string; + address?: string; +} + +export interface QueryOptions { + type: Type; + host: string; + port?: number; + notes?: object; + maxAttempts?: number; + socketTimeout?: number; + attemptTimeout?: number; +} + +export interface QueryResult { + name: string; + map: string; + password: boolean; + maxplayers: number; + players: Player[]; + bots: Player[]; + notes: object; + raw?: object; + query?: object; +} + +export function query( + options: QueryOptions, + callback: (error: any, state: QueryResult) => void +): void; + +export function query(options: QueryOptions): Promise; diff --git a/types/gamedig/tsconfig.json b/types/gamedig/tsconfig.json new file mode 100644 index 0000000000..ae26ece7da --- /dev/null +++ b/types/gamedig/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", + "gamedig-tests.ts" + ] +} diff --git a/types/gamedig/tslint.json b/types/gamedig/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/gamedig/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/google-cloud__storage/index.d.ts b/types/google-cloud__storage/index.d.ts index 18ac093c5d..2053abcc62 100644 --- a/types/google-cloud__storage/index.d.ts +++ b/types/google-cloud__storage/index.d.ts @@ -104,10 +104,12 @@ declare namespace Storage { interface BucketQuery { autoPaginate?: boolean; delimiter?: string; + directory?: string; prefix?: string; maxApiCalls?: number; maxResults?: number; pageToken?: string; + userProject?: string; versions?: boolean; } diff --git a/types/google-map-react/index.d.ts b/types/google-map-react/index.d.ts index ffd8cb90c2..b77c481dd9 100644 --- a/types/google-map-react/index.d.ts +++ b/types/google-map-react/index.d.ts @@ -131,6 +131,7 @@ export interface Props { onChildClick?(hoverKey: any, childProps: any): void; onChildMouseEnter?(hoverKey: any, childProps: any): void; onChildMouseLeave?(hoverKey: any, childProps: any): void; + onDrag?(args: any): void; onZoomAnimationStart?(args: any): void; onZoomAnimationEnd?(args: any): void; onMapTypeIdChange?(args: any): void; diff --git a/types/googlemaps/googlemaps-tests.ts b/types/googlemaps/googlemaps-tests.ts index 77a2900b7b..e161e8068e 100644 --- a/types/googlemaps/googlemaps-tests.ts +++ b/types/googlemaps/googlemaps-tests.ts @@ -418,7 +418,8 @@ let service = new google.maps.places.PlacesService(new HTMLDivElement()); service.getDetails({ placeId: '-a1', - fields: ['name'] + fields: ['name'], + sessionToken: new google.maps.places.AutocompleteSessionToken() }, (result, status) => { if (status === google.maps.places.PlacesServiceStatus.NOT_FOUND) { return; diff --git a/types/googlemaps/index.d.ts b/types/googlemaps/index.d.ts index 501dd4c1f8..dba5a5a5a1 100644 --- a/types/googlemaps/index.d.ts +++ b/types/googlemaps/index.d.ts @@ -1,14 +1,15 @@ // Type definitions for Google Maps JavaScript API 3.30 // Project: https://developers.google.com/maps/ -// Definitions by: Folia A/S , -// Chris Wrench , -// Kiarash Ghiaseddin , -// Grant Hutchins , -// Denis Atyasov , -// Michael McMullin , -// Martin Costello , +// Definitions by: Folia A/S , +// Chris Wrench , +// Kiarash Ghiaseddin , +// Grant Hutchins , +// Denis Atyasov , +// Michael McMullin , +// Martin Costello , // Sven Kreiss // Umar Bolatov +// Michael Gauthier // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /* @@ -2542,6 +2543,10 @@ declare namespace google.maps { getQueryPredictions(request: QueryAutocompletionRequest, callback: (result: QueryAutocompletePrediction[], status: PlacesServiceStatus) => void): void; } + export class AutocompleteSessionToken { + constructor(); + } + export interface AutocompletionRequest { bounds?: LatLngBounds|LatLngBoundsLiteral; componentRestrictions?: ComponentRestrictions; @@ -2549,6 +2554,7 @@ declare namespace google.maps { location?: LatLng; offset?: number; radius?: number; + sessionToken?: AutocompleteSessionToken; types?: string[]; } @@ -2566,6 +2572,7 @@ declare namespace google.maps { export interface PlaceDetailsRequest { placeId: string; fields?: string[]; + sessionToken?: AutocompleteSessionToken; } export interface PlaceGeometry { diff --git a/types/grpc-error/grpc-error-tests.ts b/types/grpc-error/grpc-error-tests.ts new file mode 100644 index 0000000000..f8f309cb65 --- /dev/null +++ b/types/grpc-error/grpc-error-tests.ts @@ -0,0 +1,7 @@ +import GRPCError = require('grpc-error'); + +const error1 = new GRPCError('test'); +const error2 = new GRPCError({status_code: 'invalid'}); +const error3 = new GRPCError('test', 12); +const error4 = new GRPCError('test', {status_code: 'invalid'}); +const error5 = new GRPCError('test', 12, {status_code: 'invalid'}); diff --git a/types/grpc-error/index.d.ts b/types/grpc-error/index.d.ts new file mode 100644 index 0000000000..6f76d288db --- /dev/null +++ b/types/grpc-error/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for grpc-error 1.0 +// Project: https://github.com/bojand/grpc-error +// Definitions by: Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +declare class GRPCError extends Error { + constructor(value: string | object); + constructor(message: string, value: number | object); + constructor(message: string, code: number, metadata: object); + + code: number; + metadata: object; +} + +export = GRPCError; diff --git a/types/grpc-error/tsconfig.json b/types/grpc-error/tsconfig.json new file mode 100644 index 0000000000..51388578e0 --- /dev/null +++ b/types/grpc-error/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "grpc-error-tests.ts" + ] +} diff --git a/types/grpc-error/tslint.json b/types/grpc-error/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/grpc-error/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/gulp-imagemin/gulp-imagemin-tests.ts b/types/gulp-imagemin/gulp-imagemin-tests.ts index 7fc1d86311..839e126fe2 100644 --- a/types/gulp-imagemin/gulp-imagemin-tests.ts +++ b/types/gulp-imagemin/gulp-imagemin-tests.ts @@ -1,20 +1,33 @@ -import * as GulpImagemin from 'gulp-imagemin'; +import gulp = require('gulp'); +import gulpImagemin = require('gulp-imagemin'); -GulpImagemin(); +const plugins = [ + gulpImagemin.gifsicle({ interlaced: true }), + gulpImagemin.jpegtran({ progressive: true }), + gulpImagemin.optipng({ optimizationLevel: 5 }), + gulpImagemin.svgo({ floatPrecision: 2 }) +]; -GulpImagemin([ - GulpImagemin.gifsicle({ interlaced: true }), - GulpImagemin.jpegtran({ progressive: true }), - GulpImagemin.optipng({ optimizationLevel: 5 }), - GulpImagemin.svgo({ - plugins: [{ removeViewBox: true }, { cleanupIDs: false }] - }) -]); +gulp.task('build', () => { + return gulp.src('*.{gif,jpg,png,svg}') + .pipe(gulpImagemin()) + .pipe(gulp.dest('dist')); +}); -GulpImagemin({ verbose: true }); +gulp.task('build', () => { + return gulp.src('*.{gif,jpg,png,svg}') + .pipe(gulpImagemin(plugins)) + .pipe(gulp.dest('dist')); +}); -GulpImagemin([ - GulpImagemin.svgo({ - plugins: [{ removeViewBox: true }] - }) -], { verbose: true }); +gulp.task('build', () => { + return gulp.src('*.{gif,jpg,png,svg}') + .pipe(gulpImagemin({ verbose: true })) + .pipe(gulp.dest('dist')); +}); + +gulp.task('build', () => { + return gulp.src('*.{gif,jpg,png,svg}') + .pipe(gulpImagemin(plugins, { verbose: true })) + .pipe(gulp.dest('dist')); +}); diff --git a/types/gulp-imagemin/index.d.ts b/types/gulp-imagemin/index.d.ts index 42c1ef8d5c..ac61547a74 100644 --- a/types/gulp-imagemin/index.d.ts +++ b/types/gulp-imagemin/index.d.ts @@ -2,26 +2,31 @@ // Project: https://github.com/sindresorhus/gulp-imagemin#readme // Definitions by: Romain Faust // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// +import { Plugin } from 'imagemin'; +import { Options as GifsicleOptions } from 'imagemin-gifsicle'; +import { Options as JpegtranOptions } from 'imagemin-jpegtran'; +import { Options as OptipngOptions } from 'imagemin-optipng'; +import { Options as SvgoOptions } from 'imagemin-svgo'; import { Transform } from 'stream'; -declare function imagemin(pluginsOrOptions?: imagemin.Plugin[] | imagemin.Options): Transform; -declare function imagemin(plugins?: imagemin.Plugin[], options?: imagemin.Options): Transform; +declare function imagemin(pluginsOrOptions?: ReadonlyArray | imagemin.Options): Transform; +declare function imagemin(plugins?: ReadonlyArray, options?: imagemin.Options): Transform; declare namespace imagemin { interface Options { verbose?: boolean; } - type Plugin = (input: any) => Promise; - type PluginFactory = (options?: any) => Plugin; + type PluginFactory = (options?: T) => Plugin; - const gifsicle: PluginFactory; - const jpegtran: PluginFactory; - const optipng: PluginFactory; - const svgo: PluginFactory; + const gifsicle: PluginFactory; + const jpegtran: PluginFactory; + const optipng: PluginFactory; + const svgo: PluginFactory; } export = imagemin; diff --git a/types/gulp-jsonmin/gulp-jsonmin-tests.ts b/types/gulp-jsonmin/gulp-jsonmin-tests.ts index 5c0cf66cc3..e13ec2c69f 100644 --- a/types/gulp-jsonmin/gulp-jsonmin-tests.ts +++ b/types/gulp-jsonmin/gulp-jsonmin-tests.ts @@ -1,5 +1,14 @@ -import * as GulpJsonmin from 'gulp-jsonmin'; +import gulp = require('gulp'); +import gulpJsonmin = require('gulp-jsonmin'); -GulpJsonmin(); -GulpJsonmin({}); -GulpJsonmin({ verbose: true }); +gulp.task('build', () => { + return gulp.src('*.json') + .pipe(gulpJsonmin()) + .pipe(gulp.dest('dist')); +}); + +gulp.task('build', () => { + return gulp.src('*.json') + .pipe(gulpJsonmin({ verbose: true })) + .pipe(gulp.dest('dist')); +}); diff --git a/types/gulp-jsonmin/index.d.ts b/types/gulp-jsonmin/index.d.ts index 16a4347dd2..d5faa2b969 100644 --- a/types/gulp-jsonmin/index.d.ts +++ b/types/gulp-jsonmin/index.d.ts @@ -7,12 +7,12 @@ import { Transform } from 'stream'; -declare function jsonmin(options?: jsonmin.Options): Transform; +declare function gulpJsonmin(options?: gulpJsonmin.Options): Transform; -declare namespace jsonmin { +declare namespace gulpJsonmin { interface Options { verbose?: boolean; } } -export = jsonmin; +export = gulpJsonmin; diff --git a/types/gulp-pug-i18n/gulp-pug-i18n-tests.ts b/types/gulp-pug-i18n/gulp-pug-i18n-tests.ts new file mode 100644 index 0000000000..98e83afcff --- /dev/null +++ b/types/gulp-pug-i18n/gulp-pug-i18n-tests.ts @@ -0,0 +1,10 @@ +import gulp = require('gulp'); +import gulpPugI18n = require('gulp-pug-i18n'); + +gulp.task('build', () => { + return gulp.src('*.pug') + .pipe(gulpPugI18n({ + i18n: { locales: 'locales/*.json' } + })) + .pipe(gulp.dest('dist')); +}); diff --git a/types/gulp-pug-i18n/index.d.ts b/types/gulp-pug-i18n/index.d.ts new file mode 100644 index 0000000000..7f4c50deda --- /dev/null +++ b/types/gulp-pug-i18n/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for gulp-pug-i18n 1.0 +// Project: https://github.com/dogancelik/gulp-pug-i18n +// Definitions by: Romain Faust +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { Options as PugOptions } from 'pug'; +import { Transform } from 'stream'; + +declare function gulpPugI18n(options: gulpPugI18n.Options): Transform; + +declare namespace gulpPugI18n { + interface Options extends PugOptions { + data?: any; + i18n: { + default?: string; + filename?: string; + locales: string | ReadonlyArray; + namespace?: string | null; + }; + } +} + +export = gulpPugI18n; diff --git a/types/gulp-pug-i18n/tsconfig.json b/types/gulp-pug-i18n/tsconfig.json new file mode 100644 index 0000000000..afd4c6ea4c --- /dev/null +++ b/types/gulp-pug-i18n/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", + "gulp-pug-i18n-tests.ts" + ] +} diff --git a/types/gulp-pug-i18n/tslint.json b/types/gulp-pug-i18n/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/gulp-pug-i18n/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index 3d3b69b959..b152d34e5b 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -2904,7 +2904,7 @@ export interface ServerOptions { * Default value: none. * Used to create an HTTPS connection. The tls object is passed unchanged to the node HTTPS server as described in the node HTTPS documentation. */ - tls?: boolean | https.RequestOptions; + tls?: boolean | https.ServerOptions; /** * Default value: constructed from runtime server information. diff --git a/types/hash-sum/hash-sum-tests.ts b/types/hash-sum/hash-sum-tests.ts new file mode 100644 index 0000000000..2da5ff9566 --- /dev/null +++ b/types/hash-sum/hash-sum-tests.ts @@ -0,0 +1,9 @@ +import sum = require("hash-sum"); + +sum(undefined); +sum(null); +sum({}); +sum({ hello: "world" }); +sum(100); +sum(""); +sum(true); diff --git a/types/hash-sum/index.d.ts b/types/hash-sum/index.d.ts new file mode 100644 index 0000000000..e999437abe --- /dev/null +++ b/types/hash-sum/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for hash-sum 1.0 +// Project: https://github.com/bevacqua/hash-sum +// Definitions by: Daniel Rosenwasser +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = hash_sum; + +declare function hash_sum(value: any): string; diff --git a/types/hash-sum/tsconfig.json b/types/hash-sum/tsconfig.json new file mode 100644 index 0000000000..be8178d410 --- /dev/null +++ b/types/hash-sum/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", + "hash-sum-tests.ts" + ] +} diff --git a/types/hash-sum/tslint.json b/types/hash-sum/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/hash-sum/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/hat/hat-tests.ts b/types/hat/hat-tests.ts new file mode 100644 index 0000000000..3156a138f0 --- /dev/null +++ b/types/hat/hat-tests.ts @@ -0,0 +1,10 @@ +import hat = require('hat'); + +const randomId = hat(); + +const rack = hat.rack(); +rack('car'); +const tractorId = rack('tractor'); +rack.get(tractorId); +rack.set(randomId, 'bicycle'); +rack.hats; diff --git a/types/hat/index.d.ts b/types/hat/index.d.ts new file mode 100644 index 0000000000..58a7bdc983 --- /dev/null +++ b/types/hat/index.d.ts @@ -0,0 +1,28 @@ +// Type definitions for hat 0.0 +// Project: https://github.com/substack/node-hat +// Definitions by: Sasha Grin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface HatsList { + [key: string]: any; +} + +interface Rack { + bits: number; + base: number; + hats: HatsList; + + (data: any): string; + get(id: string): any; + set(id: string, value: any): Rack; +} + +type CreateRack = (bits?: number, base?: number, expandBy?: number) => Rack; + +interface Hat { + (bits?: number, base?: number): string; + rack: CreateRack; +} + +declare const hat: Hat; +export = hat; diff --git a/types/hat/tsconfig.json b/types/hat/tsconfig.json new file mode 100644 index 0000000000..c13e03fd48 --- /dev/null +++ b/types/hat/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", + "hat-tests.ts" + ] +} diff --git a/types/hat/tslint.json b/types/hat/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/hat/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/hedron/hedron-tests.tsx b/types/hedron/hedron-tests.tsx index 8b2ce82f01..3fe25ddff1 100644 --- a/types/hedron/hedron-tests.tsx +++ b/types/hedron/hedron-tests.tsx @@ -4,7 +4,29 @@ import * as hedron from 'hedron'; - test + + test + ; + +// withBreakpoints test +interface Props { + numeric: number; + str: string; +} + +class ComponentWithBreakpoints extends React.Component { + render() { + // `breakpoints` prop is accessible in component + this.props.breakpoints; + + return null; + } +} + +const WithBreakpoints = hedron.withBreakpoints(ComponentWithBreakpoints); + +// breakpoints props is not needed +; diff --git a/types/hedron/index.d.ts b/types/hedron/index.d.ts index 1e19aaee7a..8ce464c017 100644 --- a/types/hedron/index.d.ts +++ b/types/hedron/index.d.ts @@ -150,8 +150,14 @@ export interface HiddenProps { lg?: boolean; } -export interface BreakpointProviderProps { - breakpoints: { sm?: number; md?: number; lg?: number }; +export interface Breakpoints { + sm?: number; + md?: number; + lg?: number; +} + +export interface BreakpointsProps { + breakpoints: Breakpoints; } export class Column extends React.Component> {} @@ -159,8 +165,8 @@ export class Page extends React.Component> {} export class Hidden extends React.Component> {} export class BreakpointProvider extends React.Component< - BreakpointProviderProps & React.HTMLProps + BreakpointsProps & React.HTMLProps > {} export function withBreakpoints( - wrappedComponent: React.ComponentClass + wrappedComponent: React.ComponentClass ): React.ComponentClass; diff --git a/types/helmet/helmet-tests.ts b/types/helmet/helmet-tests.ts index 38fa53828f..afedea6c23 100644 --- a/types/helmet/helmet-tests.ts +++ b/types/helmet/helmet-tests.ts @@ -58,6 +58,7 @@ function contentSecurityPolicyTest() { directives: { defaultSrc: ["'self'"] }, + loose: false, setAllHeaders: true })); } @@ -206,3 +207,12 @@ function xssFilterTest() { app.use(helmet.xssFilter({ setOnOldIE: false })); app.use(helmet.xssFilter({ setOnOldIE: true })); } + +/** + * @summary Test for {@see helmet#permittedCrossDomainPolicies} function. + */ +function permittedCrossDomainPoliciesTest() { + app.use(helmet.permittedCrossDomainPolicies()); + app.use(helmet.permittedCrossDomainPolicies({})); + app.use(helmet.permittedCrossDomainPolicies({ permittedPolicies: 'none' })); +} diff --git a/types/helmet/index.d.ts b/types/helmet/index.d.ts index 0162912d99..6f89728e8a 100644 --- a/types/helmet/index.d.ts +++ b/types/helmet/index.d.ts @@ -11,18 +11,23 @@ export = helmet; declare namespace helmet { export interface IHelmetConfiguration { - contentSecurityPolicy?: boolean | IHelmetContentSecurityPolicyConfiguration, - dnsPrefetchControl?: boolean | IHelmetDnsPrefetchControlConfiguration, - frameguard?: boolean | IHelmetFrameguardConfiguration, - hidePoweredBy?: boolean | IHelmetHidePoweredByConfiguration, - hpkp?: boolean | IHelmetHpkpConfiguration, - hsts?: boolean | IHelmetHstsConfiguration, - ieNoOpen?: boolean, - noCache?: boolean, - noSniff?: boolean, - referrerPolicy?: boolean | IHelmetReferrerPolicyConfiguration, - xssFilter?: boolean | IHelmetXssFilterConfiguration, - expectCt?: boolean | IHelmetExpectCtConfiguration, + contentSecurityPolicy?: boolean | IHelmetContentSecurityPolicyConfiguration; + dnsPrefetchControl?: boolean | IHelmetDnsPrefetchControlConfiguration; + frameguard?: boolean | IHelmetFrameguardConfiguration; + hidePoweredBy?: boolean | IHelmetHidePoweredByConfiguration; + hpkp?: boolean | IHelmetHpkpConfiguration; + hsts?: boolean | IHelmetHstsConfiguration; + ieNoOpen?: boolean; + noCache?: boolean; + noSniff?: boolean; + referrerPolicy?: boolean | IHelmetReferrerPolicyConfiguration; + xssFilter?: boolean | IHelmetXssFilterConfiguration; + expectCt?: boolean | IHelmetExpectCtConfiguration; + permittedCrossDomainPolicies?: boolean | IHelmetPermittedCrossDomainPoliciesConfiguration; + } + + export interface IHelmetPermittedCrossDomainPoliciesConfiguration { + permittedPolicies?: string; } export interface IHelmetContentSecurityPolicyDirectiveFunction { @@ -31,22 +36,22 @@ declare namespace helmet { export type HelmetCspDirectiveValue = string | IHelmetContentSecurityPolicyDirectiveFunction; export interface IHelmetContentSecurityPolicyDirectives { - baseUri?: HelmetCspDirectiveValue[], - childSrc?: HelmetCspDirectiveValue[], - connectSrc?: HelmetCspDirectiveValue[], - defaultSrc?: HelmetCspDirectiveValue[], - fontSrc?: HelmetCspDirectiveValue[], - formAction?: HelmetCspDirectiveValue[], - frameAncestors?: HelmetCspDirectiveValue[], - frameSrc?: HelmetCspDirectiveValue[], - imgSrc?: HelmetCspDirectiveValue[], - mediaSrc?: HelmetCspDirectiveValue[], - objectSrc?: HelmetCspDirectiveValue[], - pluginTypes?: HelmetCspDirectiveValue[], - reportUri?: string, - sandbox?: HelmetCspDirectiveValue[], - scriptSrc?: HelmetCspDirectiveValue[], - styleSrc?: HelmetCspDirectiveValue[] + baseUri?: HelmetCspDirectiveValue[]; + childSrc?: HelmetCspDirectiveValue[]; + connectSrc?: HelmetCspDirectiveValue[]; + defaultSrc?: HelmetCspDirectiveValue[]; + fontSrc?: HelmetCspDirectiveValue[]; + formAction?: HelmetCspDirectiveValue[]; + frameAncestors?: HelmetCspDirectiveValue[]; + frameSrc?: HelmetCspDirectiveValue[]; + imgSrc?: HelmetCspDirectiveValue[]; + mediaSrc?: HelmetCspDirectiveValue[]; + objectSrc?: HelmetCspDirectiveValue[]; + pluginTypes?: HelmetCspDirectiveValue[]; + reportUri?: string; + sandbox?: HelmetCspDirectiveValue[]; + scriptSrc?: HelmetCspDirectiveValue[]; + styleSrc?: HelmetCspDirectiveValue[]; } export interface IHelmetContentSecurityPolicyConfiguration { @@ -54,7 +59,8 @@ declare namespace helmet { setAllHeaders?: boolean; disableAndroid?: boolean; browserSniff?: boolean; - directives?: IHelmetContentSecurityPolicyDirectives + directives?: IHelmetContentSecurityPolicyDirectives; + loose?: boolean; } export interface IHelmetDnsPrefetchControlConfiguration { @@ -62,12 +68,12 @@ declare namespace helmet { } export interface IHelmetFrameguardConfiguration { - action?: string, - domain?: string + action?: string; + domain?: string; } export interface IHelmetHidePoweredByConfiguration { - setTo?: string + setTo?: string; } export interface IHelmetSetIfFunction { @@ -80,14 +86,14 @@ declare namespace helmet { includeSubdomains?: boolean; reportUri?: string; reportOnly?: boolean; - setIf?: IHelmetSetIfFunction + setIf?: IHelmetSetIfFunction; } export interface IHelmetHstsConfiguration { maxAge?: number; includeSubdomains?: boolean; preload?: boolean; - setIf?: IHelmetSetIfFunction, + setIf?: IHelmetSetIfFunction; force?: boolean; } @@ -195,5 +201,12 @@ declare namespace helmet { * @returns {e.RequestHandler} */ expectCt(options?: IHelmetExpectCtConfiguration): express.RequestHandler; + + /** + * @summary Adds the "X-Permitted-Cross-Domain-Policies" header. + * @param {helmet.IHelmetPermittedCrossDomainPoliciesConfiguration} options + * @returns {express.RequestHandler} + */ + permittedCrossDomainPolicies(options?: IHelmetPermittedCrossDomainPoliciesConfiguration): express.RequestHandler; } } diff --git a/types/i18next/index.d.ts b/types/i18next/index.d.ts index 7674762de6..484745bcad 100644 --- a/types/i18next/index.d.ts +++ b/types/i18next/index.d.ts @@ -97,17 +97,29 @@ declare namespace i18next { interface ReactOptions { /** * set to true if you like to wait for loaded in every translated hoc + * @default false */ wait?: boolean; /** * set it to fallback to let passed namespaces to translated hoc act as fallbacks + * @default 'default' */ - nsMode?: string; + nsMode?: 'default' | 'fallback'; /** * set it to the default parent element created by the Trans component. - * @default div + * @default 'div' */ defaultTransParent?: string; + /** + * set which events trigger a rerender, can be set to false or string of events + * @default 'languageChanged loaded' + */ + bindI18n?: string | false; + /** + * set which events on store trigger a rerender, can be set to false or string of events + * @default 'added removed' + */ + bindStore?: string | false; } interface InitOptions { diff --git a/types/ignite-ui/index.d.ts b/types/ignite-ui/index.d.ts index 1fa6cf1168..29d809964a 100644 --- a/types/ignite-ui/index.d.ts +++ b/types/ignite-ui/index.d.ts @@ -1044,6 +1044,7 @@ class TypeParser { * @param obj */ toDate(obj: Object): void; + toTime(obj: Object): void; toNumber(obj: Object): void; toBool(obj: Object): void; isNullOrUndefined(obj: Object): void; @@ -1063,8 +1064,12 @@ interface DataSchemaSchemaFields { * number * bool * date + * time * object * + * + * Valid values: + * "time" */ type?: string|number|boolean|Date|Object; @@ -10903,6 +10908,13 @@ interface IgCategoryChart { */ tooltipTemplates?: any; + /** + * Gets or sets the scaling value used to affect the pixel density of the control. + * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control + * to appear blurry. + */ + pixelScalingRatio?: number; + /** * Gets or sets the left margin of chart title */ @@ -11139,6 +11151,11 @@ interface IgCategoryChart { */ markerMaxCount?: number; + /** + * Gets or sets whether the series animations should be allowed when a range change has been detected on an axis. + */ + animateSeriesWhenAxisRangeChanges?: boolean; + /** * Gets or sets the palette of brushes to used for coloring trend lines in this chart. * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection @@ -11728,11 +11745,6 @@ interface IgCategoryChart { */ negativeOutlines?: any; - /** - * Gets or sets whether the series animations should be allowed when a range change has been detected on an axis. - */ - animateSeriesWhenAxisRangeChanges?: boolean; - /** * Gets or sets whether the large numbers on the Y-axis labels are abbreviated. */ @@ -12020,6 +12032,22 @@ interface JQuery { */ igCategoryChart(optionLiteral: 'option', optionName: "tooltipTemplates", optionValue: any): void; + /** + * Gets the scaling value used to affect the pixel density of the control. + * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control + * to appear blurry. + */ + igCategoryChart(optionLiteral: 'option', optionName: "pixelScalingRatio"): number; + + /** + * Sets the scaling value used to affect the pixel density of the control. + * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control + * to appear blurry. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "pixelScalingRatio", optionValue: number): void; + /** * Gets the left margin of chart title */ @@ -12546,6 +12574,18 @@ interface JQuery { */ igCategoryChart(optionLiteral: 'option', optionName: "markerMaxCount", optionValue: number): void; + /** + * Gets whether the series animations should be allowed when a range change has been detected on an axis. + */ + igCategoryChart(optionLiteral: 'option', optionName: "animateSeriesWhenAxisRangeChanges"): boolean; + + /** + * Sets whether the series animations should be allowed when a range change has been detected on an axis. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "animateSeriesWhenAxisRangeChanges", optionValue: boolean): void; + /** * Gets the palette of brushes to used for coloring trend lines in this chart. * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection @@ -13706,18 +13746,6 @@ interface JQuery { */ igCategoryChart(optionLiteral: 'option', optionName: "negativeOutlines", optionValue: any): void; - /** - * Gets whether the series animations should be allowed when a range change has been detected on an axis. - */ - igCategoryChart(optionLiteral: 'option', optionName: "animateSeriesWhenAxisRangeChanges"): boolean; - - /** - * Sets whether the series animations should be allowed when a range change has been detected on an axis. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "animateSeriesWhenAxisRangeChanges", optionValue: boolean): void; - /** * Gets whether the large numbers on the Y-axis labels are abbreviated. */ @@ -39305,6 +39333,13 @@ interface IgFinancialChart { */ tooltipTemplates?: any; + /** + * Gets or sets the scaling value used to affect the pixel density of the control. + * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control + * to appear blurry. + */ + pixelScalingRatio?: number; + /** * Gets or sets the left margin of chart title */ @@ -39541,6 +39576,11 @@ interface IgFinancialChart { */ markerMaxCount?: number; + /** + * Gets or sets whether the series animations should be allowed when a range change has been detected on an axis. + */ + animateSeriesWhenAxisRangeChanges?: boolean; + /** * Gets or sets the palette of brushes to used for coloring trend lines in this chart. * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection @@ -40093,6 +40133,7 @@ interface IgFinancialChart { * * Valid values: * "none" Do not display the zoom slider pane. + * "auto" * "bar" Display financial bar series in the zoom slider pane. * "candle" Display candle series in the zoom slider pane. * "column" Display column series in the zoom slider pane. @@ -40215,6 +40256,8 @@ interface IgFinancialChart { * When CustomIndicatorNames is set, the ApplyCustomIndicators event will be raised for each custom indicator name. */ customIndicatorNames?: any; + zoomSliderXAxisMajorStroke?: any; + zoomSliderXAxisMajorStrokeThickness?: number; /** * The width of the chart. @@ -40504,6 +40547,22 @@ interface JQuery { */ igFinancialChart(optionLiteral: 'option', optionName: "tooltipTemplates", optionValue: any): void; + /** + * Gets the scaling value used to affect the pixel density of the control. + * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control + * to appear blurry. + */ + igFinancialChart(optionLiteral: 'option', optionName: "pixelScalingRatio"): number; + + /** + * Sets the scaling value used to affect the pixel density of the control. + * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control + * to appear blurry. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "pixelScalingRatio", optionValue: number): void; + /** * Gets the left margin of chart title */ @@ -41030,6 +41089,18 @@ interface JQuery { */ igFinancialChart(optionLiteral: 'option', optionName: "markerMaxCount", optionValue: number): void; + /** + * Gets whether the series animations should be allowed when a range change has been detected on an axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "animateSeriesWhenAxisRangeChanges"): boolean; + + /** + * Sets whether the series animations should be allowed when a range change has been detected on an axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "animateSeriesWhenAxisRangeChanges", optionValue: boolean): void; + /** * Gets the palette of brushes to used for coloring trend lines in this chart. * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection @@ -42431,6 +42502,10 @@ interface JQuery { * @optionValue New value to be set. */ igFinancialChart(optionLiteral: 'option', optionName: "customIndicatorNames", optionValue: any): void; + igFinancialChart(optionLiteral: 'option', optionName: "zoomSliderXAxisMajorStroke"): any; + igFinancialChart(optionLiteral: 'option', optionName: "zoomSliderXAxisMajorStroke", optionValue: any): void; + igFinancialChart(optionLiteral: 'option', optionName: "zoomSliderXAxisMajorStrokeThickness"): number; + igFinancialChart(optionLiteral: 'option', optionName: "zoomSliderXAxisMajorStrokeThickness", optionValue: number): void; /** * The width of the chart. @@ -44382,6 +44457,22 @@ interface IgGridCellMerging { */ mergeStrategy?: string|Function; + /** + * Defines the rules merging is based on. + * + * + * Valid values: + * "duplicate" Duplicate values in the column will be merged together. + * "null" Merging will be applied for each subsequent null value after a non-null value. + */ + rowMergeStrategy?: string|Function; + + /** + * Defines the whether the rows will be merged or not. + * + */ + mergeRows?: any; + /** * A list of column settings that specifies hiding options on a per column basis. * @@ -44452,6 +44543,8 @@ interface IgGridCellMergingMethods { * @param column The column index or column key to get the state for. */ isMerged(column: Object): boolean; + mergeRow(id: Object, fireEvents: Object): void; + unmergeRow(id: Object, index: Object): void; /** * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) @@ -44472,6 +44565,8 @@ interface JQuery { igGridCellMerging(methodName: "mergeColumn", column: Object, raiseEvents: boolean): string; igGridCellMerging(methodName: "unmergeColumn", column: Object): string; igGridCellMerging(methodName: "isMerged", column: Object): boolean; + igGridCellMerging(methodName: "mergeRow", id: Object, fireEvents: Object): void; + igGridCellMerging(methodName: "unmergeRow", id: Object, index: Object): void; igGridCellMerging(methodName: "changeLocale", $container: Object): void; /** @@ -44522,6 +44617,36 @@ interface JQuery { igGridCellMerging(optionLiteral: 'option', optionName: "mergeStrategy", optionValue: string|Function): void; + /** + * Defines the rules merging is based on. + * + */ + + igGridCellMerging(optionLiteral: 'option', optionName: "rowMergeStrategy"): string|Function; + + /** + * Defines the rules merging is based on. + * + * + * @optionValue New value to be set. + */ + + igGridCellMerging(optionLiteral: 'option', optionName: "rowMergeStrategy", optionValue: string|Function): void; + + /** + * Defines the whether the rows will be merged or not. + * + */ + igGridCellMerging(optionLiteral: 'option', optionName: "mergeRows"): any; + + /** + * Defines the whether the rows will be merged or not. + * + * + * @optionValue New value to be set. + */ + igGridCellMerging(optionLiteral: 'option', optionName: "mergeRows", optionValue: any): void; + /** * A list of column settings that specifies hiding options on a per column basis. * @@ -65610,6 +65735,11 @@ interface EditRowStartingEvent { } interface EditRowStartingEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets the row's PK value. */ @@ -65626,6 +65756,11 @@ interface EditRowStartedEvent { } interface EditRowStartedEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets the row's PK value. */ @@ -65642,6 +65777,11 @@ interface EditRowEndingEvent { } interface EditRowEndingEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Check if any of the values is changed which will cause update in the data source. Can be manually set to false to prevent this update. */ @@ -65668,6 +65808,11 @@ interface EditRowEndedEvent { } interface EditRowEndedEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets the row's PK value. */ @@ -65699,6 +65844,11 @@ interface EditCellStartingEvent { } interface EditCellStartingEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets the row's PK value. */ @@ -65717,7 +65867,7 @@ interface EditCellStartingEventUIParam { /** * Gets a reference to the editor used for editing the column. */ - editor?: string; + editor?: any; /** * Gets or set the value of the editor. @@ -65735,6 +65885,11 @@ interface EditCellStartedEvent { } interface EditCellStartedEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets the row's PK value. */ @@ -65753,7 +65908,7 @@ interface EditCellStartedEventUIParam { /** * Gets a reference to the editor used for editing the column. */ - editor?: string; + editor?: any; /** * Gets or set the value of the editor. @@ -65771,6 +65926,11 @@ interface EditCellEndingEvent { } interface EditCellEndingEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets the row's PK value. */ @@ -65789,7 +65949,7 @@ interface EditCellEndingEventUIParam { /** * Gets a reference to the editor used for editing the column. */ - editor?: string; + editor?: any; /** * Gets or set the value of the editor. @@ -65817,6 +65977,11 @@ interface EditCellEndedEvent { } interface EditCellEndedEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets the row's PK value. */ @@ -65835,7 +66000,7 @@ interface EditCellEndedEventUIParam { /** * Gets a reference to the editor used for editing the column. */ - editor?: string; + editor?: any; /** * Gets the new value. @@ -65863,6 +66028,11 @@ interface RowAddingEvent { } interface RowAddingEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets the value for the column with the specified key. */ @@ -65879,6 +66049,11 @@ interface RowAddedEvent { } interface RowAddedEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets the value for the column with the specified key. */ @@ -65895,10 +66070,15 @@ interface RowDeletingEvent { } interface RowDeletingEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets a jQuery object containing the TR element of the row to delete. */ - element?: string; + element?: any; /** * Gets the row's PK value. @@ -65911,10 +66091,15 @@ interface RowDeletedEvent { } interface RowDeletedEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets a jQuery object containing the TR element of the deleted row. */ - element?: string; + element?: any; /** * Gets the row's PK value. @@ -65926,13 +66111,23 @@ interface DataDirtyEvent { (event: Event, ui: DataDirtyEventUIParam): void; } -interface DataDirtyEventUIParam {} +interface DataDirtyEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; +} interface GeneratePrimaryKeyValueEvent { (event: Event, ui: GeneratePrimaryKeyValueEventUIParam): void; } interface GeneratePrimaryKeyValueEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets the auto-generated primary key (the number of records in the data source + 1) or set a custom unique primary key for the new row. */ @@ -65944,10 +66139,15 @@ interface RowEditDialogBeforeOpenEvent { } interface RowEditDialogBeforeOpenEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets a reference to row edit dialog DOM element. */ - dialogElement?: string; + dialogElement?: any; } interface RowEditDialogAfterOpenEvent { @@ -65955,10 +66155,15 @@ interface RowEditDialogAfterOpenEvent { } interface RowEditDialogAfterOpenEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets a reference to row edit dialog DOM element. */ - dialogElement?: string; + dialogElement?: any; } interface RowEditDialogBeforeCloseEvent { @@ -65966,10 +66171,15 @@ interface RowEditDialogBeforeCloseEvent { } interface RowEditDialogBeforeCloseEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets a reference to row edit dialog DOM element. */ - dialogElement?: string; + dialogElement?: any; } interface RowEditDialogAfterCloseEvent { @@ -65977,10 +66187,15 @@ interface RowEditDialogAfterCloseEvent { } interface RowEditDialogAfterCloseEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets a reference to row edit dialog DOM element. */ - dialogElement?: string; + dialogElement?: any; } interface RowEditDialogContentsRenderedEvent { @@ -65988,10 +66203,15 @@ interface RowEditDialogContentsRenderedEvent { } interface RowEditDialogContentsRenderedEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets a reference to row edit dialog DOM element. */ - dialogElement?: string; + dialogElement?: any; } interface IgGridUpdating { @@ -84620,6 +84840,13 @@ interface IgShapeChart { */ tooltipTemplates?: any; + /** + * Gets or sets the scaling value used to affect the pixel density of the control. + * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control + * to appear blurry. + */ + pixelScalingRatio?: number; + /** * Gets or sets the left margin of chart title */ @@ -84856,6 +85083,11 @@ interface IgShapeChart { */ markerMaxCount?: number; + /** + * Gets or sets whether the series animations should be allowed when a range change has been detected on an axis. + */ + animateSeriesWhenAxisRangeChanges?: boolean; + /** * Gets or sets the palette of brushes to used for coloring trend lines in this chart. * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection @@ -85719,6 +85951,22 @@ interface JQuery { */ igShapeChart(optionLiteral: 'option', optionName: "tooltipTemplates", optionValue: any): void; + /** + * Gets the scaling value used to affect the pixel density of the control. + * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control + * to appear blurry. + */ + igShapeChart(optionLiteral: 'option', optionName: "pixelScalingRatio"): number; + + /** + * Sets the scaling value used to affect the pixel density of the control. + * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control + * to appear blurry. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "pixelScalingRatio", optionValue: number): void; + /** * Gets the left margin of chart title */ @@ -86245,6 +86493,18 @@ interface JQuery { */ igShapeChart(optionLiteral: 'option', optionName: "markerMaxCount", optionValue: number): void; + /** + * Gets whether the series animations should be allowed when a range change has been detected on an axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "animateSeriesWhenAxisRangeChanges"): boolean; + + /** + * Sets whether the series animations should be allowed when a range change has been detected on an axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "animateSeriesWhenAxisRangeChanges", optionValue: boolean): void; + /** * Gets the palette of brushes to used for coloring trend lines in this chart. * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection @@ -99597,7 +99857,7 @@ interface IgTreeGrid { /** * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. */ - avgRowHeight?: any; + avgRowHeight?: number; /** * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. @@ -100879,14 +101139,14 @@ interface JQuery { /** * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. */ - igTreeGrid(optionLiteral: 'option', optionName: "avgRowHeight"): any; + igTreeGrid(optionLiteral: 'option', optionName: "avgRowHeight"): number; /** * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. * * @optionValue New value to be set. */ - igTreeGrid(optionLiteral: 'option', optionName: "avgRowHeight", optionValue: any): void; + igTreeGrid(optionLiteral: 'option', optionName: "avgRowHeight", optionValue: number): void; /** * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. diff --git a/types/imagemin-gifsicle/imagemin-gifsicle-tests.ts b/types/imagemin-gifsicle/imagemin-gifsicle-tests.ts new file mode 100644 index 0000000000..0156322cd7 --- /dev/null +++ b/types/imagemin-gifsicle/imagemin-gifsicle-tests.ts @@ -0,0 +1,9 @@ +import imagemin = require('imagemin'); +import imageminGifsicle = require('imagemin-gifsicle'); + +imagemin(['*.gif'], { + plugins: [ + imageminGifsicle(), + imageminGifsicle({ colors: 255 }) + ] +}); diff --git a/types/imagemin-gifsicle/index.d.ts b/types/imagemin-gifsicle/index.d.ts new file mode 100644 index 0000000000..80bc128286 --- /dev/null +++ b/types/imagemin-gifsicle/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for imagemin-gifsicle 5.2 +// Project: https://github.com/imagemin/imagemin-gifsicle#readme +// Definitions by: Romain Faust +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Plugin } from 'imagemin'; + +declare function imageminGifsicle(options?: imageminGifsicle.Options): Plugin; + +declare namespace imageminGifsicle { + interface Options { + colors?: number; + interlaced?: boolean; + optimizationLevel?: number; + } +} + +export = imageminGifsicle; diff --git a/types/imagemin-gifsicle/tsconfig.json b/types/imagemin-gifsicle/tsconfig.json new file mode 100644 index 0000000000..8efb698e59 --- /dev/null +++ b/types/imagemin-gifsicle/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", + "imagemin-gifsicle-tests.ts" + ] +} diff --git a/types/imagemin-gifsicle/tslint.json b/types/imagemin-gifsicle/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/imagemin-gifsicle/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/imagemin-jpegtran/imagemin-jpegtran-tests.ts b/types/imagemin-jpegtran/imagemin-jpegtran-tests.ts new file mode 100644 index 0000000000..82a8ea927f --- /dev/null +++ b/types/imagemin-jpegtran/imagemin-jpegtran-tests.ts @@ -0,0 +1,9 @@ +import imagemin = require('imagemin'); +import imageminJpegtran = require('imagemin-jpegtran'); + +imagemin(['*.jpg'], { + plugins: [ + imageminJpegtran(), + imageminJpegtran({ progressive: true }) + ] +}); diff --git a/types/imagemin-jpegtran/index.d.ts b/types/imagemin-jpegtran/index.d.ts new file mode 100644 index 0000000000..2ec98c3c17 --- /dev/null +++ b/types/imagemin-jpegtran/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for imagemin-jpegtran 5.0 +// Project: https://github.com/imagemin/imagemin-jpegtran#readme +// Definitions by: Romain Faust +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Plugin } from 'imagemin'; + +declare function imageminJpegtran(options?: imageminJpegtran.Options): Plugin; + +declare namespace imageminJpegtran { + interface Options { + arithmetic?: boolean; + progressive?: boolean; + } +} + +export = imageminJpegtran; diff --git a/types/imagemin-jpegtran/tsconfig.json b/types/imagemin-jpegtran/tsconfig.json new file mode 100644 index 0000000000..e26dc49c0e --- /dev/null +++ b/types/imagemin-jpegtran/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", + "imagemin-jpegtran-tests.ts" + ] +} diff --git a/types/imagemin-jpegtran/tslint.json b/types/imagemin-jpegtran/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/imagemin-jpegtran/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/imagemin-optipng/imagemin-optipng-tests.ts b/types/imagemin-optipng/imagemin-optipng-tests.ts new file mode 100644 index 0000000000..ce0eb272ee --- /dev/null +++ b/types/imagemin-optipng/imagemin-optipng-tests.ts @@ -0,0 +1,9 @@ +import imagemin = require('imagemin'); +import imageminOptipng = require('imagemin-optipng'); + +imagemin(['*.png'], { + plugins: [ + imageminOptipng(), + imageminOptipng({ optimizationLevel: 2 }) + ] +}); diff --git a/types/imagemin-optipng/index.d.ts b/types/imagemin-optipng/index.d.ts new file mode 100644 index 0000000000..9ab9506205 --- /dev/null +++ b/types/imagemin-optipng/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for imagemin-optipng 5.2 +// Project: https://github.com/imagemin/imagemin-optipng#readme +// Definitions by: Romain Faust +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Plugin } from 'imagemin'; + +declare function imageminOptipng(options?: imageminOptipng.Options): Plugin; + +declare namespace imageminOptipng { + interface Options { + bitDepthReduction?: boolean; + colorTypeReduction?: boolean; + optimizationLevel?: number; + paletteReduction?: boolean; + } +} + +export = imageminOptipng; diff --git a/types/imagemin-optipng/tsconfig.json b/types/imagemin-optipng/tsconfig.json new file mode 100644 index 0000000000..586e747281 --- /dev/null +++ b/types/imagemin-optipng/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", + "imagemin-optipng-tests.ts" + ] +} diff --git a/types/imagemin-optipng/tslint.json b/types/imagemin-optipng/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/imagemin-optipng/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/imagemin-svgo/imagemin-svgo-tests.ts b/types/imagemin-svgo/imagemin-svgo-tests.ts new file mode 100644 index 0000000000..23895afcd6 --- /dev/null +++ b/types/imagemin-svgo/imagemin-svgo-tests.ts @@ -0,0 +1,9 @@ +import imagemin = require('imagemin'); +import imageminSvgo = require('imagemin-svgo'); + +imagemin(['*.svg'], { + plugins: [ + imageminSvgo(), + imageminSvgo({ floatPrecision: 2 }) + ] +}); diff --git a/types/imagemin-svgo/index.d.ts b/types/imagemin-svgo/index.d.ts new file mode 100644 index 0000000000..24d3b73ca9 --- /dev/null +++ b/types/imagemin-svgo/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for imagemin-svgo 7.0 +// Project: https://github.com/imagemin/imagemin-svgo#readme +// Definitions by: Romain Faust +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import { Plugin } from 'imagemin'; +import { Options as SvgoOptions } from 'svgo'; + +declare function imageminSvgo(options?: imageminSvgo.Options): Plugin; + +declare namespace imageminSvgo { + type Options = SvgoOptions; +} + +export = imageminSvgo; diff --git a/types/imagemin-svgo/tsconfig.json b/types/imagemin-svgo/tsconfig.json new file mode 100644 index 0000000000..6b4f221e13 --- /dev/null +++ b/types/imagemin-svgo/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", + "imagemin-svgo-tests.ts" + ] +} diff --git a/types/imagemin-svgo/tslint.json b/types/imagemin-svgo/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/imagemin-svgo/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/imagemin/imagemin-tests.ts b/types/imagemin/imagemin-tests.ts new file mode 100644 index 0000000000..88a91980d6 --- /dev/null +++ b/types/imagemin/imagemin-tests.ts @@ -0,0 +1,9 @@ +import imagemin = require('imagemin'); + +imagemin(['*.png']).then((results: imagemin.Result[]) => { /* ... */ }); +imagemin(['*.png'], 'dist').then((results: imagemin.Result[]) => { /* ... */ }); +imagemin(['*.png'], { plugins: [] }).then((results: imagemin.Result[]) => { /* ... */ }); +imagemin(['*.png'], 'dist', { plugins: [] }).then((results: imagemin.Result[]) => { /* ... */ }); + +imagemin.buffer(Buffer.from([/* ... */])).then((result: Buffer) => { /* ... */ }); +imagemin.buffer(Buffer.from([/* ... */]), { plugins: [] }).then((result: Buffer) => { /* ... */ }); diff --git a/types/imagemin/index.d.ts b/types/imagemin/index.d.ts new file mode 100644 index 0000000000..c848818f31 --- /dev/null +++ b/types/imagemin/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for imagemin 6.0 +// Project: https://github.com/imagemin/imagemin#readme +// Definitions by: Romain Faust +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare function imagemin(input: ReadonlyArray, outputOrOptions?: string | imagemin.Options): Promise; +declare function imagemin(input: ReadonlyArray, output?: string, options?: imagemin.Options): Promise; + +declare namespace imagemin { + type Plugin = (input: Buffer) => Promise; + + interface Options { + plugins: ReadonlyArray; + } + + interface Result { + data: Buffer; + path: string; + } + + function buffer(buffer: Buffer, options?: Options): Promise; +} + +export = imagemin; diff --git a/types/imagemin/tsconfig.json b/types/imagemin/tsconfig.json new file mode 100644 index 0000000000..849754b4d0 --- /dev/null +++ b/types/imagemin/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", + "imagemin-tests.ts" + ] +} diff --git a/types/imagemin/tslint.json b/types/imagemin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/imagemin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/intl-relativeformat/index.d.ts b/types/intl-relativeformat/index.d.ts new file mode 100644 index 0000000000..7c2fc0e57c --- /dev/null +++ b/types/intl-relativeformat/index.d.ts @@ -0,0 +1,94 @@ +// Type definitions for intl-relativeformat 2.1 +// Project: https://github.com/yahoo/intl-relativeformat +// Definitions by: Mohsen Azimi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/** + * This package aims to provide a way to format different variations of relative time. + * You can use this package in the browser and on the server via Node.js. + * + * This implementation is very similar to moment.js, in concept, although it provides + * only formatting features based on the Unicode CLDR locale data, an industry + * standard that supports more than 200 languages. + * + * @see https://github.com/yahoo/intl-relativeformat + */ +export default class IntlRelativeFormat { + /** + * To format a date to relative time, use the IntlRelativeFormat constructor. + * The constructor takes two parameters: + * + * @param locales A string with a BCP 47 language tag, or an array of + * such strings. If you do not provide a locale, the default locale will be used. + * When an array of locales is provided, each item and its ancestor locales are checked + * and the first one with registered locale data is returned. See: Locale Resolution + * for more details. + * @see https://github.com/yahoo/intl-relativeformat#locale-resolution + * + * @param optionas object with user defined options for format styles. + * See: Custom Options for more details. + * @see https://github.com/yahoo/intl-relativeformat#custom-options + * Note: The rf instance should be enough for your entire application, + * unless you want to use custom options. + */ + constructor( + locales: string | string[], + options?: Intl.DateTimeFormatOptions & { + /** + * By default, the relative time is computed to the best fit unit, + * but you can explicitly call it to force units to be displayed in + * "second", "second-short", "minute", "minute-short", "hour", + * "hour-short", "day", "day-short", "month", "month-short", + * "year" or "year-short": + */ + units?: + | "second" + | "second-short" + | "minute" + | "minute-short" + | "hour" + | "hour-short" + | "day" + | "day-short" + | "month" + | "month-short" + | "year" + | "year-short"; + + /** + * By default, the relative time is computed as "best fit", + * which means that instead of "1 day ago", it will display "yesterday", + * or "in 1 year" will be "next year", etc. But you can force to always + * use the "numeric" alternative: + */ + style?: "best fit" | "numeric"; + } + ); + + /** + * This method returns an object with the options values that were resolved + * during instance creation. It currently only contains a locale property + * + * var rf = new IntlRelativeFormat('en-us'); + * console.log(rf.resolvedOptions().locale); // => "en-US" + * + * Notice how the specified locale was the all lower-case value: "en-us", + * but it was resolved and normalized to: "en-US". + */ + resolvedOptions(): { locale: string }; + + /** + * The format method (which takes a JavaScript date or timestamp) and optional + * options arguments will compare the date with "now" (or options.now), + * and returns the formatted string; e.g., "3 hours ago" in the corresponding + * locale passed into the constructor. + * + * var output = rf.format(new Date()); + * console.log(output); // => "now" + * + * If you wish to specify a "now" value, it can be provided via options.now and + * will be used instead of querying Date.now() to get the current "now" value. + */ + format(date: Date, options?: { now?: Date }): string; +} diff --git a/types/intl-relativeformat/intl-relativeformat-tests.ts b/types/intl-relativeformat/intl-relativeformat-tests.ts new file mode 100644 index 0000000000..ca3d8280ca --- /dev/null +++ b/types/intl-relativeformat/intl-relativeformat-tests.ts @@ -0,0 +1,16 @@ +import IntlRelativeFormat from "intl-relativeformat"; + +let dateFormatter = new IntlRelativeFormat("en-US"); + +dateFormatter = new IntlRelativeFormat("en-US", { + units: "day" +}); +dateFormatter = new IntlRelativeFormat("en-US", { + units: "day", + style: "numeric" +}); + +console.log(dateFormatter.resolvedOptions().locale); + +dateFormatter.format(new Date()); +dateFormatter.format(new Date(), { now: new Date() }); diff --git a/types/intl-relativeformat/tsconfig.json b/types/intl-relativeformat/tsconfig.json new file mode 100644 index 0000000000..bfd9297169 --- /dev/null +++ b/types/intl-relativeformat/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": ["index.d.ts", "intl-relativeformat-tests.ts"] +} diff --git a/types/intl-relativeformat/tslint.json b/types/intl-relativeformat/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/intl-relativeformat/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ioredis/index.d.ts b/types/ioredis/index.d.ts index 3bd04944db..017fc04505 100644 --- a/types/ioredis/index.d.ts +++ b/types/ioredis/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ioredis 3.2 +// Type definitions for ioredis 4.0 // Project: https://github.com/luin/ioredis // Definitions by: York Yao // Christopher Eck @@ -12,12 +12,11 @@ /* =================== USAGE =================== import * as Redis from "ioredis"; - var redis = new Redis(); + const redis = new Redis(); =============================================== */ /// -import Promise = require('bluebird'); import tls = require('tls'); interface RedisStatic { @@ -842,6 +841,17 @@ declare namespace IORedis { * Fixed in: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/15858 */ retryStrategy?(times: number): number | false; + /** + * By default, all pending commands will be flushed with an error every + * 20 retry attempts. That makes sure commands won't wait forever when + * the connection is down. You can change this behavior by setting + * `maxRetriesPerRequest`. + * + * Set maxRetriesPerRequest to `null` to disable this behavior, and + * every command will wait forever until the connection is alive again + * (which is the default behavior before ioredis v4). + */ + maxRetriesPerRequest?: number | null; /** * 1/true means reconnect, 2 means reconnect and resend failed command. Returning false will ignore * the error and do nothing. diff --git a/types/ioredis/ioredis-tests.ts b/types/ioredis/ioredis-tests.ts index 106a50210b..848f0b2841 100644 --- a/types/ioredis/ioredis-tests.ts +++ b/types/ioredis/ioredis-tests.ts @@ -46,6 +46,7 @@ new Redis({ password: 'auth', db: 0, retryStrategy() { return false; }, + maxRetriesPerRequest: 20, showFriendlyErrorStack: true, tls: { servername: 'tlsservername' @@ -129,9 +130,6 @@ redis.multi([ // results = [[null, 'OK'], [null, 'bar']] }); -redis.Promise.onPossiblyUnhandledRejection((error) => { -}); - const keys = ['foo', 'bar']; redis.mget(...keys); diff --git a/types/ioredis/v3/index.d.ts b/types/ioredis/v3/index.d.ts new file mode 100644 index 0000000000..e593f4dcc3 --- /dev/null +++ b/types/ioredis/v3/index.d.ts @@ -0,0 +1,911 @@ +// Type definitions for ioredis 3.2 +// Project: https://github.com/luin/ioredis +// Definitions by: York Yao +// Christopher Eck +// Yoga Aliarham +// Ebrahim +// Shahar Mor +// Whemoon Jang +// Francis Gulotta +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/* =================== USAGE =================== + import * as Redis from "ioredis"; + var redis = new Redis(); + =============================================== */ + +/// + +import Promise = require('bluebird'); +import tls = require('tls'); + +interface RedisStatic { + new(port?: number, host?: string, options?: IORedis.RedisOptions): IORedis.Redis; + new(host?: string, options?: IORedis.RedisOptions): IORedis.Redis; + new(options?: IORedis.RedisOptions): IORedis.Redis; + (port?: number, host?: string, options?: IORedis.RedisOptions): IORedis.Redis; + (host?: string, options?: IORedis.RedisOptions): IORedis.Redis; + (options?: IORedis.RedisOptions): IORedis.Redis; + Cluster: IORedis.Cluster; + Command: IORedis.Command; +} + +declare var IORedis: RedisStatic; +export = IORedis; + +declare class Commander { + getBuiltinCommands(): string[]; + createBuiltinCommand(commandName: string): {}; + defineCommand(name: string, definition: { + numberOfKeys?: number; + lua?: string; + }): any; + sendCommand(): void; +} + +declare namespace IORedis { + interface Command { + setArgumentTransformer(name: string, fn: (args: any[]) => any[]): void; + setReplyTransformer(name: string, fn: (result: any) => any): void; + } + + interface Redis extends NodeJS.EventEmitter, Commander { + Promise: typeof Promise; + status: string; + connect(callback?: () => void): Promise; + disconnect(): void; + duplicate(): Redis; + + send_command(command: string, ...args: any[]): any; + + bitcount(key: string, callback: (err: Error, res: number) => void): void; + bitcount(key: string, start: number, end: number, callback: (err: Error, res: number) => void): void; + bitcount(key: string): Promise; + bitcount(key: string, start: number, end: number): Promise; + + get(key: string, callback: (err: Error, res: string) => void): void; + get(key: string): Promise; + + getBuffer(key: string, callback: (err: Error, res: Buffer) => void): void; + getBuffer(key: string): Promise; + + set(key: string, value: any, expiryMode?: string | any[], time?: number | string, setMode?: number | string): Promise; + + set(key: string, value: any, callback: (err: Error, res: string) => void): void; + set(key: string, value: any, setMode: string | any[], callback: (err: Error, res: string) => void): void; + set(key: string, value: any, expiryMode: string, time: number | string, callback: (err: Error, res: string) => void): void; + set(key: string, value: any, expiryMode: string, time: number | string, setMode: number | string, callback: (err: Error, res: string) => void): void; + + setBuffer(key: string, value: any, expiryMode?: string | any[], time?: number | string, setMode?: number | string): Promise; + + setBuffer(key: string, value: any, callback: (err: Error, res: Buffer) => void): void; + setBuffer(key: string, value: any, setMode: string, callback: (err: Error, res: Buffer) => void): void; + setBuffer(key: string, value: any, expiryMode: string, time: number, callback: (err: Error, res: Buffer) => void): void; + setBuffer(key: string, value: any, expiryMode: string, time: number | string, setMode: number | string, callback: (err: Error, res: Buffer) => void): void; + + setnx(key: string, value: any, callback: (err: Error, res: any) => void): void; + setnx(key: string, value: any): Promise; + + setex(key: string, seconds: number, value: any, callback: (err: Error, res: any) => void): void; + setex(key: string, seconds: number, value: any): Promise; + + psetex(key: string, milliseconds: number, value: any, callback: (err: Error, res: any) => void): void; + psetex(key: string, milliseconds: number, value: any): Promise; + + append(key: string, value: any, callback: (err: Error, res: number) => void): void; + append(key: string, value: any): Promise; + + strlen(key: string, callback: (err: Error, res: number) => void): void; + strlen(key: string): Promise; + + del(...keys: string[]): any; + + exists(...keys: string[]): any; + + setbit(key: string, offset: number, value: any, callback: (err: Error, res: number) => void): void; + setbit(key: string, offset: number, value: any): Promise; + + getbit(key: string, offset: number, callback: (err: Error, res: number) => void): void; + getbit(key: string, offset: number): Promise; + + setrange(key: string, offset: number, value: any, callback: (err: Error, res: number) => void): void; + setrange(key: string, offset: number, value: any): Promise; + + getrange(key: string, start: number, end: number, callback: (err: Error, res: string) => void): void; + getrange(key: string, start: number, end: number): Promise; + + substr(key: string, start: number, end: number, callback: (err: Error, res: string) => void): void; + substr(key: string, start: number, end: number): Promise; + + incr(key: string, callback: (err: Error, res: number) => void): void; + incr(key: string): Promise; + + decr(key: string, callback: (err: Error, res: number) => void): void; + decr(key: string): Promise; + + mget(...keys: string[]): any; + + rpush(key: string, ...values: any[]): any; + + lpush(key: string, ...values: any[]): any; + + rpushx(key: string, value: any, callback: (err: Error, res: number) => void): void; + rpushx(key: string, value: any): Promise; + + lpushx(key: string, value: any, callback: (err: Error, res: number) => void): void; + lpushx(key: string, value: any): Promise; + + linsert(key: string, direction: "BEFORE" | "AFTER", pivot: string, value: any, callback: (err: Error, res: number) => void): void; + linsert(key: string, direction: "BEFORE" | "AFTER", pivot: string, value: any): Promise; + + rpop(key: string, callback: (err: Error, res: string) => void): void; + rpop(key: string): Promise; + + lpop(key: string, callback: (err: Error, res: string) => void): void; + lpop(key: string): Promise; + + brpop(...keys: string[]): any; + + blpop(...keys: string[]): any; + + brpoplpush(source: string, destination: string, timeout: number, callback: (err: Error, res: any) => void): void; + brpoplpush(source: string, destination: string, timeout: number): Promise; + + llen(key: string, callback: (err: Error, res: number) => void): void; + llen(key: string): Promise; + + lindex(key: string, index: number, callback: (err: Error, res: string) => void): void; + lindex(key: string, index: number): Promise; + + lset(key: string, index: number, value: any, callback: (err: Error, res: any) => void): void; + lset(key: string, index: number, value: any): Promise; + + lrange(key: string, start: number, stop: number, callback: (err: Error, res: any) => void): void; + lrange(key: string, start: number, stop: number): Promise; + + ltrim(key: string, start: number, stop: number, callback: (err: Error, res: any) => void): void; + ltrim(key: string, start: number, stop: number): Promise; + + lrem(key: string, count: number, value: any, callback: (err: Error, res: number) => void): void; + lrem(key: string, count: number, value: any): Promise; + + rpoplpush(source: string, destination: string, callback: (err: Error, res: string) => void): void; + rpoplpush(source: string, destination: string): Promise; + + sadd(key: string, ...members: any[]): any; + + srem(key: string, ...members: any[]): any; + + smove(source: string, destination: string, member: string, callback: (err: Error, res: string) => void): void; + smove(source: string, destination: string, member: string): Promise; + + sismember(key: string, member: string, callback: (err: Error, res: 1 | 0) => void): void; + sismember(key: string, member: string): Promise<1 | 0>; + + scard(key: string, callback: (err: Error, res: number) => void): void; + scard(key: string): Promise; + + spop(key: string, callback: (err: Error, res: any) => void): void; + spop(key: string, count: number, callback: (err: Error, res: any) => void): void; + spop(key: string, count?: number): Promise; + + srandmember(key: string, callback: (err: Error, res: any) => void): void; + srandmember(key: string, count: number, callback: (err: Error, res: any) => void): void; + srandmember(key: string, count?: number): Promise; + + sinter(...keys: string[]): any; + + sinterstore(destination: string, ...keys: string[]): any; + + sunion(...keys: string[]): any; + + sunionstore(destination: string, ...keys: string[]): any; + + sdiff(...keys: string[]): any; + + sdiffstore(destination: string, ...keys: string[]): any; + + smembers(key: string, callback: (err: Error, res: any) => void): void; + smembers(key: string): Promise; + + zadd(key: string, ...args: string[]): any; + + zincrby(key: string, increment: number, member: string, callback: (err: Error, res: any) => void): void; + zincrby(key: string, increment: number, member: string): Promise; + + zrem(key: string, ...members: any[]): any; + + zremrangebyscore(key: string, min: number | string, max: number | string, callback: (err: Error, res: any) => void): void; + zremrangebyscore(key: string, min: number | string, max: number | string): Promise; + + zremrangebyrank(key: string, start: number, stop: number, callback: (err: Error, res: any) => void): void; + zremrangebyrank(key: string, start: number, stop: number): Promise; + + zunionstore(destination: string, numkeys: number, key: string, ...args: string[]): any; + + zinterstore(destination: string, numkeys: number, key: string, ...args: string[]): any; + + zrange(key: string, start: number, stop: number, callback: (err: Error, res: any) => void): void; + zrange(key: string, start: number, stop: number, withScores: "WITHSCORES", callback: (err: Error, res: any) => void): void; + zrange(key: string, start: number, stop: number, withScores?: "WITHSCORES"): Promise; + + zrevrange(key: string, start: number, stop: number, callback: (err: Error, res: any) => void): void; + zrevrange(key: string, start: number, stop: number, withScores: "WITHSCORES", callback: (err: Error, res: any) => void): void; + zrevrange(key: string, start: number, stop: number, withScores?: "WITHSCORES"): Promise; + + zrangebyscore(key: string, min: number | string, max: number | string, ...args: string[]): any; + + zrevrangebyscore(key: string, max: number | string, min: number | string, ...args: string[]): any; + + zcount(key: string, min: number | string, max: number | string, callback: (err: Error, res: number) => void): void; + zcount(key: string, min: number | string, max: number | string): Promise; + + zcard(key: string, callback: (err: Error, res: number) => void): void; + zcard(key: string): Promise; + + zscore(key: string, member: string, callback: (err: Error, res: string) => void): void; + zscore(key: string, member: string): Promise; + + zrank(key: string, member: string, callback: (err: Error, res: number) => void): void; + zrank(key: string, member: string): Promise; + + zrevrank(key: string, member: string, callback: (err: Error, res: number) => void): void; + zrevrank(key: string, member: string): Promise; + + hset(key: string, field: string, value: any, callback: (err: Error, res: 0 | 1) => void): void; + hset(key: string, field: string, value: any): Promise<0 | 1>; + hsetBuffer(key: string, field: string, value: any, callback: (err: Error, res: 0 | 1) => void): void; + hsetBuffer(key: string, field: string, value: any): Promise; + + hsetnx(key: string, field: string, value: any, callback: (err: Error, res: 0 | 1) => void): void; + hsetnx(key: string, field: string, value: any): Promise<0 | 1>; + + hget(key: string, field: string, callback: (err: Error, res: string) => void): void; + hget(key: string, field: string): Promise; + hgetBuffer(key: string, field: string, callback: (err: Error, res: Buffer) => void): void; + hgetBuffer(key: string, field: string): Promise; + + hmset(key: string, field: string, value: any, ...args: string[]): Promise<0 | 1>; + hmset(key: string, data: any, callback: (err: Error, res: 0 | 1) => void): void; + hmset(key: string, data: any): Promise<0 | 1>; + + hmget(key: string, ...fields: string[]): any; + + hincrby(key: string, field: string, increment: number, callback: (err: Error, res: number) => void): void; + hincrby(key: string, field: string, increment: number): Promise; + + hincrbyfloat(key: string, field: string, increment: number, callback: (err: Error, res: number) => void): void; + hincrbyfloat(key: string, field: string, increment: number): Promise; + + hdel(key: string, ...fields: string[]): any; + + hlen(key: string, callback: (err: Error, res: number) => void): void; + hlen(key: string): Promise; + + hkeys(key: string, callback: (err: Error, res: any) => void): void; + hkeys(key: string): Promise; + + hvals(key: string, callback: (err: Error, res: any) => void): void; + hvals(key: string): Promise; + + hgetall(key: string, callback: (err: Error, res: any) => void): void; + hgetall(key: string): Promise; + + hexists(key: string, field: string, callback: (err: Error, res: 0 | 1) => void): void; + hexists(key: string, field: string): Promise<0 | 1>; + + incrby(key: string, increment: number, callback: (err: Error, res: number) => void): void; + incrby(key: string, increment: number): Promise; + + incrbyfloat(key: string, increment: number, callback: (err: Error, res: number) => void): void; + incrbyfloat(key: string, increment: number): Promise; + + decrby(key: string, decrement: number, callback: (err: Error, res: number) => void): void; + decrby(key: string, decrement: number): Promise; + + getset(key: string, value: any, callback: (err: Error, res: string) => void): void; + getset(key: string, value: any): Promise; + + mset(key: string, value: any, ...args: string[]): any; + + msetnx(key: string, value: any, ...args: string[]): any; + + randomkey(callback: (err: Error, res: string) => void): void; + randomkey(): Promise; + + select(index: number, callback: (err: Error, res: string) => void): void; + select(index: number): Promise; + + move(key: string, db: string, callback: (err: Error, res: 0 | 1) => void): void; + move(key: string, db: string): Promise<0 | 1>; + + rename(key: string, newkey: string, callback: (err: Error, res: string) => void): void; + rename(key: string, newkey: string): Promise; + + renamenx(key: string, newkey: string, callback: (err: Error, res: 0 | 1) => void): void; + renamenx(key: string, newkey: string): Promise<0 | 1>; + + expire(key: string, seconds: number, callback: (err: Error, res: 0 | 1) => void): void; + expire(key: string, seconds: number): Promise<0 | 1>; + + pexpire(key: string, milliseconds: number, callback: (err: Error, res: 0 | 1) => void): void; + pexpire(key: string, milliseconds: number): Promise<0 | 1>; + + expireat(key: string, timestamp: number, callback: (err: Error, res: 0 | 1) => void): void; + expireat(key: string, timestamp: number): Promise<0 | 1>; + + pexpireat(key: string, millisecondsTimestamp: number, callback: (err: Error, res: 0 | 1) => void): void; + pexpireat(key: string, millisecondsTimestamp: number): Promise<0 | 1>; + + keys(pattern: string, callback: (err: Error, res: string[]) => void): void; + keys(pattern: string): Promise; + + dbsize(callback: (err: Error, res: number) => void): void; + dbsize(): Promise; + + auth(password: string, callback: (err: Error, res: string) => void): void; + auth(password: string): Promise; + + ping(callback: (err: Error, res: string) => void): void; + ping(message: string, callback: (err: Error, res: string) => void): void; + ping(message?: string): Promise; + + echo(message: string, callback: (err: Error, res: string) => void): void; + echo(message: string): Promise; + + save(callback: (err: Error, res: string) => void): void; + save(): Promise; + + bgsave(callback: (err: Error, res: string) => void): void; + bgsave(): Promise; + + bgrewriteaof(callback: (err: Error, res: string) => void): void; + bgrewriteaof(): Promise; + + shutdown(save: "SAVE" | "NOSAVE", callback: (err: Error, res: any) => void): void; + shutdown(save: "SAVE" | "NOSAVE"): Promise; + + lastsave(callback: (err: Error, res: number) => void): void; + lastsave(): Promise; + + type(key: string, callback: (err: Error, res: string) => void): void; + type(key: string): Promise; + + multi(commands?: string[][], options?: MultiOptions): Pipeline; + multi(options: { pipeline: false }): Promise; + + exec(callback: (err: Error, res: any) => void): void; + exec(): Promise; + + discard(callback: (err: Error, res: any) => void): void; + discard(): Promise; + + sync(callback: (err: Error, res: any) => void): void; + sync(): Promise; + + flushdb(callback: (err: Error, res: string) => void): void; + flushdb(): Promise; + + flushall(callback: (err: Error, res: string) => void): void; + flushall(): Promise; + + sort(key: string, ...args: string[]): any; + + info(callback: (err: Error, res: any) => void): void; + info(section: string, callback: (err: Error, res: any) => void): void; + info(section?: string): Promise; + + time(callback: (err: Error, res: any) => void): void; + time(): Promise; + + monitor(callback: (err: Error, res: NodeJS.EventEmitter) => void): void; + monitor(): Promise; + + ttl(key: string, callback: (err: Error, res: number) => void): void; + ttl(key: string): Promise; + + persist(key: string, callback: (err: Error, res: 0 | 1) => void): void; + persist(key: string): Promise<0 | 1>; + + slaveof(host: string, port: number, callback: (err: Error, res: string) => void): void; + slaveof(host: string, port: number): Promise; + + debug(...args: any[]): any; + + config(...args: any[]): any; + + subscribe(...channels: any[]): any; + + unsubscribe(...channels: string[]): any; + + psubscribe(...patterns: string[]): any; + + punsubscribe(...patterns: string[]): any; + + publish(channel: string, message: string, callback: (err: Error, res: number) => void): void; + publish(channel: string, message: string): Promise; + + watch(...keys: string[]): any; + + unwatch(callback: (err: Error, res: string) => void): void; + unwatch(): Promise; + + cluster(...args: any[]): any; + + restore(...args: any[]): any; + + migrate(...args: any[]): any; + + dump(key: string, callback: (err: Error, res: string) => void): void; + dump(key: string): Promise; + + object(subcommand: string, ...args: any[]): any; + + client(...args: any[]): any; + + eval(...args: any[]): any; + + evalsha(...args: any[]): any; + + script(...args: any[]): any; + + quit(callback: (err: Error, res: string) => void): void; + quit(): Promise; + + scan(cursor: number, ...args: any[]): any; + + sscan(key: string, cursor: number, ...args: any[]): any; + + hscan(key: string, cursor: number, ...args: any[]): any; + + zscan(key: string, cursor: number, ...args: any[]): any; + + pfmerge(destkey: string, ...sourcekeys: string[]): any; + + pfadd(key: string, ...elements: string[]): any; + + pfcount(...keys: string[]): any; + + pipeline(commands?: string[][]): Pipeline; + + scanStream(options?: ScanStreamOption): NodeJS.EventEmitter; + sscanStream(key: string, options?: ScanStreamOption): NodeJS.EventEmitter; + hscanStream(key: string, options?: ScanStreamOption): NodeJS.EventEmitter; + zscanStream(key: string, options?: ScanStreamOption): NodeJS.EventEmitter; + } + + interface Pipeline { + redis: Redis; + isCluster: boolean; + options: RedisOptions; + _queue: Command[]; + _result: any[]; + _transactions: number; + _shaToScript: {}; + bitcount(key: string, callback?: (err: Error, res: number) => void): Pipeline; + bitcount(key: string, start: number, end: number, callback?: (err: Error, res: number) => void): Pipeline; + + get(key: string, callback?: (err: Error, res: string) => void): Pipeline; + getBuffer(key: string, callback?: (err: Error, res: Buffer) => void): Pipeline; + + set(key: string, value: any, callback?: (err: Error, res: string) => void): Pipeline; + set(key: string, value: any, setMode: string, callback?: (err: Error, res: string) => void): Pipeline; + set(key: string, value: any, expiryMode: string, time: number, callback?: (err: Error, res: string) => void): Pipeline; + set(key: string, value: any, expiryMode: string, time: number, setMode: string, callback?: (err: Error, res: string) => void): Pipeline; + + setBuffer(key: string, value: any, callback?: (err: Error, res: Buffer) => void): Pipeline; + setBuffer(key: string, value: any, setMode: string, callback?: (err: Error, res: Buffer) => void): Pipeline; + setBuffer(key: string, value: any, expiryMode: string, time: number, callback?: (err: Error, res: Buffer) => void): Pipeline; + setBuffer(key: string, value: any, expiryMode: string, time: number, setMode: string, callback?: (err: Error, res: Buffer) => void): Pipeline; + + setnx(key: string, value: any, callback?: (err: Error, res: any) => void): Pipeline; + + setex(key: string, seconds: number, value: any, callback?: (err: Error, res: any) => void): Pipeline; + + psetex(key: string, milliseconds: number, value: any, callback?: (err: Error, res: any) => void): Pipeline; + + append(key: string, value: any, callback?: (err: Error, res: number) => void): Pipeline; + + strlen(key: string, callback?: (err: Error, res: number) => void): Pipeline; + + del(...keys: string[]): Pipeline; + + exists(...keys: string[]): Pipeline; + + setbit(key: string, offset: number, value: any, callback?: (err: Error, res: number) => void): Pipeline; + + getbit(key: string, offset: number, callback?: (err: Error, res: number) => void): Pipeline; + + setrange(key: string, offset: number, value: any, callback?: (err: Error, res: number) => void): Pipeline; + + getrange(key: string, start: number, end: number, callback?: (err: Error, res: string) => void): Pipeline; + + substr(key: string, start: number, end: number, callback?: (err: Error, res: string) => void): Pipeline; + + incr(key: string, callback?: (err: Error, res: number) => void): Pipeline; + + decr(key: string, callback?: (err: Error, res: number) => void): Pipeline; + + mget(...keys: string[]): Pipeline; + + rpush(key: string, ...values: any[]): Pipeline; + + lpush(key: string, ...values: any[]): Pipeline; + + rpushx(key: string, value: any, callback?: (err: Error, res: number) => void): Pipeline; + + lpushx(key: string, value: any, callback?: (err: Error, res: number) => void): Pipeline; + + linsert(key: string, direction: "BEFORE" | "AFTER", pivot: string, value: any, callback?: (err: Error, res: number) => void): Pipeline; + + rpop(key: string, callback?: (err: Error, res: string) => void): Pipeline; + + lpop(key: string, callback?: (err: Error, res: string) => void): Pipeline; + + brpop(...keys: string[]): Pipeline; + + blpop(...keys: string[]): Pipeline; + + brpoplpush(source: string, destination: string, timeout: number, callback?: (err: Error, res: any) => void): Pipeline; + + llen(key: string, callback?: (err: Error, res: number) => void): Pipeline; + + lindex(key: string, index: number, callback?: (err: Error, res: string) => void): Pipeline; + + lset(key: string, index: number, value: any, callback?: (err: Error, res: any) => void): Pipeline; + + lrange(key: string, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline; + + ltrim(key: string, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline; + + lrem(key: string, count: number, value: any, callback?: (err: Error, res: number) => void): Pipeline; + + rpoplpush(source: string, destination: string, callback?: (err: Error, res: string) => void): Pipeline; + + sadd(key: string, ...members: any[]): Pipeline; + + srem(key: string, ...members: any[]): Pipeline; + + smove(source: string, destination: string, member: string, callback?: (err: Error, res: string) => void): Pipeline; + + sismember(key: string, member: string, callback?: (err: Error, res: 1 | 0) => void): Pipeline; + + scard(key: string, callback?: (err: Error, res: number) => void): Pipeline; + + spop(key: string, callback?: (err: Error, res: any) => void): Pipeline; + spop(key: string, count: number, callback?: (err: Error, res: any) => void): Pipeline; + + srandmember(key: string, callback?: (err: Error, res: any) => void): Pipeline; + srandmember(key: string, count: number, callback?: (err: Error, res: any) => void): Pipeline; + + sinter(...keys: string[]): Pipeline; + + sinterstore(destination: string, ...keys: string[]): Pipeline; + + sunion(...keys: string[]): Pipeline; + + sunionstore(destination: string, ...keys: string[]): Pipeline; + + sdiff(...keys: string[]): Pipeline; + + sdiffstore(destination: string, ...keys: string[]): Pipeline; + + smembers(key: string, callback?: (err: Error, res: any) => void): Pipeline; + + zadd(key: string, ...args: string[]): Pipeline; + + zincrby(key: string, increment: number, member: string, callback?: (err: Error, res: any) => void): Pipeline; + + zrem(key: string, ...members: any[]): Pipeline; + + zremrangebyscore(key: string, min: number | string, max: number | string, callback?: (err: Error, res: any) => void): Pipeline; + + zremrangebyrank(key: string, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline; + + zunionstore(destination: string, numkeys: number, key: string, ...args: string[]): Pipeline; + + zinterstore(destination: string, numkeys: number, key: string, ...args: string[]): Pipeline; + + zrange(key: string, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline; + zrange(key: string, start: number, stop: number, withScores: "WITHSCORES", callback?: (err: Error, res: any) => void): Pipeline; + + zrevrange(key: string, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline; + zrevrange(key: string, start: number, stop: number, withScores: "WITHSCORES", callback?: (err: Error, res: any) => void): Pipeline; + + zrangebyscore(key: string, min: number | string, max: number | string, ...args: string[]): Pipeline; + + zrevrangebyscore(key: string, max: number | string, min: number | string, ...args: string[]): Pipeline; + + zcount(key: string, min: number | string, max: number | string, callback?: (err: Error, res: number) => void): Pipeline; + + zcard(key: string, callback?: (err: Error, res: number) => void): Pipeline; + + zscore(key: string, member: string, callback?: (err: Error, res: number) => void): Pipeline; + + zrank(key: string, member: string, callback?: (err: Error, res: number) => void): Pipeline; + + zrevrank(key: string, member: string, callback?: (err: Error, res: number) => void): Pipeline; + + hset(key: string, field: string, value: any, callback?: (err: Error, res: 0 | 1) => void): Pipeline; + hsetBuffer(key: string, field: string, value: any, callback?: (err: Error, res: Buffer) => void): Pipeline; + + hsetnx(key: string, field: string, value: any, callback?: (err: Error, res: 0 | 1) => void): Pipeline; + + hget(key: string, field: string, callback?: (err: Error, res: string) => void): Pipeline; + hgetBuffer(key: string, field: string, callback?: (err: Error, res: Buffer) => void): Pipeline; + + hmset(key: string, field: string, value: any, ...args: string[]): Pipeline; + hmset(key: string, data: any, callback?: (err: Error, res: 0 | 1) => void): Pipeline; + + hmget(key: string, ...fields: string[]): Pipeline; + + hincrby(key: string, field: string, increment: number, callback?: (err: Error, res: number) => void): Pipeline; + + hincrbyfloat(key: string, field: string, increment: number, callback?: (err: Error, res: number) => void): Pipeline; + + hdel(key: string, ...fields: string[]): Pipeline; + + hlen(key: string, callback?: (err: Error, res: number) => void): Pipeline; + + hkeys(key: string, callback?: (err: Error, res: any) => void): Pipeline; + + hvals(key: string, callback?: (err: Error, res: any) => void): Pipeline; + + hgetall(key: string, callback?: (err: Error, res: any) => void): Pipeline; + + hexists(key: string, field: string, callback?: (err: Error, res: 0 | 1) => void): Pipeline; + + incrby(key: string, increment: number, callback?: (err: Error, res: number) => void): Pipeline; + + incrbyfloat(key: string, increment: number, callback?: (err: Error, res: number) => void): Pipeline; + + decrby(key: string, decrement: number, callback?: (err: Error, res: number) => void): Pipeline; + + getset(key: string, value: any, callback?: (err: Error, res: string) => void): Pipeline; + + mset(key: string, value: any, ...args: string[]): Pipeline; + + msetnx(key: string, value: any, ...args: string[]): Pipeline; + + randomkey(callback?: (err: Error, res: string) => void): Pipeline; + + select(index: number, callback?: (err: Error, res: string) => void): Pipeline; + + move(key: string, db: string, callback?: (err: Error, res: 0 | 1) => void): Pipeline; + + rename(key: string, newkey: string, callback?: (err: Error, res: string) => void): Pipeline; + + renamenx(key: string, newkey: string, callback?: (err: Error, res: 0 | 1) => void): Pipeline; + + expire(key: string, seconds: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline; + + pexpire(key: string, milliseconds: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline; + + expireat(key: string, timestamp: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline; + + pexpireat(key: string, millisecondsTimestamp: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline; + + keys(pattern: string, callback?: (err: Error, res: string[]) => void): Pipeline; + + dbsize(callback?: (err: Error, res: number) => void): Pipeline; + + auth(password: string, callback?: (err: Error, res: string) => void): Pipeline; + + ping(callback?: (err: Error, res: string) => void): Pipeline; + ping(message: string, callback?: (err: Error, res: string) => void): Pipeline; + + echo(message: string, callback?: (err: Error, res: string) => void): Pipeline; + + save(callback?: (err: Error, res: string) => void): Pipeline; + + bgsave(callback?: (err: Error, res: string) => void): Pipeline; + + bgrewriteaof(callback?: (err: Error, res: string) => void): Pipeline; + + shutdown(save: "SAVE" | "NOSAVE", callback?: (err: Error, res: any) => void): Pipeline; + + lastsave(callback?: (err: Error, res: number) => void): Pipeline; + + type(key: string, callback?: (err: Error, res: string) => void): Pipeline; + + multi(callback?: (err: Error, res: string) => void): Pipeline; + + exec(callback?: (err: Error, res: any) => void): Promise; + + discard(callback?: (err: Error, res: any) => void): Pipeline; + + sync(callback?: (err: Error, res: any) => void): Pipeline; + + flushdb(callback?: (err: Error, res: string) => void): Pipeline; + + flushall(callback?: (err: Error, res: string) => void): Pipeline; + + sort(key: string, ...args: string[]): Pipeline; + + info(callback?: (err: Error, res: any) => void): Pipeline; + info(section: string, callback?: (err: Error, res: any) => void): Pipeline; + + time(callback?: (err: Error, res: any) => void): Pipeline; + + monitor(callback?: (err: Error, res: NodeJS.EventEmitter) => void): Pipeline; + + ttl(key: string, callback?: (err: Error, res: number) => void): Pipeline; + + persist(key: string, callback?: (err: Error, res: 0 | 1) => void): Pipeline; + + slaveof(host: string, port: number, callback?: (err: Error, res: string) => void): Pipeline; + + debug(...args: any[]): Pipeline; + + config(...args: any[]): Pipeline; + + subscribe(...channels: any[]): Pipeline; + + unsubscribe(...channels: string[]): Pipeline; + + psubscribe(...patterns: string[]): Pipeline; + + punsubscribe(...patterns: string[]): Pipeline; + + publish(channel: string, message: string, callback?: (err: Error, res: number) => void): Pipeline; + + watch(...keys: string[]): Pipeline; + + unwatch(callback?: (err: Error, res: string) => void): Pipeline; + + cluster(...args: any[]): Pipeline; + + restore(...args: any[]): Pipeline; + + migrate(...args: any[]): Pipeline; + + dump(key: string, callback?: (err: Error, res: string) => void): Pipeline; + + object(subcommand: string, ...args: any[]): Pipeline; + + client(...args: any[]): Pipeline; + + eval(...args: any[]): Pipeline; + + evalsha(...args: any[]): Pipeline; + + script(...args: any[]): Pipeline; + + quit(callback?: (err: Error, res: string) => void): Pipeline; + + scan(cursor: number, ...args: any[]): Pipeline; + + sscan(key: string, cursor: number, ...args: any[]): Pipeline; + + hscan(key: string, cursor: number, ...args: any[]): Pipeline; + + zscan(key: string, cursor: number, ...args: any[]): Pipeline; + + pfmerge(destkey: string, ...sourcekeys: string[]): Pipeline; + + pfadd(key: string, ...elements: string[]): Pipeline; + + pfcount(...keys: string[]): Pipeline; + } + + interface NodeConfiguration { + host?: string; + port?: number; + } + + type ClusterNode = string | number | NodeConfiguration; + + interface Cluster extends NodeJS.EventEmitter, Commander { + new(nodes: ClusterNode[], options?: ClusterOptions): Redis; + connect(callback: () => void): Promise; + disconnect(): void; + nodes(role: string): Redis[]; + } + + interface RedisOptions { + port?: number; + host?: string; + /** + * 4 (IPv4) or 6 (IPv6), Defaults to 4. + */ + family?: number; + /** + * Local domain socket path. If set the port, host and family will be ignored. + */ + path?: string; + /** + * TCP KeepAlive on the socket with a X ms delay before start. Set to a non-number value to disable keepAlive. + */ + keepAlive?: number; + connectionName?: string; + /** + * If set, client will send AUTH command with the value of this option when connected. + */ + password?: string; + /** + * Database index to use. + */ + db?: number; + /** + * When a connection is established to the Redis server, the server might still be loading + * the database from disk. While loading, the server not respond to any commands. + * To work around this, when this option is true, ioredis will check the status of the Redis server, + * and when the Redis server is able to process commands, a ready event will be emitted. + */ + enableReadyCheck?: boolean; + keyPrefix?: string; + /** + * When the return value isn't a number, ioredis will stop trying to reconnect. + * Fixed in: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/15858 + */ + retryStrategy?(times: number): number | false; + /** + * 1/true means reconnect, 2 means reconnect and resend failed command. Returning false will ignore + * the error and do nothing. + */ + reconnectOnError?(error: Error): boolean | 1 | 2; + /** + * By default, if there is no active connection to the Redis server, commands are added to a queue + * and are executed once the connection is "ready" (when enableReadyCheck is true, "ready" means + * the Redis server has loaded the database from disk, otherwise means the connection to the Redis + * server has been established). If this option is false, when execute the command when the connection + * isn't ready, an error will be returned. + */ + enableOfflineQueue?: boolean; + /** + * The milliseconds before a timeout occurs during the initial connection to the Redis server. + * default: 10000. + */ + connectTimeout?: number; + /** + * After reconnected, if the previous connection was in the subscriber mode, client will auto re-subscribe these channels. + * default: true. + */ + autoResubscribe?: boolean; + /** + * If true, client will resend unfulfilled commands(e.g. block commands) in the previous connection when reconnected. + * default: true. + */ + autoResendUnfulfilledCommands?: boolean; + lazyConnect?: boolean; + tls?: tls.ConnectionOptions; + sentinels?: Array<{ host: string; port: number; }>; + name?: string; + /** + * Enable READONLY mode for the connection. Only available for cluster mode. + * default: false. + */ + readOnly?: boolean; + /** + * If you are using the hiredis parser, it's highly recommended to enable this option. + * Create another instance with dropBufferSupport disabled for other commands that you want to return binary instead of string + */ + dropBufferSupport?: boolean; + /** + * Whether to show a friendly error stack. Will decrease the performance significantly. + */ + showFriendlyErrorStack?: boolean; + } + + interface ScanStreamOption { + match?: string; + count?: number; + } + + interface ClusterOptions { + clusterRetryStrategy?(times: number): number; + enableOfflineQueue?: boolean; + enableReadyCheck?: boolean; + scaleReads?: string; + maxRedirections?: number; + retryDelayOnFailover?: number; + retryDelayOnClusterDown?: number; + retryDelayOnTryAgain?: number; + redisOptions?: RedisOptions; + } + + interface MultiOptions { + pipeline: boolean; + } +} diff --git a/types/ioredis/v3/ioredis-tests.ts b/types/ioredis/v3/ioredis-tests.ts new file mode 100644 index 0000000000..32ae5c24d5 --- /dev/null +++ b/types/ioredis/v3/ioredis-tests.ts @@ -0,0 +1,153 @@ +import Redis = require("ioredis"); +const redis = new Redis(); + +redis.set('foo', 'bar'); +redis.get('foo', (err, result) => { + console.log(result); +}); + +// Or using a promise if the last argument isn't a function +redis.get('foo').then((result: any) => { + console.log(result); +}); + +// Arguments to commands are flattened, so the following are the same: +redis.sadd('set', 1, 3, 5, 7); +redis.sadd('set', [1, 3, 5, 7]); + +// All arguments are passed directly to the redis server: +redis.set('key', '100'); +redis.set('key', '100', 'XX'); +redis.set('key', '100', 'PX', 10); +redis.set('key', '100', 'EX', 10, 'NX'); +redis.set('key', '100', 'NX', 'EX', 10); +redis.set('key', '100', ['EX', 10, 'NX']); +redis.setBuffer('key', '100', 'NX', 'EX', 10); + +redis.set('key', '100', (err, data) => {}); +redis.set('key', '100', 'XX', (err, data) => {}); +redis.set('key', '100', 'PX', 10, (err, data) => {}); +redis.set('key', '100', 'EX', 10, 'NX', (err, data) => {}); +redis.set('key', '100', ['EX', 10, 'NX'], (err, data) => {}); +redis.setBuffer('key', '100', 'NX', 'EX', 10, (err, data) => {}); + +new Redis(); // Connect to 127.0.0.1:6379 +new Redis(6380); // 127.0.0.1:6380 +new Redis(6379, '192.168.1.1'); // 192.168.1.1:6379 +new Redis('/tmp/redis.sock'); +new Redis({ + port: 6379, // Redis port + host: '127.0.0.1', // Redis host + family: 4, // 4 (IPv4) or 6 (IPv6) + password: 'auth', + db: 0, + retryStrategy() { return false; }, + showFriendlyErrorStack: true, + tls: { + servername: 'tlsservername' + } +}); + +const pub = new Redis(); +redis.subscribe('news', 'music', (err: any, count: any) => { + // Now we are subscribed to both the 'news' and 'music' channels. + // `count` represents the number of channels we are currently subscribed to. + + pub.publish('news', 'Hello world!'); + pub.publish('music', 'Hello again!'); +}); + +redis.on('message', (channel: any, message: any) => { + // Receive message Hello world! from channel news + // Receive message Hello again! from channel music + console.log('Receive message %s from channel %s', message, channel); +}); + +// There's also an event called 'messageBuffer', which is the same as 'message' except +// it returns buffers instead of strings. +redis.on('messageBuffer', (channel: any, message: any) => { + // Both `channel` and `message` are buffers. +}); + +const pipeline = redis.pipeline(); +pipeline.set('foo', 'bar'); +pipeline.del('cc'); +pipeline.hset('hash', 'foo', 4); +pipeline.hget('hash', 'foo'); +pipeline.hsetBuffer('hash', 'fooBuffer', 4); +pipeline.hgetBuffer('hash', 'fooBuffer'); +pipeline.exec((err, results) => { + // `err` is always null, and `results` is an array of responses + // corresponding to the sequence of queued commands. + // Each response follows the format `[err, result]`. +}); + +// You can even chain the commands: +redis.pipeline().set('foo', 'bar').del('cc').exec((err, results) => { +}); + +// `exec` also returns a Promise: +const promise = redis.pipeline().set('foo', 'bar').get('foo').exec(); +promise.then((result) => { + // result === [[null, 'OK'], [null, 'bar']] +}); + +redis.pipeline().set('foo', 'bar').get('foo', (err, result) => { + // result === 'bar' +}).exec((err, result) => { + // result[1][1] === 'bar' +}); + +redis.pipeline([ + ['set', 'foo', 'bar'], + ['get', 'foo'] +]).exec(() => { /* ... */ }); + +Redis.Command.setArgumentTransformer('set', args => { + return args; +}); + +Redis.Command.setReplyTransformer('get', (result: any) => { + return result; +}); + +// multi +redis.multi().set('foo', 'bar').set('foo', 'baz').get('foo', (err, result) => { + // result === 'QUEUED' +}).exec((err, results) => { + // results = [[null, 'OK'], [null, 'OK'], [null, 'baz']] +}); + +redis.multi([ + ['set', 'foo', 'bar'], + ['get', 'foo'] +]).exec((err, results) => { + // results = [[null, 'OK'], [null, 'bar']] +}); + +redis.Promise.onPossiblyUnhandledRejection((error) => { +}); + +const keys = ['foo', 'bar']; +redis.mget(...keys); + +new Redis.Cluster([ + 'localhost' +]); + +new Redis.Cluster([ + 6379 +]); + +new Redis.Cluster([{ + host: 'localhost' +}]); + +new Redis.Cluster([{ + port: 6379 +}]); + +new Redis.Cluster([{ + host: 'localhost', + port: 6379 +}]); diff --git a/types/ioredis/v3/tsconfig.json b/types/ioredis/v3/tsconfig.json new file mode 100644 index 0000000000..eb6e042a5d --- /dev/null +++ b/types/ioredis/v3/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "ioredis": [ "ioredis/v3" ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ioredis-tests.ts" + ] +} diff --git a/types/ioredis/v3/tslint.json b/types/ioredis/v3/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ioredis/v3/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ip-address/index.d.ts b/types/ip-address/index.d.ts new file mode 100644 index 0000000000..59dbb07d57 --- /dev/null +++ b/types/ip-address/index.d.ts @@ -0,0 +1,110 @@ +// Type definitions for ip-address 5.8 +// Project: https://github.com/beaugunderson/ip-address +// Definitions by: Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export as namespace ipAddress; + +export interface v6Helpers { + spanAllZeroes(s: string): string; + spanAll(s: string, optionalOffset?: number): string; + spanLeadingZeroes(address: string): string; + simpleGroup(addressString: string, offset?: number): string; +} + +export interface TeredoObject { + readonly prefix: string; + readonly server4: string; + readonly client4: string; + readonly flags: string; + readonly coneNat: any; + readonly microsoft: { + readonly reserved: any, + readonly universalLocal: any, + readonly groupIndividual: any, + readonly nonce: any, + }; + udpPort: string; +} + +export interface SixToFourResponse { + readonly prefix: string; + readonly gateway: string; +} + +export class Address4 { + constructor(address: string); + static fromHex(hex: string): Address4; + static fromInteger(integer: number): Address4; + static fromBigInteger(bigInteger: any): Address4; + + valid: boolean; + address: string; + parsedAddress: string; + groups: number; + v4: boolean; + subnet: string; + subnetMask: number; + + isValid(): boolean; + correctForm(): string; + isCorrect(): boolean; + toHex(): string; + toArray(): any; + toGroup6(): string; + bigInteger(): any; + startAddress(): Address4; + startAddressExclusive(): Address4; + endAddress(): Address4; + endAddressExclusive(): Address4; + mask(optionalMask?: number): string; + getBitsBase2(start: number, end: number): string; + isInSubnet(): boolean; + binaryZeroPad(): string; +} + +export class Address6 { + constructor(address: string, optionalGroups?: number); + static fromBigInteger(bigInteger: any): Address6; + static fromURL(url: string): Address6; + static fromAddress4(address4: string): Address6; + static fromArpa(arpaFormAddress: string): Address6; + static fromByteArray(bytes: any): Address6; + static fromUnsignedByteArray(bytes: any): Address6; + + valid: boolean; + address: string; + groups: number; + v4: boolean; + subnet: string; + subnetMask: number; + + microsoftTranscription(): string; + mask(optionalMask?: number): string; + possibleSubnets(optionalSubnetSize?: number): string; + startAddress(): Address6; + startAddressExclusive(): Address6; + endAddress(): Address6; + endAddressExclusive(): Address6; + getScope(): string; + getType(): string; + getBits(start: number, end: number): any; + getBitsBase2(start: number, end: number): string; + getBitsBase16(start: number, end: number): string; + getBitsPastSubnet(): string; + reverseForm(options?: { omitSuffix: boolean }): string; + correctForm(): string; + binaryZeroPad(): string; + canonicalForm(): string; + decimal(): string; + bigInteger(): any; + to4(): string; + to4in6(): string; + inspectTeredo(): TeredoObject; + inspect6to4(): SixToFourResponse; + to6to4(): Address6; + toByteArray(): any; + toUnsignedByteArray(): any; +} + +export const v6: {helpers: v6Helpers}; diff --git a/types/ip-address/ip-address-tests.ts b/types/ip-address/ip-address-tests.ts new file mode 100644 index 0000000000..76b4e471aa --- /dev/null +++ b/types/ip-address/ip-address-tests.ts @@ -0,0 +1,121 @@ +import ipAddress = require('ip-address'); + +// Test Address4 Typings +const address4 = new ipAddress.Address4('127.0.0.1'); + +const address4Valid = address4.valid; +const address4String = address4.address; +const address4Parsed = address4.parsedAddress; +const address4Groups = address4.groups; +const address4v4 = address4.v4; +const address4Subnet = address4.subnet; +const address4Mask = address4.subnetMask; + +// $ExpectType Address4 +ipAddress.Address4.fromHex('127.0.0.1'); +// $ExpectType Address4 +ipAddress.Address4.fromInteger(127001); +// $ExpectType Address4 +address4.startAddress(); +// $ExpectType Address4 +address4.startAddressExclusive(); +// $ExpectType Address4 +address4.endAddress(); +// $ExpectType Address4 +address4.endAddressExclusive(); + +// $ExpectType string +address4.correctForm(); +// $ExpectType string +address4.toHex(); +// $ExpectType string +address4.toGroup6(); +// $ExpectType string +address4.mask(); +// $ExpectType string +address4.mask(0); +// $ExpectType string +address4.getBitsBase2(0, 1); +// $ExpectType string +address4.binaryZeroPad(); + +// $ExpectType boolean +address4.isValid(); +// $ExpectType boolean +address4.isCorrect(); +// $ExpectType boolean +address4.isInSubnet(); + +// Test Address6 Typings +const address6 = new ipAddress.Address6('127.0.0.1'); + +const address6Valid = address6.valid; +const address6String = address6.address; +const address6Groups = address6.groups; +const address6v4 = address6.v4; +const address6Subnet = address6.subnet; +const address6Mask = address6.subnetMask; + +// $ExpectType Address6 +address6.startAddress(); +// $ExpectType Address6 +address6.startAddressExclusive(); +// $ExpectType Address6 +address6.endAddress(); +// $ExpectType Address6 +address6.endAddressExclusive(); +// $ExpectType Address6 +address6.to6to4(); + +// $ExpectType string +address6.microsoftTranscription(); +// $ExpectType string +address6.mask(); +// $ExpectType string +address6.mask(0); +// $ExpectType string +address6.possibleSubnets(); +// $ExpectType string +address6.possibleSubnets(1); +// $ExpectType string +address6.getScope(); +// $ExpectType string +address6.getType(); +// $ExpectType string +address6.getBitsBase2(0, 1); +// $ExpectType string +address6.getBitsBase16(0, 1); +// $ExpectType string +address6.getBitsPastSubnet(); +// $ExpectType string +address6.reverseForm(); +// $ExpectType string +address6.correctForm(); +// $ExpectType string +address6.binaryZeroPad(); +// $ExpectType string +address6.canonicalForm(); +// $ExpectType string +address6.decimal(); +// $ExpectType string +address6.to4(); +// $ExpectType string +address6.to4in6(); + +// $ExpectType TeredoObject +address6.inspectTeredo(); + +// $ExpectType SixToFourResponse +address6.inspect6to4(); + +// Test v6 Typings +const v6 = ipAddress.v6; + +// $ExpectType string +v6.helpers.simpleGroup(address6.address); +// $ExpectType string +v6.helpers.spanAll(address6.address); +// $ExpectType string +v6.helpers.spanAllZeroes(address6.address); +// $ExpectType string +v6.helpers.spanLeadingZeroes(address6.address); diff --git a/types/ip-address/tsconfig.json b/types/ip-address/tsconfig.json new file mode 100644 index 0000000000..79254ab191 --- /dev/null +++ b/types/ip-address/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ip-address-tests.ts" + ] +} diff --git a/types/ip-address/tslint.json b/types/ip-address/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/ip-address/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/is-running/index.d.ts b/types/is-running/index.d.ts new file mode 100644 index 0000000000..e573a44193 --- /dev/null +++ b/types/is-running/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for is-running 2.1 +// Project: https://github.com/nisaacson/is-running +// Definitions by: Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function isRunning(pid: number): boolean; + +export = isRunning; diff --git a/types/is-running/is-running-tests.ts b/types/is-running/is-running-tests.ts new file mode 100644 index 0000000000..5f8ad2983a --- /dev/null +++ b/types/is-running/is-running-tests.ts @@ -0,0 +1,4 @@ +import isRunning = require("is-running"); + +// $ExpectType boolean +isRunning(100); diff --git a/types/is-running/tsconfig.json b/types/is-running/tsconfig.json new file mode 100644 index 0000000000..3a03f10b96 --- /dev/null +++ b/types/is-running/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "is-running-tests.ts" + ] +} diff --git a/types/is-running/tslint.json b/types/is-running/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/is-running/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/johnny-five/index.d.ts b/types/johnny-five/index.d.ts index 5f0f6a9f37..eafa4038de 100644 --- a/types/johnny-five/index.d.ts +++ b/types/johnny-five/index.d.ts @@ -378,6 +378,8 @@ export declare class LCD { autoscroll(): void; noAutoscroll(): void; bgColor(color: any): void; + noBacklight(): void; + backlight(): void; } export interface LedOption { diff --git a/types/joi/index.d.ts b/types/joi/index.d.ts index 256e35a8c7..5af6969665 100644 --- a/types/joi/index.d.ts +++ b/types/joi/index.d.ts @@ -137,6 +137,14 @@ export interface UriOptions { * Can be an Array or String (strings are automatically escaped for use in a Regular Expression). */ scheme?: string | RegExp | Array; + /** + * Allow relative URIs. Defaults to `false`. + */ + allowRelative?: boolean; + /** + * Restrict only relative URIs. Defaults to `false`. + */ + relativeOnly?: boolean; } export interface Base64Options { diff --git a/types/jquery-toast-plugin/index.d.ts b/types/jquery-toast-plugin/index.d.ts index 48bff9ff44..db95a9961c 100644 --- a/types/jquery-toast-plugin/index.d.ts +++ b/types/jquery-toast-plugin/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for jquery-toast-plugin 1.3 // Project: https://github.com/kamranahmedse/jquery-toast-plugin // Definitions by: Viqas Hussain +// Andrew Stegmaier // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -13,19 +14,26 @@ interface JQueryStatic { interface toastOptions { text: string; heading?: string; - showHideTransition?: string; + showHideTransition?: 'fade' | 'slide' | 'plain'; allowToastClose?: boolean; - hideAfter?: number; + hideAfter?: number | false; loader?: boolean; loaderBg?: string; - stack?: number; - position?: string; - bgColor?: boolean; - textColor?: boolean; - textAlign?: string; - icon?: boolean; + stack?: number | false; + position?: 'bottom-left' | 'bottom-right' | 'bottom-center' | 'top-right' | 'top-left' | 'top-center' | 'mid-center' | CustomPosition; + bgColor?: string; + textColor?: string; + textAlign?: 'left' | 'right' | 'center'; + icon?: 'info' | 'warning' | 'error' | 'success'; beforeShow?: () => any; afterShown?: () => any; beforeHide?: () => any; afterHidden?: () => any; } + +interface CustomPosition { + left: number | 'auto'; + right: number | 'auto'; + top: number | 'auto'; + bottom: number | 'auto'; +} diff --git a/types/jquery-toast-plugin/jquery-toast-plugin-tests.ts b/types/jquery-toast-plugin/jquery-toast-plugin-tests.ts index d9a2889c9b..d8f21dd200 100644 --- a/types/jquery-toast-plugin/jquery-toast-plugin-tests.ts +++ b/types/jquery-toast-plugin/jquery-toast-plugin-tests.ts @@ -1 +1,52 @@ $.toast({ text: "test" }); + +$.toast({ text: "test", heading: "Test Heading" }); + +$.toast({ text: "test", showHideTransition: "fade" }); +$.toast({ text: "test", showHideTransition: "slide" }); +$.toast({ text: "test", showHideTransition: "plain" }); + +$.toast({ text: "test", allowToastClose: false }); +$.toast({ text: "test", allowToastClose: true }); + +$.toast({ text: "test", hideAfter: 5}); +$.toast({ text: "test", hideAfter: false}); + +$.toast({ text: "test", loader: true }); +$.toast({ text: "test", loader: false }); + +$.toast({ text: "test", loaderBg: "#9EC600" }); + +$.toast({ text: "test", stack: 5}); +$.toast({ text: "test", stack: false}); + +$.toast({ text: "test", position: "bottom-left" }); +$.toast({ text: "test", position: "bottom-right" }); +$.toast({ text: "test", position: "bottom-center" }); +$.toast({ text: "test", position: "top-right" }); +$.toast({ text: "test", position: "top-left" }); +$.toast({ text: "test", position: "top-center" }); +$.toast({ text: "test", position: "mid-center" }); +$.toast({ text: "test", position: { left : "auto", right : 20, top : 20, bottom : "auto" } }); +$.toast({ text: "test", position: { left : 20, right : "auto", top : "auto", bottom : 20 } }); + +$.toast({ text: "test", bgColor: "#9EC600" }); + +$.toast({ text: "test", textColor: "#9EC600" }); + +$.toast({ text: "test", textAlign: "left" }); +$.toast({ text: "test", textAlign: "right" }); +$.toast({ text: "test", textAlign: "center" }); + +$.toast({ text: "test", icon: "info" }); +$.toast({ text: "test", icon: "warning" }); +$.toast({ text: "test", icon: "error" }); +$.toast({ text: "test", icon: "success" }); + +$.toast({ + text: 'Triggers the events', + beforeShow: () => {}, + afterShown: () => {}, + beforeHide: () => {}, + afterHidden: () => {} +}); diff --git a/types/jqueryui/index.d.ts b/types/jqueryui/index.d.ts index a979c65c7a..7dca429ce4 100644 --- a/types/jqueryui/index.d.ts +++ b/types/jqueryui/index.d.ts @@ -1071,6 +1071,17 @@ declare namespace JQueryUI { show?: any; } + interface WidgetCommonProperties { + element: JQuery; + defaultElement : string; + document: Document; + namespace: string; + uuid: string; + widgetEventPrefix: string; + widgetFullName: string; + window: Window; + } + interface Widget { (methodName: string): JQuery; (options: WidgetOptions): JQuery; @@ -1079,8 +1090,8 @@ declare namespace JQueryUI { (optionLiteral: string, options: WidgetOptions): any; (optionLiteral: string, optionName: string, optionValue: any): JQuery; - (name: string, prototype: any): JQuery; - (name: string, base: Function, prototype: any): JQuery; + (name: string, prototype: T & ThisType): JQuery; + (name: string, base: Function, prototype: T & ThisType ): JQuery; } //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/types/jsforce/salesforce-id.d.ts b/types/jsforce/salesforce-id.d.ts index 87d086880f..5e79506ed6 100644 --- a/types/jsforce/salesforce-id.d.ts +++ b/types/jsforce/salesforce-id.d.ts @@ -1,2 +1 @@ -export class SalesforceId extends String { -} +export type SalesforceId = string diff --git a/types/jsgraph/index.d.ts b/types/jsgraph/index.d.ts new file mode 100644 index 0000000000..fe4fa42e2f --- /dev/null +++ b/types/jsgraph/index.d.ts @@ -0,0 +1,174 @@ +// Type definitions for jsgraph 0.7 +// Project: https://github.com/Encapsule/jsgraph +// Definitions by: Joel Rosinbum +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +declare namespace jsgraph { + + interface jsGraphStatic { + directed: Directed; + } + + export interface VertexRequest { + u: string; + p: any + } + + export interface JsGraphResponse { + error?: any; + result?: any; + } + + export interface Edge { + u: string; + v: string + } + + export interface EdgeRequest { + e: Edge; + p: any; + } + + export interface DirectedGraph { + new(): DirectedGraph; + + setGraphName(name: string): JsGraphResponse; + + getGraphName(): string; + + setGraphDescription(description: string): JsGraphResponse; + + getGraphDescription(): string; + + verticesCount(): number; + + getVertices(): string[]; + + getEdgeCount(): number; + + getEdeges(): Edge[]; + + rootVerticesCount(): number; + + getRootVertices(): string[]; + + leafVerticesCount(): number; + + getLeafVertices(): string[]; + + toObject(): string; + + toJSON(): string; + + stringify(replacer: Function, space?: number): string; + + fromObject(graph: any): JsGraphResponse; + + + //Vertex functions + addVertex(vertex: VertexRequest): JsGraphResponse; + + removeVertex(vertex: string): boolean; + + getVertexProperty(vertex: string): any; + + setVertexProperty(vertex: VertexRequest): JsGraphResponse; + + hasVertexProperty(vertex: string): boolean; + + clearVertexProperty(vertex: string): boolean; + + inDegree(vertex: string): number; + + inEdges(vertex: string): Edge[]; + + outDegree(vertex: string): number; + + outEdges(vertex: string): Edge[]; + + //Edge functions + addEdge(request: EdgeRequest): JsGraphResponse; + + isEdge(edge: Edge): boolean; + + removeEdge(edge: Edge): JsGraphResponse; + + getEdgeProperty(edge: Edge): any; + + setEdgeProperty(request: EdgeRequest): JsGraphResponse; + + hasEdgeProperty(edge: Edge): boolean; + + clearEdgeProperty(edge: Edge): boolean; + + + } + + export interface Visitor { + initializeVertex(req: { u: string, g: DirectedGraph }): void; + + startVertex(req: { u: string, g: DirectedGraph }): void; + + discoverVertex(req: { u: string, g: DirectedGraph }): void; + + examineVertex(req: { u: string, g: DirectedGraph }): void; + + examineEdge(req: { e: Edge, g: DirectedGraph }): void; + + nonTreeEdge(req: { e: Edge, g: DirectedGraph }): void; + + grayTarget(req: { e: Edge, g: DirectedGraph }): void; + + blackTarget(req: { e: Edge, g: DirectedGraph }): void; + + finishVertex(req: { u: string, g: DirectedGraph }): void; + } + + export interface TraversalContext { + searchStatus: string; + colorMap: any; + undiscoveredMap: any; + } + + export interface TraversalOptions { + startVector: string | string[]; + allowEmptyStartVector: boolean; + signalStart: boolean; + traverseContext: TraversalContext; + } + + export interface TraversalParams { + digraph: DirectedGraph, + visitor: Visitor, + options?: TraversalOptions + } + + export interface TraversalResult { + error?: any; + result?: TraversalContext + } + + export type colors = { white: 0, gray: 1, black: 2 }; + + export interface Directed { + breadthFirstTraverse(params: TraversalParams): TraversalResult; + + colors: colors; + + create(): { result: DirectedGraph }; + + createTraversalContext(req: { dirgaph: DirectedGraph }): TraversalContext; + + depthFirstTraverse(params: TraversalParams): TraversalResult; + + transpose(graph: DirectedGraph): { error?: any, result?: DirectedGraph }; + + directedGraph: DirectedGraph; + + } +} + +declare var jsgraph: jsgraph.jsGraphStatic; + +export = jsgraph; diff --git a/types/jsgraph/jsgraph-tests.ts b/types/jsgraph/jsgraph-tests.ts new file mode 100644 index 0000000000..2fdab3c0bf --- /dev/null +++ b/types/jsgraph/jsgraph-tests.ts @@ -0,0 +1,43 @@ +import * as jsgraph from 'jsgraph'; +import {Edge, JsGraphResponse} from 'jsgraph'; + +const mygraph = jsgraph.directed.create().result; + +let name: string = 'my name'; +mygraph.setGraphName(name); +name = mygraph.getGraphName(); +let description: string = 'My desc'; +mygraph.setGraphDescription(description); +description = mygraph.getGraphDescription(); + +let count: number = mygraph.verticesCount(); +let verticies: string [] = mygraph.getVertices(); +count = mygraph.getEdgeCount(); +let edges: Edge[] = mygraph.getEdeges(); +count = mygraph.rootVerticesCount(); +verticies = mygraph.getRootVertices(); +count = mygraph.leafVerticesCount(); +verticies = mygraph.getLeafVertices(); +let json: string = mygraph.toObject(); +json = mygraph.toJSON(); +json = mygraph.stringify( () => {return}, 2); +const graph2 = mygraph.fromObject(mygraph); + +let response: JsGraphResponse = mygraph.addVertex({u: 'a', p: 'some data'}); +let bool: boolean = mygraph.removeVertex('a'); +let property: string = mygraph.getVertexProperty('a'); +mygraph.setVertexProperty({u: 'a', p: property}); +bool = mygraph.hasVertexProperty('a'); +bool = mygraph.clearVertexProperty('a'); +count = mygraph.inDegree('a'); +edges = mygraph.inEdges('a'); +count = mygraph.outDegree('a'); +edges = mygraph.outEdges('a'); + +response = mygraph.addEdge({e: {u: 'a', v:'b'}, p: 'some data'}); +bool = mygraph.isEdge({u: 'a', v:'b'}); +response = mygraph.removeEdge({u: 'a', v: 'b'}); +property = mygraph.getEdgeProperty({u: 'a', v: 'b'}); +response = mygraph.setEdgeProperty({e: {u: 'a', v: 'b'}, p: 'some data'}); +bool = mygraph.hasEdgeProperty({u: 'a', v: 'b'}); +bool = mygraph.clearEdgeProperty({u:'a', v: 'b'}); diff --git a/types/jsgraph/tsconfig.json b/types/jsgraph/tsconfig.json new file mode 100644 index 0000000000..22997eae59 --- /dev/null +++ b/types/jsgraph/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jsgraph-tests.ts" + ] +} diff --git a/types/jsgraph/tslint.json b/types/jsgraph/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/jsgraph/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/jss/index.d.ts b/types/jss/index.d.ts index 3318f9a565..c8e0f13c6c 100644 --- a/types/jss/index.d.ts +++ b/types/jss/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Brenton Simpson // Oleg Slobodskoi // Thomas Crockett +// Sebastian Silbermann // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -137,6 +138,7 @@ export declare class JSS { * Creates a new instance of JSS. */ export function create(options?: Partial): JSS; +export function createGenerateClassName(): GenerateClassName; declare const sharedInstance: JSS; /** * A global JSS instance. diff --git a/types/jss/jss-tests.ts b/types/jss/jss-tests.ts index 5e9a876036..4c7fcc9270 100644 --- a/types/jss/jss-tests.ts +++ b/types/jss/jss-tests.ts @@ -2,11 +2,12 @@ import { create as createJSS, + createGenerateClassName, SheetsRegistry, default as sharedInstance, } from 'jss'; -const jss = createJSS().setup({}); +const jss = createJSS().setup({ createGenerateClassName }); jss.use({}, {}); // $ExpectType JSS const styleSheet = jss.createStyleSheet( diff --git a/types/karma/index.d.ts b/types/karma/index.d.ts index cc4525566b..4b71c0a723 100644 --- a/types/karma/index.d.ts +++ b/types/karma/index.d.ts @@ -248,6 +248,7 @@ declare namespace karma { * you can specify how many browsers should be running at once at any given point in time. */ concurrency?: number; + customLaunchers?: { [key: string]: CustomLauncher }; /** * @default [] * @description List of files/patterns to exclude from loaded files. @@ -470,6 +471,13 @@ declare namespace karma { */ nocache?: boolean; } + + interface CustomLauncher { + base: string; + browserName?: string; + flags?: string[]; + platform?: string; + } } declare var karma: karma.Karma; diff --git a/types/karma/karma-tests.ts b/types/karma/karma-tests.ts index 6d9b8abd9f..a8adc36f45 100644 --- a/types/karma/karma-tests.ts +++ b/types/karma/karma-tests.ts @@ -106,6 +106,12 @@ module.exports = function(config: karma.Config) { 'Chrome', 'Firefox' ], + customLaunchers: { + ChromiumHeadless_without_security: { + base: 'ChromiumHeadless', + flags: ['--no-sandbox', '--disable-setuid-sandbox'], + }, + }, singleRun: true }); diff --git a/types/knex/index.d.ts b/types/knex/index.d.ts index 54dece1068..b400af2497 100644 --- a/types/knex/index.d.ts +++ b/types/knex/index.d.ts @@ -1,7 +1,6 @@ // Type definitions for Knex.js 0.14 // Project: https://github.com/tgriesser/knex // Definitions by: Qubo -// Baronfel // Pablo Rodríguez // Matt R. Wilson // Satana Charuwichitratana @@ -138,14 +137,19 @@ declare namespace Knex { limit(limit: number): QueryBuilder; // Aggregation - count(columnName?: string): QueryBuilder; - countDistinct(columnName?: string): QueryBuilder; - min(columnName: string): QueryBuilder; - max(columnName: string): QueryBuilder; - sum(columnName: string): QueryBuilder; - sumDistinct(columnName: string): QueryBuilder; - avg(columnName: string): QueryBuilder; - avgDistinct(columnName: string): QueryBuilder; + count(...columnNames: string[]): QueryBuilder; + count(columnName: Record | Knex.Raw): QueryBuilder; + countDistinct(columnName: string | Record | Knex.Raw): QueryBuilder; + min(columnName: string, ...columnNames: string[]): QueryBuilder; + min(columnName: Record | Knex.Raw): QueryBuilder; + max(columnName: string, ...columnNames: string[]): QueryBuilder; + max(columnName: Record | Knex.Raw): QueryBuilder; + sum(columnName: string, ...columnNames: string[]): QueryBuilder; + sum(columnName: Record | Knex.Raw): QueryBuilder; + sumDistinct(columnName: string | Record | Knex.Raw): QueryBuilder; + avg(columnName: string, ...columnNames: string[]): QueryBuilder; + avg(columnName: Record | Knex.Raw): QueryBuilder; + avgDistinct(columnName: string | Record | Knex.Raw): QueryBuilder; increment(columnName: string, amount?: number): QueryBuilder; decrement(columnName: string, amount?: number): QueryBuilder; diff --git a/types/knex/knex-tests.ts b/types/knex/knex-tests.ts index 0037948415..e7fb3e1b81 100644 --- a/types/knex/knex-tests.ts +++ b/types/knex/knex-tests.ts @@ -251,6 +251,58 @@ knex('users').whereRaw('id = ?', [1]); knex('users').whereRaw('id = :id', { id: 1 }); knex('users').whereRaw('id = :id', { id: knex('users').select('id').limit(1) }); +// Aggregate functions can use string/object parameters +knex('users').count(); +knex('users').count('*'); +knex('users').count('id', 'votes'); +knex('users').count({count: '*'}); +knex('users').count({count: ['id', 'votes']}); +knex('users').count({count: knex.raw('*')}); +knex('users').count(knex.raw('id')); + +knex('users').countDistinct('votes'); +knex('users').countDistinct(knex.raw('votes')); +knex('users').countDistinct({votes: 'votes'}); +knex('users').countDistinct({votes: knex.raw('votes')}); + +knex('users').avg('id'); +knex('users').avg('id', 'votes'); +knex('users').avg({avg: 'id'}); +knex('users').avg({avg: ['id', 'votes']}); +knex('users').avg({ab: knex.raw('a + b')}); +knex('users').avg(knex.raw('votes')); + +knex('users').avgDistinct('votes'); +knex('users').avgDistinct(knex.raw('votes')); +knex('users').avgDistinct({votes: 'votes'}); +knex('users').avgDistinct({votes: knex.raw('votes')}); + +knex('users').max('id'); +knex('users').max('id', 'votes'); +knex('users').max({max: 'id'}); +knex('users').max({max: ['id', 'votes']}); +knex('users').max({ab: knex.raw('a + b')}); +knex('users').max(knex.raw('votes')); + +knex('users').min('id'); +knex('users').min('id', 'votes'); +knex('users').min({min: 'id'}); +knex('users').min({min: ['id', 'votes']}); +knex('users').min({ab: knex.raw('a + b')}); +knex('users').min(knex.raw('votes')); + +knex('users').sum('id'); +knex('users').sum('id', 'votes'); +knex('users').sum({sum: 'id'}); +knex('users').sum({sum: ['id', 'votes']}); +knex('users').sum({ab: knex.raw('a + b')}); +knex('users').sum(knex.raw('votes')); + +knex('users').sumDistinct('votes'); +knex('users').sumDistinct(knex.raw('votes')); +knex('users').sumDistinct({votes: 'votes'}); +knex('users').sumDistinct({votes: knex.raw('votes')}); + // Join methods knex('users') .join('contacts', 'users.id', '=', 'contacts.user_id') diff --git a/types/knuddels-userapps-api/index.d.ts b/types/knuddels-userapps-api/index.d.ts index baff7689f8..1985c305a2 100644 --- a/types/knuddels-userapps-api/index.d.ts +++ b/types/knuddels-userapps-api/index.d.ts @@ -1,25 +1,35 @@ -// Type definitions for Knuddels UserApps API 1.00108823 +// Type definitions for Knuddels UserApps API 1.00109481 // Project: https://developer.knuddels.de // Definitions by: Knuddels GmbH & Co. KG // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// JSON definition -export interface Json { - [x: string]: string | number | boolean | Date | Json | JsonArray; -} -export interface JsonArray extends Array { } - -// serializable objects (for persistence) +// helper types +export type JsonData = string | number | boolean | Date | Json | JsonArray; +export type KnuddelsJsonData = string | number | boolean | Date | KnuddelsJson | KnuddelsJsonArray | KnuddelsSerializable; export type KnuddelsSerializable = string | number | boolean | User | BotUser; -export interface KnuddelsJson { - [x: string]: string | number | boolean | Date | KnuddelsJson | KnuddelsJsonArray | KnuddelsSerializable; -} -export interface KnuddelsJsonArray extends Array { } - -// "data" that may be send between apps and between server and client export type KnuddelsEvent = string | Json | KnuddelsEventArray; -export interface KnuddelsEventArray extends Array { } +// helper interfaces +declare global { + interface Json { + [x: string]: JsonData; + } + + interface KnuddelsJson { + [x: string]: KnuddelsJsonData; + } + + interface JsonArray extends Array { + } + + interface KnuddelsJsonArray extends Array { + } + + interface KnuddelsEventArray extends Array { + } +} + +// Apps API declare global { /** * @see https://developer.knuddels.de/docs/classes/App.html @@ -254,6 +264,13 @@ declare global { width: number, height: number ): AppContent; + /** + * @see https://developer.knuddels.de/docs/classes/AppContent.html#method_headerbarContent + */ + static headerbarContent( + htmlFile: HTMLFile, + height: number + ): AppContent; /** * @see https://developer.knuddels.de/docs/classes/AppContent.html#method_sendEvent */ @@ -426,6 +443,14 @@ declare global { * @see https://developer.knuddels.de/docs/classes/AppPersistence.html */ class AppPersistence extends Persistence { + /** + * @see https://developer.knuddels.de/docs/classes/AppPersistence.html#method_getDatabaseFileSize + */ + getDatabaseFileSize(): number; + /** + * @see https://developer.knuddels.de/docs/classes/AppPersistence.html#method_getDatabaseFileSizeLimit + */ + getDatabaseFileSizeLimit(): number; } /** @@ -493,6 +518,10 @@ declare global { * @see https://developer.knuddels.de/docs/classes/AppViewMode.html#property_Popup */ static readonly Popup: AppViewMode; + /** + * @see https://developer.knuddels.de/docs/classes/AppViewMode.html#property_Headerbar + */ + static readonly Headerbar: AppViewMode; } /** @@ -1597,6 +1626,18 @@ declare global { * @see https://developer.knuddels.de/docs/classes/KnuddelsServer.html */ class KnuddelsServer { + /** + * @see https://developer.knuddels.de/docs/classes/KnuddelsServer.html#method_execute + */ + static execute( + fileName: string + ): void; + /** + * @see https://developer.knuddels.de/docs/classes/KnuddelsServer.html#method_listFiles + */ + static listFiles( + path: string + ): string[]; /** * @see https://developer.knuddels.de/docs/classes/KnuddelsServer.html#method_getDefaultBotUser */ @@ -2269,6 +2310,7 @@ declare global { parameters?: { labelMapping?: { [minValue: string]: string }; ascending?: boolean; + sortIndex?: number; } ): Toplist; } diff --git a/types/koa-better-body/index.d.ts b/types/koa-better-body/index.d.ts new file mode 100644 index 0000000000..ab7cf5b21f --- /dev/null +++ b/types/koa-better-body/index.d.ts @@ -0,0 +1,33 @@ +// Type definitions for koa-better-body 3.0 +// Project: https://github.com/tunnckoCore/koa-better-body +// Definitions by: Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Context } from 'koa'; + +declare function KoaBetterBody(options?: KoaBetterBody.Options): KoaBetterBody.Body; + +declare namespace KoaBetterBody { + interface Options { + fields?: boolean | string; + files?: boolean | string; + multipart?: boolean; + textLimit?: string; + formLimit?: string; + urlencodedLimit?: string; + jsonLimit?: string; + bufferLimit?: string; + jsonStrict?: boolean; + detectJSON?: () => any; + strict?: boolean; + delimiter?: symbol; + decodeURIComponent?: any; + maxKeys?: number; + buffer?: boolean; + } + + type Body = (context: Context, next: () => void) => Generator; +} + +export = KoaBetterBody; diff --git a/types/koa-better-body/koa-better-body-tests.ts b/types/koa-better-body/koa-better-body-tests.ts new file mode 100644 index 0000000000..2f4deb2d49 --- /dev/null +++ b/types/koa-better-body/koa-better-body-tests.ts @@ -0,0 +1,11 @@ +import body = require('koa-better-body'); + +// $ExpectType Body +body(); + +const testOptions: body.Options = { + jsonLimit: '100mb', +}; + +// $ExpectType Body +body(testOptions); diff --git a/types/koa-better-body/tsconfig.json b/types/koa-better-body/tsconfig.json new file mode 100644 index 0000000000..74a794a11c --- /dev/null +++ b/types/koa-better-body/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "koa-better-body-tests.ts" + ] +} diff --git a/types/koa-better-body/tslint.json b/types/koa-better-body/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/koa-better-body/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/koa-convert/index.d.ts b/types/koa-convert/index.d.ts new file mode 100644 index 0000000000..ed5cd38480 --- /dev/null +++ b/types/koa-convert/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for koa-convert 1.2 +// Project: https://github.com/koajs/convert +// Definitions by: Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Context, Middleware } from "koa"; + +declare function convert( + mw: (context: Context, next: () => void) => Generator +): Middleware; + +export = convert; diff --git a/types/koa-convert/koa-convert-tests.ts b/types/koa-convert/koa-convert-tests.ts new file mode 100644 index 0000000000..0a795e522b --- /dev/null +++ b/types/koa-convert/koa-convert-tests.ts @@ -0,0 +1,16 @@ +import convert = require('koa-convert'); +import Koa = require('koa'); + +const app = new Koa(); + +app.use(modernMiddleware); + +app.use(convert(legacyMiddleware)); + +function * legacyMiddleware(next: any) { + yield next; +} + +function modernMiddleware(ctx: Koa.Context, next: any) { + return next().then(() => {}); +} diff --git a/types/koa-convert/tsconfig.json b/types/koa-convert/tsconfig.json new file mode 100644 index 0000000000..c86211adaa --- /dev/null +++ b/types/koa-convert/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "koa-convert-tests.ts" + ] +} diff --git a/types/koa-convert/tslint.json b/types/koa-convert/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/koa-convert/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/koa-cors/index.d.ts b/types/koa-cors/index.d.ts new file mode 100644 index 0000000000..4b996b7b07 --- /dev/null +++ b/types/koa-cors/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for koa-cors 0.0 +// Project: https://github.com/evert0n/koa-cors +// Definitions by: Romain Faust +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Middleware, Request } from 'koa'; + +declare function koaCors(options?: koaCors.Options): Middleware; + +declare namespace koaCors { + interface Options { + credentials?: true; + expose?: string | ReadonlyArray; + headers?: string | ReadonlyArray; + maxAge?: number; + methods?: string | ReadonlyArray; + origin?: boolean | string | ((request: Request) => string); + } +} + +export = koaCors; diff --git a/types/koa-cors/koa-cors-tests.ts b/types/koa-cors/koa-cors-tests.ts new file mode 100644 index 0000000000..943e11ae5f --- /dev/null +++ b/types/koa-cors/koa-cors-tests.ts @@ -0,0 +1,6 @@ +import Koa = require('koa'); +import koaCors = require('koa-cors'); + +const app = new Koa(); +app.use(koaCors()); +app.use(koaCors({ origin: '*' })); diff --git a/types/koa-cors/tsconfig.json b/types/koa-cors/tsconfig.json new file mode 100644 index 0000000000..69cf8667e4 --- /dev/null +++ b/types/koa-cors/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "koa-cors-tests.ts" + ] +} diff --git a/types/koa-cors/tslint.json b/types/koa-cors/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/koa-cors/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/koa-html-minifier/index.d.ts b/types/koa-html-minifier/index.d.ts index 5343257116..6c0c58db12 100644 --- a/types/koa-html-minifier/index.d.ts +++ b/types/koa-html-minifier/index.d.ts @@ -4,11 +4,13 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 +import { Options as HtmlMinifierOptions } from 'html-minifier'; import { Middleware } from 'koa'; -import { Options } from 'html-minifier'; -declare function minifier(options?: Options): Middleware; +declare function koaHtmlMinifier(options?: koaHtmlMinifier.Options): Middleware; -declare namespace minifier {} +declare namespace koaHtmlMinifier { + type Options = HtmlMinifierOptions; +} -export = minifier; +export = koaHtmlMinifier; diff --git a/types/koa-html-minifier/koa-html-minifier-tests.ts b/types/koa-html-minifier/koa-html-minifier-tests.ts index c068d303af..e84c6d81d1 100644 --- a/types/koa-html-minifier/koa-html-minifier-tests.ts +++ b/types/koa-html-minifier/koa-html-minifier-tests.ts @@ -1,8 +1,6 @@ -import * as Koa from 'koa'; -import * as KoaHtmlMinifier from 'koa-html-minifier'; +import Koa = require('koa'); +import koaHtmlMinifier = require('koa-html-minifier'); -const app = new Koa() - .use(KoaHtmlMinifier()) - .use(KoaHtmlMinifier({ - collapseWhitespace: true - })); +const app = new Koa(); +app.use(koaHtmlMinifier()); +app.use(koaHtmlMinifier({ collapseWhitespace: true })); diff --git a/types/koa2-session-redis/index.d.ts b/types/koa2-session-redis/index.d.ts new file mode 100644 index 0000000000..24e85e1674 --- /dev/null +++ b/types/koa2-session-redis/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for koa2-session-redis 0.0 +// Project: https://github.com/lonord/koa2-session-redis +// Definitions by: Dima Mukhin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as Redis from 'redis'; +import * as session from 'koa-session'; + +export = RedisStore; + +declare class RedisStore implements session.stores { + constructor(config?: Redis.ClientOpts); + + /** + * get session object by key + */ + get(key: string): any; + + /** + * set session object for key, with a maxAge (in ms) + */ + set(key: string, sess: Partial & { _expire?: number, _maxAge?: number }, maxAge: session.opts["maxAge"]): any; + + /** + * destroy session for key + */ + destroy(key: string): any; + + /** + * sends the quit command to the redis server and ends cleanly right after all running commands were properly handled + */ + quit(): void; +} diff --git a/types/koa2-session-redis/koa2-session-redis-tests.ts b/types/koa2-session-redis/koa2-session-redis-tests.ts new file mode 100644 index 0000000000..7623b30aca --- /dev/null +++ b/types/koa2-session-redis/koa2-session-redis-tests.ts @@ -0,0 +1,15 @@ +import * as session from 'koa-session'; +import * as Koa from 'koa'; +import RedisStore = require('koa2-session-redis'); + +const app = new Koa(); + +const CONFIG = { + store: new RedisStore({ + host: '127.0.0.1', + port: 6379, + max_attempts: 0 + }) +}; + +app.use(session(CONFIG, app)); diff --git a/types/koa2-session-redis/tsconfig.json b/types/koa2-session-redis/tsconfig.json new file mode 100644 index 0000000000..e96bc50af3 --- /dev/null +++ b/types/koa2-session-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", + "koa2-session-redis-tests.ts" + ] +} diff --git a/types/koa2-session-redis/tslint.json b/types/koa2-session-redis/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/koa2-session-redis/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/leaflet-editable/index.d.ts b/types/leaflet-editable/index.d.ts index 932ca33fd2..f73befb161 100644 --- a/types/leaflet-editable/index.d.ts +++ b/types/leaflet-editable/index.d.ts @@ -124,6 +124,11 @@ declare module 'leaflet' { * When you need to stop any ongoing drawing, without needing to know which editor is active. */ stopDrawing(): void; + + /** + * When you need to commit any ongoing drawing, without needing to know which editor is active. + */ + commitDrawing(): void; } let Editable: EditableStatic; diff --git a/types/leaflet-editable/leaflet-editable-tests.ts b/types/leaflet-editable/leaflet-editable-tests.ts index 23bcc988fb..e804fcc250 100644 --- a/types/leaflet-editable/leaflet-editable-tests.ts +++ b/types/leaflet-editable/leaflet-editable-tests.ts @@ -31,6 +31,7 @@ const map: L.Map = L.map('div', { const currentPoly: L.Polygon|L.Polyline| L.Marker = map.editTools.currentPolygon; map.editTools.stopDrawing(); +map.editTools.commitDrawing(); const marker: L.Marker = map.editTools.startMarker(L.latLng(0, 0), { draggable: true }); marker.disable(); diff --git a/types/leaflet/index.d.ts b/types/leaflet/index.d.ts index 89c9cbd9b9..0822dea605 100644 --- a/types/leaflet/index.d.ts +++ b/types/leaflet/index.d.ts @@ -612,10 +612,10 @@ export interface PolylineOptions extends PathOptions { } export class Polyline extends Path { - constructor(latlngs: LatLngExpression[], options?: PolylineOptions); + constructor(latlngs: LatLngExpression[] | LatLngExpression[][], options?: PolylineOptions); toGeoJSON(): geojson.Feature; getLatLngs(): LatLng[] | LatLng[][] | LatLng[][][]; - setLatLngs(latlngs: LatLngExpression[]): this; + setLatLngs(latlngs: LatLngExpression[] | LatLngExpression[][] | LatLngExpression[][][]): this; isEmpty(): boolean; getCenter(): LatLng; getBounds(): LatLngBounds; @@ -625,13 +625,13 @@ export class Polyline extends Polyline { - constructor(latlngs: LatLngExpression[] | LatLngExpression[][], options?: PolylineOptions); + constructor(latlngs: LatLngExpression[] | LatLngExpression[][] | LatLngExpression[][][], options?: PolylineOptions); } -export function polygon(latlngs: LatLngExpression[] | LatLngExpression[][], options?: PolylineOptions): Polygon; +export function polygon(latlngs: LatLngExpression[] | LatLngExpression[][] | LatLngExpression[][][], options?: PolylineOptions): Polygon; export class Rectangle

            extends Polygon

            { constructor(latLngBounds: LatLngBoundsExpression, options?: PolylineOptions); diff --git a/types/leaflet/leaflet-tests.ts b/types/leaflet/leaflet-tests.ts index 1f6671cc8c..66f12fd0ed 100644 --- a/types/leaflet/leaflet-tests.ts +++ b/types/leaflet/leaflet-tests.ts @@ -473,15 +473,58 @@ L.marker([1, 2], { className: 'my-div-icon' })); -const latLngs = [ - {lat: 0, lng: 0}, - {lat: 1, lng: 1} -]; -const polygon = new L.Polygon(latLngs); -const polygonExclusion = new L.Polygon([latLngs, latLngs]); +let polygon: L.Polygon; -L.polygon(latLngs).addTo(map); -L.polygon([latLngs, latLngs]).addTo(map); +// simple polygon +const simplePolygonLatLngs: L.LatLngExpression[] = [[37, -109.05], [41, -109.03], [41, -102.05], [37, -102.04]]; +polygon = L.polygon(simplePolygonLatLngs); +polygon = new L.Polygon(simplePolygonLatLngs); +polygon.setLatLngs(simplePolygonLatLngs); +const simplePolygonLatLngs2: L.LatLng[] = polygon.getLatLngs() as L.LatLng[]; + +// complex polygon (polygon with holes) +const complexPolygonLatLngs: L.LatLngExpression[][] = [ + [[37, -109.05], [41, -109.03], [41, -102.05], [37, -102.04]], // outer ring + [[37.29, -108.58], [40.71, -108.58], [40.71, -102.50], [37.29, -102.50]] // hole +]; +polygon = L.polygon(complexPolygonLatLngs); +polygon = new L.Polygon(complexPolygonLatLngs); +polygon.setLatLngs(complexPolygonLatLngs); +const complexPolygonLatLngs2: L.LatLng[][] = polygon.getLatLngs() as L.LatLng[][]; + +// multi polygon +const multiPolygonLatLngs: L.LatLngExpression[][][] = [ + [ // first polygon + [[37, -109.05], [41, -109.03], [41, -102.05], [37, -102.04]], // outer ring + [[37.29, -108.58], [40.71, -108.58], [40.71, -102.50], [37.29, -102.50]] // hole + ], + [ // second polygon + [[41, -111.03], [45, -111.04], [45, -104.05], [41, -104.05]] + ] +]; +polygon = L.polygon(multiPolygonLatLngs); +polygon = new L.Polygon(multiPolygonLatLngs); +polygon.setLatLngs(multiPolygonLatLngs); +const multiPolygonLatLngs2: L.LatLng[][][] = polygon.getLatLngs() as L.LatLng[][][]; + +let polyline: L.Polyline; + +// simple polyline +const simplePolylineLatLngs: L.LatLngExpression[] = [[45.51, -122.68], [37.77, -122.43], [34.04, -118.2]]; +polyline = L.polyline(simplePolylineLatLngs); +polyline = new L.Polyline(simplePolylineLatLngs); +polyline.setLatLngs(simplePolylineLatLngs); +const simplePolylineLatLngs2: L.LatLng[] = polyline.getLatLngs() as L.LatLng[]; + +// multi polyline +const multiPolylineLatLngs: L.LatLngExpression[][] = [ + [[45.51, -122.68], [37.77, -122.43], [34.04, -118.2]], + [[40.78, -73.91], [41.83, -87.62], [32.76, -96.72]] +]; +polyline = L.polyline(multiPolylineLatLngs); +polyline = new L.Polyline(multiPolylineLatLngs); +polyline.setLatLngs(multiPolylineLatLngs); +const multiPolylineLatLngs2: L.LatLng[][] = polyline.getLatLngs() as L.LatLng[][]; L.Util.extend({}); L.Util.create({}); @@ -512,7 +555,7 @@ interface MyProperties { testProperty: string; } -(L.polygon(latLngs) as L.Polygon).feature.properties.testProperty = "test"; +(L.polygon(simplePolygonLatLngs) as L.Polygon).feature.properties.testProperty = "test"; (L.marker([1, 2], { icon: L.icon({ diff --git a/types/level-codec/index.d.ts b/types/level-codec/index.d.ts new file mode 100644 index 0000000000..a106350215 --- /dev/null +++ b/types/level-codec/index.d.ts @@ -0,0 +1,32 @@ +// Type definitions for level-codec 9.0 +// Project: https://github.com/Level/codec +// Definitions by: Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface CodecEncoder { + encode: (val: any) => any; + decode: (val: any) => any; + buffer: boolean; + type: string; +} +export interface CodecOptions { + keyEncoding?: string | CodecEncoder; + valueEncoding?: string | CodecEncoder; +} +export interface Codec { + encodeKey(key: any, opts?: CodecOptions, batchOpts?: CodecOptions): any; + encodeValue(value: any, opts?: CodecOptions, batchOpts?: CodecOptions): any; + decodeKey(key: any, opts?: CodecOptions): any; + decodeValue(value: any, opts?: CodecOptions): any; + encodeBatch(ops: any, opts?: CodecOptions): any; + encodeLtgt(ltgt: any): any; + createStreamDecoder(opts: CodecOptions): any; + keyAsBuffer(opts?: CodecOptions): any; + valueAsBuffer(opts?: CodecOptions): any; +} +export interface CodecConstructor { + new (options?: CodecOptions): Codec; + (options?: CodecOptions): Codec; +} + +export const Codec: CodecConstructor; diff --git a/types/level-codec/level-codec-tests.ts b/types/level-codec/level-codec-tests.ts new file mode 100644 index 0000000000..371966844f --- /dev/null +++ b/types/level-codec/level-codec-tests.ts @@ -0,0 +1,12 @@ +import { Codec } from "level-codec"; + +const test = (codec: Codec) => { + return codec.keyAsBuffer(); +}; + +test(new Codec({ keyEncoding: "hex" })); +test(new Codec()); + +// new not needed +test(Codec({ keyEncoding: "hex" })); +test(Codec()); diff --git a/types/level-codec/tsconfig.json b/types/level-codec/tsconfig.json new file mode 100644 index 0000000000..0381e4eb12 --- /dev/null +++ b/types/level-codec/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", + "level-codec-tests.ts" + ] +} diff --git a/types/level-codec/tslint.json b/types/level-codec/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/level-codec/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/libxmljs/index.d.ts b/types/libxmljs/index.d.ts index 7fc9e9e2bf..4305c662a8 100644 --- a/types/libxmljs/index.d.ts +++ b/types/libxmljs/index.d.ts @@ -12,16 +12,14 @@ export const libxml_version: string; export const libxml_parser_version: string; // tslint:disable-next-line:strict-export-declare-modifiers -interface ParseOptions { - [optionName: string]: string; -} +interface StringMap { [key: string]: string; } -export function parseXml(source: string, options?: ParseOptions): Document; -export function parseXmlString(source: string, options?: ParseOptions): Document; +export function parseXml(source: string, options?: StringMap): Document; +export function parseXmlString(source: string, options?: StringMap): Document; -export function parseHtml(source: string, options?: ParseOptions): Document; -export function parseHtmlString(source: string, options?: ParseOptions): Document; -export function parseHtmlFragment(source: string, options?: ParseOptions): Document; +export function parseHtml(source: string, options?: StringMap): Document; +export function parseHtmlString(source: string, options?: StringMap): Document; +export function parseHtmlFragment(source: string, options?: StringMap): Document; export function memoryUsage(): number; export function nodeCount(): number; @@ -41,7 +39,7 @@ export class Document { encoding(): string; encoding(enc: string): this; find(xpath: string): Element[]; - get(xpath: string): Element|null; + get(xpath: string, namespaces?: StringMap): Element|null; node(name: string, content?: string): Element; root(): Element|null; root(newRoot: Node): Node; @@ -98,7 +96,7 @@ export class Element extends Node { text(): string; text(newText: string): this; attr(name: string): Attribute|null; - attr(attrObject: { [key: string]: string; }): this; + attr(attrObject: StringMap): this; attrs(): Attribute[]; doc(): Document; @@ -115,7 +113,7 @@ export class Element extends Node { addNextSibling(siblingNode: Node): Node; find(xpath: string, ns_uri?: string): Node[]; - find(xpath: string, namespaces: { [key: string]: string; }): Node[]; + find(xpath: string, namespaces: StringMap): Node[]; get(xpath: string, ns_uri?: string): Element|null; defineNamespace(prefixOrHref: string, hrefInCaseOfPrefix?: string): Namespace; diff --git a/types/libxmljs/libxmljs-tests.ts b/types/libxmljs/libxmljs-tests.ts index 367d74c69d..fe720cc242 100644 --- a/types/libxmljs/libxmljs-tests.ts +++ b/types/libxmljs/libxmljs-tests.ts @@ -47,3 +47,18 @@ const doc = new libxmljs.Document(); .node('sibling', 'with content!'); const {name, externalId, systemId} = doc.getDtd(); + +const xmlWithNs = '' + + '' + + '' + + 'grandchild content' + + '' + + 'with content!' + + ''; + +const xmlDocWithNs = libxmljs.parseXml(xmlWithNs); + +// xpath queries +const gchildWithNs = xmlDocWithNs.get('//a:grandchild', {a: 'http://test.com/test'})!; + +console.log(gchildWithNs.text()); // prints "grandchild content" diff --git a/types/local-storage/index.d.ts b/types/local-storage/index.d.ts new file mode 100644 index 0000000000..3452837374 --- /dev/null +++ b/types/local-storage/index.d.ts @@ -0,0 +1,42 @@ +// Type definitions for local-storage 1.4 +// Project: https://github.com/bevacqua/local-storage +// Definitions by: Sasha Grin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +type Listener = (newValue: any, oldValue: any, url: string) => any; + +interface Accessor { + /** + * Invokes set if value is present and get otherwise + * https://github.com/bevacqua/local-storage#lskey-value + */ + (key: string, value: any): boolean; + (key: string): any; + + /** + * Internally uses JSON.parse to parse value from storage without try/catch + * https://github.com/bevacqua/local-storage#lsgetkey + */ + get(key: string): any; + + /** + * Internally uses JSON.stringify before saving. + * https://github.com/bevacqua/local-storage#lssetkey-value + */ + set(key: string, value: any): boolean; + + /** https://github.com/bevacqua/local-storage#lsremovekey */ + remove(key: string): boolean; + + /** https://github.com/bevacqua/local-storage#lsclear */ + clear(): boolean; + + /** https://github.com/bevacqua/local-storage#lsonkey-fn */ + on(key: string, callback: Listener): void; + + /** https://github.com/bevacqua/local-storage#lsoffkey-fn */ + off(key: string, callback: Listener): void; +} + +declare const accessor: Accessor; +export = accessor; diff --git a/types/local-storage/local-storage-tests.ts b/types/local-storage/local-storage-tests.ts new file mode 100644 index 0000000000..410c3cac8e --- /dev/null +++ b/types/local-storage/local-storage-tests.ts @@ -0,0 +1,13 @@ +import ls = require('local-storage'); + +ls('foo'); +ls('foo', 'bar'); +ls.get('foo'); +ls.set('foo', 'bar'); +ls.remove('foo'); +ls.clear(); + +const callback = (newValue: any, oldValue: any, url: string) => null; + +ls.on('foo', callback); +ls.off('foo', callback); diff --git a/types/local-storage/tsconfig.json b/types/local-storage/tsconfig.json new file mode 100644 index 0000000000..f046bae993 --- /dev/null +++ b/types/local-storage/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", + "local-storage-tests.ts" + ] +} diff --git a/types/local-storage/tslint.json b/types/local-storage/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/local-storage/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/mali-compose/index.d.ts b/types/mali-compose/index.d.ts new file mode 100644 index 0000000000..87b23087d3 --- /dev/null +++ b/types/mali-compose/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for mali 1.1 +// Project: https://github.com/malijs/mali-compose +// Definitions by: Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +import { Context } from "mali"; + +declare function compose( + middleware: ReadonlyArray< + (ctx: Context, next: () => Promise) => Promise + > +): (context: Context, next: () => Promise) => Promise; + +export = compose; diff --git a/types/mali-compose/mali-compose-tests.ts b/types/mali-compose/mali-compose-tests.ts new file mode 100644 index 0000000000..190ab46458 --- /dev/null +++ b/types/mali-compose/mali-compose-tests.ts @@ -0,0 +1,39 @@ +import compose = require('mali-compose'); +import { Context } from 'mali'; + +type middleware = (context: Context, next: () => Promise) => Promise; + +const arr: number[] = []; +const stack: middleware[] = []; + +function _sleep(ms: number) { + return new Promise((resolve) => setTimeout(resolve, ms)); +} + +stack.push(async (ctx: Context, next: () => Promise) => { + arr.push(1); + await _sleep(1); + await next(); + await _sleep(1); + arr.push(6); + }); + +stack.push(async (ctx: Context, next: () => Promise) => { + arr.push(2); + await _sleep(1); + await next(); + await _sleep(1); + arr.push(5); +}); + +stack.push(async (ctx: Context, next: () => Promise) => { + arr.push(3); + await _sleep(1); + await next(); + await _sleep(1); + arr.push(4); +}); + +compose(stack); +compose([]); +compose([compose(stack)]); diff --git a/types/mali-compose/tsconfig.json b/types/mali-compose/tsconfig.json new file mode 100644 index 0000000000..e0afe50e85 --- /dev/null +++ b/types/mali-compose/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "mali-compose-tests.ts" + ] +} diff --git a/types/mali-compose/tslint.json b/types/mali-compose/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/mali-compose/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/mali/index.d.ts b/types/mali/index.d.ts new file mode 100644 index 0000000000..1c73b18c75 --- /dev/null +++ b/types/mali/index.d.ts @@ -0,0 +1,77 @@ +// Type definitions for mali 0.9 +// Project: https://github.com/malijs/mali +// Definitions by: Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +import { EventEmitter } from 'events'; +import { Stream } from 'stream'; + +declare class Mali extends EventEmitter { + constructor(path: any, name?: string | ReadonlyArray, options?: any); + name: string; + env: string; + ports: ReadonlyArray; // ? not sure which it is + silent: boolean; + + addService(path: any, name: string | ReadonlyArray, options?: any): void; + use(service?: any, name?: any, fns?: any): void; + start(port?: any, creds?: any, options?: any): any; // gnarly type asserting for these functions so Im just gonna let them handle it. + toJSON(): any; + close(): void; + inspect(): any; +} + +declare namespace Mali { + interface Context { + name: string; + fullName: string; + service: string; + package: string; + app: any; // ? app + call: any; + request: Request; + response: Response; + req: any; // ? + res: any; // ? + type: string; + metadata: string; + get(field: string): any; + set(field: any, val?: any): void; // do I need `?:` if its of type `any`? + sendMetadata(md: any): void; + getStatus(field: string): any; + setStatus(field: any, val?: any): void; // ^ + } + + class Request { + constructor(call: any, type: string); + call: any; + type: string; + metadata: any; + req: any; // ? + + getMetadata(): any; + get(field: string): any; + } + + class Response { + constructor(call: any, type: string); + call: any; + type: string; + metadata: any; + status: any; + res: any; // ? + set(field: any, val?: any): void; // is `val?:` necessary when its of type `any`? + get(field: string): any; + getMetadata(): any; + sendMetadata(md?: any): void; + getStatus(field: string): any; + setStatus(field: any, val?: any): void; // ^ same as above + } + + function exec(ctx: Context, handler: any, cb?: any): void; +} + +export = Mali; diff --git a/types/mali/mali-tests.ts b/types/mali/mali-tests.ts new file mode 100644 index 0000000000..d6d33a263f --- /dev/null +++ b/types/mali/mali-tests.ts @@ -0,0 +1,16 @@ +// example from https://github.com/malijs/mali#example + +import Mali = require('mali'); +import path = require('path'); + +const PROTO_PATH = path.resolve(__dirname, '../protos/helloworld.proto'); + +async function sayHello(ctx: Mali.Context) { + ctx.res = { message: 'Hello '.concat(ctx.req.name) }; +} + +const app = new Mali(PROTO_PATH); +// $ExpectType void +app.use({sayHello}); +// $ExpectType any +app.start('127.0.0.1:50051'); diff --git a/types/mali/tsconfig.json b/types/mali/tsconfig.json new file mode 100644 index 0000000000..1a4f86d02c --- /dev/null +++ b/types/mali/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "mali-tests.ts" + ] +} diff --git a/types/mali/tslint.json b/types/mali/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/mali/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/mapbox-gl/index.d.ts b/types/mapbox-gl/index.d.ts index 78ce94cb56..3f09b5d6de 100644 --- a/types/mapbox-gl/index.d.ts +++ b/types/mapbox-gl/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Mapbox GL JS v0.47.0 +// Type definitions for Mapbox GL JS v0.48.0 // Project: https://github.com/mapbox/mapbox-gl-js // Definitions by: Dominik Bruderer , Patrick Reames // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -63,9 +63,9 @@ declare namespace mapboxgl { isRotating(): boolean; - queryRenderedFeatures(pointOrBox?: PointLike | PointLike[], parameters?: { layers?: string[], filter?: any[] }): GeoJSON.Feature[]; + queryRenderedFeatures(pointOrBox?: PointLike | PointLike[], parameters?: { layers?: string[], filter?: any[] }): GeoJSON.Feature[]; - querySourceFeatures(sourceID: string, parameters?: { sourceLayer?: string, filter?: any[] }): GeoJSON.Feature[]; + querySourceFeatures(sourceID: string, parameters?: { sourceLayer?: string, filter?: any[] }): GeoJSON.Feature[]; setStyle(style: mapboxgl.Style | string, options?: { diff?: boolean, localIdeographFontFamily?: string }): this; @@ -226,6 +226,10 @@ declare namespace mapboxgl { /** ID of the container element */ container?: string | Element; + /** String or strings to show in an AttributionControl. + * Only applicable if options.attributionControl is `true`. */ + customAttribution?: string | string[]; + /** If true, enable the "drag to pan" interaction (see DragPanHandler). */ dragPan?: boolean; @@ -441,7 +445,7 @@ declare namespace mapboxgl { * Attribution */ export class AttributionControl extends Control { - constructor(options?: { compact?: boolean }); + constructor(options?: { compact?: boolean, customAttribution?: string | string[] }); } /** @@ -530,8 +534,6 @@ declare namespace mapboxgl { type: 'vector' | 'raster' | 'raster-dem' | 'geojson' | 'image' | 'video' | 'canvas'; } - export type GeoJSONGeometry = GeoJSON.Point | GeoJSON.LineString | GeoJSON.MultiPoint | GeoJSON.Polygon | GeoJSON.MultiLineString | GeoJSON.MultiPolygon | GeoJSON.GeometryCollection; - /** * GeoJSONSource */ @@ -545,17 +547,17 @@ declare namespace mapboxgl { constructor(options?: mapboxgl.GeoJSONSourceOptions); - setData(data: GeoJSON.Feature | GeoJSON.FeatureCollection | String): this; + setData(data: GeoJSON.Feature | GeoJSON.FeatureCollection | String): this; getClusterExpansionZoom(clusterId: number, callback: (error: any, zoom: number) => void): this; - getClusterChildren(clusterId: number, callback: (error: any, features: GeoJSON.Feature[]) => void): this; + getClusterChildren(clusterId: number, callback: (error: any, features: GeoJSON.Feature[]) => void): this; - getClusterLeaves(cluserId: number, limit: number, offset: number, callback: (error: any, features: GeoJSON.Feature[]) => void): this; + getClusterLeaves(cluserId: number, limit: number, offset: number, callback: (error: any, features: GeoJSON.Feature[]) => void): this; } export interface GeoJSONSourceOptions { - data?: GeoJSON.Feature | GeoJSON.FeatureCollection | string; + data?: GeoJSON.Feature | GeoJSON.FeatureCollection | string; maxzoom?: number; @@ -1053,7 +1055,7 @@ declare namespace mapboxgl { base?: number; type?: 'identity' | 'exponential' | 'interval' | 'categorical'; default?: any; - 'colorSpace'?: 'rgb' | 'lab' | 'interval'; + 'colorSpace'?: 'rgb' | 'lab' | 'hcl'; } export interface BackgroundLayout { diff --git a/types/mapbox-gl/mapbox-gl-tests.ts b/types/mapbox-gl/mapbox-gl-tests.ts index 87297effda..783ee86f74 100644 --- a/types/mapbox-gl/mapbox-gl-tests.ts +++ b/types/mapbox-gl/mapbox-gl-tests.ts @@ -17,7 +17,8 @@ let map = new mapboxgl.Map({ minZoom: 1, maxZoom: 2, interactive: true, - attributionControl: false, + attributionControl: true, + customAttribution: '© YourCo', bearingSnap: 7, scrollZoom: true, maxBounds: [[-100,-90],[100,90]], @@ -387,6 +388,16 @@ let marker = new mapboxgl.Marker(undefined, {offset: [10, 0]}) .addTo(map); marker.remove(); + +/* + * LngLatBounds + */ let bool:boolean let bounds = new mapboxgl.LngLatBounds() bool = bounds.isEmpty() + +/* + * AttributionControl + */ +let attributionControl = new mapboxgl.AttributionControl({ compact: false, customAttribution: '© YourCo' }); +attributionControl.on('click', () => {}); diff --git a/types/mapbox__polyline/index.d.ts b/types/mapbox__polyline/index.d.ts new file mode 100644 index 0000000000..84845edb35 --- /dev/null +++ b/types/mapbox__polyline/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for mapbox__polyline 1.0 +// Project: https://github.com/mapbox/polyline +// Definitions by: Arseniy Maximov +// Marko Klopets +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +export function decode(string: string, precision?: number): number[][]; +export function encode(coordinates: number[][], precision?: number): string; +export function fromGeoJSON(geojson: GeoJSON.LineString | GeoJSON.Feature, precision?: number): string; +export function toGeoJSON(string: string, precision?: number): GeoJSON.LineString; + +export as namespace polyline; diff --git a/types/mapbox__polyline/mapbox__polyline-tests.ts b/types/mapbox__polyline/mapbox__polyline-tests.ts new file mode 100644 index 0000000000..d1cf46553f --- /dev/null +++ b/types/mapbox__polyline/mapbox__polyline-tests.ts @@ -0,0 +1,25 @@ +const decodedString: number[][] = polyline.decode('_p~iF~ps|U_ulLnnqC_mqNvxq`@'); +const decodedStringWithPrecision: number[][] = polyline.decode('_p~iF~ps|U_ulLnnqC_mqNvxq`@', 2); + +const encoded: string = polyline.encode([[38.5, -120.2], [40.7, -120.95], [43.252, -126.453]]); +const encodedWithPrecision: string = polyline.encode([[38.5, -120.2], [40.7, -120.95], [43.252, -126.453]], 2); + +const fromGeoJSON: string = polyline.fromGeoJSON({ + type: 'Feature', + geometry: { + type: 'LineString', + coordinates: [[-120.2, 38.5], [-120.95, 40.7], [-126.453, 43.252]] + }, + properties: {} +}); +const fromGeoJSONWithPrecision: string = polyline.fromGeoJSON({ + type: 'Feature', + geometry: { + type: 'LineString', + coordinates: [[-120.2, 38.5], [-120.95, 40.7], [-126.453, 43.252]] + }, + properties: {} +}, 3); + +const toGeoJSON: GeoJSON.LineString = polyline.toGeoJSON('_p~iF~ps|U_ulLnnqC_mqNvxq`@'); +const toGeoJSONWithPrecision: GeoJSON.LineString = polyline.toGeoJSON('_p~iF~ps|U_ulLnnqC_mqNvxq`@', 6); diff --git a/types/mapbox__polyline/tsconfig.json b/types/mapbox__polyline/tsconfig.json new file mode 100644 index 0000000000..2d044d5adc --- /dev/null +++ b/types/mapbox__polyline/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", + "mapbox__polyline-tests.ts" + ] +} diff --git a/types/mapbox__polyline/tslint.json b/types/mapbox__polyline/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/mapbox__polyline/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/megajs/index.d.ts b/types/megajs/index.d.ts new file mode 100644 index 0000000000..8162d6d648 --- /dev/null +++ b/types/megajs/index.d.ts @@ -0,0 +1,116 @@ +// Type definitions for megajs 0.14 +// Project: https://github.com/qgustavor/mega +// Definitions by: Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +import { Readable, Writable, Stream } from 'stream'; + +export interface AccountInfo { + type: string; + spaceUsed: number; + spaceTotal: number; + downloadBandwidthUsed: number; + downloadBandwidthTotal: number; + sharedBandwidthUsed: number; + sharedBandwidthLimit: number; +} + +export interface DownloadOptions { + maxConnections?: number; + initialChunkSize?: number; + chunkSizeIncrement?: number; + maxChunkSize?: number; + returnCiphertext?: boolean; + start?: any; + end?: any; +} + +export interface UploadOptions { + name: string; + attributes?: object; + size?: any; + thumbnailImage?: Buffer | Readable; + previewImage?: Buffer | Readable; +} + +export interface LinkOptions { + noKey?: boolean; + key?: string | Buffer; +} + +export interface MakeDirectoryOptions { + name: string; + attributes?: object; + key?: string | Buffer; +} + +export interface FileOptions { + downloadId: string; + key: string; + directory: boolean; +} + +export interface StorageOptions { + email: string; + password: string; + keepalive?: boolean; + autologin?: boolean; + autoload?: boolean; +} + +export class File { + constructor(options: FileOptions | string); + static fromURL(options: FileOptions | string): File; + static unpackAttributes(at: any): JSON; + name: string; + attributes: object; + size: number; + key: Buffer; + timestamp: number; + nodeId: string; + downloadId: string; + directory: boolean; + children: ReadonlyArray; + loadAttributes(cb?: any): Readable; + download(options?: DownloadOptions, cb?: any): Readable; +} + +export class Storage { + constructor(options: StorageOptions, callback?: any); + static fromJSON(json: JSON): Storage; + name: string; + key: Buffer; + sid: string; + files: {[id in string]: MutableFile}; + root: MutableFile; + trash: MutableFile; + inbox: MutableFile; + mounts: ReadonlyArray; + upload(options: UploadOptions | string, buffer?: Buffer, cb?: any): Writable; + mkdir(options: MakeDirectoryOptions | string, cb: (err: Error | undefined, file: MutableFile) => void): Readable; + reload(cb: any): Readable; + login(cb: any): Readable; + getAccountInfo(cb: any): AccountInfo; + toJSON(): JSON; +} + +export class MutableFile extends File { + constructor(options: FileOptions | string, storage: Storage); + upload(options: UploadOptions | string, buffer?: Buffer, cb?: any): Writable; + mkdir(options: MakeDirectoryOptions | string, cb?: any): Readable; + importFile(file: File | string, cb: (err: Error | undefined, file: MutableFile) => void): Readable; + link(options: LinkOptions | undefined, cb: (err: Error | undefined, url: string) => void): Readable; + shareFolder(options: LinkOptions | undefined, cb: (err: Error | undefined, url: string) => void): Readable; + delete(permanent: true | undefined, cb: (err: Error | undefined) => void): Readable; + moveTo(target: MutableFile | string, cb: (err: Error | undefined) => void): Readable; + setAttributes(attributes: object, cb: (err: Error | undefined) => void): Readable; + uploadAttribute(type: string | number, opt?: Buffer | Stream, cb?: any): Readable; + rename(newFileName: string, cb: (err: Error | undefined) => void): Readable; + setLabel(label: string, cb: (err: Error | undefined) => void): Readable; + setFavorite(isFavorite: boolean, cb: (err: Error | undefined) => void): Readable; +} + +export default function mega(options: StorageOptions, cb?: any): Storage; diff --git a/types/megajs/megajs-tests.ts b/types/megajs/megajs-tests.ts new file mode 100644 index 0000000000..862373c85a --- /dev/null +++ b/types/megajs/megajs-tests.ts @@ -0,0 +1,9 @@ +import mega from 'megajs'; + +// $ExpectType Storage +mega({email: 'test@test.net', password: '1234'}); + +// tslint:disable-next-line no-duplicate-imports +import { Storage } from 'megajs'; + +const storage = new Storage({email: 'test@test.net', password: '1234'}); diff --git a/types/megajs/tsconfig.json b/types/megajs/tsconfig.json new file mode 100644 index 0000000000..0e6bb53df1 --- /dev/null +++ b/types/megajs/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "megajs-tests.ts" + ] +} diff --git a/types/megajs/tslint.json b/types/megajs/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/megajs/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/meteor/accounts.d.ts b/types/meteor/accounts-base.d.ts similarity index 51% rename from types/meteor/accounts.d.ts rename to types/meteor/accounts-base.d.ts index b4e78c1664..6e25e71b07 100644 --- a/types/meteor/accounts.d.ts +++ b/types/meteor/accounts-base.d.ts @@ -1,54 +1,3 @@ -interface URLS { - resetPassword: (token: string) => string; - verifyEmail: (token: string) => string; - enrollAccount: (token: string) => string; -} - -interface EmailFields { - from?: () => string; - subject?: (user: Meteor.User) => string; - text?: (user: Meteor.User, url: string) => string; - html?: (user: Meteor.User, url: string) => string; -} - -declare module Accounts { - var urls: URLS; - - function user(): Meteor.User; - - function userId(): string; - - function createUser(options: { - username?: string; - email?: string; - password?: string; - profile?: Object; - }, callback?: Function): string; - - function config(options: { - sendVerificationEmail?: boolean; - forbidClientAccountCreation?: boolean; - restrictCreationByEmailDomain?: string | Function; - loginExpirationInDays?: number; - oauthSecretKey?: string; - passwordResetTokenExpirationInDays?: number; - passwordEnrollTokenExpirationInDays?: number; - ambiguousErrorMessages?: boolean; - }): void; - - function onLogin(func: Function): { - stop: () => void - }; - - function onLoginFailure(func: Function): { - stop: () => void - }; - - function loginServicesConfigured(): boolean; - - function onPageLoadLogin(func: Function): void; -} - declare module "meteor/accounts-base" { interface URLS { resetPassword: (token: string) => string; @@ -56,6 +5,13 @@ declare module "meteor/accounts-base" { enrollAccount: (token: string) => string; } + interface EmailFields { + from?: () => string; + subject?: (user: Meteor.User) => string; + text?: (user: Meteor.User, url: string) => string; + html?: (user: Meteor.User, url: string) => string; + } + module Accounts { var urls: URLS; @@ -93,42 +49,7 @@ declare module "meteor/accounts-base" { function onPageLoadLogin(func: Function): void; } -} -declare module Accounts { - function changePassword(oldPassword: string, newPassword: string, callback?: Function): void; - - function forgotPassword(options: { - email?: string; - }, callback?: Function): void; - - function resetPassword(token: string, newPassword: string, callback?: Function): void; - - function verifyEmail(token: string, callback?: Function): void; - - function onEmailVerificationLink(callback: Function): void; - - function onEnrollmentLink(callback: Function): void; - - function onResetPasswordLink(callback: Function): void; - - function loggingIn(): boolean; - - function logout(callback?: Function): void; - - function logoutOtherClients(callback?: Function): void; - - var ui: { - config(options: { - requestPermissions?: Object; - requestOfflineToken?: Object; - forceApprovalPrompt?: Object; - passwordSignupFields?: string; - }): void; - }; -} - -declare module "meteor/accounts-base" { module Accounts { function changePassword(oldPassword: string, newPassword: string, callback?: Function): void; @@ -161,72 +82,6 @@ declare module "meteor/accounts-base" { }): void; }; } -} - -interface Header { - [id: string]: string; -} - -interface EmailTemplates { - from: string; - siteName: string; - headers?: Header; - resetPassword: EmailFields; - enrollAccount: EmailFields; - verifyEmail: EmailFields; -} - -declare module Accounts { - var emailTemplates: EmailTemplates; - - function addEmail(userId: string, newEmail: string, verified?: boolean): void; - - function removeEmail(userId: string, email: string): void; - - function onCreateUser(func: Function): void; - - function findUserByEmail(email: string): Object; - - function findUserByUsername(username: string): Object; - - function sendEnrollmentEmail(userId: string, email?: string): void; - - function sendResetPasswordEmail(userId: string, email?: string): void; - - function sendVerificationEmail(userId: string, email?: string): void; - - function setUsername(userId: string, newUsername: string): void; - - function setPassword(userId: string, newPassword: string, options?: { - logout?: Object; - }): void; - - function validateNewUser(func: Function): boolean; - - function validateLoginAttempt(func: Function): { - stop: () => void - }; - - function _hashPassword(password: string): { digest: string; algorithm: string; }; - - interface IValidateLoginAttemptCbOpts { - type: string; - allowed: boolean; - error: Meteor.Error; - user: Meteor.User; - connection: Meteor.Connection; - methodName: string; - methodArguments: any[]; - } -} - -declare module "meteor/accounts-base" { - interface EmailFields { - from?: () => string; - subject?: (user: Meteor.User) => string; - text?: (user: Meteor.User, url: string) => string; - html?: (user: Meteor.User, url: string) => string; - } interface Header { [id: string]: string; @@ -284,23 +139,11 @@ declare module "meteor/accounts-base" { methodArguments: any[]; } } -} -declare module Accounts { - function onLogout(func: Function): void; -} - -declare module "meteor/accounts-base" { module Accounts { function onLogout(func: Function): void; } -} -declare module Accounts { - function onLogout(func: (user: Meteor.User, connection: Meteor.Connection) => void): void; -} - -declare module "meteor/accounts-base" { module Accounts { function onLogout(func: (user: Meteor.User, connection: Meteor.Connection) => void): void; } diff --git a/types/meteor/blaze.d.ts b/types/meteor/blaze.d.ts index dbb562558d..bd3b3cf79e 100644 --- a/types/meteor/blaze.d.ts +++ b/types/meteor/blaze.d.ts @@ -1,112 +1,3 @@ - -declare module Blaze { - var View: ViewStatic; - - interface ViewStatic { - new (name?: string, renderFunction?: Function): View; - } - - interface View { - name: string; - parentView: View; - isCreated: boolean; - isRendered: boolean; - isDestroyed: boolean; - renderCount: number; - autorun(runFunc: (computation: Tracker.Computation) => void): Tracker.Computation; - onViewCreated(func: Function): void; - onViewReady(func: Function): void; - onViewDestroyed(func: Function): void; - firstNode(): Node; - lastNode(): Node; - template: Template; - templateInstance(): TemplateInstance; - } - var currentView: View; - - function isTemplate(value: any): boolean; - - interface HelpersMap { - [key: string]: Function; - } - - interface EventsMap { - [key: string]: Function; - } - - var Template: TemplateStatic; - - interface TemplateStatic { - new (viewName?: string, renderFunction?: Function): Template; - - registerHelper(name: string, func: Function): void; - instance(): TemplateInstance; - currentData(): any; - parentData(numLevels: number): any; - } - - interface Template { - viewName: string; - renderFunction: Function; - constructView(): View; - head: Template; - find(selector: string): HTMLElement; - findAll(selector: string): HTMLElement[]; - $: any; - onCreated(cb: Function): void; - onRendered(cb: Function): void; - onDestroyed(cb: Function): void; - created: Function; - rendered: Function; - destroyed: Function; - helpers(helpersMap: HelpersMap): void; - events(eventsMap: EventsMap): void; - } - - var TemplateInstance: TemplateInstanceStatic; - - interface TemplateInstanceStatic { - new (view: View): TemplateInstance; - } - - interface TemplateInstance { - $(selector: string): any; - autorun(runFunc: (computation: Tracker.Computation) => void): Tracker.Computation; - data: Object; - find(selector: string): HTMLElement; - findAll(selector: string): HTMLElement[]; - firstNode: Object; - lastNode: Object; - subscribe(name: string, ...args: any[]): Meteor.SubscriptionHandle; - subscriptionsReady(): boolean; - view: Object; - } - - function Each(argFunc: Function, contentFunc: Function, elseFunc?: Function): View; - - function Unless(conditionFunc: Function, contentFunc: Function, elseFunc?: Function): View; - - function If(conditionFunc: Function, contentFunc: Function, elseFunc?: Function): View; - - function Let(bindings: Function, contentFunc: Function): View; - - function With(data: Object | Function, contentFunc: Function): View; - - function getData(elementOrView?: HTMLElement | View): Object; - - function getView(element?: HTMLElement): View; - - function remove(renderedView: View): void; - - function render(templateOrView: Template | View, parentNode: Node, nextNode?: Node, parentView?: View): View; - - function renderWithData(templateOrView: Template | View, data: Object | Function, parentNode: Node, nextNode?: Node, parentView?: View): View; - - function toHTML(templateOrView: Template | View): string; - - function toHTMLWithData(templateOrView: Template | View, data: Object | Function): string; -} - declare module "meteor/blaze" { module Blaze { var View: ViewStatic; diff --git a/types/meteor/browser-policy-common.d.ts b/types/meteor/browser-policy-common.d.ts index 6d82eab683..8926938976 100644 --- a/types/meteor/browser-policy-common.d.ts +++ b/types/meteor/browser-policy-common.d.ts @@ -1,39 +1,3 @@ - -declare module BrowserPolicy { - var framing: { - disallow(): void; - restrictToOrigin(origin: string): void; - allowAll(): void; - }; - - var content: { - allowEval(): void; - allowInlineStyles(): void; - allowInlineScripts(): void; - allowSameOriginForAll(): void; - allowDataUrlForAll(): void; - allowOriginForAll(origin: string): void; - allowImageOrigin(origin: string): void; - allowMediaOrigin(origin: string): void; - allowFontOrigin(origin: string): void; - allowStyleOrigin(origin: string): void; - allowScriptOrigin(origin: string): void; - allowFrameOrigin(origin: string): void; - allowContentTypeSniffing(): void; - allowAllContentOrigin(): void; - allowAllContentDataUrl(): void; - allowAllContentSameOrigin(): void; - - disallowAll(): void; - disallowInlineStyles(): void; - disallowEval(): void; - disallowInlineScripts(): void; - disallowFont(): void; - disallowObject(): void; - disallowAllContent(): void; - }; -} - declare module "meteor/browser-policy-common" { module BrowserPolicy { var framing: { @@ -55,10 +19,13 @@ declare module "meteor/browser-policy-common" { allowStyleOrigin(origin: string): void; allowScriptOrigin(origin: string): void; allowFrameOrigin(origin: string): void; + allowFrameAncestorsOrigin(origin: string): void; allowContentTypeSniffing(): void; allowAllContentOrigin(): void; allowAllContentDataUrl(): void; allowAllContentSameOrigin(): void; + allowConnectOrigin(origin: string): void; + allowObjectOrigin(origin: string): void; disallowAll(): void; disallowInlineStyles(): void; @@ -67,6 +34,7 @@ declare module "meteor/browser-policy-common" { disallowFont(): void; disallowObject(): void; disallowAllContent(): void; + disallowConnect(): void; }; } } diff --git a/types/meteor/check.d.ts b/types/meteor/check.d.ts index 57482cd3f5..065850fb4e 100644 --- a/types/meteor/check.d.ts +++ b/types/meteor/check.d.ts @@ -1,27 +1,3 @@ - -declare module Match { - var Any: any; - var String: any; - var Integer: any; - var Boolean: any; - var undefined: any; - var Object: any; - - function Maybe(pattern: any): boolean; - - function Optional(pattern: any): boolean; - - function ObjectIncluding(dico: any): boolean; - - function OneOf(...patterns: any[]): any; - - function Where(condition: any): any; - - function test(value: any, pattern: any): boolean; -} - -declare function check(value: any, pattern: any): void; - declare module "meteor/check" { module Match { var Any: any; diff --git a/types/meteor/ddp-rate-limiter.d.ts b/types/meteor/ddp-rate-limiter.d.ts index dc906f4ac1..86e47bf9ac 100644 --- a/types/meteor/ddp-rate-limiter.d.ts +++ b/types/meteor/ddp-rate-limiter.d.ts @@ -1,18 +1,3 @@ - -declare module DDPRateLimiter { - interface Matcher { - type?: string | ((type: string) => boolean); - name?: string | ((name: string) => boolean); - userId?: string | ((userId: string) => boolean); - connectionId?: string | ((connectionId: string) => boolean); - clientAddress?: string | ((clientAddress: string) => boolean); - } - - function addRule(matcher: Matcher, numRequests: number, timeInterval: number): string; - - function removeRule(ruleId: string): boolean; -} - declare module "meteor/ddp-rate-limiter" { module DDPRateLimiter { interface Matcher { diff --git a/types/meteor/ddp.d.ts b/types/meteor/ddp.d.ts index 083244d601..ea4ca4fc96 100644 --- a/types/meteor/ddp.d.ts +++ b/types/meteor/ddp.d.ts @@ -1,42 +1,3 @@ - - -declare module DDP { - interface DDPStatic { - subscribe(name: string, ...rest: any[]): Meteor.SubscriptionHandle; - call(method: string, ...parameters: any[]): void; - apply(method: string, ...parameters: any[]): void; - methods(IMeteorMethodsDictionary: any): any; - status(): DDPStatus; - reconnect(): void; - disconnect(): void; - onReconnect(): void; - } - - function _allSubscriptionsReady(): boolean; - - type Status = 'connected' | 'connecting' | 'failed' | 'waiting' | 'offline'; - - interface DDPStatus { - connected: boolean; - status: Status; - retryCount: number; - retryTime?: number; - reason?: string; - } - - function connect(url: string): DDPStatic; -} - -declare module DDPCommon { - interface MethodInvocation { - new (options: {}): MethodInvocation; - - unblock(): void; - - setUserId(userId: number): void; - } -} - declare module "meteor/ddp" { module DDP { interface DDPStatic { diff --git a/types/meteor/ejson.d.ts b/types/meteor/ejson.d.ts index aa5cd0f5f9..3c9f161097 100644 --- a/types/meteor/ejson.d.ts +++ b/types/meteor/ejson.d.ts @@ -1,41 +1,3 @@ -interface EJSONableCustomType { - clone?(): EJSONableCustomType; - equals?(other: Object): boolean; - toJSONValue(): JSONable; - typeName(): string; -} -interface EJSONable { - [key: string]: number | string | boolean | Object | number[] | string[] | Object[] | Date | Uint8Array | EJSONableCustomType | undefined | null; -} -interface JSONable { - [key: string]: number | string | boolean | Object | number[] | string[] | Object[] | undefined | null; -} -interface EJSON extends EJSONable { } - -declare module EJSON { - function addType(name: string, factory: (val: JSONable) => EJSONableCustomType): void; - - function clone(val: T): T; - - function equals(a: EJSON, b: EJSON, options?: { - keyOrderSensitive?: boolean; - }): boolean; - - function fromJSONValue(val: JSONable): any; - - function isBinary(x: Object): boolean; - var newBinary: any; - - function parse(str: string): EJSON; - - function stringify(val: EJSON, options?: { - indent?: boolean | number | string; - canonical?: boolean; - }): string; - - function toJSONValue(val: EJSON): JSONable; -} - declare module "meteor/ejson" { interface EJSONableCustomType { clone?(): EJSONableCustomType; diff --git a/types/meteor/email.d.ts b/types/meteor/email.d.ts index 0e0e81590d..464dbed8a9 100644 --- a/types/meteor/email.d.ts +++ b/types/meteor/email.d.ts @@ -1,38 +1,3 @@ -declare module Email { - function send(options: { - from?: string; - to?: string | string[]; - cc?: string | string[]; - bcc?: string | string[]; - replyTo?: string | string[]; - subject?: string; - text?: string; - html?: string; - headers?: Object; - attachments?: Object[]; - mailComposer?: MailComposer; - }): void; -} - -interface MailComposerOptions { - escapeSMTP: boolean; - encoding: string; - charset: string; - keepBcc: boolean; - forceEmbeddedImages: boolean; -} - -declare var MailComposer: MailComposerStatic; -interface MailComposerStatic { - new (options: MailComposerOptions): MailComposer; -} -interface MailComposer { - addHeader(name: string, value: string): void; - setMessageOption(from: string, to: string, body: string, html: string): void; - streamMessage(): void; - pipe(stream: any /** fs.WriteStream **/): void; -} - declare module "meteor/email" { module Email { function send(options: { diff --git a/types/meteor/globals/README.md b/types/meteor/globals/README.md new file mode 100644 index 0000000000..b9e3615b2b --- /dev/null +++ b/types/meteor/globals/README.md @@ -0,0 +1,3 @@ +This `globals/` directory is generated by `scripts/generate-globals`! To update +this directory, edit the corresponding files outside `globals/` and re-run +`scripts/generate-globals`. \ No newline at end of file diff --git a/types/meteor/globals/accounts-base.d.ts b/types/meteor/globals/accounts-base.d.ts new file mode 100644 index 0000000000..f7b914f734 --- /dev/null +++ b/types/meteor/globals/accounts-base.d.ts @@ -0,0 +1,148 @@ +declare interface URLS { + resetPassword: (token: string) => string; + verifyEmail: (token: string) => string; + enrollAccount: (token: string) => string; +} + +declare interface EmailFields { + from?: () => string; + subject?: (user: Meteor.User) => string; + text?: (user: Meteor.User, url: string) => string; + html?: (user: Meteor.User, url: string) => string; +} + +declare module Accounts { + var urls: URLS; + + function user(): Meteor.User; + + function userId(): string; + + function createUser(options: { + username?: string; + email?: string; + password?: string; + profile?: Object; + }, callback?: Function): string; + + function config(options: { + sendVerificationEmail?: boolean; + forbidClientAccountCreation?: boolean; + restrictCreationByEmailDomain?: string | Function; + loginExpirationInDays?: number; + oauthSecretKey?: string; + passwordResetTokenExpirationInDays?: number; + passwordEnrollTokenExpirationInDays?: number; + ambiguousErrorMessages?: boolean; + }): void; + + function onLogin(func: Function): { + stop: () => void + }; + + function onLoginFailure(func: Function): { + stop: () => void + }; + + function loginServicesConfigured(): boolean; + + function onPageLoadLogin(func: Function): void; +} + +declare module Accounts { + function changePassword(oldPassword: string, newPassword: string, callback?: Function): void; + + function forgotPassword(options: { + email?: string; + }, callback?: Function): void; + + function resetPassword(token: string, newPassword: string, callback?: Function): void; + + function verifyEmail(token: string, callback?: Function): void; + + function onEmailVerificationLink(callback: Function): void; + + function onEnrollmentLink(callback: Function): void; + + function onResetPasswordLink(callback: Function): void; + + function loggingIn(): boolean; + + function logout(callback?: Function): void; + + function logoutOtherClients(callback?: Function): void; + + var ui: { + config(options: { + requestPermissions?: Object; + requestOfflineToken?: Object; + forceApprovalPrompt?: Object; + passwordSignupFields?: string; + }): void; + }; +} + +declare interface Header { + [id: string]: string; +} + +declare interface EmailTemplates { + from: string; + siteName: string; + headers?: Header; + resetPassword: EmailFields; + enrollAccount: EmailFields; + verifyEmail: EmailFields; +} + +declare module Accounts { + var emailTemplates: EmailTemplates; + + function addEmail(userId: string, newEmail: string, verified?: boolean): void; + + function removeEmail(userId: string, email: string): void; + + function onCreateUser(func: Function): void; + + function findUserByEmail(email: string): Object; + + function findUserByUsername(username: string): Object; + + function sendEnrollmentEmail(userId: string, email?: string): void; + + function sendResetPasswordEmail(userId: string, email?: string): void; + + function sendVerificationEmail(userId: string, email?: string): void; + + function setUsername(userId: string, newUsername: string): void; + + function setPassword(userId: string, newPassword: string, options?: { + logout?: Object; + }): void; + + function validateNewUser(func: Function): boolean; + + function validateLoginAttempt(func: Function): { + stop: () => void + }; + + function _hashPassword(password: string): { digest: string; algorithm: string; }; + + interface IValidateLoginAttemptCbOpts { + type: string; + allowed: boolean; + error: Meteor.Error; + user: Meteor.User; + connection: Meteor.Connection; + methodName: string; + methodArguments: any[]; + } +} + +declare module Accounts { + function onLogout(func: Function): void; +} + +declare module Accounts { + function onLogout(func: (user: Meteor.User, connection: Meteor.Connection) => void): void; +} diff --git a/types/meteor/globals/blaze.d.ts b/types/meteor/globals/blaze.d.ts new file mode 100644 index 0000000000..2082382100 --- /dev/null +++ b/types/meteor/globals/blaze.d.ts @@ -0,0 +1,107 @@ +declare module Blaze { + var View: ViewStatic; + + interface ViewStatic { + new (name?: string, renderFunction?: Function): View; + } + + interface View { + name: string; + parentView: View; + isCreated: boolean; + isRendered: boolean; + isDestroyed: boolean; + renderCount: number; + autorun(runFunc: (computation: Tracker.Computation) => void): Tracker.Computation; + onViewCreated(func: Function): void; + onViewReady(func: Function): void; + onViewDestroyed(func: Function): void; + firstNode(): Node; + lastNode(): Node; + template: Template; + templateInstance(): TemplateInstance; + } + var currentView: View; + + function isTemplate(value: any): boolean; + + interface HelpersMap { + [key: string]: Function; + } + + interface EventsMap { + [key: string]: Function; + } + + var Template: TemplateStatic; + + interface TemplateStatic { + new (viewName?: string, renderFunction?: Function): Template; + + registerHelper(name: string, func: Function): void; + instance(): TemplateInstance; + currentData(): any; + parentData(numLevels: number): any; + } + + interface Template { + viewName: string; + renderFunction: Function; + constructView(): View; + head: Template; + find(selector: string): HTMLElement; + findAll(selector: string): HTMLElement[]; + $: any; + onCreated(cb: Function): void; + onRendered(cb: Function): void; + onDestroyed(cb: Function): void; + created: Function; + rendered: Function; + destroyed: Function; + helpers(helpersMap: HelpersMap): void; + events(eventsMap: EventsMap): void; + } + + var TemplateInstance: TemplateInstanceStatic; + + interface TemplateInstanceStatic { + new (view: View): TemplateInstance; + } + + interface TemplateInstance { + $(selector: string): any; + autorun(runFunc: (computation: Tracker.Computation) => void): Tracker.Computation; + data: Object; + find(selector: string): HTMLElement; + findAll(selector: string): HTMLElement[]; + firstNode: Object; + lastNode: Object; + subscribe(name: string, ...args: any[]): Meteor.SubscriptionHandle; + subscriptionsReady(): boolean; + view: Object; + } + + function Each(argFunc: Function, contentFunc: Function, elseFunc?: Function): View; + + function Unless(conditionFunc: Function, contentFunc: Function, elseFunc?: Function): View; + + function If(conditionFunc: Function, contentFunc: Function, elseFunc?: Function): View; + + function Let(bindings: Function, contentFunc: Function): View; + + function With(data: Object | Function, contentFunc: Function): View; + + function getData(elementOrView?: HTMLElement | View): Object; + + function getView(element?: HTMLElement): View; + + function remove(renderedView: View): void; + + function render(templateOrView: Template | View, parentNode: Node, nextNode?: Node, parentView?: View): View; + + function renderWithData(templateOrView: Template | View, data: Object | Function, parentNode: Node, nextNode?: Node, parentView?: View): View; + + function toHTML(templateOrView: Template | View): string; + + function toHTMLWithData(templateOrView: Template | View, data: Object | Function): string; +} diff --git a/types/meteor/globals/browser-policy-common.d.ts b/types/meteor/globals/browser-policy-common.d.ts new file mode 100644 index 0000000000..826065844f --- /dev/null +++ b/types/meteor/globals/browser-policy-common.d.ts @@ -0,0 +1,34 @@ +declare module BrowserPolicy { + var framing: { + disallow(): void; + restrictToOrigin(origin: string): void; + allowAll(): void; + }; + + var content: { + allowEval(): void; + allowInlineStyles(): void; + allowInlineScripts(): void; + allowSameOriginForAll(): void; + allowDataUrlForAll(): void; + allowOriginForAll(origin: string): void; + allowImageOrigin(origin: string): void; + allowMediaOrigin(origin: string): void; + allowFontOrigin(origin: string): void; + allowStyleOrigin(origin: string): void; + allowScriptOrigin(origin: string): void; + allowFrameOrigin(origin: string): void; + allowContentTypeSniffing(): void; + allowAllContentOrigin(): void; + allowAllContentDataUrl(): void; + allowAllContentSameOrigin(): void; + + disallowAll(): void; + disallowInlineStyles(): void; + disallowEval(): void; + disallowInlineScripts(): void; + disallowFont(): void; + disallowObject(): void; + disallowAllContent(): void; + }; +} diff --git a/types/meteor/globals/check.d.ts b/types/meteor/globals/check.d.ts new file mode 100644 index 0000000000..1b1ec39736 --- /dev/null +++ b/types/meteor/globals/check.d.ts @@ -0,0 +1,22 @@ +declare module Match { + var Any: any; + var String: any; + var Integer: any; + var Boolean: any; + var undefined: any; + var Object: any; + + function Maybe(pattern: any): boolean; + + function Optional(pattern: any): boolean; + + function ObjectIncluding(dico: any): boolean; + + function OneOf(...patterns: any[]): any; + + function Where(condition: any): any; + + function test(value: any, pattern: any): boolean; +} + +declare function check(value: any, pattern: any): void; diff --git a/types/meteor/globals/ddp-rate-limiter.d.ts b/types/meteor/globals/ddp-rate-limiter.d.ts new file mode 100644 index 0000000000..5093837eb1 --- /dev/null +++ b/types/meteor/globals/ddp-rate-limiter.d.ts @@ -0,0 +1,13 @@ +declare module DDPRateLimiter { + interface Matcher { + type?: string | ((type: string) => boolean); + name?: string | ((name: string) => boolean); + userId?: string | ((userId: string) => boolean); + connectionId?: string | ((connectionId: string) => boolean); + clientAddress?: string | ((clientAddress: string) => boolean); + } + + function addRule(matcher: Matcher, numRequests: number, timeInterval: number): string; + + function removeRule(ruleId: string): boolean; +} diff --git a/types/meteor/globals/ddp.d.ts b/types/meteor/globals/ddp.d.ts new file mode 100644 index 0000000000..2b92528391 --- /dev/null +++ b/types/meteor/globals/ddp.d.ts @@ -0,0 +1,36 @@ +declare module DDP { + interface DDPStatic { + subscribe(name: string, ...rest: any[]): Meteor.SubscriptionHandle; + call(method: string, ...parameters: any[]): void; + apply(method: string, ...parameters: any[]): void; + methods(IMeteorMethodsDictionary: any): any; + status(): DDPStatus; + reconnect(): void; + disconnect(): void; + onReconnect(): void; + } + + function _allSubscriptionsReady(): boolean; + + type Status = 'connected' | 'connecting' | 'failed' | 'waiting' | 'offline'; + + interface DDPStatus { + connected: boolean; + status: Status; + retryCount: number; + retryTime?: number; + reason?: string; + } + + function connect(url: string): DDPStatic; +} + +declare module DDPCommon { + interface MethodInvocation { + new (options: {}): MethodInvocation; + + unblock(): void; + + setUserId(userId: number): void; + } +} diff --git a/types/meteor/globals/ejson.d.ts b/types/meteor/globals/ejson.d.ts new file mode 100644 index 0000000000..3a85075c6b --- /dev/null +++ b/types/meteor/globals/ejson.d.ts @@ -0,0 +1,37 @@ +declare interface EJSONableCustomType { + clone?(): EJSONableCustomType; + equals?(other: Object): boolean; + toJSONValue(): JSONable; + typeName(): string; +} +declare interface EJSONable { + [key: string]: number | string | boolean | Object | number[] | string[] | Object[] | Date | Uint8Array | EJSONableCustomType | undefined | null; +} +declare interface JSONable { + [key: string]: number | string | boolean | Object | number[] | string[] | Object[] | undefined | null; +} +declare interface EJSON extends EJSONable { } + +declare module EJSON { + function addType(name: string, factory: (val: JSONable) => EJSONableCustomType): void; + + function clone(val: T): T; + + function equals(a: EJSON, b: EJSON, options?: { + keyOrderSensitive?: boolean; + }): boolean; + + function fromJSONValue(val: JSONable): any; + + function isBinary(x: Object): boolean; + var newBinary: any; + + function parse(str: string): EJSON; + + function stringify(val: EJSON, options?: { + indent?: boolean | number | string; + canonical?: boolean; + }): string; + + function toJSONValue(val: EJSON): JSONable; +} diff --git a/types/meteor/globals/email.d.ts b/types/meteor/globals/email.d.ts new file mode 100644 index 0000000000..f80528893b --- /dev/null +++ b/types/meteor/globals/email.d.ts @@ -0,0 +1,34 @@ +declare module Email { + function send(options: { + from?: string; + to?: string | string[]; + cc?: string | string[]; + bcc?: string | string[]; + replyTo?: string | string[]; + subject?: string; + text?: string; + html?: string; + headers?: Object; + attachments?: Object[]; + mailComposer?: MailComposer; + }): void; +} + +declare interface MailComposerOptions { + escapeSMTP: boolean; + encoding: string; + charset: string; + keepBcc: boolean; + forceEmbeddedImages: boolean; +} + +declare var MailComposer: MailComposerStatic; +declare interface MailComposerStatic { + new (options: MailComposerOptions): MailComposer; +} +declare interface MailComposer { + addHeader(name: string, value: string): void; + setMessageOption(from: string, to: string, body: string, html: string): void; + streamMessage(): void; + pipe(stream: any /** fs.WriteStream **/): void; +} diff --git a/types/meteor/globals/http.d.ts b/types/meteor/globals/http.d.ts new file mode 100644 index 0000000000..88a67fe790 --- /dev/null +++ b/types/meteor/globals/http.d.ts @@ -0,0 +1,48 @@ +declare module HTTP { + interface HTTPRequest { + content?: string; + data?: any; + query?: string; + params?: { + [id: string]: string + }; + auth?: string; + headers?: { + [id: string]: string + }; + timeout?: number; + followRedirects?: boolean; + } + + interface HTTPResponse { + statusCode?: number; + headers?: { + [id: string]: string + }; + content?: string; + data?: any; + } + + function call(method: string, url: string, options?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; + + function del(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; + + function get(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; + + function post(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; + + function put(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; + + function call(method: string, url: string, options?: { + content?: string; + data?: Object; + query?: string; + params?: Object; + auth?: string; + headers?: Object; + timeout?: number; + followRedirects?: boolean; + npmRequestOptions?: Object; + beforeSend?: Function; + }, asyncCallback?: Function): HTTP.HTTPResponse; +} diff --git a/types/meteor/globals/meteor.d.ts b/types/meteor/globals/meteor.d.ts new file mode 100644 index 0000000000..7a90b0611e --- /dev/null +++ b/types/meteor/globals/meteor.d.ts @@ -0,0 +1,220 @@ +declare module Meteor { + /** Global props **/ + var isClient: boolean; + var isCordova: boolean; + var isServer: boolean; + var isProduction: boolean; + var release: string; + /** Global props **/ + + /** Settings **/ + interface Settings { + public: { + [id: string]: any + }, [id: string]: any + } + var settings: Settings; + /** Settings **/ + + /** User **/ + interface UserEmail { + address: string; + verified: boolean; + } + interface User { + _id?: string; + username?: string; + emails?: UserEmail[]; + createdAt?: number; + profile?: any; + services?: any; + } + + function user(): User; + + function userId(): string; + var users: Mongo.Collection; + /** User **/ + + /** Error **/ + var Error: ErrorStatic; + interface ErrorStatic { + new (error: string | number, reason?: string, details?: string): Error; + } + interface Error { + error: string | number; + reason?: string; + details?: string; + } + /** Error **/ + + /** Method **/ + function methods(methods: Object): void; + + function call(name: string, ...args: any[]): any; + + function apply(name: string, args: EJSONable[], options?: { + wait?: boolean; + onResultReceived?: Function; + returnStubValue?: boolean; + throwStubExceptions?: boolean; + }, asyncCallback?: Function): any; + /** Method **/ + + /** Url **/ + function absoluteUrl(path?: string, options?: { + secure?: boolean; + replaceLocalhost?: boolean; + rootUrl?: string; + }): string; + /** Url **/ + + /** Timeout **/ + function setInterval(func: Function, delay: number): number; + + function setTimeout(func: Function, delay: number): number; + + function clearInterval(id: number): void; + + function clearTimeout(id: number): void; + + function defer(func: Function): void; + /** Timeout **/ + + /** utils **/ + function startup(func: Function): void; + + function wrapAsync(func: Function, context?: Object): any; + + function bindEnvironment(func: Function): any; + /** utils **/ + + /** Pub/Sub **/ + interface SubscriptionHandle { + stop(): void; + ready(): boolean; + } + interface LiveQueryHandle { + stop(): void; + } + /** Pub/Sub **/ +} + +declare module Meteor { + /** Login **/ + interface LoginWithExternalServiceOptions { + requestPermissions?: string[]; + requestOfflineToken?: Boolean; + forceApprovalPrompt?: Boolean; + loginUrlParameters?: Object; + redirectUrl?: string; + loginHint?: string; + loginStyle?: string; + } + + function loginWithMeteorDeveloperAccount(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loginWithFacebook(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loginWithGithub(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loginWithGoogle(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loginWithMeetup(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loginWithTwitter(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loginWithWeibo(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loggingIn(): boolean; + + function loginWith(options?: { + requestPermissions?: string[]; + requestOfflineToken?: boolean; + loginUrlParameters?: Object; + userEmail?: string; + loginStyle?: string; + redirectUrl?: string; + }, callback?: Function): void; + + function loginWithPassword(user: Object | string, password: string, callback?: Function): void; + + function loginWithToken(token: string, callback?: Function): void; + + function logout(callback?: Function): void; + + function logoutOtherClients(callback?: Function): void; + /** Login **/ + + /** Event **/ + interface Event { + type: string; + target: HTMLElement; + currentTarget: HTMLElement; + which: number; + stopPropagation(): void; + stopImmediatePropagation(): void; + preventDefault(): void; + isPropagationStopped(): boolean; + isImmediatePropagationStopped(): boolean; + isDefaultPrevented(): boolean; + } + interface EventHandlerFunction extends Function { + (event?: Meteor.Event, templateInstance?: Blaze.TemplateInstance): void; + } + interface EventMap { + [id: string]: Meteor.EventHandlerFunction; + } + /** Event **/ + + /** Connection **/ + function reconnect(): void; + + function disconnect(): void; + /** Connection **/ + + /** Status **/ + function status(): DDP.DDPStatus; + /** Status **/ + + /** Pub/Sub **/ + function subscribe(name: string, ...args: any[]): Meteor.SubscriptionHandle; + /** Pub/Sub **/ +} + +declare module Meteor { + /** Connection **/ + interface Connection { + id: string; + close: Function; + onClose: Function; + clientAddress: string; + httpHeaders: Object; + } + + function onConnection(callback: Function): void; + /** Connection **/ + + function publish(name: string, func: Function): void; + + function _debug(...args: any[]): void; +} + +declare interface Subscription { + added(collection: string, id: string, fields: Object): void; + changed(collection: string, id: string, fields: Object): void; + connection: Meteor.Connection; + error(error: Error): void; + onStop(func: Function): void; + ready(): void; + removed(collection: string, id: string): void; + stop(): void; + userId: string; +} + +declare module Meteor { + /** Global props **/ + var isDevelopment: boolean; + var isTest: boolean; + /** Global props **/ +} diff --git a/types/meteor/globals/mongo.d.ts b/types/meteor/globals/mongo.d.ts new file mode 100644 index 0000000000..108008febe --- /dev/null +++ b/types/meteor/globals/mongo.d.ts @@ -0,0 +1,234 @@ +declare module Mongo { + + type BsonType = 1 | "double" | + 2 | "string" | + 3 | "object" | + 4 | "array" | + 5 | "binData" | + 6 | "undefined" | + 7 | "objectId" | + 8 | "bool" | + 9 | "date" | + 10 | "null" | + 11 | "regex" | + 12 | "dbPointer" | + 13 | "javascript" | + 14 | "symbol" | + 15 | "javascriptWithScope" | + 16 | "int" | + 17 | "timestamp" | + 18 | "long" | + 19 | "decimal" | + -1 | "minKey" | + 127 | "maxKey" | "number" + + type FieldExpression = { + $eq?: T, + $gt?: T, + $gte?: T, + $lt?: T, + $lte?: T, + $in?: T[], + $nin?: T[], + $ne?: T, + $exists?: boolean, + $type?: BsonType[] | BsonType, + $not?: FieldExpression, + $expr?: FieldExpression, + $jsonSchema?: any, + $mod?: number[], + $regex?: RegExp | string, + $options?: string, + $text?: { $search: string, $language?: string, $caseSensitive?: boolean, $diacriticSensitive?: boolean }, + $where?: string | Function, + $geoIntersects?: any, + $geoWithin?: any, + $near?: any, + $nearSphere?: any, + $all?: T[], + $elemMatch?: T extends {} ? Query : FieldExpression, + $size?: number, + $bitsAllClear?: any, + $bitsAllSet?: any, + $bitsAnyClear?: any, + $bitsAnySet?: any, + $comment?: string + } + + type Flatten = T extends any[] ? T[0] : T + + type Query = { + [P in keyof T]?: Flatten | RegExp | FieldExpression> + } & { + $or?: Query[], + $and?: Query[], + $nor?: Query[] + } & Dictionary + + type QueryWithModifiers = { + $query: Query, + $comment?: string, + $explain?: any, + $hint?: any, + $maxScan?: any, + $max?: any, + $maxTimeMS?: any, + $min?: any, + $orderby?: any, + $returnKey?: any, + $showDiskLoc?: any, + $natural?: any + } + + type Selector = Query | QueryWithModifiers + + type Dictionary = { [key: string]: T } + type PartialMapTo = Partial> + type OnlyArrays = T extends any[] ? T : never; + type OnlyElementsOfArrays = T extends any[] ? Partial : never + type ElementsOf = { + [P in keyof T]?: OnlyElementsOfArrays + } + type PushModifier = { + [P in keyof T]?: + OnlyElementsOfArrays | + { $each?: T[P], $position?: number, $slice?: number, $sort?: 1 | -1 | Dictionary } + } + type ArraysOrEach = { + [P in keyof T]?: OnlyArrays | { $each: T[P] } + } + type CurrentDateModifier = { $type: "timestamp" | "date" } | true + type Modifier = T | { + $currentDate?: Partial> & Dictionary, + $inc?: PartialMapTo & Dictionary, + $min?: PartialMapTo & Dictionary, + $max?: PartialMapTo & Dictionary, + $mul?: PartialMapTo & Dictionary, + $rename?: PartialMapTo & Dictionary, + $set?: Partial & Dictionary, + $setOnInsert?: Partial & Dictionary, + $unset?: PartialMapTo & Dictionary, + $addToSet?: ArraysOrEach & Dictionary, + $push?: PushModifier & Dictionary, + $pull?: ElementsOf & Dictionary, + $pullAll?: Partial & Dictionary, + $pop?: PartialMapTo & Dictionary<1 | -1>, + } + + + interface SortSpecifier { } + interface FieldSpecifier { + [id: string]: Number; + } + + var Collection: CollectionStatic; + interface CollectionStatic { + new (name: string, options?: { + connection?: Object | null; + idGeneration?: string; + transform?: Function; + }): Collection; + } + interface Collection { + allow(options: { + insert?: (userId: string, doc: T) => boolean; + update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; + remove?: (userId: string, doc: T) => boolean; + fetch?: string[]; + transform?: Function; + }): boolean; + deny(options: { + insert?: (userId: string, doc: T) => boolean; + update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; + remove?: (userId: string, doc: T) => boolean; + fetch?: string[]; + transform?: Function; + }): boolean; + find(selector?: Selector | ObjectID | string, options?: { + sort?: SortSpecifier; + skip?: number; + limit?: number; + fields?: FieldSpecifier; + reactive?: boolean; + transform?: Function; + }): Cursor; + findOne(selector?: Selector | ObjectID | string, options?: { + sort?: SortSpecifier; + skip?: number; + fields?: FieldSpecifier; + reactive?: boolean; + transform?: Function; + }): T; + insert(doc: T, callback?: Function): string; + rawCollection(): any; + rawDatabase(): any; + remove(selector: Selector | ObjectID | string, callback?: Function): number; + update(selector: Selector | ObjectID | string, modifier: Modifier, options?: { + multi?: boolean; + upsert?: boolean; + }, callback?: Function): number; + upsert(selector: Selector | ObjectID | string, modifier: Modifier, options?: { + multi?: boolean; + }, callback?: Function): { + numberAffected?: number; insertedId?: string; + }; + _ensureIndex(keys: { + [key: string]: number | string + } | string, options?: { + [key: string]: any + }): void; + _dropIndex(keys: { + [key: string]: number | string + } | string): void; + } + + var Cursor: CursorStatic; + interface CursorStatic { + new (): Cursor; + } + interface ObserveCallbacks { + added?(document: Object): void; + addedAt?(document: Object, atIndex: number, before: Object): void; + changed?(newDocument: Object, oldDocument: Object): void; + changedAt?(newDocument: Object, oldDocument: Object, indexAt: number): void; + removed?(oldDocument: Object): void; + removedAt?(oldDocument: Object, atIndex: number): void; + movedTo?(document: Object, fromIndex: number, toIndex: number, before: Object): void; + } + interface ObserveChangesCallbacks { + added?(id: string, fields: Object): void; + addedBefore?(id: string, fields: Object, before: Object): void; + changed?(id: string, fields: Object): void; + movedBefore?(id: string, before: Object): void; + removed?(id: string): void; + } + interface Cursor { + count(applySkipLimit?: boolean): number; + fetch(): Array; + forEach(callback: (doc: T, index: number, cursor: Cursor) => void, thisArg?: any): void; + map(callback: (doc: T, index: number, cursor: Cursor) => U, thisArg?: any): Array; + observe(callbacks: ObserveCallbacks): Meteor.LiveQueryHandle; + observeChanges(callbacks: ObserveChangesCallbacks): Meteor.LiveQueryHandle; + } + + var ObjectID: ObjectIDStatic; + interface ObjectIDStatic { + new(hexString?: string): ObjectID; + } + interface ObjectID { + toHexString(): string; + equals(otherID: ObjectID): boolean; + } + + function setConnectionOptions(options: any): void; +} + +declare module Mongo { + interface AllowDenyOptions { + insert?: (userId: string, doc: any) => boolean; + update?: (userId: string, doc: any, fieldNames: string[], modifier: any) => boolean; + remove?: (userId: string, doc: any) => boolean; + fetch?: string[]; + transform?: Function; + } +} diff --git a/types/meteor/globals/random.d.ts b/types/meteor/globals/random.d.ts new file mode 100644 index 0000000000..db334d98c6 --- /dev/null +++ b/types/meteor/globals/random.d.ts @@ -0,0 +1,13 @@ +declare module Random { + function id(numberOfChars?: number): string; + + function secret(numberOfChars?: number): string; + + function fraction(): number; + // @param numberOfDigits, @returns a random hex string of the given length + function hexString(numberOfDigits: number): string; + // @param array, @return a random element in array + function choice(array: any[]): string; + // @param str, @return a random char in str + function choice(str: string): string; +} diff --git a/types/meteor/globals/reactive-var.d.ts b/types/meteor/globals/reactive-var.d.ts new file mode 100644 index 0000000000..5d322ad27b --- /dev/null +++ b/types/meteor/globals/reactive-var.d.ts @@ -0,0 +1,8 @@ +declare var ReactiveVar: ReactiveVarStatic; +declare interface ReactiveVarStatic { + new (initialValue: T, equalsFunc?: Function): ReactiveVar; +} +declare interface ReactiveVar { + get(): T; + set(newValue: T): void; +} diff --git a/types/meteor/globals/session.d.ts b/types/meteor/globals/session.d.ts new file mode 100644 index 0000000000..1e7c4f24f2 --- /dev/null +++ b/types/meteor/globals/session.d.ts @@ -0,0 +1,9 @@ +declare module Session { + function equals(key: string, value: string | number | boolean | any): boolean; + + function get(key: string): any; + + function set(key: string, value: EJSONable | any): void; + + function setDefault(key: string, value: EJSONable | any): void; +} diff --git a/types/meteor/globals/templating.d.ts b/types/meteor/globals/templating.d.ts new file mode 100644 index 0000000000..5962fb9a71 --- /dev/null +++ b/types/meteor/globals/templating.d.ts @@ -0,0 +1,6 @@ +declare var Template: TemplateStatic; +declare interface TemplateStatic extends Blaze.TemplateStatic { + new (viewName?: string, renderFunction?: Function): Blaze.Template; + body: Blaze.Template; + [index: string]: any | Blaze.Template; +} diff --git a/types/meteor/globals/tiny-test.d.ts b/types/meteor/globals/tiny-test.d.ts new file mode 100644 index 0000000000..1289d87d23 --- /dev/null +++ b/types/meteor/globals/tiny-test.d.ts @@ -0,0 +1,36 @@ +declare interface ILengthAble { + length: number; +} + +declare interface ITinytestAssertions { + ok(doc: Object): void; + expect_fail(): void; + fail(doc: Object): void; + runId(): string; + equal(actual: T, expected: T, message?: string, not?: boolean): void; + notEqual(actual: T, expected: T, message?: string): void; + instanceOf(obj: Object, klass: Function, message?: string): void; + notInstanceOf(obj: Object, klass: Function, message?: string): void; + matches(actual: any, regexp: RegExp, message?: string): void; + notMatches(actual: any, regexp: RegExp, message?: string): void; + throws(f: Function, expected?: string | RegExp): void; + isTrue(v: boolean, msg?: string): void; + isFalse(v: boolean, msg?: string): void; + isNull(v: any, msg?: string): void; + isNotNull(v: any, msg?: string): void; + isUndefined(v: any, msg?: string): void; + isNotUndefined(v: any, msg?: string): void; + isNan(v: any, msg?: string): void; + isNotNan(v: any, msg?: string): void; + include(s: Array | Object | string, value: any, msg?: string, not?: boolean): void; + + notInclude(s: Array | Object | string, value: any, msg?: string, not?: boolean): void; + length(obj: ILengthAble, expected_length: number, msg?: string): void; + _stringEqual(actual: string, expected: string, msg?: string): void; +} + +declare module Tinytest { + function add(description: string, func: (test: ITinytestAssertions) => void): void; + + function addAsync(description: string, func: (test: ITinytestAssertions) => void): void; +} diff --git a/types/meteor/globals/tools.d.ts b/types/meteor/globals/tools.d.ts new file mode 100644 index 0000000000..ecba67f06b --- /dev/null +++ b/types/meteor/globals/tools.d.ts @@ -0,0 +1,102 @@ +declare module App { + function accessRule(pattern: string, options?: { + type?: string; + launchExternal?: boolean; + }): void; + + function configurePlugin(id: string, config: Object): void; + + function icons(icons: Object): void; + + function info(options: { + id?: string; + version?: string; + name?: string; + description?: string; + author?: string; + email?: string; + website?: string; + }): void; + + function launchScreens(launchScreens: Object): void; + + function setPreference(name: string, value: string, platform?: string): void; +} + +declare function execFileAsync(command: string, args?: any[], options?: { + cwd?: Object; + env?: Object; + stdio?: any[] | string; + destination?: any; + waitForClose?: string; +}): any; +declare function execFileSync(command: string, args?: any[], options?: { + cwd?: Object; + env?: Object; + stdio?: any[] | string; + destination?: any; + waitForClose?: string; +}): String; + +declare module Assets { + function getBinary(assetPath: string, asyncCallback?: Function): EJSON; + + function getText(assetPath: string, asyncCallback?: Function): string; + + function absoluteFilePath(assetPath: string): string; +} + +declare module Cordova { + function depends(dependencies: { + [id: string]: string + }): void; +} + +declare module Npm { + function depends(dependencies: { + [id: string]: string + }): void; + + function require(name: string): any; +} + +declare namespace Package { + function describe(options: { + summary?: string; + version?: string; + name?: string; + git?: string; + documentation?: string; + debugOnly?: boolean; + prodOnly?: boolean; + testOnly?: boolean; + }): void; + + function onTest(func: (api: PackageAPI) => void): void; + + function onUse(func: (api: PackageAPI) => void): void; + + function registerBuildPlugin(options?: { + name?: string; + use?: string | string[]; + sources?: string[]; + npmDependencies?: Object; + }): void; +} + +declare interface PackageAPI { + new (): PackageAPI; + addAssets(filenames: string | string[], architecture: string | string[]): void; + addFiles(filenames: string | string[], architecture?: string | string[], options?: { + bare?: boolean; + }): void; + export(exportedObjects: string | string[], architecture?: string | string[], exportOptions?: Object, testOnly?: boolean): void; + imply(packageNames: string | string[], architecture?: string | string[]): void; + use(packageNames: string | string[], architecture?: string | string[], options?: { + weak?: boolean; + unordered?: boolean; + }): void; + versionsFrom(meteorRelease: string | string[]): void; +} + +declare var console: Console; diff --git a/types/meteor/globals/tracker.d.ts b/types/meteor/globals/tracker.d.ts new file mode 100644 index 0000000000..15c1be408a --- /dev/null +++ b/types/meteor/globals/tracker.d.ts @@ -0,0 +1,37 @@ +declare module Tracker { + function Computation(): void; + interface Computation { + firstRun: boolean; + invalidate(): void; + invalidated: boolean; + onInvalidate(callback: Function): void; + onStop(callback: Function): void; + stop(): void; + stopped: boolean; + } + var currentComputation: Computation; + + var Dependency: DependencyStatic; + interface DependencyStatic { + new (): Dependency; + } + interface Dependency { + changed(): void; + depend(fromComputation?: Computation): boolean; + hasDependents(): boolean; + } + + var active: boolean; + + function afterFlush(callback: Function): void; + + function autorun(runFunc: (computation: Computation) => void, options?: { + onError?: Function; + }): Computation; + + function flush(): void; + + function nonreactive(func: Function): void; + + function onInvalidate(callback: Function): void; +} diff --git a/types/meteor/http.d.ts b/types/meteor/http.d.ts index 0d8bb6afa1..166a5cf96a 100644 --- a/types/meteor/http.d.ts +++ b/types/meteor/http.d.ts @@ -1,52 +1,3 @@ -declare module HTTP { - interface HTTPRequest { - content?: string; - data?: any; - query?: string; - params?: { - [id: string]: string - }; - auth?: string; - headers?: { - [id: string]: string - }; - timeout?: number; - followRedirects?: boolean; - } - - interface HTTPResponse { - statusCode?: number; - headers?: { - [id: string]: string - }; - content?: string; - data?: any; - } - - function call(method: string, url: string, options?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; - - function del(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; - - function get(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; - - function post(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; - - function put(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; - - function call(method: string, url: string, options?: { - content?: string; - data?: Object; - query?: string; - params?: Object; - auth?: string; - headers?: Object; - timeout?: number; - followRedirects?: boolean; - npmRequestOptions?: Object; - beforeSend?: Function; - }, asyncCallback?: Function): HTTP.HTTPResponse; -} - declare module "meteor/http" { module HTTP { interface HTTPRequest { diff --git a/types/meteor/index.d.ts b/types/meteor/index.d.ts index fad7da05bf..0822bab8e7 100644 --- a/types/meteor/index.d.ts +++ b/types/meteor/index.d.ts @@ -11,25 +11,43 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -/// +/// +/// /// +/// /// +/// /// +/// /// +/// /// +/// /// +/// /// +/// /// +/// /// +/// /// +/// /// +/// /// +/// /// /// /// +/// /// +/// /// +/// /// +/// /// +/// /// /// diff --git a/types/meteor/meteor.d.ts b/types/meteor/meteor.d.ts index 07c1365459..ca08c31c98 100644 --- a/types/meteor/meteor.d.ts +++ b/types/meteor/meteor.d.ts @@ -1,105 +1,3 @@ -declare module Meteor { - /** Global props **/ - var isClient: boolean; - var isCordova: boolean; - var isServer: boolean; - var isProduction: boolean; - var release: string; - /** Global props **/ - - /** Settings **/ - interface Settings { - public: { - [id: string]: any - }, [id: string]: any - } - var settings: Settings; - /** Settings **/ - - /** User **/ - interface UserEmail { - address: string; - verified: boolean; - } - interface User { - _id?: string; - username?: string; - emails?: UserEmail[]; - createdAt?: number; - profile?: any; - services?: any; - } - - function user(): User; - - function userId(): string; - var users: Mongo.Collection; - /** User **/ - - /** Error **/ - var Error: ErrorStatic; - interface ErrorStatic { - new (error: string | number, reason?: string, details?: string): Error; - } - interface Error { - error: string | number; - reason?: string; - details?: string; - } - /** Error **/ - - /** Method **/ - function methods(methods: Object): void; - - function call(name: string, ...args: any[]): any; - - function apply(name: string, args: EJSONable[], options?: { - wait?: boolean; - onResultReceived?: Function; - returnStubValue?: boolean; - throwStubExceptions?: boolean; - }, asyncCallback?: Function): any; - /** Method **/ - - /** Url **/ - function absoluteUrl(path?: string, options?: { - secure?: boolean; - replaceLocalhost?: boolean; - rootUrl?: string; - }): string; - /** Url **/ - - /** Timeout **/ - function setInterval(func: Function, delay: number): number; - - function setTimeout(func: Function, delay: number): number; - - function clearInterval(id: number): void; - - function clearTimeout(id: number): void; - - function defer(func: Function): void; - /** Timeout **/ - - /** utils **/ - function startup(func: Function): void; - - function wrapAsync(func: Function, context?: Object): any; - - function bindEnvironment(func: Function): any; - /** utils **/ - - /** Pub/Sub **/ - interface SubscriptionHandle { - stop(): void; - ready(): boolean; - } - interface LiveQueryHandle { - stop(): void; - } - /** Pub/Sub **/ -} - declare module "meteor/meteor" { module Meteor { /** Global props **/ @@ -202,91 +100,7 @@ declare module "meteor/meteor" { } /** Pub/Sub **/ } -} -declare module Meteor { - /** Login **/ - interface LoginWithExternalServiceOptions { - requestPermissions?: string[]; - requestOfflineToken?: Boolean; - forceApprovalPrompt?: Boolean; - loginUrlParameters?: Object; - redirectUrl?: string; - loginHint?: string; - loginStyle?: string; - } - - function loginWithMeteorDeveloperAccount(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; - - function loginWithFacebook(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; - - function loginWithGithub(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; - - function loginWithGoogle(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; - - function loginWithMeetup(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; - - function loginWithTwitter(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; - - function loginWithWeibo(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; - - function loggingIn(): boolean; - - function loginWith(options?: { - requestPermissions?: string[]; - requestOfflineToken?: boolean; - loginUrlParameters?: Object; - userEmail?: string; - loginStyle?: string; - redirectUrl?: string; - }, callback?: Function): void; - - function loginWithPassword(user: Object | string, password: string, callback?: Function): void; - - function loginWithToken(token: string, callback?: Function): void; - - function logout(callback?: Function): void; - - function logoutOtherClients(callback?: Function): void; - /** Login **/ - - /** Event **/ - interface Event { - type: string; - target: HTMLElement; - currentTarget: HTMLElement; - which: number; - stopPropagation(): void; - stopImmediatePropagation(): void; - preventDefault(): void; - isPropagationStopped(): boolean; - isImmediatePropagationStopped(): boolean; - isDefaultPrevented(): boolean; - } - interface EventHandlerFunction extends Function { - (event?: Meteor.Event, templateInstance?: Blaze.TemplateInstance): void; - } - interface EventMap { - [id: string]: Meteor.EventHandlerFunction; - } - /** Event **/ - - /** Connection **/ - function reconnect(): void; - - function disconnect(): void; - /** Connection **/ - - /** Status **/ - function status(): DDP.DDPStatus; - /** Status **/ - - /** Pub/Sub **/ - function subscribe(name: string, ...args: any[]): Meteor.SubscriptionHandle; - /** Pub/Sub **/ -} - -declare module "meteor/meteor" { module Meteor { /** Login **/ interface LoginWithExternalServiceOptions { @@ -368,39 +182,7 @@ declare module "meteor/meteor" { function subscribe(name: string, ...args: any[]): Meteor.SubscriptionHandle; /** Pub/Sub **/ } -} -declare module Meteor { - /** Connection **/ - interface Connection { - id: string; - close: Function; - onClose: Function; - clientAddress: string; - httpHeaders: Object; - } - - function onConnection(callback: Function): void; - /** Connection **/ - - function publish(name: string, func: Function): void; - - function _debug(...args: any[]): void; -} - -interface Subscription { - added(collection: string, id: string, fields: Object): void; - changed(collection: string, id: string, fields: Object): void; - connection: Meteor.Connection; - error(error: Error): void; - onStop(func: Function): void; - ready(): void; - removed(collection: string, id: string): void; - stop(): void; - userId: string; -} - -declare module "meteor/meteor" { module Meteor { /** Connection **/ interface Connection { @@ -430,16 +212,7 @@ declare module "meteor/meteor" { stop(): void; userId: string; } -} -declare module Meteor { - /** Global props **/ - var isDevelopment: boolean; - var isTest: boolean; - /** Global props **/ -} - -declare module "meteor/meteor" { module Meteor { /** Global props **/ var isDevelopment: boolean; diff --git a/types/meteor/mongo.d.ts b/types/meteor/mongo.d.ts index 771d24edc1..ced791205b 100644 --- a/types/meteor/mongo.d.ts +++ b/types/meteor/mongo.d.ts @@ -1,230 +1,6 @@ -declare module Mongo { - - type BsonType = 1 | "double" | - 2 | "string" | - 3 | "object" | - 4 | "array" | - 5 | "binData" | - 6 | "undefined" | - 7 | "objectId" | - 8 | "bool" | - 9 | "date" | - 10 | "null" | - 11 | "regex" | - 12 | "dbPointer" | - 13 | "javascript" | - 14 | "symbol" | - 15 | "javascriptWithScope" | - 16 | "int" | - 17 | "timestamp" | - 18 | "long" | - 19 | "decimal" | - -1 | "minKey" | - 127 | "maxKey" | "number" - - type FieldExpression = { - $eq?: T, - $gt?: T, - $gte?: T, - $lt?: T, - $lte?: T, - $in?: T[], - $nin?: T[], - $ne?: T, - $exists?: boolean, - $type?: BsonType[] | BsonType, - $not?: FieldExpression, - $expr?: FieldExpression, - $jsonSchema?: any, - $mod?: number[], - $regex?: RegExp | string, - $options?: string, - $text?: { $search: string, $language?: string, $caseSensitive?: boolean, $diacriticSensitive?: boolean }, - $where?: string | Function, - $geoIntersects?: any, - $geoWithin?: any, - $near?: any, - $nearSphere?: any, - $all?: T[], - $elemMatch?: T extends {} ? Query : FieldExpression, - $size?: number, - $bitsAllClear?: any, - $bitsAllSet?: any, - $bitsAnyClear?: any, - $bitsAnySet?: any, - $comment?: string - } - - type Flatten = T extends any[] ? T[0] : T - - type Query = { - [P in keyof T]?: Flatten | RegExp | FieldExpression> - } & { - $or?: Query[], - $and?: Query[], - $nor?: Query[] - } & Dictionary - - type QueryWithModifiers = { - $query: Query, - $comment?: string, - $explain?: any, - $hint?: any, - $maxScan?: any, - $max?: any, - $maxTimeMS?: any, - $min?: any, - $orderby?: any, - $returnKey?: any, - $showDiskLoc?: any, - $natural?: any - } - - type Selector = Query | QueryWithModifiers - - type Dictionary = { [key: string]: T } - type PartialMapTo = Partial> - type OnlyArrays = T extends any[] ? T : never; - type OnlyElementsOfArrays = T extends any[] ? Partial : never - type ElementsOf = { - [P in keyof T]?: OnlyElementsOfArrays - } - type PushModifier = { - [P in keyof T]?: - OnlyElementsOfArrays | - { $each?: T[P], $position?: number, $slice?: number, $sort?: 1 | -1 | Dictionary } - } - type ArraysOrEach = { - [P in keyof T]?: OnlyArrays | { $each: T[P] } - } - type CurrentDateModifier = { $type: "timestamp" | "date" } | true - type Modifier = T | { - $currentDate?: Partial> & Dictionary, - $inc?: PartialMapTo & Dictionary, - $min?: PartialMapTo & Dictionary, - $max?: PartialMapTo & Dictionary, - $mul?: PartialMapTo & Dictionary, - $rename?: PartialMapTo & Dictionary, - $set?: Partial & Dictionary, - $setOnInsert?: Partial & Dictionary, - $unset?: PartialMapTo & Dictionary, - $addToSet?: ArraysOrEach & Dictionary, - $push?: PushModifier & Dictionary, - $pull?: ElementsOf & Dictionary, - $pullAll?: Partial & Dictionary, - $pop?: PartialMapTo & Dictionary<1 | -1>, - } - - - interface SortSpecifier { } - interface FieldSpecifier { - [id: string]: Number; - } - - var Collection: CollectionStatic; - interface CollectionStatic { - new (name: string, options?: { - connection?: Object | null; - idGeneration?: string; - transform?: Function; - }): Collection; - } - interface Collection { - allow(options: { - insert?: (userId: string, doc: T) => boolean; - update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; - remove?: (userId: string, doc: T) => boolean; - fetch?: string[]; - transform?: Function; - }): boolean; - deny(options: { - insert?: (userId: string, doc: T) => boolean; - update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; - remove?: (userId: string, doc: T) => boolean; - fetch?: string[]; - transform?: Function; - }): boolean; - find(selector?: Selector | ObjectID | string, options?: { - sort?: SortSpecifier; - skip?: number; - limit?: number; - fields?: FieldSpecifier; - reactive?: boolean; - transform?: Function; - }): Cursor; - findOne(selector?: Selector | ObjectID | string, options?: { - sort?: SortSpecifier; - skip?: number; - fields?: FieldSpecifier; - reactive?: boolean; - transform?: Function; - }): T; - insert(doc: T, callback?: Function): string; - rawCollection(): any; - rawDatabase(): any; - remove(selector: Selector | ObjectID | string, callback?: Function): number; - update(selector: Selector | ObjectID | string, modifier: Modifier, options?: { - multi?: boolean; - upsert?: boolean; - }, callback?: Function): number; - upsert(selector: Selector | ObjectID | string, modifier: Modifier, options?: { - multi?: boolean; - }, callback?: Function): { - numberAffected?: number; insertedId?: string; - }; - _ensureIndex(keys: { - [key: string]: number | string - } | string, options?: { - [key: string]: any - }): void; - _dropIndex(keys: { - [key: string]: number | string - } | string): void; - } - - var Cursor: CursorStatic; - interface CursorStatic { - new (): Cursor; - } - interface ObserveCallbacks { - added?(document: Object): void; - addedAt?(document: Object, atIndex: number, before: Object): void; - changed?(newDocument: Object, oldDocument: Object): void; - changedAt?(newDocument: Object, oldDocument: Object, indexAt: number): void; - removed?(oldDocument: Object): void; - removedAt?(oldDocument: Object, atIndex: number): void; - movedTo?(document: Object, fromIndex: number, toIndex: number, before: Object): void; - } - interface ObserveChangesCallbacks { - added?(id: string, fields: Object): void; - addedBefore?(id: string, fields: Object, before: Object): void; - changed?(id: string, fields: Object): void; - movedBefore?(id: string, before: Object): void; - removed?(id: string): void; - } - interface Cursor { - count(applySkipLimit?: boolean): number; - fetch(): Array; - forEach(callback: < T > (doc: T, index: number, cursor: Cursor) => void, thisArg?: any): void; - map(callback: (doc: T, index: number, cursor: Cursor) => U, thisArg?: any): Array; - observe(callbacks: ObserveCallbacks): Meteor.LiveQueryHandle; - observeChanges(callbacks: ObserveChangesCallbacks): Meteor.LiveQueryHandle; - } - - var ObjectID: ObjectIDStatic; - interface ObjectIDStatic { - new(hexString?: string): ObjectID; - } - interface ObjectID { - toHexString(): string; - equals(otherID: ObjectID): boolean; - } - - function setConnectionOptions(options: any): void; -} - declare module "meteor/mongo" { module Mongo { + type BsonType = 1 | "double" | 2 | "string" | 3 | "object" | @@ -340,6 +116,7 @@ declare module "meteor/mongo" { $pop?: PartialMapTo & Dictionary<1 | -1>, } + interface SortSpecifier { } interface FieldSpecifier { [id: string]: Number; @@ -446,19 +223,7 @@ declare module "meteor/mongo" { function setConnectionOptions(options: any): void; } -} -declare module Mongo { - interface AllowDenyOptions { - insert?: (userId: string, doc: any) => boolean; - update?: (userId: string, doc: any, fieldNames: string[], modifier: any) => boolean; - remove?: (userId: string, doc: any) => boolean; - fetch?: string[]; - transform?: Function; - } -} - -declare module "meteor/mongo" { module Mongo { interface AllowDenyOptions { insert?: (userId: string, doc: any) => boolean; diff --git a/types/meteor/random.d.ts b/types/meteor/random.d.ts index 6a0232088f..775616396e 100644 --- a/types/meteor/random.d.ts +++ b/types/meteor/random.d.ts @@ -1,17 +1,3 @@ -declare module Random { - function id(numberOfChars?: number): string; - - function secret(numberOfChars?: number): string; - - function fraction(): number; - // @param numberOfDigits, @returns a random hex string of the given length - function hexString(numberOfDigits: number): string; - // @param array, @return a random element in array - function choice(array: any[]): string; - // @param str, @return a random char in str - function choice(str: string): string; -} - declare module "meteor/random" { module Random { function id(numberOfChars?: number): string; diff --git a/types/meteor/reactive-var.d.ts b/types/meteor/reactive-var.d.ts index 8426433b7f..ec399d598f 100644 --- a/types/meteor/reactive-var.d.ts +++ b/types/meteor/reactive-var.d.ts @@ -1,12 +1,3 @@ -declare var ReactiveVar: ReactiveVarStatic; -interface ReactiveVarStatic { - new (initialValue: T, equalsFunc?: Function): ReactiveVar; -} -interface ReactiveVar { - get(): T; - set(newValue: T): void; -} - declare module "meteor/reactive-var" { var ReactiveVar: ReactiveVarStatic; interface ReactiveVarStatic { diff --git a/types/meteor/scripts/generate-globals b/types/meteor/scripts/generate-globals new file mode 100755 index 0000000000..3c5f8fc781 --- /dev/null +++ b/types/meteor/scripts/generate-globals @@ -0,0 +1,79 @@ +#!/usr/bin/env node + +/* +For a Meteor package that is exposed as both a global and an ES6 module, we +unfortunately need to provide two copies of the typings for compatibility with +existing code that expects to augment and use either the global or the ES6 +module. We maintain the module typings by hand and use this script to generate +the global typings in the `globals/` subdirectory. Not every package is exposed +globally; `generate-globals` reads `tsconfig.json` to get the list of expected +files in `globals/`. Similarly, we maintain `meteor-tests.ts` (which tests the +the modules that also have globals) by hand, and this script generates +`globals/meteor-tests.ts` (which tests the globals). + +Usage: scripts/generate-globals + +This script may be used by Meteor typings packages in DefinitelyTyped other than +`meteor` itself. + +Inspired by prior art (but not believed to constitute a derivative work): +https://github.com/meteor-typings/meteor/blob/09ef92da99549ac090603ce70cfa632db4fad6e7/gulpfile.js#L43 +*/ + +// @ts-check + +// We are relying on the following modules to be transitive dependencies of +// DefinitelyTyped and npm 5 to install them in a place visible to us. :/ +let ts = require("typescript"); +let path = require("path"); +let os = require("os"); +let fs = require("fs"); +let mkdirp = require("mkdirp"); +let rimraf = require("rimraf"); + +function formatDiagnostic(diag) { + return ts.flattenDiagnosticMessageText(diag.messageText, os.EOL); +} + +let rcfResult = ts.readConfigFile("tsconfig.json", (path) => { + try { + return fs.readFileSync(path, "UTF-8"); + } catch (e) { + return undefined; + } +}); +let configObject = rcfResult.config; +if (!configObject) { + throw new Error(formatDiagnostic(rcfResult.error)); +} +rimraf.sync("globals"); +rimraf.sync("test/globals"); +let readmeText = `This \`globals/\` directory is generated by \`scripts/generate-globals\`! To update +this directory, edit the corresponding files outside \`globals/\` and re-run +\`scripts/generate-globals\`.`.replace("\n", os.EOL); +mkdirp.sync("globals"); +fs.writeFileSync("globals/README.md", readmeText, "UTF-8"); +mkdirp.sync("test/globals"); +fs.writeFileSync("test/globals/README.md", readmeText, "UTF-8"); +for (let outFile of configObject.files) { + let m = /^(test\/)?globals\/(.*)$/.exec(outFile); + if (m) { + let inFile = (m[1] || "") + m[2]; + let inLines = fs.readFileSync(inFile, "UTF-8").split(os.EOL); + let isTest = !!m[1]; + let outLines = inLines.map((l) => { + if (/^import /.test(l)) return null; + if (isTest) { + return l; + } else { + let m2; + if ((m2 = /^ ([^} ].*)$/.exec(l)) != null) return "declare " + m2[1]; + if ((m2 = /^ (.*)$/.exec(l)) != null) return m2[1]; + if (l == "") return l; + return null; // Strip `declare module "..." {` and `}`. + } + }).filter((l) => l != null); + mkdirp.sync(path.dirname(outFile)); + fs.writeFileSync(outFile, outLines.join(os.EOL), "UTF-8"); + } +} diff --git a/types/meteor/session.d.ts b/types/meteor/session.d.ts index 3dad5e682c..221e0e379e 100644 --- a/types/meteor/session.d.ts +++ b/types/meteor/session.d.ts @@ -1,14 +1,3 @@ - -declare module Session { - function equals(key: string, value: string | number | boolean | any): boolean; - - function get(key: string): any; - - function set(key: string, value: EJSONable | any): void; - - function setDefault(key: string, value: EJSONable | any): void; -} - declare module "meteor/session" { module Session { function equals(key: string, value: string | number | boolean | any): boolean; diff --git a/types/meteor/templating.d.ts b/types/meteor/templating.d.ts index e3b05109fb..0d8da7e899 100644 --- a/types/meteor/templating.d.ts +++ b/types/meteor/templating.d.ts @@ -1,11 +1,3 @@ - -declare var Template: TemplateStatic; -interface TemplateStatic extends Blaze.TemplateStatic { - new (viewName?: string, renderFunction?: Function): Blaze.Template; - body: Blaze.Template; - [index: string]: any | Blaze.Template; -} - declare module "meteor/templating" { var Template: TemplateStatic; interface TemplateStatic extends Blaze.TemplateStatic { diff --git a/types/meteor/test/globals/README.md b/types/meteor/test/globals/README.md new file mode 100644 index 0000000000..b9e3615b2b --- /dev/null +++ b/types/meteor/test/globals/README.md @@ -0,0 +1,3 @@ +This `globals/` directory is generated by `scripts/generate-globals`! To update +this directory, edit the corresponding files outside `globals/` and re-run +`scripts/generate-globals`. \ No newline at end of file diff --git a/types/meteor/test/globals/meteor-tests.ts b/types/meteor/test/globals/meteor-tests.ts new file mode 100644 index 0000000000..c2145be0a6 --- /dev/null +++ b/types/meteor/test/globals/meteor-tests.ts @@ -0,0 +1,785 @@ +// This file may use only modules that have corresponding globals, because +// `globals/meteor-tests.ts` is generated from it. Tests that involve modules +// that don't have corresponding globals belong in +// `meteor-tests-module-only.ts`. + +/** + * All code below was copied from the examples at http://docs.meteor.com/. + * When necessary, code was added to make the examples work (e.g. declaring a variable + * that was assumed to have been declared earlier) + */ + +/*********************************** Begin setup for tests ******************************/ + +// Avoid conflicts between `meteor-tests.ts` and `globals/meteor-tests.ts`. +namespace MeteorTests { + +var Rooms = new Mongo.Collection('rooms'); +var Messages = new Mongo.Collection('messages'); +interface MonkeyDAO { + _id: string; + name: string; +} +var Monkeys = new Mongo.Collection('monkeys'); +//var x = new Mongo.Collection('x'); +//var y = new Mongo.Collection('y'); +/********************************** End setup for tests *********************************/ + + +/** + * From Core, Meteor.startup section + * Tests Meteor.isServer, Meteor.startup, Collection.insert(), Collection.find() + */ +if (Meteor.isServer) { + Meteor.startup(function () { + if (Rooms.find().count() === 0) { + Rooms.insert({ name: "Initial room" }); + } + }); +} + +/** + * From Publish and Subscribe, Meteor.publish section + **/ +Meteor.publish("rooms", function () { + return Rooms.find({}, { fields: { secretInfo: 0 } }); +}); + +Meteor.publish("adminSecretInfo", function () { + return Rooms.find({ admin: this.userId }, { fields: { secretInfo: 1 } }); +}); + +Meteor.publish("roomAndMessages", function (roomId: string) { + check(roomId, String); + return [ + Rooms.find({ _id: roomId }, { fields: { secretInfo: 0 } }), + Messages.find({ roomId: roomId }) + ]; +}); + +/** + * Also from Publish and Subscribe, Meteor.publish section + */ +Meteor.publish("counts-by-room", function (roomId: string) { + var self = this; + check(roomId, String); + var count = 0; + var initializing = true; + var handle = Messages.find({ roomId: roomId }).observeChanges({ + added: function (id: any) { + count++; + // if (!initializing) + // this.changed("counts", roomId, {count: count}); + }, + removed: function (id: any) { + count--; + // Todo: Not sure how to define in typescript + // self.changed("counts", roomId, {count: count}); + } + }); + + initializing = false; + + // Todo: Not sure how to define in typescript + // self.added("counts", roomId, {count: count}); + self.ready(); + + self.onStop(function () { + handle.stop(); + }); +}); + +var Counts = new Mongo.Collection("counts"); + +Tracker.autorun(function () { + Meteor.subscribe("counts-by-room", Session.get("roomId")); +}); + +// Checking status +let status: DDP.Status = 'connected'; + +console.log("Current room has " + + Counts.find(Session.get("roomId")).count + + " messages."); + +/** + * From Publish and Subscribe, Meteor.subscribe section + */ +Meteor.subscribe("allplayers"); + +/** + * Also from Meteor.subscribe section + */ +Tracker.autorun(function () { + Meteor.subscribe("chat", { room: Session.get("current-room") }); + Meteor.subscribe("privateMessages"); +}); + +/** + * From Methods, Meteor.methods section + */ +Meteor.methods({ + foo: function (arg1: string, arg2: number[]) { + check(arg1, String); + check(arg2, [Number]); + + var you_want_to_throw_an_error = true; + if (you_want_to_throw_an_error) + throw new Meteor.Error("404", "Can't find my pants"); + return "some return value"; + }, + + bar: function () { + // .. do other stuff .. + return "baz"; + } +}); + +/** + * From Methods, Meteor.Error section + */ +function meteorErrorTestFunction1() { + throw new Meteor.Error("logged-out", + "The user must be logged in to post a comment."); +} + +function meteorErrorTestFunction2() { + throw new Meteor.Error(403, + "The user must be logged in to post a comment."); +} + +Meteor.call("methodName", function (error: Meteor.Error) { + if (error.error === "logged-out") { + Session.set("errorMessage", "Please log in to post a comment."); + } +}); +var error = new Meteor.Error("logged-out", "The user must be logged in to post a comment."); +console.log(error.error === "logged-out"); +console.log(error.reason === "The user must be logged in to post a comment."); +console.log(error.details !== ""); + +/** + * From Methods, Meteor.call section + */ +Meteor.call('foo', 1, 2, function (error: any, result: any) { }); +var result = Meteor.call('foo', 1, 2); + +/** + * From Collections, Mongo.Collection section + */ +// DA: I added the "var" keyword in there + +interface ChatroomsDAO { + _id?: string; +} +interface MessagesDAO { + _id?: string; +} +var Chatrooms = new Mongo.Collection("chatrooms"); +Messages = new Mongo.Collection("messages"); + +var myMessages: any[] = Messages.find({ userId: Session.get('myUserId') }).fetch(); + +Messages.insert({ text: "Hello, world!" }); + +Messages.update(myMessages[0]._id, { $set: { important: true } }); + +var Posts = new Mongo.Collection("posts"); +Posts.insert({ title: "Hello world", body: "First post" }); + +// Couldn't find assert() in the meteor docs +//assert(Posts.find().count() === 1); + +/** + * Todo: couldn't figure out how to make this next line work with Typescript + * since there is already a Collection constructor with a different signature + * + var Scratchpad = new Mongo.Collection; + for (var i = 0; i < 10; i++) + Scratchpad.insert({number: i * 2}); + assert(Scratchpad.find({number: {$lt: 9}}).count() === 5); + **/ + +class Animal { + constructor(doc: any) {} +} + +interface AnimalDAO { + _id?: string; + name: string; + sound: string; + makeNoise?: () => void; +} + +// Define a Collection that uses Animal as its document +var Animals = new Mongo.Collection("Animals", { + transform: function (doc: any): Animal { return new Animal(doc); } +}); + +// Create an Animal and call its makeNoise method +Animals.insert({ name: "raptor", sound: "roar" }); +Animals.findOne({ name: "raptor" }).makeNoise(); // prints "roar" + +/** + * From Collections, Collection.insert section + */ +// DA: I added the variable declaration statements to make this work +var Lists = new Mongo.Collection('Lists'); +var Items = new Mongo.Collection('Lists'); + +var groceriesId = Lists.insert({ name: "Groceries" }); +Items.insert({ list: groceriesId, name: "Watercress" }); +Items.insert({ list: groceriesId, name: "Persimmons" }); + +/** + * From Collections, collection.update section + */ +var Players = new Mongo.Collection('Players'); + +Template['adminDashboard'].events({ + 'click .givePoints': function () { + Players.update(Session.get("currentPlayer"), { $inc: { score: 5 } }); + } +}); + +/** + * Also from Collections, collection.update section + */ +Meteor.methods({ + declareWinners: function () { + Players.update({ score: { $gt: 10 } }, + { $addToSet: { badges: "Winner" } }, + { multi: true }); + } +}); + +/** + * From Collections, collection.remove section + */ +Template['chat'].events({ + 'click .remove': function () { + Messages.remove(this._id); + } +}); + +// DA: I added this next line +var Logs = new Mongo.Collection('logs'); + +Meteor.startup(function () { + if (Meteor.isServer) { + Logs.remove({}); + Players.remove({ karma: { $lt: -2 } }); + } +}); + +/*** + * From Collections, collection.allow section + */ + +interface iPost { + _id: string; + owner: string; + userId: string; + locked: boolean; +} + +Posts = new Mongo.Collection("posts"); + +Posts.allow({ + insert: function (userId: string, doc: iPost) { + // the user must be logged in, and the document must be owned by the user + return (userId && doc.owner === userId); + }, + update: function (userId: string, doc: iPost, fields: string[], modifier: any) { + // can only change your own documents + return doc.owner === userId; + }, + remove: function (userId: string, doc: iPost) { + // can only remove your own documents + return doc.owner === userId; + }, + fetch: ['owner'] +}); + +Posts.deny({ + update: function (userId: string, doc: iPost, fields: string[], modifier: any) { + // can't change owners + return doc.userId !== userId; + }, + remove: function (userId: string, doc: iPost) { + // can't remove locked documents + return doc.locked; + }, + fetch: ['locked'] // no need to fetch 'owner' +}); + +/** + * From Collections, cursor.forEach section + */ +var topPosts = Posts.find({}, { sort: { score: -1 }, limit: 5 }); +var count = 0; +topPosts.forEach(function (post: { title: string }) { + console.log("Title of post " + count + ": " + post.title); + count += 1; +}); + +/** + * From Collections, cursor.observeChanges section + */ +// DA: I added this line to make it work +var Users = new Mongo.Collection('users'); + +var count1 = 0; +var query = Users.find({ admin: true, onlineNow: true }); +var handle = query.observeChanges({ + added: function (id: string, user: { name: string }) { + count1++; + console.log(user.name + " brings the total to " + count1 + " admins."); + }, + removed: function () { + count1--; + console.log("Lost one. We're now down to " + count1 + " admins."); + } +}); + +let cursor: Mongo.Cursor; + +// After five seconds, stop keeping the count. +setTimeout(function () { handle.stop(); }, 5000); + +// Additional testing for Mongo.Collection +enum InlineObjectType { + Invalid, + Link, + Image, + Video, + Person +} +interface CommentsDAO { + text: string; + authorId: string; + inlineLinks: { objectType: InlineObjectType, objectId: string, objectUrl: string }[], + tags: string[], + viewNumber: number, + private: boolean +} + +var Comments = new Mongo.Collection("comments"); + +Comments.find({ text: { $regex: /test/ } }); +Comments.find({ viewNumber: { $gt: 100 } }); +Comments.find({ viewNumber: { $not: { $lt: 100, $gt: 1000 } } }); +Comments.find({ tags: { $in: [ "tag-1", "tag-2", "tag-3" ] } }); +Comments.find({ $or: [ { text: "hello" }, { text: "world" } ] }); +Comments.find({ $or: [ + { text: "hello" }, + { text: "world", viewNumber: { $gt: 0 } } +], authorId: "test-author-id" }); +Comments.find({ $and: [ + { $or: [{ authorId: "author-id-1" }, { authorId: "author-id-2" }] }, + { $or: [{ tags: "tag-1" }, { tags: "tag-2" }] } +]}); + +Comments.find({ inlineLinks: { $exists: true, $type: "array" } }); +Comments.find({ inlineLinks: { $elemMatch: { + objectType: InlineObjectType.Image, + objectUrl: { $regex: "https://(www\.?)youtube\.com" } +} } }); +Comments.find({ "inlineLinks.objectType": InlineObjectType.Person }); +Comments.find({ tags: "tag-1" }); +Comments.find({ tags: { $all: ["tag-1", "tag2"] } }); + +Comments.update({ viewNumber: { $exists: false } }, { $set: { viewNumber: 0 } }); +Comments.update({ authorId: "author-id-1" }, { $push: { tags: "test-tag-1" } }); +Comments.update({ authorId: "author-id-1" }, { $push: { tags: { $each: [ "test-tag-2", "test-tag-3" ] } } }); + +Comments.update({ authorId: "author-id-1" }, { $push: { inlineLinks: { + objectId: "test-object-id", + objectType: InlineObjectType.Link, + objectUrl: "https://test.url/" +} } }); +Comments.update({ viewNumber: { $exists: false } }, { $set: { viewNumber: 0 } }); +Comments.update({ private: true }, { $unset: { tags: true } }); + +/** + * From Sessions, Session.set section + */ +Tracker.autorun(function () { + Meteor.subscribe("chat-history", { room: Session.get("currentRoomId") }); +}); + +// Causes the function passed to Tracker.autorun to be re-run, so +// that the chat-history subscription is moved to the room "home". +Session.set("currentRoomId", "home"); + +/** + * From Sessions, Session.get section + */ +// Page will say "We've always been at war with Eastasia" + +// DA: commented out since transpiler didn't like append() +//document.body.append(frag1); + +// Page will change to say "We've always been at war with Eurasia" +Session.set("enemy", "Eurasia"); + +/** + * From Sessions, Session.equals section + */ +var value: string; +Session.get("key") === value; +Session.equals("key", value); + +/** + * From Accounts, Meteor.users section + */ +Meteor.publish("userData", function () { + return Meteor.users.find({ _id: this.userId }, + { fields: { 'other': 1, 'things': 1 } }); +}); + +Meteor.users.deny({ update: function () { return true; } }); + +/** + * From Accounts, Meteor.loginWithExternalService section + */ +Meteor.loginWithGithub({ + requestPermissions: ['user', 'public_repo'] +}, function (err: Meteor.Error) { + if (err) + Session.set('errorMessage', err.reason || 'Unknown error'); +}); + +/** + * From Accounts, Accounts.ui.config section + */ +Accounts.ui.config({ + requestPermissions: { + facebook: ['user_likes'], + github: ['user', 'repo'] + }, + requestOfflineToken: { + google: true + }, + passwordSignupFields: 'USERNAME_AND_OPTIONAL_EMAIL' +}); + +/** + * From Accounts, Accounts.validateNewUser section + */ +Accounts.validateNewUser(function (user: { username: string }) { + if (user.username && user.username.length >= 3) + return true; + throw new Meteor.Error("403", "Username must have at least 3 characters"); +}); +// Validate username, without a specific error message. +Accounts.validateNewUser(function (user: { username: string }) { + return user.username !== "root"; +}); + +/** + * From Accounts, Accounts.onCreateUser section + */ +Accounts.onCreateUser(function (options: { profile: any }, user: { profile: any, dexterity: number }) { + var d6 = function () { return Math.floor(Math.random() * 6) + 1; }; + user.dexterity = d6() + d6() + d6(); + // We still want the default hook's 'profile' behavior. + if (options.profile) + user.profile = options.profile; + return user; +}); + +/** + * From Passwords, Accounts.emailTemplates section + */ +Accounts.emailTemplates.siteName = "AwesomeSite"; +Accounts.emailTemplates.from = "AwesomeSite Admin "; +Accounts.emailTemplates.enrollAccount.subject = function (user: { profile: { name: string } }) { + return "Welcome to Awesome Town, " + user.profile.name; +}; +Accounts.emailTemplates.enrollAccount.text = function (user: any, url: string) { + return "You have been selected to participate in building a better future!" + + " To activate your account, simply click the link below:\n\n" + + url; +}; + +/** + * From Templates, Template.myTemplate.helpers section + */ +Template['adminDashboard'].helpers({ + foo: function () { + return Session.get("foo"); + } +}); + +Template['newTemplate'].helpers({ + helperName: function () { + } +}); + +Template['newTemplate'].created = function () { + +}; + +Template['newTemplate'].rendered = function () { + +}; + +Template['newTemplate'].destroyed = function () { + +}; + +Template['newTemplate'].events({ + 'click .something': function (event: Meteor.Event, template: Blaze.TemplateInstance) { + } +}); + +Template.registerHelper('testHelper', function () { + return 'tester'; +}); + +var instance = Template.instance(); +var data = Template.currentData(); +var data = Template.parentData(1); +var body = Template.body; + +/** + * From Match section + */ +var Chats = new Mongo.Collection('chats'); + +Meteor.publish("chats-in-room", function (roomId: string) { + // Make sure roomId is a string, not an arbitrary mongo selector object. + check(roomId, String); + return Chats.find({ room: roomId }); +}); + +Meteor.methods({ + addChat: function (roomId: string, message: { text: string, timestamp: Date, tags: string }) { + check(roomId, String); + check(message, { + text: String, + timestamp: Date, + // Optional, but if present must be an array of strings. + tags: Match.Optional('Test String') + }); + + // ... do something with the message ... + } +}); + +/** + * From Match patterns section + */ +var pat = { name: Match.Optional('test') }; +check({ name: "something" }, pat) // OK +check({}, pat) // OK +check({ name: undefined }, pat) // Throws an exception + +// Outside an object +check(undefined, Match.Optional('test')); // OK + +/** + * From Deps, Tracker.autorun section + */ +Tracker.autorun(function () { + var oldest = Monkeys.findOne('age = 20'); + + if (oldest) + Session.set("oldest", oldest.name); +}); + +Tracker.autorun(function (c) { + if (!Session.equals("shouldAlert", true)) + return; + + c.stop(); + alert("Oh no!"); +}); + +/** + * From Deps, Deps.Computation + */ +if (Tracker.active) { + Tracker.onInvalidate(function () { + console.log('invalidated'); + }); +} + +/** + * From Tracker, Tracker.Dependency + */ +var weather = "sunny"; +var weatherDep = new Tracker.Dependency; + +var getWeather = function () { + weatherDep.depend(); + return weather; +}; + +var setWeather = function (w: string) { + weather = w; + // (could add logic here to only call changed() + // if the new value is different from the old) + weatherDep.changed(); +}; + +/** + * From HTTP, HTTP.call section + */ +Meteor.methods({ + checkTwitter: function (userId: string) { + check(userId, String); + this.unblock(); + var result = HTTP.call("GET", "http://api.twitter.com/xyz", + { params: { user: userId } }); + if (result.statusCode === 200) + return true + return false; + } +}); + + +HTTP.call("POST", "http://api.twitter.com/xyz", + { data: { some: "json", stuff: 1 } }, + function (error: Meteor.Error, result: any) { + if (result.statusCode === 200) { + Session.set("twizzled", true); + } + }); + +/** + * From Email, Email.send section + */ +Meteor.methods({ + sendEmail: function (to: string, from: string, subject: string, text: string) { + check([to, from, subject, text], [String]); + + // Let other method calls from the same client start running, + // without waiting for the email sending to complete. + this.unblock(); + } +}); + +// In your client code: asynchronously send an email +Meteor.call('sendEmail', + 'alice@example.com', + 'Hello from Meteor!', + 'This is a test of Email.send.'); + +var testTemplate = new Blaze.Template('foo'); +var testView = new Blaze.View('foo'); +Blaze.Template.instance(); + +declare var el: HTMLElement; +Blaze.render(testTemplate, el); +Blaze.renderWithData(testTemplate, { testData: 123 }, el); +Blaze.remove(testView); +Blaze.getData(el); +Blaze.getData(testView); +Blaze.toHTML(testTemplate); +Blaze.toHTML(testView); +Blaze.toHTMLWithData(testTemplate, { test: 1 }); +Blaze.toHTMLWithData(testTemplate, function () { }); +Blaze.toHTMLWithData(testView, { test: 1 }); +Blaze.toHTMLWithData(testView, function () { }); + +var reactiveVar1 = new ReactiveVar('test value'); +var reactiveVar2 = new ReactiveVar('test value', function (oldVal: any) { return true; }); + +var varValue: string = reactiveVar1.get(); +reactiveVar1.set('new value'); + +// Covers this PR: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/8233 +var isConfigured: boolean = Accounts.loginServicesConfigured(); +Accounts.onPageLoadLogin(function () { + // do something +}); + +// Covers this PR: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/8065 +var loginOpts = { + requestPermissions: ["a", "b"], + requestOfflineToken: true, + loginUrlParameters: { asdf: 1, qwer: "1234" }, + loginHint: "Help me", + loginStyle: "Bold and powerful", + redirectUrl: "popup", + profile: "asdfasdf" +}; +Meteor.loginWithMeteorDeveloperAccount(loginOpts, function (error: Meteor.Error) { }); + +Accounts.emailTemplates.siteName = "AwesomeSite"; +Accounts.emailTemplates.from = "AwesomeSite Admin "; +Accounts.emailTemplates.headers = { asdf: 'asdf', qwer: 'qwer' }; + +Accounts.emailTemplates.enrollAccount.subject = function (user: Meteor.User) { + return "Welcome to Awesome Town, " + user.profile.name; +}; +Accounts.emailTemplates.enrollAccount.html = function (user: Meteor.User, url: string) { + return "

            Some html here

            "; +}; +Accounts.emailTemplates.enrollAccount.from = function () { + return "asdf@asdf.com"; +}; +Accounts.emailTemplates.enrollAccount.text = function (user: Meteor.User, url: string) { + return "You have been selected to participate in building a better future!" + + " To activate your account, simply click the link below:\n\n" + + url; +}; + +var handle = Accounts.validateLoginAttempt(function (attemptInfoObject: Accounts.IValidateLoginAttemptCbOpts) { + var type: string = attemptInfoObject.type; + var allowed: boolean = attemptInfoObject.allowed; + var error: Meteor.Error = attemptInfoObject.error; + var user: Meteor.User = attemptInfoObject.user; + var connection: Meteor.Connection = attemptInfoObject.connection; + var methodName: string = attemptInfoObject.methodName; + var methodArguments: any[] = attemptInfoObject.methodArguments; + return true; +}); +handle.stop(); + + +// Covers https://github.com/meteor-typings/meteor/issues/8 +const publicSetting = Meteor.settings.public['somePublicSetting']; +const deeperPublicSetting = Meteor.settings.public['somePublicSetting']['deeperSetting']; +const privateSetting = Meteor.settings['somePrivateSetting']; +const deeperPrivateSetting = Meteor.settings['somePrivateSettings']['deeperSetting']; + + +// Covers https://github.com/meteor-typings/meteor/issues/9 +const username = (Template.instance().find('#username')).value; + + +// Covers https://github.com/meteor-typings/meteor/issues/3 +BrowserPolicy.framing.disallow(); +BrowserPolicy.content.allowEval(); + + +// Covers https://github.com/meteor-typings/meteor/issues/18 +if (Meteor.isDevelopment) { + Rooms._dropIndex({ field: 1 }); +} + + +// Covers https://github.com/meteor-typings/meteor/issues/20 +Rooms.find().count(true); + + +// Covers https://github.com/meteor-typings/meteor/issues/21 +if (Meteor.isTest) { + // do something +} + +DDPRateLimiter.addRule({ userId: 'foo' }, 5, 1000); + +DDPRateLimiter.addRule({ userId: userId => userId == 'foo' }, 5, 1000); + +Template.instance().autorun(() => { }).stop(); + +// Mongo Collection without connection (local collection) +const collectionWithoutConnection = new Mongo.Collection("monkey", { + connection: null +}); + +} // End of namespace diff --git a/types/meteor/test/meteor-tests-module-only.ts b/types/meteor/test/meteor-tests-module-only.ts new file mode 100644 index 0000000000..3591b90635 --- /dev/null +++ b/types/meteor/test/meteor-tests-module-only.ts @@ -0,0 +1,8 @@ +// This file is for tests that involve modules that don't have corresponding +// globals. + +import { onPageLoad } from "meteor/server-render"; +import { ServiceConfiguration } from "meteor/service-configuration"; +import { WebApp } from "meteor/webapp"; + +// We have no actual tests beyond the imports yet. diff --git a/types/meteor/meteor-tests.ts b/types/meteor/test/meteor-tests.ts similarity index 98% rename from types/meteor/meteor-tests.ts rename to types/meteor/test/meteor-tests.ts index a321e4a409..c7fde5b8be 100644 --- a/types/meteor/meteor-tests.ts +++ b/types/meteor/test/meteor-tests.ts @@ -1,10 +1,14 @@ +// This file may use only modules that have corresponding globals, because +// `globals/meteor-tests.ts` is generated from it. Tests that involve modules +// that don't have corresponding globals belong in +// `meteor-tests-module-only.ts`. + /** * All code below was copied from the examples at http://docs.meteor.com/. * When necessary, code was added to make the examples work (e.g. declaring a variable * that was assumed to have been declared earlier) */ - /*********************************** Begin setup for tests ******************************/ import { Mongo } from "meteor/mongo"; import { Meteor } from "meteor/meteor"; @@ -19,6 +23,9 @@ import { Accounts } from "meteor/accounts-base"; import { BrowserPolicy } from "meteor/browser-policy-common"; import { DDPRateLimiter } from "meteor/ddp-rate-limiter"; +// Avoid conflicts between `meteor-tests.ts` and `globals/meteor-tests.ts`. +namespace MeteorTests { + var Rooms = new Mongo.Collection('rooms'); var Messages = new Mongo.Collection('messages'); interface MonkeyDAO { @@ -786,3 +793,5 @@ Template.instance().autorun(() => { }).stop(); const collectionWithoutConnection = new Mongo.Collection("monkey", { connection: null }); + +} // End of namespace diff --git a/types/meteor/tiny-test.d.ts b/types/meteor/tiny-test.d.ts index 15e0939684..8d149e0711 100644 --- a/types/meteor/tiny-test.d.ts +++ b/types/meteor/tiny-test.d.ts @@ -1,41 +1,3 @@ - -interface ILengthAble { - length: number; -} - -interface ITinytestAssertions { - ok(doc: Object): void; - expect_fail(): void; - fail(doc: Object): void; - runId(): string; - equal(actual: T, expected: T, message?: string, not?: boolean): void; - notEqual(actual: T, expected: T, message?: string): void; - instanceOf(obj: Object, klass: Function, message?: string): void; - notInstanceOf(obj: Object, klass: Function, message?: string): void; - matches(actual: any, regexp: RegExp, message?: string): void; - notMatches(actual: any, regexp: RegExp, message?: string): void; - throws(f: Function, expected?: string | RegExp): void; - isTrue(v: boolean, msg?: string): void; - isFalse(v: boolean, msg?: string): void; - isNull(v: any, msg?: string): void; - isNotNull(v: any, msg?: string): void; - isUndefined(v: any, msg?: string): void; - isNotUndefined(v: any, msg?: string): void; - isNan(v: any, msg?: string): void; - isNotNan(v: any, msg?: string): void; - include(s: Array | Object | string, value: any, msg?: string, not?: boolean): void; - - notInclude(s: Array | Object | string, value: any, msg?: string, not?: boolean): void; - length(obj: ILengthAble, expected_length: number, msg?: string): void; - _stringEqual(actual: string, expected: string, msg?: string): void; -} - -declare module Tinytest { - function add(description: string, func: (test: ITinytestAssertions) => void): void; - - function addAsync(description: string, func: (test: ITinytestAssertions) => void): void; -} - declare module "meteor/tiny-test" { interface ILengthAble { length: number; diff --git a/types/meteor/tools.d.ts b/types/meteor/tools.d.ts index a23a2bafaa..f45f75d0cc 100644 --- a/types/meteor/tools.d.ts +++ b/types/meteor/tools.d.ts @@ -1,107 +1,3 @@ - -declare module App { - function accessRule(pattern: string, options?: { - type?: string; - launchExternal?: boolean; - }): void; - - function configurePlugin(id: string, config: Object): void; - - function icons(icons: Object): void; - - function info(options: { - id?: string; - version?: string; - name?: string; - description?: string; - author?: string; - email?: string; - website?: string; - }): void; - - function launchScreens(launchScreens: Object): void; - - function setPreference(name: string, value: string, platform?: string): void; -} - -declare function execFileAsync(command: string, args?: any[], options?: { - cwd?: Object; - env?: Object; - stdio?: any[] | string; - destination?: any; - waitForClose?: string; -}): any; -declare function execFileSync(command: string, args?: any[], options?: { - cwd?: Object; - env?: Object; - stdio?: any[] | string; - destination?: any; - waitForClose?: string; -}): String; - -declare module Assets { - function getBinary(assetPath: string, asyncCallback?: Function): EJSON; - - function getText(assetPath: string, asyncCallback?: Function): string; - - function absoluteFilePath(assetPath: string): string; -} - -declare module Cordova { - function depends(dependencies: { - [id: string]: string - }): void; -} - -declare module Npm { - function depends(dependencies: { - [id: string]: string - }): void; - - function require(name: string): any; -} - -declare namespace Package { - function describe(options: { - summary?: string; - version?: string; - name?: string; - git?: string; - documentation?: string; - debugOnly?: boolean; - prodOnly?: boolean; - testOnly?: boolean; - }): void; - - function onTest(func: (api: PackageAPI) => void): void; - - function onUse(func: (api: PackageAPI) => void): void; - - function registerBuildPlugin(options?: { - name?: string; - use?: string | string[]; - sources?: string[]; - npmDependencies?: Object; - }): void; -} - -interface PackageAPI { - new (): PackageAPI; - addAssets(filenames: string | string[], architecture: string | string[]): void; - addFiles(filenames: string | string[], architecture?: string | string[], options?: { - bare?: boolean; - }): void; - export(exportedObjects: string | string[], architecture?: string | string[], exportOptions?: Object, testOnly?: boolean): void; - imply(packageNames: string | string[], architecture?: string | string[]): void; - use(packageNames: string | string[], architecture?: string | string[], options?: { - weak?: boolean; - unordered?: boolean; - }): void; - versionsFrom(meteorRelease: string | string[]): void; -} - -declare var console: Console; - declare module "meteor/tools" { module App { function accessRule(pattern: string, options?: { @@ -135,7 +31,6 @@ declare module "meteor/tools" { destination?: any; waitForClose?: string; }): any; - function execFileSync(command: string, args?: any[], options?: { cwd?: Object; env?: Object; diff --git a/types/meteor/tracker.d.ts b/types/meteor/tracker.d.ts index 495ae46abd..8a8b69c8da 100644 --- a/types/meteor/tracker.d.ts +++ b/types/meteor/tracker.d.ts @@ -1,42 +1,3 @@ - -declare module Tracker { - function Computation(): void; - interface Computation { - firstRun: boolean; - invalidate(): void; - invalidated: boolean; - onInvalidate(callback: Function): void; - onStop(callback: Function): void; - stop(): void; - stopped: boolean; - } - var currentComputation: Computation; - - var Dependency: DependencyStatic; - interface DependencyStatic { - new (): Dependency; - } - interface Dependency { - changed(): void; - depend(fromComputation?: Computation): boolean; - hasDependents(): boolean; - } - - var active: boolean; - - function afterFlush(callback: Function): void; - - function autorun(runFunc: (computation: Computation) => void, options?: { - onError?: Function; - }): Computation; - - function flush(): void; - - function nonreactive(func: Function): void; - - function onInvalidate(callback: Function): void; -} - declare module "meteor/tracker" { module Tracker { function Computation(): void; diff --git a/types/meteor/tsconfig.json b/types/meteor/tsconfig.json index b6cfc721f1..7ad451fd56 100644 --- a/types/meteor/tsconfig.json +++ b/types/meteor/tsconfig.json @@ -18,27 +18,49 @@ "forceConsistentCasingInFileNames": true }, "files": [ - "accounts.d.ts", + "accounts-base.d.ts", + "globals/accounts-base.d.ts", "blaze.d.ts", + "globals/blaze.d.ts", "browser-policy-common.d.ts", + "globals/browser-policy-common.d.ts", "check.d.ts", + "globals/check.d.ts", "ddp-rate-limiter.d.ts", + "globals/ddp-rate-limiter.d.ts", "ddp.d.ts", + "globals/ddp.d.ts", "ejson.d.ts", + "globals/ejson.d.ts", "email.d.ts", + "globals/email.d.ts", "http.d.ts", + "globals/http.d.ts", "meteor.d.ts", + "globals/meteor.d.ts", "mongo.d.ts", + "globals/mongo.d.ts", + "random.d.ts", + "globals/random.d.ts", "reactive-var.d.ts", + "globals/reactive-var.d.ts", "server-render.d.ts", "service-configuration.d.ts", "session.d.ts", + "globals/session.d.ts", + "templating.d.ts", + "globals/templating.d.ts", "tiny-test.d.ts", + "globals/tiny-test.d.ts", "tools.d.ts", + "globals/tools.d.ts", "tracker.d.ts", + "globals/tracker.d.ts", "underscore.d.ts", "webapp.d.ts", "index.d.ts", - "meteor-tests.ts" + "test/meteor-tests.ts", + "test/globals/meteor-tests.ts", + "test/meteor-tests-module-only.ts" ] -} \ No newline at end of file +} diff --git a/types/money-math/index.d.ts b/types/money-math/index.d.ts new file mode 100644 index 0000000000..a86734c477 --- /dev/null +++ b/types/money-math/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for money-math 2.5 +// Project: https://github.com/ikr/money-math#readme +// Definitions by: taoqf +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export as namespace Money; + +export function add(a: string, b: string): string; +export function subtract(a: string, b: string): string; +export function mul(a: string, b: string): string; +export function div(a: string, b: string): string; +export function percent(a: string, b: string): string; +export function cmp(a: string, b: string): 0 | number; +export function isEqual(a: string, b: string): boolean; +export function isZero(value: string): boolean; +export function isNegative(value: string): boolean; +export function isPositive(value: string): boolean; +export function floatToAmount(value: number): string; +export function format(currency: 'CHF' | 'CNY' | 'EUR' | 'GBP' | 'JPY' | 'LTL' | 'PLN' | 'SEK' | 'SKK' | 'UAH' | 'USD' | string, value: string): string; +export function roundUpTo5Cents(value: string): string; +export function roundTo5Cents(value: string): string; diff --git a/types/money-math/money-math-tests.ts b/types/money-math/money-math-tests.ts new file mode 100644 index 0000000000..9b93824ca1 --- /dev/null +++ b/types/money-math/money-math-tests.ts @@ -0,0 +1,18 @@ +import * as money from 'money-math'; + +money.add("16.11", "17.07"); // "33.18" +money.subtract("16.00", "7.00"); // "9.00" +money.mul("24.00", "0.25"); // "6.00" +money.div("64.00", "2.00"); // "32.00" +money.percent("200.00", "3.25"); // "6.50" +money.cmp("100.00", "200.00"); // -1 +money.isEqual("100.00", "100.00"); // true +money.isZero("0.00"); // true +money.isNegative("-1.00"); // true +money.isPositive("-1.00"); // false + +money.format("JPY", "236800.00"); // "236,800" +money.floatToAmount(56.345); // "56.35" + +money.roundUpTo5Cents("42.02"); // "42.05" +money.roundTo5Cents("442.26"); // "442.25" diff --git a/types/money-math/tsconfig.json b/types/money-math/tsconfig.json new file mode 100644 index 0000000000..fd8b7d167d --- /dev/null +++ b/types/money-math/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "strictFunctionTypes": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "money-math-tests.ts" + ] +} \ No newline at end of file diff --git a/types/money-math/tslint.json b/types/money-math/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/money-math/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 90bb04747f..94aacd244e 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Mongoose 5.2.2 +// Type definitions for Mongoose 5.2.3 // Project: http://mongoosejs.com/ // Definitions by: horiuchi // sindrenm @@ -808,11 +808,11 @@ declare module "mongoose" { // Hook functions: https://github.com/vkarpov15/hooks-fixed interface HookSyncCallback { - (this: T, next: HookNextFunction): Promise | void; + (this: T, next: HookNextFunction, docs: any[]): Promise | void; } interface HookAsyncCallback { - (this: T, next: HookNextFunction, done: HookDoneFunction): Promise | void; + (this: T, next: HookNextFunction, done: HookDoneFunction, docs: any[]): Promise | void; } interface HookErrorCallback { @@ -976,8 +976,8 @@ declare module "mongoose" { */ validate?: RegExp | [RegExp, string] | SchemaTypeOpts.ValidateFn | [SchemaTypeOpts.ValidateFn, string] | - SchemaTypeOpts.ValidateOpts | SchemaTypeOpts.ValidateOpts[] | - SchemaTypeOpts.AsyncValidateOpts | SchemaTypeOpts.AsyncValidateOpts[]; + SchemaTypeOpts.ValidateOpts | SchemaTypeOpts.AsyncValidateOpts | + (SchemaTypeOpts.ValidateOpts | SchemaTypeOpts.AsyncValidateOpts)[]; /** Declares an unique index. */ unique?: boolean | any; @@ -2409,6 +2409,13 @@ declare module "mongoose" { */ read(pref: string, tags?: any[]): this; + /** + * Appends a new $replaceRoot operator to this aggregate pipeline. + * Note that the $replaceRoot operator requires field strings to start with '$'. If you are passing in a string Mongoose will prepend '$' if the specified field doesn't start '$'. If you are passing in an object the strings in your expression will not be altered. + * @param newRoot field or document which will become the new root document + */ + replaceRoot(newRoot: string | object): this; + /** * Appends new custom $sample operator(s) to this aggregate pipeline. * @param size number of random documents to pick diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index 02227c681d..af8770dc28 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -390,23 +390,23 @@ preHookTestSchemaArr.push( // Model preHookTestSchemaArr.push( - schema.pre("insertMany", function(next) { + schema.pre("insertMany", function(next, docs) { const isDefaultType: mongoose.Model = this; }, err => {}) ); preHookTestSchemaArr.push( - schema.pre>("insertMany", function(next) { + schema.pre>("insertMany", function(next, docs) { const isSpecificType: PreHookTestModelInterface = this; return Promise.resolve("") }, err => {}) ); preHookTestSchemaArr.push( - schema.pre("insertMany", true, function(next, done) { + schema.pre("insertMany", true, function(next, done, docs) { const isDefaultType: mongoose.Model = this; }, err => {}) ); preHookTestSchemaArr.push( - schema.pre>("insertMany", true, function(next, done) { + schema.pre>("insertMany", true, function(next, done, docs) { const isSpecificType: PreHookTestModelInterface = this; return Promise.resolve("") }, err => {}) @@ -1264,6 +1264,8 @@ aggregate.project({ }) aggregate.project({ salary_k: { $divide: [ "$salary", 1000 ]}}); aggregate.read('primaryPreferred').read('pp'); +aggregate.replaceRoot("user"); +aggregate.replaceRoot({x: {$concat: ['$this', '$that']}}); aggregate.sample(3).sample(3); aggregate.skip(10).skip(10); aggregate.sort({ field: 'asc', test: -1 }); diff --git a/types/mssql/index.d.ts b/types/mssql/index.d.ts index db1256e2a3..d4558737ba 100644 --- a/types/mssql/index.d.ts +++ b/types/mssql/index.d.ts @@ -8,6 +8,7 @@ // Peter Keuter // David Gasperoni // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// diff --git a/types/mssql/msnodesqlv8.d.ts b/types/mssql/msnodesqlv8.d.ts new file mode 100644 index 0000000000..27d51e2daa --- /dev/null +++ b/types/mssql/msnodesqlv8.d.ts @@ -0,0 +1,2 @@ +// Export the same API as index.d.ts (which implicitly uses the "msnodesqlv8" driver): +export * from '.'; diff --git a/types/mssql/mssql-tests.ts b/types/mssql/mssql-tests.ts index 9d9e72bd4f..72bbc15126 100644 --- a/types/mssql/mssql-tests.ts +++ b/types/mssql/mssql-tests.ts @@ -1,4 +1,5 @@ import * as sql from 'mssql'; +import * as msnodesqlv8 from 'mssql/msnodesqlv8'; interface Entity { value: number; @@ -203,3 +204,10 @@ function test_classes_extend_eventemitter() { preparedStatment.on('error', () => { }) } + +async function test_msnodesqlv8() { + const connection = new msnodesqlv8.ConnectionPool({ server: "localhost", database: "master", options: { trustedConnection: true } }); + await connection.connect(); + const result = await connection.query`SELECT * FROM sys.databases`; + await connection.close(); +} diff --git a/types/mssql/tsconfig.json b/types/mssql/tsconfig.json index 51f03fd652..d53105dc0a 100644 --- a/types/mssql/tsconfig.json +++ b/types/mssql/tsconfig.json @@ -18,6 +18,7 @@ }, "files": [ "index.d.ts", + "msnodesqlv8.d.ts", "mssql-tests.ts" ] } \ No newline at end of file diff --git a/types/nanoid/async-browser.d.ts b/types/nanoid/async-browser.d.ts new file mode 100644 index 0000000000..7d96f06f29 --- /dev/null +++ b/types/nanoid/async-browser.d.ts @@ -0,0 +1,3 @@ +declare function nanoidAsyncBrowser(size?: number): Promise; + +export = nanoidAsyncBrowser; diff --git a/types/nanoid/async.d.ts b/types/nanoid/async.d.ts new file mode 100644 index 0000000000..a455681f11 --- /dev/null +++ b/types/nanoid/async.d.ts @@ -0,0 +1,8 @@ +interface NanoidAsync { + (size?: number): Promise; + (size: number | null, callback: (error: Error | null, id: string) => any): void; +} + +declare const nanoidAsync: NanoidAsync; + +export = nanoidAsync; diff --git a/types/nanoid/index.d.ts b/types/nanoid/index.d.ts index 5ec4ccc025..ec18370859 100644 --- a/types/nanoid/index.d.ts +++ b/types/nanoid/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for nanoid 1.0 +// Type definitions for nanoid 1.2 // Project: https://github.com/ai/nanoid // Definitions by: Ruben Schmidmeister +// Daniel Zhang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare function nanoid(size?: number): string; diff --git a/types/nanoid/nanoid-tests.ts b/types/nanoid/nanoid-tests.ts index 063bb3317d..e026ec0659 100644 --- a/types/nanoid/nanoid-tests.ts +++ b/types/nanoid/nanoid-tests.ts @@ -4,6 +4,8 @@ import generate = require('nanoid/generate'); import random = require('nanoid/random'); import randomBrowser = require('nanoid/random-browser'); import url = require('nanoid/url'); +import nanoidAsync = require('nanoid/async'); +import nanoidAsyncBrowser = require('nanoid/async-browser'); const _random = (size: number) => [1, 2, 3, 4]; @@ -13,5 +15,12 @@ format(_random, "abcdef", 5); generate('0123456789абвгдеё', 5); random(10); randomBrowser(10); +nanoidAsync().then((id) => console.log(id)); +nanoidAsync(10).then((id) => console.log(id)); +nanoidAsync(null, (error, id) => { + console.log(error, id); +}); +nanoidAsyncBrowser().then((id) => console.log(id)); +nanoidAsyncBrowser(10).then((id) => console.log(id)); console.log(url); diff --git a/types/nanoid/tsconfig.json b/types/nanoid/tsconfig.json index cab6900700..1051097a89 100644 --- a/types/nanoid/tsconfig.json +++ b/types/nanoid/tsconfig.json @@ -17,6 +17,8 @@ "strictFunctionTypes": true }, "files": [ + "async-browser.d.ts", + "async.d.ts", "format.d.ts", "generate.d.ts", "index.d.ts", @@ -25,4 +27,4 @@ "random.d.ts", "url.d.ts" ] -} \ No newline at end of file +} diff --git a/types/nested-error-stacks/index.d.ts b/types/nested-error-stacks/index.d.ts new file mode 100644 index 0000000000..29d629a50b --- /dev/null +++ b/types/nested-error-stacks/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for nested-error-stacks 2.1 +// Project: https://github.com/mdlavin/nested-error-stacks +// Definitions by: Wouter van Heeswijk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare class NestedError extends Error { + constructor(message?: any, nested?: Error); +} + +export = NestedError; diff --git a/types/nested-error-stacks/nested-error-stacks-tests.ts b/types/nested-error-stacks/nested-error-stacks-tests.ts new file mode 100644 index 0000000000..52a9a55495 --- /dev/null +++ b/types/nested-error-stacks/nested-error-stacks-tests.ts @@ -0,0 +1,6 @@ +import NestedErrorStacks = require('nested-error-stacks'); + +const error = new NestedErrorStacks('Top level error', new Error('Nested error')); +const message = error.message; +const name = error.name; +const stack = error.stack; diff --git a/types/nested-error-stacks/tsconfig.json b/types/nested-error-stacks/tsconfig.json new file mode 100644 index 0000000000..2954204b36 --- /dev/null +++ b/types/nested-error-stacks/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", + "nested-error-stacks-tests.ts" + ] +} \ No newline at end of file diff --git a/types/nested-error-stacks/tslint.json b/types/nested-error-stacks/tslint.json new file mode 100644 index 0000000000..b4b47a0378 --- /dev/null +++ b/types/nested-error-stacks/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/next/app.d.ts b/types/next/app.d.ts index e086af0ca8..d077c0e95a 100644 --- a/types/next/app.d.ts +++ b/types/next/app.d.ts @@ -1,19 +1,19 @@ import * as React from "react"; import { NextContext } from "."; -import { RouterProps } from "./router"; +import { RouterProps, DefaultQuery } from "./router"; -export interface AppComponentProps { +export interface AppComponentProps { Component: React.ComponentType; - router: RouterProps; + router: RouterProps; pageProps: any; } -export interface AppComponentContext { +export interface AppComponentContext { Component: React.ComponentType; - router: RouterProps; - ctx: NextContext; + router: RouterProps; + ctx: NextContext; } -export class Container extends React.Component {} +export class Container extends React.Component { } -export default class App extends React.Component {} +export default class App extends React.Component> { } diff --git a/types/next/index.d.ts b/types/next/index.d.ts index 2d87121d61..399963cbd8 100644 --- a/types/next/index.d.ts +++ b/types/next/index.d.ts @@ -16,19 +16,22 @@ import * as url from "url"; import { Response as NodeResponse } from "node-fetch"; +import { SingletonRouter } from './router'; + declare namespace next { /** Map object used in query strings. */ type QueryStringMapObject = Record; /** * Context object used in methods like `getInitialProps()` - * <> + * https://github.com/zeit/next.js/blob/6.1.1/server/render.js#L77 + * https://github.com/zeit/next.js/blob/6.1.1/readme.md#fetching-data-and-component-lifecycle */ - interface NextContext { + interface NextContext { /** path section of URL */ pathname: string; /** query string section of URL parsed as an object */ - query: QueryStringMapObject; + query: Q; /** String of the actual path (including the query) shows in the browser */ asPath: string; /** HTTP request object (server only) */ @@ -39,20 +42,21 @@ declare namespace next { jsonPageRes?: NodeResponse; /** Error object if any error is encountered during the rendering */ err?: Error; - /** Whether we're running on the server environment or not. */ - isServer?: boolean; } - type NextSFC = NextStatelessComponent; - interface NextStatelessComponent + type NextSFC = NextStatelessComponent; + interface NextStatelessComponent extends React.StatelessComponent { - getInitialProps?: (ctx: NextContext) => Promise; + getInitialProps?: (ctx: NextContext) => Promise; } type UrlLike = url.UrlObject | url.Url; + /** + * Next.js config schema. + * https://github.com/zeit/next.js/blob/6.1.1/server/config.js#L10 + */ interface ServerConfig { - // known keys webpack?: any; webpackDevMiddleware?: any; poweredByHeader?: boolean; @@ -60,11 +64,20 @@ declare namespace next { assetPrefix?: string; configOrigin?: string; useFileSystemPublicRoutes?: boolean; + generateBuildId?: () => string; + generateEtags?: boolean; + pageExtensions?: string[]; + publicRuntimeConfig?: object; + serverRuntimeConfig?: object; - // and since this is a config, it can take anything else, too. + // Plugin can define their own keys. [key: string]: any; } + /** + * Options passed to the Server constructor in Node.js. + * https://github.com/zeit/next.js/blob/6.1.1/server/index.js#L30 + */ interface ServerOptions { dir?: string; dev?: boolean; @@ -73,8 +86,36 @@ declare namespace next { conf?: ServerConfig; } + /** + * Next.js server instance API. + */ interface Server { - setAssetPrefix: (cdnUrl: string) => void; + // From constructor + // https://github.com/zeit/next.js/blob/6.1.1/server/index.js#L30 + dir: string; + dev: boolean; + quiet: boolean; + router: SingletonRouter; + http: null | http.Server; + nextConfig: ServerConfig; + distDir: string; + buildId: string; + hotReloader: any; + renderOpts: { + dev: string; + staticMarkup: boolean; + distDir: string; + hotReloader: any; + buildId: string; + availableChunks: object; + generateETags: boolean; + runtimeConfig?: object; + }; + + getHotReloader( + dir: string, + options: { quiet: boolean; config: ServerConfig; buildId: string } + ): any; handleRequest( req: http.IncomingMessage, res: http.ServerResponse, @@ -85,6 +126,8 @@ declare namespace next { res: http.ServerResponse, parsedUrl?: UrlLike ) => Promise; + setAssetPrefix(prefix: string): void; + prepare(): Promise; close(): Promise; defineRoutes(): Promise; @@ -102,6 +145,12 @@ declare namespace next { query?: QueryStringMapObject, parsedUrl?: UrlLike ): Promise; + renderToHTML( + req: http.IncomingMessage, + res: http.ServerResponse, + pathname: string, + query?: QueryStringMapObject + ): Promise; renderError( err: any, req: http.IncomingMessage, @@ -109,17 +158,6 @@ declare namespace next { pathname: string, query?: QueryStringMapObject ): Promise; - render404( - req: http.IncomingMessage, - res: http.ServerResponse, - parsedUrl: UrlLike - ): Promise; - renderToHTML( - req: http.IncomingMessage, - res: http.ServerResponse, - pathname: string, - query?: QueryStringMapObject - ): Promise; renderErrorToHTML( err: any, req: http.IncomingMessage, @@ -127,6 +165,11 @@ declare namespace next { pathname: string, query?: QueryStringMapObject ): Promise; + render404( + req: http.IncomingMessage, + res: http.ServerResponse, + parsedUrl?: UrlLike + ): Promise; serveStatic( req: http.IncomingMessage, @@ -134,19 +177,9 @@ declare namespace next { path: string ): Promise; isServeableUrl(path: string): boolean; - isInternalUrl(req: http.IncomingMessage): boolean; readBuildId(): string; handleBuildId(buildId: string, res: http.ServerResponse): boolean; - getCompilationError( - page: string, - req: http.IncomingMessage, - res: http.ServerResponse - ): Promise; - handleBuildHash( - filename: string, - hash: string, - res: http.ServerResponse - ): void; + getCompilationError(): Promise; send404(res: http.ServerResponse): void; } } diff --git a/types/next/router.d.ts b/types/next/router.d.ts index fe3563d473..be3665e3d5 100644 --- a/types/next/router.d.ts +++ b/types/next/router.d.ts @@ -26,20 +26,22 @@ export type PopStateCallback = (state: any) => boolean | undefined; export type RouterCallback = () => void; -export interface RouterProps { +export interface DefaultQuery { + [key: string]: + | boolean + | boolean[] + | number + | number[] + | string + | string[]; +} + +export interface RouterProps { // url property fields readonly pathname: string; readonly route: string; readonly asPath?: string; - readonly query?: { - [key: string]: - | boolean - | boolean[] - | number - | number[] - | string - | string[]; - }; + readonly query?: Q; // property fields readonly components: { @@ -78,18 +80,22 @@ export interface RouterProps { }; } -export interface SingletonRouter extends RouterProps { - router: RouterProps | null; +export interface SingletonRouter extends RouterProps { + router: RouterProps | null; readyCallbacks: RouterCallback[]; ready(cb: RouterCallback): void; } -export interface WithRouterProps { - router: SingletonRouter; +export interface WithRouterProps { + router: SingletonRouter; } -export function withRouter( - Component: React.ComponentType, +// Manually disabling the no-unnecessary-generics rule so users can +// retain type inference if they warp their component in withRouter +// without defining props explicitly +export function withRouter( + // tslint:disable-next-line:no-unnecessary-generics + Component: React.ComponentType>, ): React.ComponentType; declare const Router: SingletonRouter; diff --git a/types/next/test/next-router-tests.tsx b/types/next/test/next-router-tests.tsx index fdcf1de3ff..04fa50b912 100644 --- a/types/next/test/next-router-tests.tsx +++ b/types/next/test/next-router-tests.tsx @@ -96,3 +96,13 @@ class TestComponent extends React.Component { } + +const TestSFC: React.SFC = ({ router }) => { + return
            {router.query && router.query.test}
            ; +}; diff --git a/types/next/test/next-tests.ts b/types/next/test/next-tests.ts index ddbc51ee33..2e717f6698 100644 --- a/types/next/test/next-tests.ts +++ b/types/next/test/next-tests.ts @@ -10,13 +10,22 @@ const server = createServer({ distDir: "./dist", useFileSystemPublicRoutes: false, anotherProperty: { - key: true, - }, - }, + key: true + } + } }); -const voidFunc = () => {}; -const stringFunc = (x: string) => x.split("\n"); +const { + dir, + dev, + quiet, + router, + nextConfig, + distDir, + buildId + } = server; + const { assetPrefix } = nextConfig; + const voidFunc = () => {}; server.prepare().then(voidFunc); server.close().then(voidFunc); @@ -68,11 +77,9 @@ function handle(req: http.IncomingMessage, res: http.ServerResponse) { let b: boolean; b = server.isServeableUrl("/path/to/thing"); - b = server.isInternalUrl(req); b = server.handleBuildId("{buildId}", res); const s: string = server.readBuildId(); - server.getCompilationError("page", req, res).then(err => err.thisIsAnAny); - server.handleBuildHash("filename", "hash", res); + server.getCompilationError().then(err => err.thisIsAnAny); server.send404(res); } diff --git a/types/node-forge/README.md b/types/node-forge/README.md new file mode 100644 index 0000000000..fcac651de8 --- /dev/null +++ b/types/node-forge/README.md @@ -0,0 +1,29 @@ +# DefinitelyTyped for node-forge + +## Current node-forge Version +`v0.7.6` +## Usage + +```bash +npm install --save-dev @types/node-forge +npm install --save node-forge +``` + +example: +```ts +import * as forge from "node-forge"; + +Buffer.isBuffer(forge.pki.ed25519.generateKeyPair().publicKey) // true +``` +## License +BSD-2-Clause + +## dependencies +`@types/node` + +## Author +[Seth Westphal](https://github.com/westy92) +[Kay Schecker](https://github.com/flynetworks) +[Aakash Goenka](https://github.com/a-k-g) +[Rafal2228](https://github.com/rafal2228) +[Beeno Tung](https://github.com/beenotung) diff --git a/types/node-forge/index.d.ts b/types/node-forge/index.d.ts index 65ff4edb47..e30a217ddc 100644 --- a/types/node-forge/index.d.ts +++ b/types/node-forge/index.d.ts @@ -1,10 +1,14 @@ -// Type definitions for node-forge 0.7.5 +// Type definitions for node-forge 0.7.6 // Project: https://github.com/digitalbazaar/forge // Definitions by: Seth Westphal // Kay Schecker // Aakash Goenka // Rafal2228 +// Beeno Tung // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/// declare module "node-forge" { type Byte = string; @@ -73,6 +77,33 @@ declare module "node-forge" { function generateKeyPair(options?: GenerateKeyPairOptions, callback?: (err: Error, keypair: KeyPair) => void): KeyPair; } + namespace ed25519 { + + type NativeBuffer = Buffer | Uint8Array; + + namespace constants { + const PUBLIC_KEY_BYTE_LENGTH = 32; + const PRIVATE_KEY_BYTE_LENGTH = 64; + const SEED_BYTE_LENGTH = 32; + const SIGN_BYTE_LENGTH = 64; + const HASH_BYTE_LENGTH = 64; + } + + function generateKeyPair(options?: { seed?: Buffer | Uint8Array | string }): { + publicKey: NativeBuffer; + privateKey: NativeBuffer; + }; + + function publicKeyFromPrivateKey(options: { privateKey: NativeBuffer }): NativeBuffer; + + function sign(options: { privateKey: NativeBuffer }): NativeBuffer; + + function verify(options: { + signature: Buffer | Uint8Array | util.ByteBuffer | string, + publicKey: NativeBuffer + }): boolean; + } + interface CertificateFieldOptions { name?: string; type?: string; diff --git a/types/node-localstorage/index.d.ts b/types/node-localstorage/index.d.ts new file mode 100644 index 0000000000..960d40f1da --- /dev/null +++ b/types/node-localstorage/index.d.ts @@ -0,0 +1,126 @@ +// Type definitions for node-localstorage 1.3 +// Project: https://github.com/lmaccherone/node-localstorage +// Definitions by: Allen Gammel +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import { EventEmitter } from 'events'; + +/** + * A drop-in substitute for the browser native localStorage API that runs on node.js. + * Copyright (c) 2012, Lawrence S. Maccherone, Jr. -- https://github.com/lmaccherone/node-localstorage + * (MIT License) + */ +export class LocalStorage extends EventEmitter { + /** + * The number of keys in the local storage. + */ + length: number; + /** + * Clears the local storage + */ + clear(): void; + /** + * Gets the value of the given [key] + * @param key The key whose value you want to retrieve. + */ + getItem(key: string): string | null; + /** + * Retrieves the value of the key at the [index]. + * @param index The index of the key in which you want to return the value of. + */ + key(index: number): string; + /** + * Removes the specified [key] from local storage. + * @param key The key you want to remove. + */ + removeItem(key: string): void; + /** + * Stores a `key` and it's `value` in to the local store. + * @param key Unique identifier for the new local storage item + * @param value The value of the item + */ + setItem(key: string, value: string): void; + /** + * Internal event `storage` is fired on the `removeItem`, `setItem` and `clear` methods, if subscribed. + * @param eventName The only `eventName` that is supported is `storage`. + * @param callback The call back type is of `StorageEvent`. + */ + on(eventName: 'storage', callback: (event: StorageEvent) => void): this; + /** + * Creates a new LocalStorage instance + * @param location The location in which the local storage resides + * @param quota The partitioned size of the local storage + */ + constructor(location: string, quota?: number); +} +export class JSONStorage extends LocalStorage { + /** + * Gets the value of the given `key`. This method performs a `JSON.parse` on the `value` before returning it. + * @param key The key whose value you want to retrieve. + * @returns `Array of Objects` or an `Object`. This `getItem` method performs a `JSON.parse` on the `value` before returning it. + */ + getItem(key: string): any; + /** + * Stores a `key` and it's `value` in to the local store. The given `value` will have `JSON.stringify` performed on it prior to storing. + * @param key Unique identifier for the new local storage item + * @param value The value associated with the `key`. This `setItem` method performs a `JSON.stringify` on the value before storage. The `value` *must* be a valid `JSON` object. + */ + setItem(key: string, value: any): void; + /** + * Creates a new LocalStorage instance + * @param location The location in which the local storage resides + * @param quota The partitioned size of the local storage + */ + constructor(location: string, quota?: number); +} + +/** + * Contains information regarding a `storage` event. + */ +export class StorageEvent { + /** + * Affected `key`. + */ + key: string; + /** + * Previous `value` associated with the `key`. + */ + oldValue: string; + /** + * Current `value` associated with the `key`. + */ + newValue: string; + /** + * The current `process.pid` for the calling process. + */ + url: string; + /** + * The location of the storage area. Defaults to `localStorage`. + */ + storageArea: string; + /** + * Creates an object containing information regarding a `storage` event. + * @param key Affected `key`. + * @param oldValue Previous `value` associated with the `key`. + * @param newValue Current `value` associated with the `key`. + * @param url The current `process.pid` for the calling process. + * @param storageArea The location of the storage area. Defaults to `localStorage`. + */ + constructor(key: string, oldValue: string, newValue: string, url: string, storageArea: string); +} + +/** + * Provides a specific `Error` object for **Quota Exceeded Errors**. + */ +export class QUOTA_EXCEEDED_ERR extends Error { + /** + * Message explaining the error. + */ + message: string; + /** + * Creates a specific `Error` object for **Quota Exceeded Errors**. + * @param message Message explaining the error. + */ + constructor(message: string); +} diff --git a/types/node-localstorage/node-localstorage-tests.ts b/types/node-localstorage/node-localstorage-tests.ts new file mode 100644 index 0000000000..25c27e622c --- /dev/null +++ b/types/node-localstorage/node-localstorage-tests.ts @@ -0,0 +1,58 @@ +import { LocalStorage, JSONStorage } from 'node-localstorage'; + +const jsonStore = new JSONStorage('./jsonStore'); +const textStore = new LocalStorage('./textStore'); + +interface Person { + givenName: string; + middleName: string; + familyName: string; +} + +const mjkModel: Person = { + givenName: 'Maynard', + middleName: 'James', + familyName: 'Keenan', +}; + +textStore.clear(); +jsonStore.clear(); + +textStore.on('storage', (event) => { + if (textStore.getItem(event.key) !== event.newValue) { + throw new Error('textStore: An error occurred with the event handler.'); + } +}); + +jsonStore.on('storage', (event) => { + if (jsonStore.getItem(event.key) !== event.newValue) { + throw new Error('jsonStore: An error occurred with the event handler.'); + } +}); + +textStore.setItem('tool', '46&2'); + +if (textStore.getItem('tool') !== '46&2') { + throw new Error('.setItem method is not working!'); +} + +jsonStore.setItem('mjk', mjkModel); + +if (jsonStore.getItem('mjk') === null) { + throw new Error('.getItem failed.'); +} + +const mjkTest: Person = jsonStore.getItem('mjk'); + +if (mjkTest === null || mjkTest.givenName !== mjkModel.givenName || mjkTest.middleName !== mjkModel.middleName || mjkTest.familyName !== mjkModel.familyName) { + throw new Error('.setItem method is not working!'); +} + +const keyCheck = textStore.key(0); + +if (keyCheck && keyCheck !== 'tool') { + throw new Error('.key method has failed.'); +} + +textStore.clear(); +jsonStore.clear(); diff --git a/types/node-localstorage/tsconfig.json b/types/node-localstorage/tsconfig.json new file mode 100644 index 0000000000..9411b285e2 --- /dev/null +++ b/types/node-localstorage/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", + "node-localstorage-tests.ts" + ] +} \ No newline at end of file diff --git a/types/node-localstorage/tslint.json b/types/node-localstorage/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/node-localstorage/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/node-telegram-bot-api/index.d.ts b/types/node-telegram-bot-api/index.d.ts index 32f4ae8d85..934daa3fe3 100644 --- a/types/node-telegram-bot-api/index.d.ts +++ b/types/node-telegram-bot-api/index.d.ts @@ -904,96 +904,96 @@ declare class TelegramBot extends EventEmitter { hasOpenWebHook(): boolean; - getMe(): Promise; + getMe(): Promise; setWebHook(url: string, options?: TelegramBot.SetWebHookOptions): Promise; - deleteWebHook(): Promise; + deleteWebHook(): Promise; - getWebHookInfo(): Promise; + getWebHookInfo(): Promise; - getUpdates(options?: TelegramBot.GetUpdatesOptions): Promise; + getUpdates(options?: TelegramBot.GetUpdatesOptions): Promise; processUpdate(update: TelegramBot.Update): void; - sendMessage(chatId: number | string, text: string, options?: TelegramBot.SendMessageOptions): Promise; + sendMessage(chatId: number | string, text: string, options?: TelegramBot.SendMessageOptions): Promise; - answerInlineQuery(inlineQueryId: string, results: ReadonlyArray, options?: TelegramBot.AnswerInlineQueryOptions): Promise; + answerInlineQuery(inlineQueryId: string, results: ReadonlyArray, options?: TelegramBot.AnswerInlineQueryOptions): Promise; - forwardMessage(chatId: number | string, fromChatId: number | string, messageId: number | string, options?: TelegramBot.ForwardMessageOptions): Promise; + forwardMessage(chatId: number | string, fromChatId: number | string, messageId: number | string, options?: TelegramBot.ForwardMessageOptions): Promise; - sendPhoto(chatId: number | string, photo: string | Stream | Buffer, options?: TelegramBot.SendPhotoOptions): Promise; + sendPhoto(chatId: number | string, photo: string | Stream | Buffer, options?: TelegramBot.SendPhotoOptions): Promise; - sendAudio(chatId: number | string, audio: string | Stream | Buffer, options?: TelegramBot.SendAudioOptions): Promise; + sendAudio(chatId: number | string, audio: string | Stream | Buffer, options?: TelegramBot.SendAudioOptions): Promise; - sendDocument(chatId: number | string, doc: string | Stream | Buffer, options?: TelegramBot.SendDocumentOptions, fileOpts?: any): Promise; + sendDocument(chatId: number | string, doc: string | Stream | Buffer, options?: TelegramBot.SendDocumentOptions, fileOpts?: any): Promise; - sendMediaGroup(chatId: number | string, media: ReadonlyArray, options?: TelegramBot.SendMediaGroupOptions): Promise; + sendMediaGroup(chatId: number | string, media: ReadonlyArray, options?: TelegramBot.SendMediaGroupOptions): Promise; - sendSticker(chatId: number | string, sticker: string | Stream | Buffer, options?: TelegramBot.SendStickerOptions): Promise; + sendSticker(chatId: number | string, sticker: string | Stream | Buffer, options?: TelegramBot.SendStickerOptions): Promise; - sendVideo(chatId: number | string, video: string | Stream | Buffer, options?: TelegramBot.SendVideoOptions): Promise; + sendVideo(chatId: number | string, video: string | Stream | Buffer, options?: TelegramBot.SendVideoOptions): Promise; - sendVideoNote(chatId: number | string, videoNote: string | Stream | Buffer, options?: TelegramBot.SendVideoNoteOptions): Promise; + sendVideoNote(chatId: number | string, videoNote: string | Stream | Buffer, options?: TelegramBot.SendVideoNoteOptions): Promise; - sendVoice(chatId: number | string, voice: string | Stream | Buffer, options?: TelegramBot.SendVoiceOptions): Promise; + sendVoice(chatId: number | string, voice: string | Stream | Buffer, options?: TelegramBot.SendVoiceOptions): Promise; - sendChatAction(chatId: number | string, action: TelegramBot.ChatAction): Promise; + sendChatAction(chatId: number | string, action: TelegramBot.ChatAction): Promise; - kickChatMember(chatId: number | string, userId: string): Promise; + kickChatMember(chatId: number | string, userId: string): Promise; - unbanChatMember(chatId: number | string, userId: string): Promise; + unbanChatMember(chatId: number | string, userId: string): Promise; - restrictChatMember(chatId: number | string, userId: string, options?: TelegramBot.RestrictChatMemberOptions): Promise; + restrictChatMember(chatId: number | string, userId: string, options?: TelegramBot.RestrictChatMemberOptions): Promise; - promoteChatMember(chatId: number | string, userId: string, options?: TelegramBot.PromoteChatMemberOptions): Promise; + promoteChatMember(chatId: number | string, userId: string, options?: TelegramBot.PromoteChatMemberOptions): Promise; - exportChatInviteLink(chatId: number | string): Promise; + exportChatInviteLink(chatId: number | string): Promise; - setChatPhoto(chatId: number | string, photo: string | Stream | Buffer): Promise; + setChatPhoto(chatId: number | string, photo: string | Stream | Buffer): Promise; - deleteChatPhoto(chatId: number | string): Promise; + deleteChatPhoto(chatId: number | string): Promise; - setChatTitle(chatId: number | string, title: string): Promise; + setChatTitle(chatId: number | string, title: string): Promise; - setChatDescription(chatId: number | string, description: string): Promise; + setChatDescription(chatId: number | string, description: string): Promise; - pinChatMessage(chatId: number | string, messageId: string): Promise; + pinChatMessage(chatId: number | string, messageId: string): Promise; - unpinChatMessage(chatId: number | string): Promise; + unpinChatMessage(chatId: number | string): Promise; - answerCallbackQuery(callbackQueryId: string, options?: Partial): Promise; + answerCallbackQuery(callbackQueryId: string, options?: Partial): Promise; /** * @deprecated since version 0.30.0 */ - answerCallbackQuery(options?: TelegramBot.AnswerCallbackQueryOptions): Promise; + answerCallbackQuery(options?: TelegramBot.AnswerCallbackQueryOptions): Promise; - editMessageText(text: string, options?: TelegramBot.EditMessageTextOptions): Promise; + editMessageText(text: string, options?: TelegramBot.EditMessageTextOptions): Promise; - editMessageCaption(caption: string, options?: TelegramBot.EditMessageCaptionOptions): Promise; + editMessageCaption(caption: string, options?: TelegramBot.EditMessageCaptionOptions): Promise; - editMessageReplyMarkup(replyMarkup: TelegramBot.InlineKeyboardMarkup, options?: TelegramBot.EditMessageReplyMarkupOptions): Promise; + editMessageReplyMarkup(replyMarkup: TelegramBot.InlineKeyboardMarkup, options?: TelegramBot.EditMessageReplyMarkupOptions): Promise; - getUserProfilePhotos(userId: number | string, options?: TelegramBot.GetUserProfilePhotosOptions): Promise; + getUserProfilePhotos(userId: number | string, options?: TelegramBot.GetUserProfilePhotosOptions): Promise; - sendLocation(chatId: number | string, latitude: number, longitude: number, options?: TelegramBot.SendLocationOptions): Promise; + sendLocation(chatId: number | string, latitude: number, longitude: number, options?: TelegramBot.SendLocationOptions): Promise; - editMessageLiveLocation(latitude: number, longitude: number, options?: TelegramBot.EditMessageLiveLocationOptions): Promise; + editMessageLiveLocation(latitude: number, longitude: number, options?: TelegramBot.EditMessageLiveLocationOptions): Promise; - stopMessageLiveLocation(options?: TelegramBot.StopMessageLiveLocationOptions): Promise; + stopMessageLiveLocation(options?: TelegramBot.StopMessageLiveLocationOptions): Promise; - sendVenue(chatId: number | string, latitude: number, longitude: number, title: string, address: string, options?: TelegramBot.SendVenueOptions): Promise; + sendVenue(chatId: number | string, latitude: number, longitude: number, title: string, address: string, options?: TelegramBot.SendVenueOptions): Promise; - sendContact(chatId: number | string, phoneNumber: string, firstName: string, options?: TelegramBot.SendContactOptions): Promise; + sendContact(chatId: number | string, phoneNumber: string, firstName: string, options?: TelegramBot.SendContactOptions): Promise; - getFile(fileId: string): Promise; + getFile(fileId: string): Promise; - getFileLink(fileId: string): Promise; + getFileLink(fileId: string): Promise; getFileStream(fileId: string): Readable; - downloadFile(fileId: string, downloadDir: string): Promise; + downloadFile(fileId: string, downloadDir: string): Promise; onText(regexp: RegExp, callback: ((msg: TelegramBot.Message, match: RegExpExecArray | null) => void)): void; @@ -1003,34 +1003,34 @@ declare class TelegramBot extends EventEmitter { removeReplyListener(replyListenerId: number): TelegramBot.ReplyListener; - getChat(chatId: number | string): Promise; + getChat(chatId: number | string): Promise; - getChatAdministrators(chatId: number | string): Promise; + getChatAdministrators(chatId: number | string): Promise; - getChatMembersCount(chatId: number | string): Promise; + getChatMembersCount(chatId: number | string): Promise; - getChatMember(chatId: number | string, userId: string): Promise; + getChatMember(chatId: number | string, userId: string): Promise; - leaveChat(chatId: number | string): Promise; + leaveChat(chatId: number | string): Promise; - setChatStickerSet(chatId: number | string, stickerSetName: string): Promise; + setChatStickerSet(chatId: number | string, stickerSetName: string): Promise; - deleteChatStickerSet(chatId: number | string): Promise; + deleteChatStickerSet(chatId: number | string): Promise; - sendGame(chatId: number | string, gameShortName: string, options?: TelegramBot.SendGameOptions): Promise; + sendGame(chatId: number | string, gameShortName: string, options?: TelegramBot.SendGameOptions): Promise; - setGameScore(userId: string, score: number, options?: TelegramBot.SetGameScoreOptions): Promise; + setGameScore(userId: string, score: number, options?: TelegramBot.SetGameScoreOptions): Promise; - getGameHighScores(userId: string, options?: TelegramBot.GetGameHighScoresOptions): Promise; + getGameHighScores(userId: string, options?: TelegramBot.GetGameHighScoresOptions): Promise; - deleteMessage(chatId: number | string, messageId: string, options?: any): Promise; + deleteMessage(chatId: number | string, messageId: string, options?: any): Promise; sendInvoice(chatId: number | string, title: string, description: string, payload: string, providerToken: string, startParameter: string, currency: string, - prices: ReadonlyArray, options?: TelegramBot.SendInvoiceOptions): Promise; + prices: ReadonlyArray, options?: TelegramBot.SendInvoiceOptions): Promise; - answerShippingQuery(shippingQueryId: string, ok: boolean, options?: TelegramBot.AnswerShippingQueryOptions): Promise; + answerShippingQuery(shippingQueryId: string, ok: boolean, options?: TelegramBot.AnswerShippingQueryOptions): Promise; - answerPreCheckoutQuery(preCheckoutQueryId: string, ok: boolean, options?: TelegramBot.AnswerPreCheckoutQueryOptions): Promise; + answerPreCheckoutQuery(preCheckoutQueryId: string, ok: boolean, options?: TelegramBot.AnswerPreCheckoutQueryOptions): Promise; } export = TelegramBot; diff --git a/types/node-telegram-bot-api/node-telegram-bot-api-tests.ts b/types/node-telegram-bot-api/node-telegram-bot-api-tests.ts index b4b09485cb..49368e74ec 100644 --- a/types/node-telegram-bot-api/node-telegram-bot-api-tests.ts +++ b/types/node-telegram-bot-api/node-telegram-bot-api-tests.ts @@ -9,6 +9,9 @@ MyTelegramBot.openWebHook(); MyTelegramBot.closeWebHook(); MyTelegramBot.hasOpenWebHook(); MyTelegramBot.getMe(); +MyTelegramBot.getMe().then((value: TelegramBot.User) => { + const username = value.username; +}); MyTelegramBot.setWebHook('http://typescriptlang.org', {max_connections: 100}); MyTelegramBot.deleteWebHook(); MyTelegramBot.getWebHookInfo(); diff --git a/types/node/index.d.ts b/types/node/index.d.ts index f768f0aae9..ea3a5e8c47 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Node.js 10.7.x +// Type definitions for Node.js 10.9.x // Project: http://nodejs.org/ // Definitions by: Microsoft TypeScript // DefinitelyTyped @@ -28,6 +28,7 @@ // Zane Hannan AU // Thomas den Hollander // Eugene Y. Q. Shen +// Matthieu Sieben // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** inspector module types */ @@ -186,11 +187,11 @@ interface String { trimRight(): string; } -/************************************************ -* * -* GLOBAL * -* * -************************************************/ +/*-----------------------------------------------* + * * + * GLOBAL * + * * + ------------------------------------------------*/ declare var process: NodeJS.Process; declare var global: NodeJS.Global; declare var console: Console; @@ -468,11 +469,11 @@ declare var Buffer: { poolSize: number; }; -/************************************************ +/*----------------------------------------------* * * * GLOBAL INTERFACES * * * -************************************************/ +*-----------------------------------------------*/ declare namespace NodeJS { export interface InspectOptions { showHidden?: boolean; @@ -828,7 +829,7 @@ declare namespace NodeJS { emit(event: "unhandledRejection", reason: any, promise: Promise): boolean; emit(event: "warning", warning: Error): boolean; emit(event: "message", message: any, sendHandle: any): this; - emit(event: Signals): boolean; + emit(event: Signals, signal: Signals): boolean; emit(event: "newListener", eventName: string | symbol, listener: (...args: any[]) => void): this; emit(event: "removeListener", eventName: string, listener: (...args: any[]) => void): this; @@ -988,11 +989,11 @@ declare namespace NodeJS { interface IterableIterator { } -/************************************************ +/*----------------------------------------------* * * * MODULES * * * -************************************************/ +*-----------------------------------------------*/ declare module "buffer" { export var INSPECT_MAX_BYTES: number; var BuffType: typeof Buffer; @@ -1094,6 +1095,7 @@ declare module "http" { 'transfer-encoding'?: string; 'tk'?: string; 'upgrade'?: string; + 'user-agent'?: string; 'vary'?: string; 'via'?: string; 'warning'?: string; @@ -1289,7 +1291,9 @@ declare module "http" { // create interface RequestOptions would make the naming more clear to developers export interface RequestOptions extends ClientRequestArgs { } export function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + export function request(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; export function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + export function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; export var globalAgent: Agent; } @@ -1708,6 +1712,7 @@ declare module "os" { netmask: string; mac: string; internal: boolean; + cidr: string | null; } export interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { @@ -1891,7 +1896,9 @@ declare module "https" { export function createServer(options: ServerOptions, requestListener?: (req: http.IncomingMessage, res: http.ServerResponse) => void): Server; export function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + export function request(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; export function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + export function get(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; export var globalAgent: Agent; } @@ -5899,13 +5906,15 @@ declare module "crypto" { authTagLength?: number; } /** @deprecated since v10.0.0 use createCipheriv() */ - export function createCipher(algorithm: string, password: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Cipher; export function createCipher(algorithm: CipherCCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): CipherCCM; - export function createCipher(algorithm: CipherGCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options: CipherGCMOptions): CipherGCM; + /** @deprecated since v10.0.0 use createCipheriv() */ + export function createCipher(algorithm: CipherGCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options?: CipherGCMOptions): CipherGCM; + /** @deprecated since v10.0.0 use createCipheriv() */ + export function createCipher(algorithm: string, password: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Cipher; + export function createCipheriv(algorithm: CipherCCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): CipherCCM; + export function createCipheriv(algorithm: CipherGCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options?: CipherGCMOptions): CipherGCM; export function createCipheriv(algorithm: string, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Cipher; - export function createCipheriv(algorithm: CipherGCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): CipherCCM; - export function createCipheriv(algorithm: CipherGCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherGCMOptions): CipherGCM; export interface Cipher extends NodeJS.ReadWriteStream { update(data: string | Buffer | NodeJS.TypedArray | DataView): Buffer; @@ -5921,21 +5930,23 @@ declare module "crypto" { // setAAD(buffer: Buffer): this; // docs only say buffer } export interface CipherCCM extends Cipher { - setAAD(buffer: Buffer, options: { plainTextLength: number }): this; + setAAD(buffer: Buffer, options: { plaintextLength: number }): this; getAuthTag(): Buffer; } export interface CipherGCM extends Cipher { - setAAD(buffer: Buffer, options?: { plainTextLength: number }): this; + setAAD(buffer: Buffer, options?: { plaintextLength: number }): this; getAuthTag(): Buffer; } /** @deprecated since v10.0.0 use createCipheriv() */ - export function createDecipher(algorithm: string, password: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Decipher; export function createDecipher(algorithm: CipherCCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): DecipherCCM; - export function createDecipher(algorithm: CipherGCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options: CipherGCMOptions): DecipherGCM; + /** @deprecated since v10.0.0 use createCipheriv() */ + export function createDecipher(algorithm: CipherGCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options?: CipherGCMOptions): DecipherGCM; + /** @deprecated since v10.0.0 use createCipheriv() */ + export function createDecipher(algorithm: string, password: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Decipher; - export function createDecipheriv(algorithm: string, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Decipher; export function createDecipheriv(algorithm: CipherCCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): DecipherCCM; - export function createDecipheriv(algorithm: CipherGCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherGCMOptions): DecipherGCM; + export function createDecipheriv(algorithm: CipherGCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options?: CipherGCMOptions): DecipherGCM; + export function createDecipheriv(algorithm: string, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Decipher; export interface Decipher extends NodeJS.ReadWriteStream { update(data: Buffer | NodeJS.TypedArray | DataView): Buffer; @@ -5950,12 +5961,12 @@ declare module "crypto" { // setAAD(buffer: Buffer | NodeJS.TypedArray | DataView): this; } export interface DecipherCCM extends Decipher { - setAuthTag(buffer: Buffer | NodeJS.TypedArray | DataView, options: { plainTextLength: number }): this; - setAAD(buffer: Buffer | NodeJS.TypedArray | DataView): this; + setAuthTag(buffer: Buffer | NodeJS.TypedArray | DataView): this; + setAAD(buffer: Buffer | NodeJS.TypedArray | DataView, options: { plaintextLength: number }): this; } export interface DecipherGCM extends Decipher { - setAuthTag(buffer: Buffer | NodeJS.TypedArray | DataView, options?: { plainTextLength: number }): this; - setAAD(buffer: Buffer | NodeJS.TypedArray | DataView): this; + setAuthTag(buffer: Buffer | NodeJS.TypedArray | DataView): this; + setAAD(buffer: Buffer | NodeJS.TypedArray | DataView, options?: { plaintextLength: number }): this; } export function createSign(algorithm: string, options?: stream.WritableOptions): Signer; @@ -6327,6 +6338,7 @@ declare module "stream" { declare module "util" { export interface InspectOptions extends NodeJS.InspectOptions { } export function format(format: any, ...param: any[]): string; + export function formatWithOptions(inspectOptions: InspectOptions, format: string, ...param: any[]): string; /** @deprecated since v0.11.3 - use `console.error()` instead. */ export function debug(string: string): void; /** @deprecated since v0.11.3 - use `console.error()` instead. */ @@ -6405,17 +6417,17 @@ declare module "util" { export function promisify(fn: CustomPromisify): TCustom; export function promisify(fn: (callback: (err: Error | null, result: TResult) => void) => void): () => Promise; - export function promisify(fn: (callback: (err: Error | null) => void) => void): () => Promise; + export function promisify(fn: (callback: (err?: Error | null) => void) => void): () => Promise; export function promisify(fn: (arg1: T1, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1) => Promise; - export function promisify(fn: (arg1: T1, callback: (err: Error | null) => void) => void): (arg1: T1) => Promise; + export function promisify(fn: (arg1: T1, callback: (err?: Error | null) => void) => void): (arg1: T1) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; export function promisify(fn: Function): Function; export namespace promisify { const custom: symbol; diff --git a/types/node/inspector.d.ts b/types/node/inspector.d.ts index 955239b486..474c481d5a 100644 --- a/types/node/inspector.d.ts +++ b/types/node/inspector.d.ts @@ -15,26 +15,1075 @@ declare module "inspector" { params: T; } - export namespace Schema { + export namespace Console { /** - * Description of the protocol domain. + * Console message. */ - export interface Domain { + export interface ConsoleMessage { /** - * Domain name. + * Message source. */ - name: string; + source: string; /** - * Domain version. + * Message severity. */ - version: string; + level: string; + /** + * Message text. + */ + text: string; + /** + * URL of the message origin. + */ + url?: string; + /** + * Line number in the resource that generated this message (1-based). + */ + line?: number; + /** + * Column number in the resource that generated this message (1-based). + */ + column?: number; } - export interface GetDomainsReturnType { + export interface MessageAddedEventDataType { /** - * List of supported domains. + * Console message that has been added. */ - domains: Schema.Domain[]; + message: Console.ConsoleMessage; + } + } + + export namespace Debugger { + /** + * Breakpoint identifier. + */ + export type BreakpointId = string; + + /** + * Call frame identifier. + */ + export type CallFrameId = string; + + /** + * Location in the source code. + */ + export interface Location { + /** + * Script identifier as reported in the `Debugger.scriptParsed`. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number; + } + + /** + * Location in the source code. + * @experimental + */ + export interface ScriptPosition { + lineNumber: number; + columnNumber: number; + } + + /** + * JavaScript call frame. Array of call frames form the call stack. + */ + export interface CallFrame { + /** + * Call frame identifier. This identifier is only valid while the virtual machine is paused. + */ + callFrameId: Debugger.CallFrameId; + /** + * Name of the JavaScript function called on this call frame. + */ + functionName: string; + /** + * Location in the source code. + */ + functionLocation?: Debugger.Location; + /** + * Location in the source code. + */ + location: Debugger.Location; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Scope chain for this call frame. + */ + scopeChain: Debugger.Scope[]; + /** + * `this` object for this call frame. + */ + this: Runtime.RemoteObject; + /** + * The value being returned, if the function is at return point. + */ + returnValue?: Runtime.RemoteObject; + } + + /** + * Scope description. + */ + export interface Scope { + /** + * Scope type. + */ + type: string; + /** + * Object representing the scope. For `global` and `with` scopes it represents the actual +object; for the rest of the scopes, it is artificial transient object enumerating scope +variables as its properties. + */ + object: Runtime.RemoteObject; + name?: string; + /** + * Location in the source code where scope starts + */ + startLocation?: Debugger.Location; + /** + * Location in the source code where scope ends + */ + endLocation?: Debugger.Location; + } + + /** + * Search match for resource. + */ + export interface SearchMatch { + /** + * Line number in resource content. + */ + lineNumber: number; + /** + * Line with match content. + */ + lineContent: string; + } + + export interface BreakLocation { + /** + * Script identifier as reported in the `Debugger.scriptParsed`. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number; + type?: string; + } + + export interface ContinueToLocationParameterType { + /** + * Location to continue to. + */ + location: Debugger.Location; + targetCallFrames?: string; + } + + export interface EvaluateOnCallFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: Debugger.CallFrameId; + /** + * Expression to evaluate. + */ + expression: string; + /** + * String object group name to put result into (allows rapid releasing resulting object handles +using `releaseObjectGroup`). + */ + objectGroup?: string; + /** + * Specifies whether command line API should be available to the evaluated expression, defaults +to false. + */ + includeCommandLineAPI?: boolean; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause +execution. Overrides `setPauseOnException` state. + */ + silent?: boolean; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean; + /** + * Whether to throw an exception if side effect cannot be ruled out during evaluation. + */ + throwOnSideEffect?: boolean; + } + + export interface GetPossibleBreakpointsParameterType { + /** + * Start of range to search possible breakpoint locations in. + */ + start: Debugger.Location; + /** + * End of range to search possible breakpoint locations in (excluding). When not specified, end +of scripts is used as end of range. + */ + end?: Debugger.Location; + /** + * Only consider locations which are in the same (non-nested) function as start. + */ + restrictToFunction?: boolean; + } + + export interface GetScriptSourceParameterType { + /** + * Id of the script to get source for. + */ + scriptId: Runtime.ScriptId; + } + + export interface GetStackTraceParameterType { + stackTraceId: Runtime.StackTraceId; + } + + export interface PauseOnAsyncCallParameterType { + /** + * Debugger will pause when async call with given stack trace is started. + */ + parentStackTraceId: Runtime.StackTraceId; + } + + export interface RemoveBreakpointParameterType { + breakpointId: Debugger.BreakpointId; + } + + export interface RestartFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: Debugger.CallFrameId; + } + + export interface SearchInContentParameterType { + /** + * Id of the script to search in. + */ + scriptId: Runtime.ScriptId; + /** + * String to search for. + */ + query: string; + /** + * If true, search is case sensitive. + */ + caseSensitive?: boolean; + /** + * If true, treats string parameter as regex. + */ + isRegex?: boolean; + } + + export interface SetAsyncCallStackDepthParameterType { + /** + * Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async +call stacks (default). + */ + maxDepth: number; + } + + export interface SetBlackboxPatternsParameterType { + /** + * Array of regexps that will be used to check script url for blackbox state. + */ + patterns: string[]; + } + + export interface SetBlackboxedRangesParameterType { + /** + * Id of the script. + */ + scriptId: Runtime.ScriptId; + positions: Debugger.ScriptPosition[]; + } + + export interface SetBreakpointParameterType { + /** + * Location to set breakpoint in. + */ + location: Debugger.Location; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the +breakpoint if this expression evaluates to true. + */ + condition?: string; + } + + export interface SetBreakpointByUrlParameterType { + /** + * Line number to set breakpoint at. + */ + lineNumber: number; + /** + * URL of the resources to set breakpoint on. + */ + url?: string; + /** + * Regex pattern for the URLs of the resources to set breakpoints on. Either `url` or +`urlRegex` must be specified. + */ + urlRegex?: string; + /** + * Script hash of the resources to set breakpoint on. + */ + scriptHash?: string; + /** + * Offset in the line to set breakpoint at. + */ + columnNumber?: number; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the +breakpoint if this expression evaluates to true. + */ + condition?: string; + } + + export interface SetBreakpointsActiveParameterType { + /** + * New value for breakpoints active state. + */ + active: boolean; + } + + export interface SetPauseOnExceptionsParameterType { + /** + * Pause on exceptions mode. + */ + state: string; + } + + export interface SetReturnValueParameterType { + /** + * New return value. + */ + newValue: Runtime.CallArgument; + } + + export interface SetScriptSourceParameterType { + /** + * Id of the script to edit. + */ + scriptId: Runtime.ScriptId; + /** + * New content of the script. + */ + scriptSource: string; + /** + * If true the change will not actually be applied. Dry run may be used to get result +description without actually modifying the code. + */ + dryRun?: boolean; + } + + export interface SetSkipAllPausesParameterType { + /** + * New value for skip pauses state. + */ + skip: boolean; + } + + export interface SetVariableValueParameterType { + /** + * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' +scope types are allowed. Other scopes could be manipulated manually. + */ + scopeNumber: number; + /** + * Variable name. + */ + variableName: string; + /** + * New variable value. + */ + newValue: Runtime.CallArgument; + /** + * Id of callframe that holds variable. + */ + callFrameId: Debugger.CallFrameId; + } + + export interface StepIntoParameterType { + /** + * Debugger will issue additional Debugger.paused notification if any async task is scheduled +before next pause. + * @experimental + */ + breakOnAsyncCall?: boolean; + } + + export interface EnableReturnType { + /** + * Unique identifier of the debugger. + * @experimental + */ + debuggerId: Runtime.UniqueDebuggerId; + } + + export interface EvaluateOnCallFrameReturnType { + /** + * Object wrapper for the evaluation result. + */ + result: Runtime.RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface GetPossibleBreakpointsReturnType { + /** + * List of the possible breakpoint locations. + */ + locations: Debugger.BreakLocation[]; + } + + export interface GetScriptSourceReturnType { + /** + * Script source. + */ + scriptSource: string; + } + + export interface GetStackTraceReturnType { + stackTrace: Runtime.StackTrace; + } + + export interface RestartFrameReturnType { + /** + * New stack trace. + */ + callFrames: Debugger.CallFrame[]; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId; + } + + export interface SearchInContentReturnType { + /** + * List of search matches. + */ + result: Debugger.SearchMatch[]; + } + + export interface SetBreakpointReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: Debugger.BreakpointId; + /** + * Location this breakpoint resolved into. + */ + actualLocation: Debugger.Location; + } + + export interface SetBreakpointByUrlReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: Debugger.BreakpointId; + /** + * List of the locations this breakpoint resolved into upon addition. + */ + locations: Debugger.Location[]; + } + + export interface SetScriptSourceReturnType { + /** + * New stack trace in case editing has happened while VM was stopped. + */ + callFrames?: Debugger.CallFrame[]; + /** + * Whether current call stack was modified after applying the changes. + */ + stackChanged?: boolean; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId; + /** + * Exception details if any. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface BreakpointResolvedEventDataType { + /** + * Breakpoint unique identifier. + */ + breakpointId: Debugger.BreakpointId; + /** + * Actual breakpoint location. + */ + location: Debugger.Location; + } + + export interface PausedEventDataType { + /** + * Call stack the virtual machine stopped on. + */ + callFrames: Debugger.CallFrame[]; + /** + * Pause reason. + */ + reason: string; + /** + * Object containing break-specific auxiliary properties. + */ + data?: {}; + /** + * Hit breakpoints IDs + */ + hitBreakpoints?: string[]; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId; + /** + * Just scheduled async call will have this stack trace as parent stack during async execution. +This field is available only after `Debugger.stepInto` call with `breakOnAsynCall` flag. + * @experimental + */ + asyncCallStackTraceId?: Runtime.StackTraceId; + } + + export interface ScriptFailedToParseEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: {}; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string; + /** + * True, if this script has sourceURL. + */ + hasSourceURL?: boolean; + /** + * True, if this script is ES6 module. + */ + isModule?: boolean; + /** + * This script length. + */ + length?: number; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace; + } + + export interface ScriptParsedEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: {}; + /** + * True, if this script is generated as a result of the live edit operation. + * @experimental + */ + isLiveEdit?: boolean; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string; + /** + * True, if this script has sourceURL. + */ + hasSourceURL?: boolean; + /** + * True, if this script is ES6 module. + */ + isModule?: boolean; + /** + * This script length. + */ + length?: number; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace; + } + } + + export namespace HeapProfiler { + /** + * Heap snapshot object id. + */ + export type HeapSnapshotObjectId = string; + + /** + * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. + */ + export interface SamplingHeapProfileNode { + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Allocations size in bytes for the node excluding children. + */ + selfSize: number; + /** + * Child nodes. + */ + children: HeapProfiler.SamplingHeapProfileNode[]; + } + + /** + * Profile. + */ + export interface SamplingHeapProfile { + head: HeapProfiler.SamplingHeapProfileNode; + } + + export interface AddInspectedHeapObjectParameterType { + /** + * Heap snapshot object id to be accessible by means of $x command line API. + */ + heapObjectId: HeapProfiler.HeapSnapshotObjectId; + } + + export interface GetHeapObjectIdParameterType { + /** + * Identifier of the object to get heap object id for. + */ + objectId: Runtime.RemoteObjectId; + } + + export interface GetObjectByHeapObjectIdParameterType { + objectId: HeapProfiler.HeapSnapshotObjectId; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string; + } + + export interface StartSamplingParameterType { + /** + * Average sample interval in bytes. Poisson distribution is used for the intervals. The +default value is 32768 bytes. + */ + samplingInterval?: number; + } + + export interface StartTrackingHeapObjectsParameterType { + trackAllocations?: boolean; + } + + export interface StopTrackingHeapObjectsParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken +when the tracking is stopped. + */ + reportProgress?: boolean; + } + + export interface TakeHeapSnapshotParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. + */ + reportProgress?: boolean; + } + + export interface GetHeapObjectIdReturnType { + /** + * Id of the heap snapshot object corresponding to the passed remote object id. + */ + heapSnapshotObjectId: HeapProfiler.HeapSnapshotObjectId; + } + + export interface GetObjectByHeapObjectIdReturnType { + /** + * Evaluation result. + */ + result: Runtime.RemoteObject; + } + + export interface GetSamplingProfileReturnType { + /** + * Return the sampling profile being collected. + */ + profile: HeapProfiler.SamplingHeapProfile; + } + + export interface StopSamplingReturnType { + /** + * Recorded sampling heap profile. + */ + profile: HeapProfiler.SamplingHeapProfile; + } + + export interface AddHeapSnapshotChunkEventDataType { + chunk: string; + } + + export interface HeapStatsUpdateEventDataType { + /** + * An array of triplets. Each triplet describes a fragment. The first integer is the fragment +index, the second integer is a total count of objects for the fragment, the third integer is +a total size of the objects for the fragment. + */ + statsUpdate: number[]; + } + + export interface LastSeenObjectIdEventDataType { + lastSeenObjectId: number; + timestamp: number; + } + + export interface ReportHeapSnapshotProgressEventDataType { + done: number; + total: number; + finished?: boolean; + } + } + + export namespace Profiler { + /** + * Profile node. Holds callsite information, execution statistics and child nodes. + */ + export interface ProfileNode { + /** + * Unique id of the node. + */ + id: number; + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Number of samples where this node was on top of the call stack. + */ + hitCount?: number; + /** + * Child node ids. + */ + children?: number[]; + /** + * The reason of being not optimized. The function may be deoptimized or marked as don't +optimize. + */ + deoptReason?: string; + /** + * An array of source position ticks. + */ + positionTicks?: Profiler.PositionTickInfo[]; + } + + /** + * Profile. + */ + export interface Profile { + /** + * The list of profile nodes. First item is the root node. + */ + nodes: Profiler.ProfileNode[]; + /** + * Profiling start timestamp in microseconds. + */ + startTime: number; + /** + * Profiling end timestamp in microseconds. + */ + endTime: number; + /** + * Ids of samples top nodes. + */ + samples?: number[]; + /** + * Time intervals between adjacent samples in microseconds. The first delta is relative to the +profile startTime. + */ + timeDeltas?: number[]; + } + + /** + * Specifies a number of samples attributed to a certain source position. + */ + export interface PositionTickInfo { + /** + * Source line number (1-based). + */ + line: number; + /** + * Number of samples attributed to the source line. + */ + ticks: number; + } + + /** + * Coverage data for a source range. + */ + export interface CoverageRange { + /** + * JavaScript script source offset for the range start. + */ + startOffset: number; + /** + * JavaScript script source offset for the range end. + */ + endOffset: number; + /** + * Collected execution count of the source range. + */ + count: number; + } + + /** + * Coverage data for a JavaScript function. + */ + export interface FunctionCoverage { + /** + * JavaScript function name. + */ + functionName: string; + /** + * Source ranges inside the function with coverage data. + */ + ranges: Profiler.CoverageRange[]; + /** + * Whether coverage data for this function has block granularity. + */ + isBlockCoverage: boolean; + } + + /** + * Coverage data for a JavaScript script. + */ + export interface ScriptCoverage { + /** + * JavaScript script id. + */ + scriptId: Runtime.ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Functions contained in the script that has coverage data. + */ + functions: Profiler.FunctionCoverage[]; + } + + /** + * Describes a type collected during runtime. + * @experimental + */ + export interface TypeObject { + /** + * Name of a type collected with type profiling. + */ + name: string; + } + + /** + * Source offset and types for a parameter or return value. + * @experimental + */ + export interface TypeProfileEntry { + /** + * Source offset of the parameter or end of function for return values. + */ + offset: number; + /** + * The types for this parameter or return value. + */ + types: Profiler.TypeObject[]; + } + + /** + * Type profile data collected during runtime for a JavaScript script. + * @experimental + */ + export interface ScriptTypeProfile { + /** + * JavaScript script id. + */ + scriptId: Runtime.ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Type profile entries for parameters and return values of the functions in the script. + */ + entries: Profiler.TypeProfileEntry[]; + } + + export interface SetSamplingIntervalParameterType { + /** + * New sampling interval in microseconds. + */ + interval: number; + } + + export interface StartPreciseCoverageParameterType { + /** + * Collect accurate call counts beyond simple 'covered' or 'not covered'. + */ + callCount?: boolean; + /** + * Collect block-based coverage. + */ + detailed?: boolean; + } + + export interface GetBestEffortCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: Profiler.ScriptCoverage[]; + } + + export interface StopReturnType { + /** + * Recorded profile. + */ + profile: Profiler.Profile; + } + + export interface TakePreciseCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: Profiler.ScriptCoverage[]; + } + + export interface TakeTypeProfileReturnType { + /** + * Type profile for all scripts since startTypeProfile() was turned on. + */ + result: Profiler.ScriptTypeProfile[]; + } + + export interface ConsoleProfileFinishedEventDataType { + id: string; + /** + * Location of console.profileEnd(). + */ + location: Debugger.Location; + profile: Profiler.Profile; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string; + } + + export interface ConsoleProfileStartedEventDataType { + id: string; + /** + * Location of console.profile(). + */ + location: Debugger.Location; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string; } } @@ -50,7 +1099,8 @@ declare module "inspector" { export type RemoteObjectId = string; /** - * Primitive value which cannot be JSON-stringified. + * Primitive value which cannot be JSON-stringified. Includes values `-0`, `NaN`, `Infinity`, +`-Infinity`, and bigint literals. */ export type UnserializableValue = string; @@ -63,11 +1113,11 @@ declare module "inspector" { */ type: string; /** - * Object subtype hint. Specified for object type values only. + * Object subtype hint. Specified for `object` type values only. */ subtype?: string; /** - * Object class (constructor) name. Specified for object type values only. + * Object class (constructor) name. Specified for `object` type values only. */ className?: string; /** @@ -75,7 +1125,8 @@ declare module "inspector" { */ value?: any; /** - * Primitive value which can not be JSON-stringified does not have value, but gets this property. + * Primitive value which can not be JSON-stringified does not have `value`, but gets this +property. */ unserializableValue?: Runtime.UnserializableValue; /** @@ -87,7 +1138,7 @@ declare module "inspector" { */ objectId?: Runtime.RemoteObjectId; /** - * Preview containing abbreviated property values. Specified for object type values only. + * Preview containing abbreviated property values. Specified for `object` type values only. * @experimental */ preview?: Runtime.ObjectPreview; @@ -118,7 +1169,7 @@ declare module "inspector" { */ type: string; /** - * Object subtype hint. Specified for object type values only. + * Object subtype hint. Specified for `object` type values only. */ subtype?: string; /** @@ -134,7 +1185,7 @@ declare module "inspector" { */ properties: Runtime.PropertyPreview[]; /** - * List of the entries. Specified for map and set subtype values only. + * List of the entries. Specified for `map` and `set` subtype values only. */ entries?: Runtime.EntryPreview[]; } @@ -160,7 +1211,7 @@ declare module "inspector" { */ valuePreview?: Runtime.ObjectPreview; /** - * Object subtype hint. Specified for object type values only. + * Object subtype hint. Specified for `object` type values only. */ subtype?: string; } @@ -196,19 +1247,23 @@ declare module "inspector" { */ writable?: boolean; /** - * A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). + * A function which serves as a getter for the property, or `undefined` if there is no getter +(accessor descriptors only). */ get?: Runtime.RemoteObject; /** - * A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). + * A function which serves as a setter for the property, or `undefined` if there is no setter +(accessor descriptors only). */ set?: Runtime.RemoteObject; /** - * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. + * True if the type of this property descriptor may be changed and if the property may be +deleted from the corresponding object. */ configurable: boolean; /** - * True if this property shows up during enumeration of the properties on the corresponding object. + * True if this property shows up during enumeration of the properties on the corresponding +object. */ enumerable: boolean; /** @@ -220,7 +1275,7 @@ declare module "inspector" { */ isOwn?: boolean; /** - * Property symbol object, if the property is of the symbol type. + * Property symbol object, if the property is of the `symbol` type. */ symbol?: Runtime.RemoteObject; } @@ -240,11 +1295,12 @@ declare module "inspector" { } /** - * Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified. + * Represents function call argument. Either remote object id `objectId`, primitive `value`, +unserializable primitive value or neither of (for undefined) them should be specified. */ export interface CallArgument { /** - * Primitive value. + * Primitive value or serializable javascript object. */ value?: any; /** @@ -267,7 +1323,8 @@ declare module "inspector" { */ export interface ExecutionContextDescription { /** - * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. + * Unique id of the execution context. It can be used to specify in which execution context +script evaluation should be performed. */ id: Runtime.ExecutionContextId; /** @@ -285,7 +1342,8 @@ declare module "inspector" { } /** - * Detailed information about exception (or error) that was thrown during script compilation or execution. + * Detailed information about exception (or error) that was thrown during script compilation or +execution. */ export interface ExceptionDetails { /** @@ -362,7 +1420,8 @@ declare module "inspector" { */ export interface StackTrace { /** - * String label of this stack trace. For async traces this may be a name of the function that initiated the async call. + * String label of this stack trace. For async traces this may be a name of the function that +initiated the async call. */ description?: string; /** @@ -374,51 +1433,26 @@ declare module "inspector" { */ parent?: Runtime.StackTrace; /** - * Creation frame of the Promise which produced the next synchronous trace when resolved, if available. + * Asynchronous JavaScript stack trace that preceded this stack, if available. * @experimental */ - promiseCreationFrame?: Runtime.CallFrame; + parentId?: Runtime.StackTraceId; } - export interface EvaluateParameterType { - /** - * Expression to evaluate. - */ - expression: string; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean; - /** - * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - contextId?: Runtime.ExecutionContextId; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean; - /** - * Whether execution should be treated as initiated by user in the UI. - * @experimental - */ - userGesture?: boolean; - /** - * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. - */ - awaitPromise?: boolean; + /** + * Unique identifier of current debugger. + * @experimental + */ + export type UniqueDebuggerId = string; + + /** + * If `debuggerId` is set stack trace comes from another debugger and can be resolved there. This +allows to track cross-debugger calls. See `Runtime.StackTrace` and `Debugger.paused` for usages. + * @experimental + */ + export interface StackTraceId { + id: string; + debuggerId?: Runtime.UniqueDebuggerId; } export interface AwaitPromiseParameterType { @@ -437,20 +1471,23 @@ declare module "inspector" { } export interface CallFunctionOnParameterType { - /** - * Identifier of the object to call function on. - */ - objectId: Runtime.RemoteObjectId; /** * Declaration of the function to call. */ functionDeclaration: string; /** - * Call arguments. All call arguments must belong to the same JavaScript world as the target object. + * Identifier of the object to call function on. Either objectId or executionContextId should +be specified. + */ + objectId?: Runtime.RemoteObjectId; + /** + * Call arguments. All call arguments must belong to the same JavaScript world as the target +object. */ arguments?: Runtime.CallArgument[]; /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + * In silent mode exceptions thrown during evaluation are not reported and do not pause +execution. Overrides `setPauseOnException` state. */ silent?: boolean; /** @@ -464,52 +1501,23 @@ declare module "inspector" { generatePreview?: boolean; /** * Whether execution should be treated as initiated by user in the UI. - * @experimental */ userGesture?: boolean; /** - * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + * Whether execution should `await` for resulting value and return once awaited promise is +resolved. */ awaitPromise?: boolean; - } - - export interface GetPropertiesParameterType { /** - * Identifier of the object to return properties for. + * Specifies execution context which global object will be used to call function on. Either +executionContextId or objectId should be specified. */ - objectId: Runtime.RemoteObjectId; + executionContextId?: Runtime.ExecutionContextId; /** - * If true, returns properties belonging only to the element itself, not to its prototype chain. + * Symbolic group name that can be used to release multiple objects. If objectGroup is not +specified and objectId is, objectGroup will be inherited from object. */ - ownProperties?: boolean; - /** - * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. - * @experimental - */ - accessorPropertiesOnly?: boolean; - /** - * Whether preview should be generated for the results. - * @experimental - */ - generatePreview?: boolean; - } - - export interface ReleaseObjectParameterType { - /** - * Identifier of the object to release. - */ - objectId: Runtime.RemoteObjectId; - } - - export interface ReleaseObjectGroupParameterType { - /** - * Symbolic object group name. - */ - objectGroup: string; - } - - export interface SetCustomObjectFormatterEnabledParameterType { - enabled: boolean; + objectGroup?: string; } export interface CompileScriptParameterType { @@ -526,18 +1534,123 @@ declare module "inspector" { */ persistScript: boolean; /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + * Specifies in which execution context to perform script run. If the parameter is omitted the +evaluation will be performed in the context of the inspected page. */ executionContextId?: Runtime.ExecutionContextId; } + export interface EvaluateParameterType { + /** + * Expression to evaluate. + */ + expression: string; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string; + /** + * Determines whether Command Line API should be available during the evaluation. + */ + includeCommandLineAPI?: boolean; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause +execution. Overrides `setPauseOnException` state. + */ + silent?: boolean; + /** + * Specifies in which execution context to perform evaluation. If the parameter is omitted the +evaluation will be performed in the context of the inspected page. + */ + contextId?: Runtime.ExecutionContextId; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean; + /** + * Whether execution should be treated as initiated by user in the UI. + */ + userGesture?: boolean; + /** + * Whether execution should `await` for resulting value and return once awaited promise is +resolved. + */ + awaitPromise?: boolean; + /** + * Whether to throw an exception if side effect cannot be ruled out during evaluation. + * @experimental + */ + throwOnSideEffect?: boolean; + } + + export interface GetPropertiesParameterType { + /** + * Identifier of the object to return properties for. + */ + objectId: Runtime.RemoteObjectId; + /** + * If true, returns properties belonging only to the element itself, not to its prototype +chain. + */ + ownProperties?: boolean; + /** + * If true, returns accessor properties (with getter/setter) only; internal properties are not +returned either. + * @experimental + */ + accessorPropertiesOnly?: boolean; + /** + * Whether preview should be generated for the results. + * @experimental + */ + generatePreview?: boolean; + } + + export interface GlobalLexicalScopeNamesParameterType { + /** + * Specifies in which execution context to lookup global scope variables. + */ + executionContextId?: Runtime.ExecutionContextId; + } + + export interface QueryObjectsParameterType { + /** + * Identifier of the prototype to return objects for. + */ + prototypeObjectId: Runtime.RemoteObjectId; + /** + * Symbolic group name that can be used to release the results. + */ + objectGroup?: string; + } + + export interface ReleaseObjectParameterType { + /** + * Identifier of the object to release. + */ + objectId: Runtime.RemoteObjectId; + } + + export interface ReleaseObjectGroupParameterType { + /** + * Symbolic object group name. + */ + objectGroup: string; + } + export interface RunScriptParameterType { /** * Id of the script to run. */ scriptId: Runtime.ScriptId; /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + * Specifies in which execution context to perform script run. If the parameter is omitted the +evaluation will be performed in the context of the inspected page. */ executionContextId?: Runtime.ExecutionContextId; /** @@ -545,7 +1658,8 @@ declare module "inspector" { */ objectGroup?: string; /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + * In silent mode exceptions thrown during evaluation are not reported and do not pause +execution. Overrides `setPauseOnException` state. */ silent?: boolean; /** @@ -561,20 +1675,14 @@ declare module "inspector" { */ generatePreview?: boolean; /** - * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + * Whether execution should `await` for resulting value and return once awaited promise is +resolved. */ awaitPromise?: boolean; } - export interface EvaluateReturnType { - /** - * Evaluation result. - */ - result: Runtime.RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: Runtime.ExceptionDetails; + export interface SetCustomObjectFormatterEnabledParameterType { + enabled: boolean; } export interface AwaitPromiseReturnType { @@ -599,6 +1707,46 @@ declare module "inspector" { exceptionDetails?: Runtime.ExceptionDetails; } + export interface CompileScriptReturnType { + /** + * Id of the script. + */ + scriptId?: Runtime.ScriptId; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface EvaluateReturnType { + /** + * Evaluation result. + */ + result: Runtime.RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface GetIsolateIdReturnType { + /** + * The isolate id. + */ + id: string; + } + + export interface GetHeapUsageReturnType { + /** + * Used heap size in bytes. + */ + usedSize: number; + /** + * Allocated heap size in bytes. + */ + totalSize: number; + } + export interface GetPropertiesReturnType { /** * Object properties. @@ -614,15 +1762,15 @@ declare module "inspector" { exceptionDetails?: Runtime.ExceptionDetails; } - export interface CompileScriptReturnType { + export interface GlobalLexicalScopeNamesReturnType { + names: string[]; + } + + export interface QueryObjectsReturnType { /** - * Id of the script. + * Array with objects. */ - scriptId?: Runtime.ScriptId; - /** - * Exception details. - */ - exceptionDetails?: Runtime.ExceptionDetails; + objects: Runtime.RemoteObject; } export interface RunScriptReturnType { @@ -636,39 +1784,6 @@ declare module "inspector" { exceptionDetails?: Runtime.ExceptionDetails; } - export interface ExecutionContextCreatedEventDataType { - /** - * A newly created execution context. - */ - context: Runtime.ExecutionContextDescription; - } - - export interface ExecutionContextDestroyedEventDataType { - /** - * Id of the destroyed context - */ - executionContextId: Runtime.ExecutionContextId; - } - - export interface ExceptionThrownEventDataType { - /** - * Timestamp of the exception. - */ - timestamp: Runtime.Timestamp; - exceptionDetails: Runtime.ExceptionDetails; - } - - export interface ExceptionRevokedEventDataType { - /** - * Reason describing why exception was revoked. - */ - reason: string; - /** - * The id of revoked exception, as reported in exceptionUnhandled. - */ - exceptionId: number; - } - export interface ConsoleAPICalledEventDataType { /** * Type of the call. @@ -691,959 +1806,73 @@ declare module "inspector" { */ stackTrace?: Runtime.StackTrace; /** - * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. + * Console context descriptor for calls on non-default console context (not console.*): +'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call +on named context. * @experimental */ context?: string; } + export interface ExceptionRevokedEventDataType { + /** + * Reason describing why exception was revoked. + */ + reason: string; + /** + * The id of revoked exception, as reported in `exceptionThrown`. + */ + exceptionId: number; + } + + export interface ExceptionThrownEventDataType { + /** + * Timestamp of the exception. + */ + timestamp: Runtime.Timestamp; + exceptionDetails: Runtime.ExceptionDetails; + } + + export interface ExecutionContextCreatedEventDataType { + /** + * A newly created execution context. + */ + context: Runtime.ExecutionContextDescription; + } + + export interface ExecutionContextDestroyedEventDataType { + /** + * Id of the destroyed context + */ + executionContextId: Runtime.ExecutionContextId; + } + export interface InspectRequestedEventDataType { object: Runtime.RemoteObject; hints: {}; } } - export namespace Debugger { + export namespace Schema { /** - * Breakpoint identifier. + * Description of the protocol domain. */ - export type BreakpointId = string; - - /** - * Call frame identifier. - */ - export type CallFrameId = string; - - /** - * Location in the source code. - */ - export interface Location { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number; - } - - /** - * Location in the source code. - * @experimental - */ - export interface ScriptPosition { - lineNumber: number; - columnNumber: number; - } - - /** - * JavaScript call frame. Array of call frames form the call stack. - */ - export interface CallFrame { - /** - * Call frame identifier. This identifier is only valid while the virtual machine is paused. - */ - callFrameId: Debugger.CallFrameId; - /** - * Name of the JavaScript function called on this call frame. - */ - functionName: string; - /** - * Location in the source code. - * @experimental - */ - functionLocation?: Debugger.Location; - /** - * Location in the source code. - */ - location: Debugger.Location; - /** - * Scope chain for this call frame. - */ - scopeChain: Debugger.Scope[]; - /** - * this object for this call frame. - */ - this: Runtime.RemoteObject; - /** - * The value being returned, if the function is at return point. - */ - returnValue?: Runtime.RemoteObject; - } - - /** - * Scope description. - */ - export interface Scope { - /** - * Scope type. - */ - type: string; - /** - * Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties. - */ - object: Runtime.RemoteObject; - name?: string; - /** - * Location in the source code where scope starts - */ - startLocation?: Debugger.Location; - /** - * Location in the source code where scope ends - */ - endLocation?: Debugger.Location; - } - - /** - * Search match for resource. - * @experimental - */ - export interface SearchMatch { - /** - * Line number in resource content. - */ - lineNumber: number; - /** - * Line with match content. - */ - lineContent: string; - } - - /** - * @experimental - */ - export interface BreakLocation { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number; - type?: string; - } - - export interface SetBreakpointsActiveParameterType { - /** - * New value for breakpoints active state. - */ - active: boolean; - } - - export interface SetSkipAllPausesParameterType { + export interface Domain { /** - * New value for skip pauses state. + * Domain name. */ - skip: boolean; - } - - export interface SetBreakpointByUrlParameterType { - /** - * Line number to set breakpoint at. - */ - lineNumber: number; - /** - * URL of the resources to set breakpoint on. - */ - url?: string; - /** - * Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. - */ - urlRegex?: string; - /** - * Offset in the line to set breakpoint at. - */ - columnNumber?: number; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string; - } - - export interface SetBreakpointParameterType { - /** - * Location to set breakpoint in. - */ - location: Debugger.Location; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string; - } - - export interface RemoveBreakpointParameterType { - breakpointId: Debugger.BreakpointId; - } - - export interface GetPossibleBreakpointsParameterType { - /** - * Start of range to search possible breakpoint locations in. - */ - start: Debugger.Location; - /** - * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. - */ - end?: Debugger.Location; - /** - * Only consider locations which are in the same (non-nested) function as start. - */ - restrictToFunction?: boolean; - } - - export interface ContinueToLocationParameterType { - /** - * Location to continue to. - */ - location: Debugger.Location; - /** - * @experimental - */ - targetCallFrames?: string; - } - - export interface SearchInContentParameterType { - /** - * Id of the script to search in. - */ - scriptId: Runtime.ScriptId; - /** - * String to search for. - */ - query: string; - /** - * If true, search is case sensitive. - */ - caseSensitive?: boolean; + name: string; /** - * If true, treats string parameter as regex. + * Domain version. */ - isRegex?: boolean; - } - - export interface SetScriptSourceParameterType { - /** - * Id of the script to edit. - */ - scriptId: Runtime.ScriptId; - /** - * New content of the script. - */ - scriptSource: string; - /** - * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. - */ - dryRun?: boolean; - } - - export interface RestartFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: Debugger.CallFrameId; - } - - export interface GetScriptSourceParameterType { - /** - * Id of the script to get source for. - */ - scriptId: Runtime.ScriptId; - } - - export interface SetPauseOnExceptionsParameterType { - /** - * Pause on exceptions mode. - */ - state: string; - } - - export interface EvaluateOnCallFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: Debugger.CallFrameId; - /** - * Expression to evaluate. - */ - expression: string; - /** - * String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup). - */ - objectGroup?: string; - /** - * Specifies whether command line API should be available to the evaluated expression, defaults to false. - */ - includeCommandLineAPI?: boolean; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean; - /** - * Whether to throw an exception if side effect cannot be ruled out during evaluation. - * @experimental - */ - throwOnSideEffect?: boolean; - } - - export interface SetVariableValueParameterType { - /** - * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. - */ - scopeNumber: number; - /** - * Variable name. - */ - variableName: string; - /** - * New variable value. - */ - newValue: Runtime.CallArgument; - /** - * Id of callframe that holds variable. - */ - callFrameId: Debugger.CallFrameId; - } - - export interface SetAsyncCallStackDepthParameterType { - /** - * Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default). - */ - maxDepth: number; - } - - export interface SetBlackboxPatternsParameterType { - /** - * Array of regexps that will be used to check script url for blackbox state. - */ - patterns: string[]; - } - - export interface SetBlackboxedRangesParameterType { - /** - * Id of the script. - */ - scriptId: Runtime.ScriptId; - positions: Debugger.ScriptPosition[]; - } - - export interface SetBreakpointByUrlReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: Debugger.BreakpointId; - /** - * List of the locations this breakpoint resolved into upon addition. - */ - locations: Debugger.Location[]; - } - - export interface SetBreakpointReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: Debugger.BreakpointId; - /** - * Location this breakpoint resolved into. - */ - actualLocation: Debugger.Location; - } - - export interface GetPossibleBreakpointsReturnType { - /** - * List of the possible breakpoint locations. - */ - locations: Debugger.BreakLocation[]; - } - - export interface SearchInContentReturnType { - /** - * List of search matches. - */ - result: Debugger.SearchMatch[]; - } - - export interface SetScriptSourceReturnType { - /** - * New stack trace in case editing has happened while VM was stopped. - */ - callFrames?: Debugger.CallFrame[]; - /** - * Whether current call stack was modified after applying the changes. - */ - stackChanged?: boolean; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace; - /** - * Exception details if any. - */ - exceptionDetails?: Runtime.ExceptionDetails; - } - - export interface RestartFrameReturnType { - /** - * New stack trace. - */ - callFrames: Debugger.CallFrame[]; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace; - } - - export interface GetScriptSourceReturnType { - /** - * Script source. - */ - scriptSource: string; - } - - export interface EvaluateOnCallFrameReturnType { - /** - * Object wrapper for the evaluation result. - */ - result: Runtime.RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: Runtime.ExceptionDetails; - } - - export interface ScriptParsedEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {}; - /** - * True, if this script is generated as a result of the live edit operation. - * @experimental - */ - isLiveEdit?: boolean; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string; - /** - * True, if this script has sourceURL. - * @experimental - */ - hasSourceURL?: boolean; - /** - * True, if this script is ES6 module. - * @experimental - */ - isModule?: boolean; - /** - * This script length. - * @experimental - */ - length?: number; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace; - } - - export interface ScriptFailedToParseEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {}; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string; - /** - * True, if this script has sourceURL. - * @experimental - */ - hasSourceURL?: boolean; - /** - * True, if this script is ES6 module. - * @experimental - */ - isModule?: boolean; - /** - * This script length. - * @experimental - */ - length?: number; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace; - } - - export interface BreakpointResolvedEventDataType { - /** - * Breakpoint unique identifier. - */ - breakpointId: Debugger.BreakpointId; - /** - * Actual breakpoint location. - */ - location: Debugger.Location; - } - - export interface PausedEventDataType { - /** - * Call stack the virtual machine stopped on. - */ - callFrames: Debugger.CallFrame[]; - /** - * Pause reason. - */ - reason: string; - /** - * Object containing break-specific auxiliary properties. - */ - data?: {}; - /** - * Hit breakpoints IDs - */ - hitBreakpoints?: string[]; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace; - } - } - - export namespace Console { - /** - * Console message. - */ - export interface ConsoleMessage { - /** - * Message source. - */ - source: string; - /** - * Message severity. - */ - level: string; - /** - * Message text. - */ - text: string; - /** - * URL of the message origin. - */ - url?: string; - /** - * Line number in the resource that generated this message (1-based). - */ - line?: number; - /** - * Column number in the resource that generated this message (1-based). - */ - column?: number; - } - - export interface MessageAddedEventDataType { - /** - * Console message that has been added. - */ - message: Console.ConsoleMessage; - } - } - - export namespace Profiler { - /** - * Profile node. Holds callsite information, execution statistics and child nodes. - */ - export interface ProfileNode { - /** - * Unique id of the node. - */ - id: number; - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Number of samples where this node was on top of the call stack. - * @experimental - */ - hitCount?: number; - /** - * Child node ids. - */ - children?: number[]; - /** - * The reason of being not optimized. The function may be deoptimized or marked as don't optimize. - */ - deoptReason?: string; - /** - * An array of source position ticks. - * @experimental - */ - positionTicks?: Profiler.PositionTickInfo[]; - } - - /** - * Profile. - */ - export interface Profile { - /** - * The list of profile nodes. First item is the root node. - */ - nodes: Profiler.ProfileNode[]; - /** - * Profiling start timestamp in microseconds. - */ - startTime: number; - /** - * Profiling end timestamp in microseconds. - */ - endTime: number; - /** - * Ids of samples top nodes. - */ - samples?: number[]; - /** - * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. - */ - timeDeltas?: number[]; - } - - /** - * Specifies a number of samples attributed to a certain source position. - * @experimental - */ - export interface PositionTickInfo { - /** - * Source line number (1-based). - */ - line: number; - /** - * Number of samples attributed to the source line. - */ - ticks: number; - } - - /** - * Coverage data for a source range. - * @experimental - */ - export interface CoverageRange { - /** - * JavaScript script source offset for the range start. - */ - startOffset: number; - /** - * JavaScript script source offset for the range end. - */ - endOffset: number; - /** - * Collected execution count of the source range. - */ - count: number; - } - - /** - * Coverage data for a JavaScript function. - * @experimental - */ - export interface FunctionCoverage { - /** - * JavaScript function name. - */ - functionName: string; - /** - * Source ranges inside the function with coverage data. - */ - ranges: Profiler.CoverageRange[]; - /** - * Whether coverage data for this function has block granularity. - */ - isBlockCoverage: boolean; - } - - /** - * Coverage data for a JavaScript script. - * @experimental - */ - export interface ScriptCoverage { - /** - * JavaScript script id. - */ - scriptId: Runtime.ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Functions contained in the script that has coverage data. - */ - functions: Profiler.FunctionCoverage[]; - } - - export interface SetSamplingIntervalParameterType { - /** - * New sampling interval in microseconds. - */ - interval: number; - } - - export interface StartPreciseCoverageParameterType { - /** - * Collect accurate call counts beyond simple 'covered' or 'not covered'. - */ - callCount?: boolean; - } - - export interface StopReturnType { - /** - * Recorded profile. - */ - profile: Profiler.Profile; - } - - export interface TakePreciseCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: Profiler.ScriptCoverage[]; - } - - export interface GetBestEffortCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: Profiler.ScriptCoverage[]; - } - - export interface ConsoleProfileStartedEventDataType { - id: string; - /** - * Location of console.profile(). - */ - location: Debugger.Location; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string; - } - - export interface ConsoleProfileFinishedEventDataType { - id: string; - /** - * Location of console.profileEnd(). - */ - location: Debugger.Location; - profile: Profiler.Profile; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string; - } - } - - export namespace HeapProfiler { - /** - * Heap snapshot object id. - */ - export type HeapSnapshotObjectId = string; - - /** - * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. - */ - export interface SamplingHeapProfileNode { - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Allocations size in bytes for the node excluding children. - */ - selfSize: number; - /** - * Child nodes. - */ - children: HeapProfiler.SamplingHeapProfileNode[]; - } - - /** - * Profile. - */ - export interface SamplingHeapProfile { - head: HeapProfiler.SamplingHeapProfileNode; - } - - export interface StartTrackingHeapObjectsParameterType { - trackAllocations?: boolean; - } - - export interface StopTrackingHeapObjectsParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. - */ - reportProgress?: boolean; - } - - export interface TakeHeapSnapshotParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. - */ - reportProgress?: boolean; - } - - export interface GetObjectByHeapObjectIdParameterType { - objectId: HeapProfiler.HeapSnapshotObjectId; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string; - } - - export interface AddInspectedHeapObjectParameterType { - /** - * Heap snapshot object id to be accessible by means of $x command line API. - */ - heapObjectId: HeapProfiler.HeapSnapshotObjectId; - } - - export interface GetHeapObjectIdParameterType { - /** - * Identifier of the object to get heap object id for. - */ - objectId: Runtime.RemoteObjectId; - } - - export interface StartSamplingParameterType { - /** - * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. - */ - samplingInterval?: number; - } - - export interface GetObjectByHeapObjectIdReturnType { - /** - * Evaluation result. - */ - result: Runtime.RemoteObject; - } - - export interface GetHeapObjectIdReturnType { - /** - * Id of the heap snapshot object corresponding to the passed remote object id. - */ - heapSnapshotObjectId: HeapProfiler.HeapSnapshotObjectId; - } - - export interface StopSamplingReturnType { - /** - * Recorded sampling heap profile. - */ - profile: HeapProfiler.SamplingHeapProfile; - } - - export interface AddHeapSnapshotChunkEventDataType { - chunk: string; - } - - export interface ReportHeapSnapshotProgressEventDataType { - done: number; - total: number; - finished?: boolean; - } - - export interface LastSeenObjectIdEventDataType { - lastSeenObjectId: number; - timestamp: number; + version: string; } - export interface HeapStatsUpdateEventDataType { + export interface GetDomainsReturnType { /** - * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. + * List of supported domains. */ - statsUpdate: number[]; + domains: Schema.Domain[]; } } @@ -1673,15 +1902,291 @@ declare module "inspector" { post(method: string, callback?: (err: Error | null, params?: {}) => void): void; /** - * Returns supported domains. + * Does nothing. */ - post(method: "Schema.getDomains", callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; - /** - * Evaluates expression on global object. - */ - post(method: "Runtime.evaluate", params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; - post(method: "Runtime.evaluate", callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + post(method: "Console.clearMessages", callback?: (err: Error | null) => void): void; + /** + * Disables console domain, prevents further console messages from being reported to the client. + */ + post(method: "Console.disable", callback?: (err: Error | null) => void): void; + + /** + * Enables console domain, sends the messages collected so far to the client by means of the +`messageAdded` notification. + */ + post(method: "Console.enable", callback?: (err: Error | null) => void): void; + /** + * Continues execution until specific location is reached. + */ + post(method: "Debugger.continueToLocation", params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.continueToLocation", callback?: (err: Error | null) => void): void; + + /** + * Disables debugger for given page. + */ + post(method: "Debugger.disable", callback?: (err: Error | null) => void): void; + + /** + * Enables debugger for the given page. Clients should not assume that the debugging has been +enabled until the result for this command is received. + */ + post(method: "Debugger.enable", callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void; + + /** + * Evaluates expression on a given call frame. + */ + post(method: "Debugger.evaluateOnCallFrame", params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + post(method: "Debugger.evaluateOnCallFrame", callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + + /** + * Returns possible locations for breakpoint. scriptId in start and end range locations should be +the same. + */ + post(method: "Debugger.getPossibleBreakpoints", params?: Debugger.GetPossibleBreakpointsParameterType, callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; + post(method: "Debugger.getPossibleBreakpoints", callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; + + /** + * Returns source for the script with given id. + */ + post(method: "Debugger.getScriptSource", params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + post(method: "Debugger.getScriptSource", callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + + /** + * Returns stack trace with given `stackTraceId`. + * @experimental + */ + post(method: "Debugger.getStackTrace", params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; + post(method: "Debugger.getStackTrace", callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; + + /** + * Stops on the next JavaScript statement. + */ + post(method: "Debugger.pause", callback?: (err: Error | null) => void): void; + + /** + * @experimental + */ + post(method: "Debugger.pauseOnAsyncCall", params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.pauseOnAsyncCall", callback?: (err: Error | null) => void): void; + + /** + * Removes JavaScript breakpoint. + */ + post(method: "Debugger.removeBreakpoint", params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.removeBreakpoint", callback?: (err: Error | null) => void): void; + + /** + * Restarts particular call frame from the beginning. + */ + post(method: "Debugger.restartFrame", params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + post(method: "Debugger.restartFrame", callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + + /** + * Resumes JavaScript execution. + */ + post(method: "Debugger.resume", callback?: (err: Error | null) => void): void; + + /** + * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and +Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled +before next pause. Returns success when async task is actually scheduled, returns error if no +task were scheduled or another scheduleStepIntoAsync was called. + * @experimental + */ + post(method: "Debugger.scheduleStepIntoAsync", callback?: (err: Error | null) => void): void; + + /** + * Searches for given string in script content. + */ + post(method: "Debugger.searchInContent", params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + post(method: "Debugger.searchInContent", callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + + /** + * Enables or disables async call stacks tracking. + */ + post(method: "Debugger.setAsyncCallStackDepth", params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setAsyncCallStackDepth", callback?: (err: Error | null) => void): void; + + /** + * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in +scripts with url matching one of the patterns. VM will try to leave blackboxed script by +performing 'step in' several times, finally resorting to 'step out' if unsuccessful. + * @experimental + */ + post(method: "Debugger.setBlackboxPatterns", params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBlackboxPatterns", callback?: (err: Error | null) => void): void; + + /** + * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted +scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. +Positions array contains positions where blackbox state is changed. First interval isn't +blackboxed. Array should be sorted. + * @experimental + */ + post(method: "Debugger.setBlackboxedRanges", params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBlackboxedRanges", callback?: (err: Error | null) => void): void; + + /** + * Sets JavaScript breakpoint at a given location. + */ + post(method: "Debugger.setBreakpoint", params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + post(method: "Debugger.setBreakpoint", callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + + /** + * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this +command is issued, all existing parsed scripts will have breakpoints resolved and returned in +`locations` property. Further matching script parsing will result in subsequent +`breakpointResolved` events issued. This logical breakpoint will survive page reloads. + */ + post(method: "Debugger.setBreakpointByUrl", params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + post(method: "Debugger.setBreakpointByUrl", callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + + /** + * Activates / deactivates all breakpoints on the page. + */ + post(method: "Debugger.setBreakpointsActive", params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBreakpointsActive", callback?: (err: Error | null) => void): void; + + /** + * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or +no exceptions. Initial pause on exceptions state is `none`. + */ + post(method: "Debugger.setPauseOnExceptions", params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setPauseOnExceptions", callback?: (err: Error | null) => void): void; + + /** + * Changes return value in top frame. Available only at return break position. + * @experimental + */ + post(method: "Debugger.setReturnValue", params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setReturnValue", callback?: (err: Error | null) => void): void; + + /** + * Edits JavaScript source live. + */ + post(method: "Debugger.setScriptSource", params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + post(method: "Debugger.setScriptSource", callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + + /** + * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). + */ + post(method: "Debugger.setSkipAllPauses", params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setSkipAllPauses", callback?: (err: Error | null) => void): void; + + /** + * Changes value of variable in a callframe. Object-based scopes are not supported and must be +mutated manually. + */ + post(method: "Debugger.setVariableValue", params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setVariableValue", callback?: (err: Error | null) => void): void; + + /** + * Steps into the function call. + */ + post(method: "Debugger.stepInto", params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.stepInto", callback?: (err: Error | null) => void): void; + + /** + * Steps out of the function call. + */ + post(method: "Debugger.stepOut", callback?: (err: Error | null) => void): void; + + /** + * Steps over the statement. + */ + post(method: "Debugger.stepOver", callback?: (err: Error | null) => void): void; + /** + * Enables console to refer to the node with given id via $x (see Command Line API for more details +$x functions). + */ + post(method: "HeapProfiler.addInspectedHeapObject", params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.addInspectedHeapObject", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.collectGarbage", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.disable", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.enable", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.getHeapObjectId", params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + post(method: "HeapProfiler.getHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + + post(method: "HeapProfiler.getObjectByHeapObjectId", params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; + post(method: "HeapProfiler.getObjectByHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; + + post(method: "HeapProfiler.getSamplingProfile", callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void; + + post(method: "HeapProfiler.startSampling", params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.startSampling", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.startTrackingHeapObjects", params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.startTrackingHeapObjects", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.stopSampling", callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; + + post(method: "HeapProfiler.stopTrackingHeapObjects", params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.stopTrackingHeapObjects", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.takeHeapSnapshot", params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.takeHeapSnapshot", callback?: (err: Error | null) => void): void; + post(method: "Profiler.disable", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.enable", callback?: (err: Error | null) => void): void; + + /** + * Collect coverage data for the current isolate. The coverage data may be incomplete due to +garbage collection. + */ + post(method: "Profiler.getBestEffortCoverage", callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; + + /** + * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. + */ + post(method: "Profiler.setSamplingInterval", params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; + post(method: "Profiler.setSamplingInterval", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.start", callback?: (err: Error | null) => void): void; + + /** + * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code +coverage may be incomplete. Enabling prevents running optimized code and resets execution +counters. + */ + post(method: "Profiler.startPreciseCoverage", params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; + post(method: "Profiler.startPreciseCoverage", callback?: (err: Error | null) => void): void; + + /** + * Enable type profile. + * @experimental + */ + post(method: "Profiler.startTypeProfile", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.stop", callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; + + /** + * Disable precise code coverage. Disabling releases unnecessary execution count records and allows +executing optimized code. + */ + post(method: "Profiler.stopPreciseCoverage", callback?: (err: Error | null) => void): void; + + /** + * Disable type profile. Disabling releases type profile data collected so far. + * @experimental + */ + post(method: "Profiler.stopTypeProfile", callback?: (err: Error | null) => void): void; + + /** + * Collect coverage data for the current isolate, and resets execution counters. Precise code +coverage needs to have started. + */ + post(method: "Profiler.takePreciseCoverage", callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; + + /** + * Collect type profile. + * @experimental + */ + post(method: "Profiler.takeTypeProfile", callback?: (err: Error | null, params: Profiler.TakeTypeProfileReturnType) => void): void; /** * Add handler to promise with given promise object id. */ @@ -1689,17 +2194,70 @@ declare module "inspector" { post(method: "Runtime.awaitPromise", callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; /** - * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. + * Calls function with given declaration on the given object. Object group of the result is +inherited from the target object. */ post(method: "Runtime.callFunctionOn", params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; post(method: "Runtime.callFunctionOn", callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; /** - * Returns properties of a given object. Object group of the result is inherited from the target object. + * Compiles expression. + */ + post(method: "Runtime.compileScript", params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + post(method: "Runtime.compileScript", callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + + /** + * Disables reporting of execution contexts creation. + */ + post(method: "Runtime.disable", callback?: (err: Error | null) => void): void; + + /** + * Discards collected exceptions and console API calls. + */ + post(method: "Runtime.discardConsoleEntries", callback?: (err: Error | null) => void): void; + + /** + * Enables reporting of execution contexts creation by means of `executionContextCreated` event. +When the reporting gets enabled the event will be sent immediately for each existing execution +context. + */ + post(method: "Runtime.enable", callback?: (err: Error | null) => void): void; + + /** + * Evaluates expression on global object. + */ + post(method: "Runtime.evaluate", params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + post(method: "Runtime.evaluate", callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + + /** + * Returns the isolate id. + * @experimental + */ + post(method: "Runtime.getIsolateId", callback?: (err: Error | null, params: Runtime.GetIsolateIdReturnType) => void): void; + + /** + * Returns the JavaScript heap usage. +It is the total usage of the corresponding isolate not scoped to a particular Runtime. + * @experimental + */ + post(method: "Runtime.getHeapUsage", callback?: (err: Error | null, params: Runtime.GetHeapUsageReturnType) => void): void; + + /** + * Returns properties of a given object. Object group of the result is inherited from the target +object. */ post(method: "Runtime.getProperties", params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; post(method: "Runtime.getProperties", callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + /** + * Returns all let, const and class variables from global scope. + */ + post(method: "Runtime.globalLexicalScopeNames", params?: Runtime.GlobalLexicalScopeNamesParameterType, callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; + post(method: "Runtime.globalLexicalScopeNames", callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; + + post(method: "Runtime.queryObjects", params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + post(method: "Runtime.queryObjects", callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + /** * Releases remote object with given id. */ @@ -1718,19 +2276,10 @@ declare module "inspector" { post(method: "Runtime.runIfWaitingForDebugger", callback?: (err: Error | null) => void): void; /** - * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. + * Runs script with given id in a given context. */ - post(method: "Runtime.enable", callback?: (err: Error | null) => void): void; - - /** - * Disables reporting of execution contexts creation. - */ - post(method: "Runtime.disable", callback?: (err: Error | null) => void): void; - - /** - * Discards collected exceptions and console API calls. - */ - post(method: "Runtime.discardConsoleEntries", callback?: (err: Error | null) => void): void; + post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; /** * @experimental @@ -1739,245 +2288,15 @@ declare module "inspector" { post(method: "Runtime.setCustomObjectFormatterEnabled", callback?: (err: Error | null) => void): void; /** - * Compiles expression. - */ - post(method: "Runtime.compileScript", params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - post(method: "Runtime.compileScript", callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - - /** - * Runs script with given id in a given context. - */ - post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - /** - * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. - */ - post(method: "Debugger.enable", callback?: (err: Error | null) => void): void; - - /** - * Disables debugger for given page. - */ - post(method: "Debugger.disable", callback?: (err: Error | null) => void): void; - - /** - * Activates / deactivates all breakpoints on the page. - */ - post(method: "Debugger.setBreakpointsActive", params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setBreakpointsActive", callback?: (err: Error | null) => void): void; - - /** - * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). - */ - post(method: "Debugger.setSkipAllPauses", params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setSkipAllPauses", callback?: (err: Error | null) => void): void; - - /** - * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. - */ - post(method: "Debugger.setBreakpointByUrl", params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - post(method: "Debugger.setBreakpointByUrl", callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - - /** - * Sets JavaScript breakpoint at a given location. - */ - post(method: "Debugger.setBreakpoint", params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - post(method: "Debugger.setBreakpoint", callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - - /** - * Removes JavaScript breakpoint. - */ - post(method: "Debugger.removeBreakpoint", params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.removeBreakpoint", callback?: (err: Error | null) => void): void; - - /** - * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. + * Terminate current or next JavaScript execution. +Will cancel the termination when the outer-most script execution ends. * @experimental */ - post(method: "Debugger.getPossibleBreakpoints", params?: Debugger.GetPossibleBreakpointsParameterType, callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; - post(method: "Debugger.getPossibleBreakpoints", callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; - + post(method: "Runtime.terminateExecution", callback?: (err: Error | null) => void): void; /** - * Continues execution until specific location is reached. + * Returns supported domains. */ - post(method: "Debugger.continueToLocation", params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.continueToLocation", callback?: (err: Error | null) => void): void; - - /** - * Steps over the statement. - */ - post(method: "Debugger.stepOver", callback?: (err: Error | null) => void): void; - - /** - * Steps into the function call. - */ - post(method: "Debugger.stepInto", callback?: (err: Error | null) => void): void; - - /** - * Steps out of the function call. - */ - post(method: "Debugger.stepOut", callback?: (err: Error | null) => void): void; - - /** - * Stops on the next JavaScript statement. - */ - post(method: "Debugger.pause", callback?: (err: Error | null) => void): void; - - /** - * Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. - * @experimental - */ - post(method: "Debugger.scheduleStepIntoAsync", callback?: (err: Error | null) => void): void; - - /** - * Resumes JavaScript execution. - */ - post(method: "Debugger.resume", callback?: (err: Error | null) => void): void; - - /** - * Searches for given string in script content. - * @experimental - */ - post(method: "Debugger.searchInContent", params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - post(method: "Debugger.searchInContent", callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - - /** - * Edits JavaScript source live. - */ - post(method: "Debugger.setScriptSource", params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - post(method: "Debugger.setScriptSource", callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - - /** - * Restarts particular call frame from the beginning. - */ - post(method: "Debugger.restartFrame", params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - post(method: "Debugger.restartFrame", callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - - /** - * Returns source for the script with given id. - */ - post(method: "Debugger.getScriptSource", params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - post(method: "Debugger.getScriptSource", callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - - /** - * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. - */ - post(method: "Debugger.setPauseOnExceptions", params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setPauseOnExceptions", callback?: (err: Error | null) => void): void; - - /** - * Evaluates expression on a given call frame. - */ - post(method: "Debugger.evaluateOnCallFrame", params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - post(method: "Debugger.evaluateOnCallFrame", callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - - /** - * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. - */ - post(method: "Debugger.setVariableValue", params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setVariableValue", callback?: (err: Error | null) => void): void; - - /** - * Enables or disables async call stacks tracking. - */ - post(method: "Debugger.setAsyncCallStackDepth", params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setAsyncCallStackDepth", callback?: (err: Error | null) => void): void; - - /** - * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. - * @experimental - */ - post(method: "Debugger.setBlackboxPatterns", params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setBlackboxPatterns", callback?: (err: Error | null) => void): void; - - /** - * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. - * @experimental - */ - post(method: "Debugger.setBlackboxedRanges", params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setBlackboxedRanges", callback?: (err: Error | null) => void): void; - /** - * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. - */ - post(method: "Console.enable", callback?: (err: Error | null) => void): void; - - /** - * Disables console domain, prevents further console messages from being reported to the client. - */ - post(method: "Console.disable", callback?: (err: Error | null) => void): void; - - /** - * Does nothing. - */ - post(method: "Console.clearMessages", callback?: (err: Error | null) => void): void; - post(method: "Profiler.enable", callback?: (err: Error | null) => void): void; - - post(method: "Profiler.disable", callback?: (err: Error | null) => void): void; - - /** - * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. - */ - post(method: "Profiler.setSamplingInterval", params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; - post(method: "Profiler.setSamplingInterval", callback?: (err: Error | null) => void): void; - - post(method: "Profiler.start", callback?: (err: Error | null) => void): void; - - post(method: "Profiler.stop", callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; - - /** - * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. - * @experimental - */ - post(method: "Profiler.startPreciseCoverage", params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; - post(method: "Profiler.startPreciseCoverage", callback?: (err: Error | null) => void): void; - - /** - * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. - * @experimental - */ - post(method: "Profiler.stopPreciseCoverage", callback?: (err: Error | null) => void): void; - - /** - * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. - * @experimental - */ - post(method: "Profiler.takePreciseCoverage", callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; - - /** - * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. - * @experimental - */ - post(method: "Profiler.getBestEffortCoverage", callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; - post(method: "HeapProfiler.enable", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.disable", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.startTrackingHeapObjects", params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: "HeapProfiler.startTrackingHeapObjects", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.stopTrackingHeapObjects", params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: "HeapProfiler.stopTrackingHeapObjects", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.takeHeapSnapshot", params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; - post(method: "HeapProfiler.takeHeapSnapshot", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.collectGarbage", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.getObjectByHeapObjectId", params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; - post(method: "HeapProfiler.getObjectByHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; - - /** - * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). - */ - post(method: "HeapProfiler.addInspectedHeapObject", params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: "HeapProfiler.addInspectedHeapObject", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.getHeapObjectId", params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - post(method: "HeapProfiler.getHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - - post(method: "HeapProfiler.startSampling", params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; - post(method: "HeapProfiler.startSampling", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.stopSampling", callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; + post(method: "Schema.getDomains", callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; // Events @@ -1989,49 +2308,9 @@ declare module "inspector" { addListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; /** - * Issued when new execution context is created. + * Issued when new console message is added. */ - addListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when execution context is destroyed. - */ - addListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when all executionContexts were cleared in browser - */ - addListener(event: "Runtime.executionContextsCleared", listener: () => void): this; - - /** - * Issued when exception was thrown and unhandled. - */ - addListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when unhandled exception was revoked. - */ - addListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when console API was called. - */ - addListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - addListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - addListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine fails to parse the script. - */ - addListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + addListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** * Fired when breakpoint is resolved to an actual script and location. @@ -2049,52 +2328,97 @@ declare module "inspector" { addListener(event: "Debugger.resumed", listener: () => void): this; /** - * Issued when new console message is added. + * Fired when virtual machine fails to parse the script. */ - addListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + addListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; /** - * Sent when new profile recording is started using console.profile() call. + * Fired when virtual machine parses script. This event is also fired for all known and uncollected +scripts upon enabling debugger. */ - addListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + addListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; - addListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; addListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; - addListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; - addListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; - - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - addListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; /** * If heap objects tracking has been started then backend may send update for one or more fragments */ addListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last +seen object id and corresponding timestamp. If the were changes in the heap since last event +then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + addListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + addListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + addListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + addListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + addListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + addListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + addListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + addListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when new execution context is created. + */ + addListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + addListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + addListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API +call). + */ + addListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; emit(event: "inspectorNotification", message: InspectorNotification<{}>): boolean; - emit(event: "Runtime.executionContextCreated", message: InspectorNotification): boolean; - emit(event: "Runtime.executionContextDestroyed", message: InspectorNotification): boolean; - emit(event: "Runtime.executionContextsCleared"): boolean; - emit(event: "Runtime.exceptionThrown", message: InspectorNotification): boolean; - emit(event: "Runtime.exceptionRevoked", message: InspectorNotification): boolean; - emit(event: "Runtime.consoleAPICalled", message: InspectorNotification): boolean; - emit(event: "Runtime.inspectRequested", message: InspectorNotification): boolean; - emit(event: "Debugger.scriptParsed", message: InspectorNotification): boolean; - emit(event: "Debugger.scriptFailedToParse", message: InspectorNotification): boolean; + emit(event: "Console.messageAdded", message: InspectorNotification): boolean; emit(event: "Debugger.breakpointResolved", message: InspectorNotification): boolean; emit(event: "Debugger.paused", message: InspectorNotification): boolean; emit(event: "Debugger.resumed"): boolean; - emit(event: "Console.messageAdded", message: InspectorNotification): boolean; - emit(event: "Profiler.consoleProfileStarted", message: InspectorNotification): boolean; - emit(event: "Profiler.consoleProfileFinished", message: InspectorNotification): boolean; + emit(event: "Debugger.scriptFailedToParse", message: InspectorNotification): boolean; + emit(event: "Debugger.scriptParsed", message: InspectorNotification): boolean; emit(event: "HeapProfiler.addHeapSnapshotChunk", message: InspectorNotification): boolean; - emit(event: "HeapProfiler.resetProfiles"): boolean; - emit(event: "HeapProfiler.reportHeapSnapshotProgress", message: InspectorNotification): boolean; - emit(event: "HeapProfiler.lastSeenObjectId", message: InspectorNotification): boolean; emit(event: "HeapProfiler.heapStatsUpdate", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.lastSeenObjectId", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.reportHeapSnapshotProgress", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.resetProfiles"): boolean; + emit(event: "Profiler.consoleProfileFinished", message: InspectorNotification): boolean; + emit(event: "Profiler.consoleProfileStarted", message: InspectorNotification): boolean; + emit(event: "Runtime.consoleAPICalled", message: InspectorNotification): boolean; + emit(event: "Runtime.exceptionRevoked", message: InspectorNotification): boolean; + emit(event: "Runtime.exceptionThrown", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextCreated", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextDestroyed", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextsCleared"): boolean; + emit(event: "Runtime.inspectRequested", message: InspectorNotification): boolean; on(event: string, listener: (...args: any[]) => void): this; @@ -2104,49 +2428,9 @@ declare module "inspector" { on(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; /** - * Issued when new execution context is created. + * Issued when new console message is added. */ - on(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when execution context is destroyed. - */ - on(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when all executionContexts were cleared in browser - */ - on(event: "Runtime.executionContextsCleared", listener: () => void): this; - - /** - * Issued when exception was thrown and unhandled. - */ - on(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when unhandled exception was revoked. - */ - on(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when console API was called. - */ - on(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - on(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - on(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine fails to parse the script. - */ - on(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + on(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** * Fired when breakpoint is resolved to an actual script and location. @@ -2164,29 +2448,74 @@ declare module "inspector" { on(event: "Debugger.resumed", listener: () => void): this; /** - * Issued when new console message is added. + * Fired when virtual machine fails to parse the script. */ - on(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + on(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected +scripts upon enabling debugger. + */ + on(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + on(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + on(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last +seen object id and corresponding timestamp. If the were changes in the heap since last event +then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + on(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + on(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + on(event: "HeapProfiler.resetProfiles", listener: () => void): this; + on(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; /** * Sent when new profile recording is started using console.profile() call. */ on(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; - on(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; - on(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; - on(event: "HeapProfiler.resetProfiles", listener: () => void): this; - on(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + on(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + * Issued when unhandled exception was revoked. */ - on(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + on(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; /** - * If heap objects tracking has been started then backend may send update for one or more fragments + * Issued when exception was thrown and unhandled. */ - on(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + on(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when new execution context is created. + */ + on(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + on(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + on(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API +call). + */ + on(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; once(event: string, listener: (...args: any[]) => void): this; @@ -2196,49 +2525,9 @@ declare module "inspector" { once(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; /** - * Issued when new execution context is created. + * Issued when new console message is added. */ - once(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when execution context is destroyed. - */ - once(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when all executionContexts were cleared in browser - */ - once(event: "Runtime.executionContextsCleared", listener: () => void): this; - - /** - * Issued when exception was thrown and unhandled. - */ - once(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when unhandled exception was revoked. - */ - once(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when console API was called. - */ - once(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - once(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - once(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine fails to parse the script. - */ - once(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + once(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** * Fired when breakpoint is resolved to an actual script and location. @@ -2256,29 +2545,74 @@ declare module "inspector" { once(event: "Debugger.resumed", listener: () => void): this; /** - * Issued when new console message is added. + * Fired when virtual machine fails to parse the script. */ - once(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + once(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected +scripts upon enabling debugger. + */ + once(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + once(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + once(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last +seen object id and corresponding timestamp. If the were changes in the heap since last event +then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + once(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + once(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + once(event: "HeapProfiler.resetProfiles", listener: () => void): this; + once(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; /** * Sent when new profile recording is started using console.profile() call. */ once(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; - once(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; - once(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; - once(event: "HeapProfiler.resetProfiles", listener: () => void): this; - once(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + once(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + * Issued when unhandled exception was revoked. */ - once(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + once(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; /** - * If heap objects tracking has been started then backend may send update for one or more fragments + * Issued when exception was thrown and unhandled. */ - once(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + once(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when new execution context is created. + */ + once(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + once(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + once(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API +call). + */ + once(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; prependListener(event: string, listener: (...args: any[]) => void): this; @@ -2288,49 +2622,9 @@ declare module "inspector" { prependListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; /** - * Issued when new execution context is created. + * Issued when new console message is added. */ - prependListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when execution context is destroyed. - */ - prependListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when all executionContexts were cleared in browser - */ - prependListener(event: "Runtime.executionContextsCleared", listener: () => void): this; - - /** - * Issued when exception was thrown and unhandled. - */ - prependListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when unhandled exception was revoked. - */ - prependListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when console API was called. - */ - prependListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine fails to parse the script. - */ - prependListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** * Fired when breakpoint is resolved to an actual script and location. @@ -2348,29 +2642,74 @@ declare module "inspector" { prependListener(event: "Debugger.resumed", listener: () => void): this; /** - * Issued when new console message is added. + * Fired when virtual machine fails to parse the script. */ - prependListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected +scripts upon enabling debugger. + */ + prependListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + prependListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last +seen object id and corresponding timestamp. If the were changes in the heap since last event +then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + prependListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + prependListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + prependListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; /** * Sent when new profile recording is started using console.profile() call. */ prependListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; - prependListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; - prependListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; - prependListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; - prependListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + prependListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + * Issued when unhandled exception was revoked. */ - prependListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; /** - * If heap objects tracking has been started then backend may send update for one or more fragments + * Issued when exception was thrown and unhandled. */ - prependListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when new execution context is created. + */ + prependListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + prependListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + prependListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API +call). + */ + prependListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; prependOnceListener(event: string, listener: (...args: any[]) => void): this; @@ -2380,49 +2719,9 @@ declare module "inspector" { prependOnceListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; /** - * Issued when new execution context is created. + * Issued when new console message is added. */ - prependOnceListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when execution context is destroyed. - */ - prependOnceListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when all executionContexts were cleared in browser - */ - prependOnceListener(event: "Runtime.executionContextsCleared", listener: () => void): this; - - /** - * Issued when exception was thrown and unhandled. - */ - prependOnceListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when unhandled exception was revoked. - */ - prependOnceListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when console API was called. - */ - prependOnceListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependOnceListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependOnceListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine fails to parse the script. - */ - prependOnceListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** * Fired when breakpoint is resolved to an actual script and location. @@ -2440,29 +2739,74 @@ declare module "inspector" { prependOnceListener(event: "Debugger.resumed", listener: () => void): this; /** - * Issued when new console message is added. + * Fired when virtual machine fails to parse the script. */ - prependOnceListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected +scripts upon enabling debugger. + */ + prependOnceListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + prependOnceListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependOnceListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last +seen object id and corresponding timestamp. If the were changes in the heap since last event +then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependOnceListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + prependOnceListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + prependOnceListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; /** * Sent when new profile recording is started using console.profile() call. */ prependOnceListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; - prependOnceListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + prependOnceListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + * Issued when unhandled exception was revoked. */ - prependOnceListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; /** - * If heap objects tracking has been started then backend may send update for one or more fragments + * Issued when exception was thrown and unhandled. */ - prependOnceListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when new execution context is created. + */ + prependOnceListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + prependOnceListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + prependOnceListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API +call). + */ + prependOnceListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; } // Top Level API diff --git a/types/node/node-tests.ts b/types/node/node-tests.ts index b4681b1d57..542e8111a2 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -782,6 +782,8 @@ namespace util_tests { }); assert(typeof util.inspect.custom === 'symbol'); + util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 }); + // util.callbackify // tslint:disable-next-line no-unnecessary-class class callbackifyTest { @@ -862,6 +864,7 @@ namespace util_tests { var arg0NoResult: () => Promise = util.promisify((cb: (err: Error) => void): void => { }); var arg1: (arg: string) => Promise = util.promisify((arg: string, cb: (err: Error, result: number) => void): void => { }); var arg1NoResult: (arg: string) => Promise = util.promisify((arg: string, cb: (err: Error) => void): void => { }); + var cbOptionalError: () => Promise = util.promisify((cb: (err?: Error | null) => void): void => { cb(); }); assert(typeof util.promisify.custom === 'symbol'); // util.deprecate const foo = () => {}; @@ -1205,8 +1208,7 @@ namespace crypto_tests { { // crypto_cipher_decipher_dataview_test let key: Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7]); - let clearText: DataView = new DataView( - new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4]).buffer); + let clearText: DataView = new DataView(new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4]).buffer); let cipher: crypto.Cipher = crypto.createCipher("aes-128-ecb", key); let cipherBuffers: Buffer[] = []; cipherBuffers.push(cipher.update(clearText)); @@ -1224,6 +1226,56 @@ namespace crypto_tests { assert.deepEqual(clearText2, clearText); } + { + const key = 'keykeykeykeykeykeykeykey'; + const nonce = crypto.randomBytes(12); + const aad = Buffer.from('0123456789', 'hex'); + + const cipher = crypto.createCipheriv('aes-192-ccm', key, nonce, { + authTagLength: 16 + }); + const plaintext = 'Hello world'; + cipher.setAAD(aad, { + plaintextLength: Buffer.byteLength(plaintext) + }); + const ciphertext = cipher.update(plaintext, 'utf8'); + cipher.final(); + const tag = cipher.getAuthTag(); + + const decipher = crypto.createDecipheriv('aes-192-ccm', key, nonce, { + authTagLength: 16 + }); + decipher.setAuthTag(tag); + decipher.setAAD(aad, { + plaintextLength: ciphertext.length + }); + const receivedPlaintext: string = decipher.update(ciphertext, null, 'utf8'); + decipher.final(); + } + + { + const key = 'keykeykeykeykeykeykeykey'; + const nonce = crypto.randomBytes(12); + const aad = Buffer.from('0123456789', 'hex'); + + const cipher = crypto.createCipheriv('aes-192-gcm', key, nonce); + const plaintext = 'Hello world'; + cipher.setAAD(aad, { + plaintextLength: Buffer.byteLength(plaintext) + }); + const ciphertext = cipher.update(plaintext, 'utf8'); + cipher.final(); + const tag = cipher.getAuthTag(); + + const decipher = crypto.createDecipheriv('aes-192-gcm', key, nonce); + decipher.setAuthTag(tag); + decipher.setAAD(aad, { + plaintextLength: ciphertext.length + }); + const receivedPlaintext: string = decipher.update(ciphertext, null, 'utf8'); + decipher.final(); + } + { // crypto_timingsafeequal_buffer_test let buffer1: Buffer = new Buffer([1, 2, 3, 4, 5]); @@ -1708,7 +1760,25 @@ namespace http_tests { } { + http.get('http://www.example.com/xyz'); http.request('http://www.example.com/xyz'); + + http.get('http://www.example.com/xyz', (res: http.IncomingMessage): void => {}); + http.request('http://www.example.com/xyz', (res: http.IncomingMessage): void => {}); + + http.get(new url.URL('http://www.example.com/xyz')); + http.request(new url.URL('http://www.example.com/xyz')); + + http.get(new url.URL('http://www.example.com/xyz'), (res: http.IncomingMessage): void => {}); + http.request(new url.URL('http://www.example.com/xyz'), (res: http.IncomingMessage): void => {}); + + const opts: http.RequestOptions = { + path: '"/some/path' + }; + http.get(new url.URL('http://www.example.com'), opts); + http.request(new url.URL('http://www.example.com'), opts); + http.get(new url.URL('http://www.example.com/xyz'), opts, (res: http.IncomingMessage): void => {}); + http.request(new url.URL('http://www.example.com/xyz'), opts, (res: http.IncomingMessage): void => {}); } { @@ -1770,8 +1840,26 @@ namespace https_tests { agent: undefined }); + https.get('http://www.example.com/xyz'); https.request('http://www.example.com/xyz'); + https.get('http://www.example.com/xyz', (res: http.IncomingMessage): void => {}); + https.request('http://www.example.com/xyz', (res: http.IncomingMessage): void => {}); + + https.get(new url.URL('http://www.example.com/xyz')); + https.request(new url.URL('http://www.example.com/xyz')); + + https.get(new url.URL('http://www.example.com/xyz'), (res: http.IncomingMessage): void => {}); + https.request(new url.URL('http://www.example.com/xyz'), (res: http.IncomingMessage): void => {}); + + const opts: https.RequestOptions = { + path: '/some/path' + }; + https.get(new url.URL('http://www.example.com'), opts); + https.request(new url.URL('http://www.example.com'), opts); + https.get(new url.URL('http://www.example.com/xyz'), opts, (res: http.IncomingMessage): void => {}); + https.request(new url.URL('http://www.example.com/xyz'), opts, (res: http.IncomingMessage): void => {}); + https.globalAgent.options.ca = []; { diff --git a/types/node/v4/index.d.ts b/types/node/v4/index.d.ts index a53098f615..6ebd6b2839 100644 --- a/types/node/v4/index.d.ts +++ b/types/node/v4/index.d.ts @@ -707,6 +707,7 @@ declare module "http" { 'transfer-encoding'?: string; 'tk'?: string; 'upgrade'?: string; + 'user-agent'?: string; 'vary'?: string; 'via'?: string; 'warning'?: string; diff --git a/types/node/v6/index.d.ts b/types/node/v6/index.d.ts index 44083060ee..8a9ee77904 100644 --- a/types/node/v6/index.d.ts +++ b/types/node/v6/index.d.ts @@ -776,6 +776,7 @@ declare module "http" { 'transfer-encoding'?: string; 'tk'?: string; 'upgrade'?: string; + 'user-agent'?: string; 'vary'?: string; 'via'?: string; 'warning'?: string; diff --git a/types/node/v7/index.d.ts b/types/node/v7/index.d.ts index da7c47d68e..11dc0e4f5a 100644 --- a/types/node/v7/index.d.ts +++ b/types/node/v7/index.d.ts @@ -773,6 +773,7 @@ declare module "http" { 'transfer-encoding'?: string; 'tk'?: string; 'upgrade'?: string; + 'user-agent'?: string; 'vary'?: string; 'via'?: string; 'warning'?: string; diff --git a/types/node/v8/index.d.ts b/types/node/v8/index.d.ts index dc44245c59..4cf8dc2a78 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -977,6 +977,7 @@ declare module "http" { 'transfer-encoding'?: string; 'tk'?: string; 'upgrade'?: string; + 'user-agent'?: string; 'vary'?: string; 'via'?: string; 'warning'?: string; @@ -1588,6 +1589,7 @@ declare module "os" { netmask: string; mac: string; internal: boolean; + cidr: string | null; } export interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { @@ -5688,17 +5690,17 @@ declare module "util" { export function promisify(fn: CustomPromisify): TCustom; export function promisify(fn: (callback: (err: Error | null, result: TResult) => void) => void): () => Promise; - export function promisify(fn: (callback: (err: Error | null) => void) => void): () => Promise; + export function promisify(fn: (callback: (err?: Error | null) => void) => void): () => Promise; export function promisify(fn: (arg1: T1, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1) => Promise; - export function promisify(fn: (arg1: T1, callback: (err: Error | null) => void) => void): (arg1: T1) => Promise; + export function promisify(fn: (arg1: T1, callback: (err?: Error | null) => void) => void): (arg1: T1) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; export function promisify(fn: Function): Function; export namespace promisify { const custom: symbol; diff --git a/types/node/v8/inspector.d.ts b/types/node/v8/inspector.d.ts index 955239b486..19bba5af01 100644 --- a/types/node/v8/inspector.d.ts +++ b/types/node/v8/inspector.d.ts @@ -244,7 +244,7 @@ declare module "inspector" { */ export interface CallArgument { /** - * Primitive value. + * Primitive value or serializable javascript object. */ value?: any; /** @@ -416,7 +416,7 @@ declare module "inspector" { */ userGesture?: boolean; /** - * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + * Whether execution should await for resulting value and return once awaited promise is resolved. */ awaitPromise?: boolean; } @@ -468,7 +468,7 @@ declare module "inspector" { */ userGesture?: boolean; /** - * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + * Whether execution should await for resulting value and return once awaited promise is resolved. */ awaitPromise?: boolean; } @@ -561,11 +561,18 @@ declare module "inspector" { */ generatePreview?: boolean; /** - * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + * Whether execution should await for resulting value and return once awaited promise is resolved. */ awaitPromise?: boolean; } + export interface QueryObjectsParameterType { + /** + * Identifier of the prototype to return objects for. + */ + prototypeObjectId: Runtime.RemoteObjectId; + } + export interface EvaluateReturnType { /** * Evaluation result. @@ -636,6 +643,13 @@ declare module "inspector" { exceptionDetails?: Runtime.ExceptionDetails; } + export interface QueryObjectsReturnType { + /** + * Array with objects. + */ + objects: Runtime.RemoteObject; + } + export interface ExecutionContextCreatedEventDataType { /** * A newly created execution context. @@ -1476,6 +1490,10 @@ declare module "inspector" { * Collect accurate call counts beyond simple 'covered' or 'not covered'. */ callCount?: boolean; + /** + * Collect block-based coverage. + */ + detailed?: boolean; } export interface StopReturnType { @@ -1749,6 +1767,12 @@ declare module "inspector" { */ post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + + /** + * @experimental + */ + post(method: "Runtime.queryObjects", params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + post(method: "Runtime.queryObjects", callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; /** * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. */ diff --git a/types/node/v8/node-tests.ts b/types/node/v8/node-tests.ts index d89e6faacc..e1d14b9089 100644 --- a/types/node/v8/node-tests.ts +++ b/types/node/v8/node-tests.ts @@ -819,6 +819,8 @@ namespace util_tests { var arg0NoResult: () => Promise = util.promisify((cb: (err: Error) => void): void => { }); var arg1: (arg: string) => Promise = util.promisify((arg: string, cb: (err: Error, result: number) => void): void => { }); var arg1NoResult: (arg: string) => Promise = util.promisify((arg: string, cb: (err: Error) => void): void => { }); + // The following test requires typescript >= 2.4, but definitions currently tested with typescript@2.1 + // var cbOptionalError: () => Promise = util.promisify((cb: (err?: Error | null) => void): void => { cb(); }); assert(typeof util.promisify.custom === 'symbol'); // util.deprecate const foo = () => {}; diff --git a/types/node/v9/index.d.ts b/types/node/v9/index.d.ts index fd89e18e16..e1b44f5602 100644 --- a/types/node/v9/index.d.ts +++ b/types/node/v9/index.d.ts @@ -1066,6 +1066,7 @@ declare module "http" { 'transfer-encoding'?: string; 'tk'?: string; 'upgrade'?: string; + 'user-agent'?: string; 'vary'?: string; 'via'?: string; 'warning'?: string; @@ -1677,6 +1678,7 @@ declare module "os" { netmask: string; mac: string; internal: boolean; + cidr: string | null; } export interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { @@ -5772,17 +5774,17 @@ declare module "util" { export function promisify(fn: CustomPromisify): TCustom; export function promisify(fn: (callback: (err: Error | null, result: TResult) => void) => void): () => Promise; - export function promisify(fn: (callback: (err: Error | null) => void) => void): () => Promise; + export function promisify(fn: (callback: (err?: Error | null) => void) => void): () => Promise; export function promisify(fn: (arg1: T1, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1) => Promise; - export function promisify(fn: (arg1: T1, callback: (err: Error | null) => void) => void): (arg1: T1) => Promise; + export function promisify(fn: (arg1: T1, callback: (err?: Error | null) => void) => void): (arg1: T1) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; export function promisify(fn: Function): Function; export namespace promisify { const custom: symbol; diff --git a/types/node/v9/inspector.d.ts b/types/node/v9/inspector.d.ts index 955239b486..7088455c8c 100644 --- a/types/node/v9/inspector.d.ts +++ b/types/node/v9/inspector.d.ts @@ -244,7 +244,7 @@ declare module "inspector" { */ export interface CallArgument { /** - * Primitive value. + * Primitive value or serializable javascript object. */ value?: any; /** @@ -416,7 +416,7 @@ declare module "inspector" { */ userGesture?: boolean; /** - * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + * Whether execution should await for resulting value and return once awaited promise is resolved. */ awaitPromise?: boolean; } @@ -468,7 +468,7 @@ declare module "inspector" { */ userGesture?: boolean; /** - * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + * Whether execution should await for resulting value and return once awaited promise is resolved. */ awaitPromise?: boolean; } @@ -561,11 +561,25 @@ declare module "inspector" { */ generatePreview?: boolean; /** - * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + * Whether execution should await for resulting value and return once awaited promise is resolved. */ awaitPromise?: boolean; } + export interface QueryObjectsParameterType { + /** + * Identifier of the prototype to return objects for. + */ + prototypeObjectId: Runtime.RemoteObjectId; + } + + export interface GlobalLexicalScopeNamesParameterType { + /** + * Specifies in which execution context to lookup global scope variables. + */ + executionContextId?: Runtime.ExecutionContextId; + } + export interface EvaluateReturnType { /** * Evaluation result. @@ -636,6 +650,17 @@ declare module "inspector" { exceptionDetails?: Runtime.ExceptionDetails; } + export interface QueryObjectsReturnType { + /** + * Array with objects. + */ + objects: Runtime.RemoteObject; + } + + export interface GlobalLexicalScopeNamesReturnType { + names: string[]; + } + export interface ExecutionContextCreatedEventDataType { /** * A newly created execution context. @@ -1476,6 +1501,10 @@ declare module "inspector" { * Collect accurate call counts beyond simple 'covered' or 'not covered'. */ callCount?: boolean; + /** + * Collect block-based coverage. + */ + detailed?: boolean; } export interface StopReturnType { @@ -1749,6 +1778,19 @@ declare module "inspector" { */ post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + + /** + * @experimental + */ + post(method: "Runtime.queryObjects", params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + post(method: "Runtime.queryObjects", callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + + /** + * Returns all let, const and class variables from global scope. + * @experimental + */ + post(method: "Runtime.globalLexicalScopeNames", params?: Runtime.GlobalLexicalScopeNamesParameterType, callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; + post(method: "Runtime.globalLexicalScopeNames", callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; /** * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. */ diff --git a/types/node/v9/node-tests.ts b/types/node/v9/node-tests.ts index ace737fa3b..03f641e216 100644 --- a/types/node/v9/node-tests.ts +++ b/types/node/v9/node-tests.ts @@ -845,6 +845,7 @@ namespace util_tests { var arg0NoResult: () => Promise = util.promisify((cb: (err: Error) => void): void => { }); var arg1: (arg: string) => Promise = util.promisify((arg: string, cb: (err: Error, result: number) => void): void => { }); var arg1NoResult: (arg: string) => Promise = util.promisify((arg: string, cb: (err: Error) => void): void => { }); + var cbOptionalError: () => Promise = util.promisify((cb: (err?: Error | null) => void): void => { cb(); }); assert(typeof util.promisify.custom === 'symbol'); // util.deprecate const foo = () => {}; diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index f2047ce098..99d7ddac1b 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -522,7 +522,7 @@ declare namespace Office { * When the function you pass to the `callback` parameter of an "Async" method executes, it receives an AsyncResult object that you can access * from the `callback` function's only parameter. */ - interface AsyncResult { + interface AsyncResult { /** * Gets the user-defined item passed to the optional `asyncContext` parameter of the invoked method in the same state as it was passed in. * This returns the user-defined item (which can be of any JavaScript type: String, Number, Boolean, Object, Array, Null, or Undefined) passed @@ -629,7 +629,7 @@ declare namespace Office { * Word Y Y Y * */ - value: any; + value: T; } /** * Represents the runtime environment of the add-in and provides access to key objects of the API. @@ -1071,7 +1071,7 @@ declare namespace Office { * @param options - Optional. Accepts an {@link Office.DialogOptions} object to define dialog display. * @param callback - Optional. Accepts a callback method to handle the dialog creation attempt. If successful, the AsyncResult.value is a Dialog object. */ - displayDialogAsync(startAddress: string, options?: DialogOptions, callback?: (result: AsyncResult) => void): void; + displayDialogAsync(startAddress: string, options?: DialogOptions, callback?: (result: AsyncResult) => void): void; /** * Delivers a message from the dialog box to its parent/opener page. The page calling this API must be on the same domain as the parent. * @param messageObject Accepts a message from the dialog to deliver to the add-in. @@ -1127,17 +1127,19 @@ declare namespace Office { */ displayInIframe?: boolean /** - * A user-defined item of any type that is returned, unchanged, in the value property of the AsyncResult object that is passed to a callback. + * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } /** - * The Office Auth namespace, Office.context.auth, provides a method that allows the Office host to obtain and access the add-in token. - * Indirectly, enable the add-in to access the signed-in user's Microsoft Graph data without requiring the user to sign in a second time. + * The Office Auth namespace, Office.context.auth, provides a method that allows the Office host to obtain an access token to the add-in's web application. + * Indirectly, this also enables the add-in to access the signed-in user's Microsoft Graph data without requiring the user to sign in a second time. + * + * @beta */ interface Auth { /** - * Calls the Azure Active Directory V 2.0 endpoint to get an access token to your add-in's web application. Allows add-ins to identify users. + * Calls the Azure Active Directory V 2.0 endpoint to get an access token to your add-in's web application. Enables add-ins to identify users. * Server side code can use this token to access Microsoft Graph for the add-in's web application by using the * {@link https://docs.microsoft.com/azure/active-directory/develop/active-directory-v2-protocols-oauth-on-behalf-of | "on behalf of" OAuth flow}. * @@ -1146,18 +1148,15 @@ declare namespace Office { * @remarks * * - *
            HostsExcel, OneNote, Outlook, PowerPoint, Word
            Requirement sets{@link https://docs.microsoft.com/office/dev/add-ins/develop/specify-office-hosts-and-api-requirements -| IdentityAPI}
            - * - * This API requires a single sign-on configuration that bridges the add-in to an Azure application. Office users sign-in with Organizational - * Accounts and Microsoft Accounts. Microsoft Azure returns tokens intended for both user account types to access resources in the Microsoft Graph. + * Requirement sets{@link https://docs.microsoft.com/office/dev/add-ins/develop/specify-office-hosts-and-api-requirements | IdentityAPI} * * @param options - Optional. Accepts an AuthOptions object to define sign-on behaviors. - * @param callback - Optional. Accepts a callback method to handle the token acquisition attempt. If AsyncResult.status is "succeeded", then AsyncResult.value is the raw AAD v. 2.0-formatted access token. + * @param callback - Optional. Accepts a callback method that can parse the token for the user's ID or use the token in the "on behalf of" flow to get access to Microsoft Graph. + * If AsyncResult.status is "succeeded", then AsyncResult.value is the raw AAD v. 2.0-formatted access token. * * @beta */ - getAccessTokenAsync(options?: AuthOptions, callback?: (result: AsyncResult) => void): void; + getAccessTokenAsync(options?: AuthOptions, callback?: (result: AsyncResult) => void): void; } /** @@ -1170,7 +1169,7 @@ declare namespace Office { */ forceConsent?: boolean, /** - * Prompts the user to add (or to switch if already added) his or her Office account. + * Prompts the user to add their Office account (or to switch to it, if it is already added). */ forceAddAccount?: boolean, /** @@ -1182,7 +1181,7 @@ declare namespace Office { */ authChallenge?: string /** - * A user-defined item of any type that is returned, unchanged, in the value property of the AsyncResult object that is passed to a callback. + * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } @@ -1191,7 +1190,7 @@ declare namespace Office { */ interface AsyncContextOptions { /** - * A user-defined item of any type that is returned, unchanged, in the value property of the AsyncResult object that is passed to a callback. + * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } @@ -1254,7 +1253,7 @@ declare namespace Office { */ rows?: string /** - * A user-defined item of any type that is returned, unchanged, in the value property of the AsyncResult object that is passed to a callback. + * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } @@ -1300,7 +1299,7 @@ declare namespace Office { */ tableOptions?: object /** - * A user-defined item of any type that is returned, unchanged, in the value property of the AsyncResult object that is passed to a callback. + * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } @@ -1341,7 +1340,7 @@ declare namespace Office { */ handler?: string /** - * A user-defined item of any type that is returned, unchanged, in the value property of the AsyncResult object that is passed to a callback. + * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } @@ -1354,7 +1353,7 @@ declare namespace Office { */ id?: string /** - * A user-defined item of any type that is returned, unchanged, in the value property of the AsyncResult object that is passed to a callback. + * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } @@ -1378,7 +1377,7 @@ declare namespace Office { */ sampleData?: Office.TableData /** - * A user-defined item of any type that is returned, unchanged, in the value property of the AsyncResult object that is passed to a callback. + * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } @@ -1395,7 +1394,7 @@ declare namespace Office { */ columns?: Array /** - * A user-defined item of any type that is returned, unchanged, in the value property of the AsyncResult object that is passed to a callback. + * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } @@ -1408,7 +1407,7 @@ declare namespace Office { */ sliceSize?: number /** - * A user-defined item of any type that is returned, unchanged, in the value property of the AsyncResult object that is passed to a callback. + * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } @@ -1426,7 +1425,7 @@ declare namespace Office { */ filterType?: Office.FilterType | string /** - * A user-defined item of any type that is returned, unchanged, in the value property of the AsyncResult object that is passed to a callback. + * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } @@ -1452,7 +1451,7 @@ declare namespace Office { */ selectionMode?: Office.SelectionMode | string /** - * A user-defined item of any type that is returned, unchanged, in the value property of the AsyncResult object that is passed to a callback. + * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } @@ -1499,7 +1498,7 @@ declare namespace Office { */ imageHeight?: number /** - * A user-defined item of any type that is returned, unchanged, in the value property of the AsyncResult object that is passed to a callback. + * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } @@ -1512,7 +1511,7 @@ declare namespace Office { */ overwriteIfStale?: boolean /** - * A user-defined item of any type that is returned, unchanged, in the value property of the AsyncResult object that is passed to a callback. + * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } @@ -1586,6 +1585,7 @@ declare namespace Office { declare namespace Office { /** * Returns a promise of an object described in the expression. Callback is invoked only if method fails. + * * @param expression The object to be retrieved. Example "bindings#BindingName", retrieves a binding promise for a binding named 'BindingName' * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * @@ -1607,7 +1607,7 @@ declare namespace Office { * Word Y Y * */ - function select(expression: string, callback?: (result: AsyncResult) => void): Binding; + function select(expression: string, callback?: (result: AsyncResult) => void): Binding; // Enumerations /** * Specifies the state of the active view of the document, for example, whether the user can edit the document. @@ -2300,7 +2300,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - addHandlerAsync(eventType: Office.EventType, handler: any, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; /** * Returns the data contained within the binding. * @@ -2312,8 +2312,10 @@ declare namespace Office { * * @param options Provides options for how to get the data in a binding. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the values in the specified binding. + * If the `coercionType` parameter is specified (and the call is successful), the data is returned in the format described in the CoercionType enumeration topic. */ - getDataAsync(options?: GetBindingDataOptions, callback?: (result: AsyncResult) => void): void; + getDataAsync(options?: GetBindingDataOptions, callback?: (result: AsyncResult) => void): void; /** * Removes the specified handler from the binding for the specified event type. * @@ -2324,7 +2326,7 @@ declare namespace Office { * @param options Provides options to determine which event handler or handlers are removed. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - removeHandlerAsync(eventType: Office.EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; /** * Writes data to the bound section of the document represented by the specified binding object. * @@ -2455,7 +2457,7 @@ declare namespace Office { * * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - setDataAsync(data: TableData | any, options?: SetBindingDataOptions, callback?: (result: AsyncResult) => void): void; + setDataAsync(data: TableData | any, options?: SetBindingDataOptions, callback?: (result: AsyncResult) => void): void; } /** @@ -2602,8 +2604,9 @@ declare namespace Office { * @param bindingType The {@link Office.BindingType} for the data. The method returns null if the selected object cannot be coerced into the specified type. * @param options Provides options for configuring the binding that is created. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the Binding object that represents the specified named item. */ - addFromNamedItemAsync(itemName: string, bindingType: BindingType, options?: AddBindingFromNamedItemOptions, callback?: (result: AsyncResult) => void): void; + addFromNamedItemAsync(itemName: string, bindingType: BindingType, options?: AddBindingFromNamedItemOptions, callback?: (result: AsyncResult) => void): void; /** * Create a binding by prompting the user to make a selection on the document. * @@ -2632,8 +2635,9 @@ declare namespace Office { * Returns null if the selected object cannot be coerced into the specified type. * @param options Provides options for configuring the prompt and identifying the binding that is created. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the Binding object that represents the selection specified by the user. */ - addFromPromptAsync(bindingType: BindingType, options?: AddBindingFromPromptOptions, callback?: (result: AsyncResult) => void): void; + addFromPromptAsync(bindingType: BindingType, options?: AddBindingFromPromptOptions, callback?: (result: AsyncResult) => void): void; /** * Create a binding based on the user's current selection. * @@ -2667,8 +2671,9 @@ declare namespace Office { * Returns null if the selected object cannot be coerced into the specified type. * @param options Provides options for configuring the prompt and identifying the binding that is created. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the Binding object that represents the selection specified by the user. */ - addFromSelectionAsync(bindingType: BindingType, options?: AddBindingFromSelectionOptions, callback?: (result: AsyncResult) => void): void; + addFromSelectionAsync(bindingType: BindingType, options?: AddBindingFromSelectionOptions, callback?: (result: AsyncResult) => void): void; /** * Gets all bindings that were previously created. * @@ -2693,8 +2698,9 @@ declare namespace Office { * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is an array that contains each binding created for the referenced Bindings object. */ - getAllAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAllAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Retrieves a binding based on its Name * @@ -2722,8 +2728,9 @@ declare namespace Office { * @param id Specifies the unique name of the binding object. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the Binding object specified by the id in the call. */ - getByIdAsync(id: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getByIdAsync(id: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes the binding from the document * @@ -2752,7 +2759,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - releaseByIdAsync(id: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + releaseByIdAsync(id: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } /** * Represents an XML node in a tree in a document. @@ -2805,8 +2812,9 @@ declare namespace Office { * @param xPath The XPath expression that specifies the nodes to get. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is an array of CustomXmlNode objects that represent the nodes specified by the XPath expression passed to the `xPath` parameter. */ - getNodesAsync(xPath: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getNodesAsync(xPath: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets the node value. * @@ -2815,8 +2823,9 @@ declare namespace Office { * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a string that contains the value of the referenced node. */ - getNodeValueAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getNodeValueAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets the text of an XML node in a custom XML part. * @@ -2825,8 +2834,9 @@ declare namespace Office { * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a string that contains the inner text of the referenced nodes. */ - getTextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getTextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets the node's XML. * @@ -2835,8 +2845,9 @@ declare namespace Office { * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a string that contains the XML of the referenced node. */ - getXmlAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getXmlAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets the node value. * @@ -2847,7 +2858,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - setNodeValueAsync(value: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setNodeValueAsync(value: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously sets the text of an XML node in a custom XML part. * @@ -2860,7 +2871,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - setTextAsync(text: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setTextAsync(text: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets the node XML. * @@ -2871,7 +2882,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - setXmlAsync(xml: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setXmlAsync(xml: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } /** * Represents a single CustomXMLPart in an {@link Office.CustomXmlParts} collection. @@ -2903,7 +2914,7 @@ declare namespace Office { */ id: string; /** - * Gets the set of namespace prefix mappings ({@link Office.CustomXmlPrefixMappings}) used against the current CustomXMLPart. + * Gets the set of namespace prefix mappings ({@link Office.CustomXmlPrefixMappings}) used against the current CustomXmlPart. */ namespaceManager: CustomXmlPrefixMappings; @@ -2921,7 +2932,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - addHandlerAsync(eventType: Office.EventType, handler: (result: any) => void, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: (result: any) => void, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Deletes the Custom XML Part. * @@ -2930,7 +2941,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - deleteAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + deleteAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets any CustomXmlNodes in this custom XML part which match the specified XPath. * @@ -2939,8 +2950,9 @@ declare namespace Office { * @param xPath An XPath expression that specifies the nodes you want returned. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is an array of CustomXmlNode objects that represent the nodes specified by the XPath expression passed to the xPath parameter. */ - getNodesAsync(xPath: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getNodesAsync(xPath: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the XML inside this custom XML part. * @@ -2948,8 +2960,9 @@ declare namespace Office { * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a string that contains the XML of the referenced CustomXmlPart object. */ - getXmlAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getXmlAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes an event handler for the specified event type. * @@ -2961,7 +2974,7 @@ declare namespace Office { * @param options Provides options to determine which event handler or handlers are removed. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - removeHandlerAsync(eventType: Office.EventType, handler?: (result: any) => void, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, handler?: (result: any) => void, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; } /** @@ -3098,24 +3111,28 @@ declare namespace Office { * @param xml The XML to add to the newly created custom XML part. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the newly created CustomXmlPart object. */ - addAsync(xml: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addAsync(xml: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the specified custom XML part by its id. * * @param id The GUID of the custom XML part, including opening and closing braces. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a CustomXmlPart object that represents the specified custom XML part. + * If there is no custom XML part with the specified id, the method returns null. */ - getByIdAsync(id: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getByIdAsync(id: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the specified custom XML part(s) by its namespace. * * @param ns The namespace URI. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is an array of CustomXmlPart objects that match the specified namespace. */ - getByNamespaceAsync(ns: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getByNamespaceAsync(ns: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } /** * Represents a collection of CustomXmlPart objects. @@ -3150,7 +3167,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - addNamespaceAsync(prefix: string, ns: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addNamespaceAsync(prefix: string, ns: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the namespace mapped to the specified prefix. * @@ -3162,8 +3179,9 @@ declare namespace Office { * @param prefix TSpecifies the prefix to get the namespace for. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a string that contains the namespace mapped to the specified prefix. */ - getNamespaceAsync(prefix: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getNamespaceAsync(prefix: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the prefix for the specified namespace. * @@ -3175,8 +3193,9 @@ declare namespace Office { * @param ns Specifies the namespace to get the prefix for. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a string that contains the prefix of the specified namespace. */ - getPrefixAsync(ns: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getPrefixAsync(ns: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } /** * An abstract class that represents the document the add-in is interacting with. @@ -3329,7 +3348,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - addHandlerAsync(eventType: Office.EventType, handler: any, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Returns the state of the current view of the presentation (edit or read). * @@ -3356,8 +3375,11 @@ declare namespace Office { * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the state of the presentation's current view. + * The value returned can be either "edit" or "read". "edit" corresponds to any of the views in which you can edit slides, + * such as Normal or Outline View. "read" corresponds to either Slide Show or Reading View. */ - getActiveViewAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getActiveViewAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult<"edit" | "read">) => void): void; /** * Returns the entire document file in slices of up to 4194304 bytes (4 MB). For add-ins for iOS, file slice is supported up to 65536 (64 KB). * Note that specifying file slice size of above permitted limit will result in an "Internal Error" failure. @@ -3399,8 +3421,9 @@ declare namespace Office { * @param fileType The format in which the file will be returned * @param options Provides options for setting the size of slices that the document will be divided into. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the File object. */ - getFileAsync(fileType: FileType, options?: GetFileOptions, callback?: (result: AsyncResult) => void): void; + getFileAsync(fileType: FileType, options?: GetFileOptions, callback?: (result: AsyncResult) => void): void; /** * Gets file properties of the current document. * @@ -3427,8 +3450,9 @@ declare namespace Office { * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the file's properties (with the URL found at `asyncResult.value.url`). */ - getFilePropertiesAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getFilePropertiesAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Reads the data contained in the current selection in the document. * @@ -3517,8 +3541,11 @@ declare namespace Office { * @param options Provides options for customizing what data is returned and how it is formatted. * * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the data in the current selection. + * This is returned in the data structure or format you specified with the coercionType parameter. + * (See Remarks for more information about data coercion.) */ - getSelectedDataAsync(coerciontype: Office.CoercionType, options?: GetSelectedDataOptions, callback?: (result: AsyncResult) => void): void; + getSelectedDataAsync(coerciontype: Office.CoercionType, options?: GetSelectedDataOptions, callback?: (result: AsyncResult) => void): void; /** * Goes to the specified object or location in the document. * @@ -3532,8 +3559,8 @@ declare namespace Office { * In Excel: `Office.SelectionMode.Selected` selects all content in the binding, or named item. Office.SelectionMode.None for text bindings, * selects the cell; for matrix bindings, table bindings, and named items, selects the first data cell (not first cell in header row for tables). * - * In PowerPoint: `Office.SelectionMode.Selected` selects the slide title or first textbox on the slide. `Office.SelectionMode.None` Doesn't - * select anything. + * In PowerPoint: `Office.SelectionMode.Selected` selects the slide title or first textbox on the slide. + * `Office.SelectionMode.None` doesn't select anything. * * In Word: `Office.SelectionMode.Selected` selects all content in the binding. Office.SelectionMode.None for text bindings, moves the cursor * to the beginning of the text; for matrix bindings and table bindings, selects the first data cell (not first cell in header row for tables). @@ -3558,8 +3585,9 @@ declare namespace Office { * @param goToType The type of the location to go to. * @param options Provides options for whether to select the location that is navigated to. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the current view. */ - goToByIdAsync(id: string | number, goToType: GoToType, options?: GoToByIdOptions, callback?: (result: AsyncResult) => void): void; + goToByIdAsync(id: string | number, goToType: GoToType, options?: GoToByIdOptions, callback?: (result: AsyncResult) => void): void; /** * Removes an event handler for the specified event type. * @@ -3586,7 +3614,7 @@ declare namespace Office { * @param options Provides options to determine which event handler or handlers are removed. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - removeHandlerAsync(eventType: Office.EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; /** * Writes the specified data into the current selection. * @@ -3696,15 +3724,16 @@ declare namespace Office { * specify the coercionType as Microsoft.Office.Matrix or "matrix". * * @param options Provides options for how to insert data to the selection. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. - * The AsyncResult.value property always returns undefined because there is no object or data to retrieve. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The AsyncResult.value property always returns undefined because there is no object or data to retrieve. */ - setSelectedDataAsync(data: string | TableData | any[][], options?: SetSelectedDataOptions, callback?: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string | TableData | any[][], options?: SetSelectedDataOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get Project field (Ex. ProjectWebAccessURL). * @param fieldId Project level fields. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result contains the `fieldValue` property, which represents the value of the specified field. * * @remarks * @@ -3722,13 +3751,14 @@ declare namespace Office { * Project Y * */ - getProjectFieldAsync(fieldId: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getProjectFieldAsync(fieldId: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get resource field for provided resource Id. (Ex.ResourceName) * @param resourceId Either a string or value of the Resource Id. * @param fieldId Resource Fields. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the GUID of the resource as a string. * * @remarks * @@ -3746,11 +3776,12 @@ declare namespace Office { * Project Y * */ - getResourceFieldAsync(resourceId: string, fieldId: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getResourceFieldAsync(resourceId: string, fieldId: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the current selected Resource's Id. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the GUID of the resource as a string. * * @remarks * @@ -3768,11 +3799,12 @@ declare namespace Office { * Project Y * */ - getSelectedResourceAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getSelectedResourceAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the current selected Task's Id. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the GUID of the resource as a string. * * @remarks * @@ -3790,11 +3822,14 @@ declare namespace Office { * Project Y * */ - getSelectedTaskAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getSelectedTaskAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the current selected View Type (Ex. Gantt) and View Name. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result contains the following properties: + * `viewName` - The name of the view, as a ProjectViewTypes constant. + * `viewType` - The type of view, as the integer value of a ProjectViewTypes constant. * * @remarks * @@ -3812,12 +3847,16 @@ declare namespace Office { * Project Y * */ - getSelectedViewAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getSelectedViewAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the Task Name, WSS Task Id, and ResourceNames for given taskId. * @param taskId Either a string or value of the Task Id. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result contains the following properties: + * `taskName` - The name of the task. + * `wssTaskId` - The ID of the task in the synchronized SharePoint task list. If the project is not synchronized with a SharePoint task list, the value is 0. + * `resourceNames` - The comma-separated list of the names of resources that are assigned to the task. * * @remarks * @@ -3835,13 +3874,14 @@ declare namespace Office { * Project Y * */ - getTaskAsync(taskId: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getTaskAsync(taskId: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get task field for provided task Id. (Ex. StartDate). * @param taskId Either a string or value of the Task Id. * @param fieldId Task Fields. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result contains the `fieldValue` property, which represents the value of the specified field. * * @remarks * @@ -3859,11 +3899,14 @@ declare namespace Office { * Project Y * */ - getTaskFieldAsync(taskId: string, fieldId: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getTaskFieldAsync(taskId: string, fieldId: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the WSS Url and list name for the Tasks List, the MPP is synced too. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result contains the following properties: + * `listName` - the name of the synchronized SharePoint task list. + * `serverUrl` - the URL of the synchronized SharePoint task list. * * @remarks * @@ -3881,7 +3924,7 @@ declare namespace Office { * Project Y * */ - getWSSUrlAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getWSSUrlAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the maximum index of the collection of resources in the current project. * @@ -3889,6 +3932,7 @@ declare namespace Office { * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the highest index number in the current project's resource collection. * * @remarks * @@ -3906,7 +3950,7 @@ declare namespace Office { * Project Y * */ - getMaxResourceIndexAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getMaxResourceIndexAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the maximum index of the collection of tasks in the current project. * @@ -3914,6 +3958,7 @@ declare namespace Office { * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the highest index number in the current project's task collection. * * @remarks * @@ -3931,7 +3976,7 @@ declare namespace Office { * Project Y * */ - getMaxTaskIndexAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getMaxTaskIndexAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the GUID of the resource that has the specified index in the resource collection. * @@ -3940,6 +3985,7 @@ declare namespace Office { * @param resourceIndex The index of the resource in the collection of resources for the project. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the GUID of the resource as a string. * * @remarks * @@ -3957,7 +4003,7 @@ declare namespace Office { * Project Y * */ - getResourceByIndexAsync(resourceIndex: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getResourceByIndexAsync(resourceIndex: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the GUID of the task that has the specified index in the task collection. * @@ -3966,6 +4012,7 @@ declare namespace Office { * @param taskIndex The index of the task in the collection of tasks for the project. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the GUID of the task as a string. * * @remarks * @@ -3983,7 +4030,7 @@ declare namespace Office { * Project Y * */ - getTaskByIndexAsync(taskIndex: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getTaskByIndexAsync(taskIndex: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Set resource field for specified resource Id. * @@ -4011,7 +4058,7 @@ declare namespace Office { * Project Y * */ - setResourceFieldAsync(resourceId: string, fieldId: number, fieldValue: string | number | boolean | object, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setResourceFieldAsync(resourceId: string, fieldId: number, fieldValue: string | number | boolean | object, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Set task field for specified task Id. * @@ -4039,7 +4086,7 @@ declare namespace Office { * Project Y * */ - setTaskFieldAsync(taskId: string, fieldId: number, fieldValue: string | number | boolean | object, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setTaskFieldAsync(taskId: string, fieldId: number, fieldValue: string | number | boolean | object, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } /** * Provides information about the document that raised the SelectionChanged event. @@ -4125,7 +4172,7 @@ declare namespace Office { * * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - closeAsync(callback?: (result: AsyncResult) => void): void; + closeAsync(callback?: (result: AsyncResult) => void): void; /** * Returns the specified slice. * @@ -4160,8 +4207,9 @@ declare namespace Office { * * @param sliceIndex Specifies the zero-based index of the slice to be retrieved. Required. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the {@link Office.Slice} object. */ - getSliceAsync(sliceIndex: number, callback?: (result: AsyncResult) => void): void; + getSliceAsync(sliceIndex: number, callback?: (result: AsyncResult) => void): void; } interface FileProperties { /** @@ -4227,6 +4275,7 @@ declare namespace Office { * * The Settings object is automatically loaded as part of the Document object, and is available by calling the settings property of that object * when the add-in is activated. + * * The developer is responsible for calling the saveAsync method after adding or deleting settings to save the settings in the document. */ interface Settings { @@ -4244,7 +4293,7 @@ declare namespace Office { * You can add multiple event handlers for the specified eventType as long as the name of each event handler function is unique. * * @param eventType Specifies the type of event to add. Required. - * @param handler The event handler function to add. Required. + * @param handler The event handler function to add, whose only parameter is of type {@link Office.SettingsChangedEventArgs}. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * @@ -4285,7 +4334,7 @@ declare namespace Office { * Excel Y * */ - addHandlerAsync(eventType: Office.EventType, handler: any, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Retrieves the specified setting. * @@ -4370,8 +4419,9 @@ declare namespace Office { * * * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is an {@link Office.Settings} object with the refreshed values. */ - refreshAsync(callback?: (result: AsyncResult) => void): void; + refreshAsync(callback?: (result: AsyncResult) => void): void; /** * Removes the specified setting. * @@ -4440,7 +4490,7 @@ declare namespace Office { * @param options Provides options to determine which event handler or handlers are removed. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - removeHandlerAsync(eventType: Office.EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; /** * Persists the in-memory copy of the settings property bag in the document. * @@ -4497,7 +4547,7 @@ declare namespace Office { * @param options Provides options for saving settings. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - saveAsync(options?: SaveSettingsOptions, callback?: (result: AsyncResult) => void): void; + saveAsync(options?: SaveSettingsOptions, callback?: (result: AsyncResult) => void): void; /** * Sets or creates the specified setting. * @@ -4535,6 +4585,52 @@ declare namespace Office { */ set(name: string, value: any): void; } + /** + * Provides information about the settings that raised the settingsChanged event. + * + * @remarks + *
            Requirement SetsSettings
            + * + * To add an event handler for the settingsChanged event, use the addHandlerAsync method of the + * {@link Office.Settings} object. + * + * The settingsChanged event fires only when your add-in's script calls the Settings.saveAsync method to persist + * the in-memory copy of the settings into the document file. The settingsChanged event is not triggered when the + * Settings.set or Settings.remove methods are called. + * + * The settingsChanged event was designed to let you to handle potential conflicts when two or more users are + * attempting to save settings at the same time when your add-in is used in a shared (co-authored) document. + * + * **Important:** Your add-in's code can register a handler for the settingsChanged event when the add-in + * is running with any Excel client, but the event will fire only when the add-in is loaded with a spreadsheet + * that is opened in Excel Online, and more than one user is editing the spreadsheet (co-authoring). + * Therefore, effectively the settingsChanged event is supported only in Excel Online in co-authoring scenarios. + * + * **Support details** + * + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. + * + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * + * *Supported hosts, by platform* + * + * + * + * + *
            Office for Windows desktop Office Online (in browser) Office for iPad
            Excel Y
            Word Y Y
            + */ + interface SettingsChangedEventArgs { + /** + * Gets an {@link Office.Settings} object that represents the settings that raised the settingsChanged event. + */ + settings: Settings; + /** + * Get an {@link Office.EventType} enumeration value that identifies the kind of event that was raised. + */ + type: EventType; + } /** * Represents a slice of a document file. * @@ -4710,7 +4806,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - addColumnsAsync(tableData: TableData | any[][], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addColumnsAsync(tableData: TableData | any[][], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds the specified data to the table as additional rows. * @@ -4750,7 +4846,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - addRowsAsync(rows: TableData | any[][], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addRowsAsync(rows: TableData | any[][], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Deletes all non-header rows and their values in the table, shifting appropriately for the host application. * @@ -4777,7 +4873,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - deleteAllDataValuesAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + deleteAllDataValuesAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Clears formatting on the bound table. * @@ -4801,15 +4897,60 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - clearFormatsAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + clearFormatsAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets the formatting on specified items in the table. + * + * @remarks + * + * **Returned format structure** + * + * Each JavaScript object in the return value array has this form: `{cells:{ cell_range }, format:{ format_definition }}` + * + * The `cells:` property specifies the range you want format using one of the following values: + * + * **Supported ranges in cells property** + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
            cells range settingsDescription
            {row: n}Specifies the range that is the zero-based nth row of data in the table.
            {column: n}Specifies the range that is the zero-based nth column of data in the table.
            {row: i, column: j}Specifies the single cell that is the ith row and jth column of the table.
            Office.Table.AllSpecifies the entire table, including column headers, data, and totals (if any).
            Office.Table.DataSpecifies only the data in the table (no headers and totals).
            Office.Table.HeadersSpecifies only the header row.
            + * + * The `format:` property specifies values that correspond to a subset of the settings available in the Format Cells dialog box in Excel (Right-click > Format Cells or Home > Format > Format Cells). + * * @param cellReference An object literal containing name-value pairs that specify the range of cells to get formatting from. * @param formats An array specifying the format properties to get. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is an array containing one or more JavaScript objects specifying the formatting of their corresponding cells. */ - getFormatsAsync(cellReference?: any, formats?: any[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getFormatsAsync(cellReference?: any, formats?: any[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult< ({ cells: any, format: any})[]>) => void): void; /** * Sets formatting on specified items and data in the table. * @@ -4904,32 +5045,6 @@ declare namespace Office { * For more details and examples, see * {@link https://docs.microsoft.com/office/dev/add-ins/excel/excel-add-ins-tables#format-a-table | How to format tables in add-ins for Excel}. * - * In the callback function passed to the goToByIdAsync method, you can use the properties of the AsyncResult object to return the following - * information. - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
            PropertyUse to...
            AsyncResult.valueAlways returns undefined because there is no data or object to retrieve when setting formats.
            AsyncResult.statusDetermine the success or failure of the operation.
            AsyncResult.errorAccess an Error object that provides error information if the operation failed.
            AsyncResult.asyncContextA user-defined item of any type that is returned in the AsyncResult object without being altered.
            - * * **Support details** * * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. @@ -4948,7 +5063,7 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - setFormatsAsync(cellFormat?: any[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setFormatsAsync(cellFormat: any[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Updates table formatting options on the bound table. * @@ -5000,9 +5115,8 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * - */ - setTableOptionsAsync(tableOptions: any, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setTableOptionsAsync(tableOptions: any, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } /** * Represents the data in a table or a {@link Office.TableBinding}. @@ -8477,14 +8591,15 @@ declare namespace Office { * * In addition to the main signature, this method also has this signature: * - * `getAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void;` + * `getAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void;` * * @param coercionType The format for the returned body. * @param options Optional. An object literal that contains one or more of the following properties: * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. The body is provided in the requested format in the asyncResult.value property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * The body is provided in the requested format in the asyncResult.value property. */ - getAsync(coerciontype: Office.CoercionType, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAsync(coerciontype: Office.CoercionType, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Returns the current body in a specified format. * @@ -8502,10 +8617,10 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param coercionType The format for the returned body. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. The body is provided in the requested format in the asyncResult.value property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * The body is provided in the requested format in the asyncResult.value property. */ - getAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; + getAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; /** * Gets a value that indicates whether the content is in HTML or text format. @@ -8519,10 +8634,10 @@ declare namespace Office { * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type - * {@link Office.AsyncResult}. The content type is returned as one of the CoercionType values in the asyncResult.value property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * The content type is returned as one of the CoercionType values in the asyncResult.value property. */ - getTypeAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getTypeAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds the specified content to the beginning of the item body. * @@ -8545,7 +8660,7 @@ declare namespace Office { * * `prependAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` * - * `prependAsync(data: string, callback: (result: AsyncResult) => void): void;` + * `prependAsync(data: string, callback: (result: AsyncResult) => void): void;` * * `prependAsync(data: string): void;` * @@ -8553,10 +8668,10 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * coercionType: The desired format for the body. The string in the data parameter will be converted to this format. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. Any errors encountered will be provided in the asyncResult.error property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * Any errors encountered will be provided in the asyncResult.error property. */ - prependAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; + prependAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Adds the specified content to the beginning of the item body. * @@ -8598,10 +8713,10 @@ declare namespace Office { * ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters. * * @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. Any errors encountered will be provided in the asyncResult.error property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * Any errors encountered will be provided in the asyncResult.error property. */ - prependAsync(data: string, callback: (result: AsyncResult) => void): void; + prependAsync(data: string, callback: (result: AsyncResult) => void): void; /** * Adds the specified content to the beginning of the item body. * @@ -8644,7 +8759,7 @@ declare namespace Office { * * `setAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` * - * `setAsync(data: string, callback: (result: AsyncResult) => void): void;` + * `setAsync(data: string, callback: (result: AsyncResult) => void): void;` * * `setAsync(data: string): void;` * @@ -8652,10 +8767,10 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * coercionType: The desired format for the body. The string in the data parameter will be converted to this format. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. Any errors encountered will be provided in the asyncResult.error property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * Any errors encountered will be provided in the asyncResult.error property. */ - setAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; + setAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Replaces the entire body with the specified text. * @@ -8701,10 +8816,10 @@ declare namespace Office { * ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.InvalidFormatError - The options.coercionType parameter is set to Office.CoercionType.Html and the message body is in plain text. * * @param data The string that will replace the existing body. The string is limited to 1,000,000 characters. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. Any errors encountered will be provided in the asyncResult.error property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * Any errors encountered will be provided in the asyncResult.error property. */ - setAsync(data: string, callback: (result: AsyncResult) => void): void; + setAsync(data: string, callback: (result: AsyncResult) => void): void; /** * Replaces the entire body with the specified text. * @@ -8751,7 +8866,7 @@ declare namespace Office { * * `setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` * - * `setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;` + * `setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;` * * `setSelectedDataAsync(data: string): void;` * @@ -8759,10 +8874,10 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * coercionType: The desired format for the body. The string in the data parameter will be converted to this format. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. Any errors encountered will be provided in the asyncResult.error property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * Any errors encountered will be provided in the asyncResult.error property. */ - setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Replaces the selection in the body with the specified text. * @@ -8808,10 +8923,10 @@ declare namespace Office { * ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.InvalidFormatError - The options.coercionType parameter is set to Office.CoercionType.Html and the message body is in plain text. * * @param data The string that will replace the existing body. The string is limited to 1,000,000 characters. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. Any errors encountered will be provided in the asyncResult.error property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * Any errors encountered will be provided in the asyncResult.error property. */ - setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; /** * Replaces the selection in the body with the specified text. * @@ -8950,7 +9065,7 @@ declare namespace Office { * Your callback method should handle this error accordingly. * * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * @param asyncContext Optional. Any state data that is passed to the callback method. * * [Api set: Mailbox 1.0] @@ -8960,7 +9075,7 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ - saveAsync(callback?: (result: AsyncResult) => void, asyncContext?: any): void; + saveAsync(callback?: (result: AsyncResult) => void, asyncContext?: any): void; } /** * Provides diagnostic information to an Outlook add-in. @@ -9166,20 +9281,20 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `getAsync(callback?: (result: AsyncResult) => void): void;` + * `getAsync(callback?: (result: AsyncResult) => void): void;` * * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, - * which is an {@link Office.AsyncResult} object. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an Office.AsyncResult object. + * The `value` property of the result is message's from value, as an EmailAddressDetails object. */ - getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** * Gets the from value of a message. * * The getAsync method starts an asynchronous call to the Exchange server to get the from value of a message. * - * The from value of the item is provided as an EmailAddressDetails in the asyncResult.value property. + * The from value of the item is provided as an {@link Office.EmailAddressDetails} in the asyncResult.value property. * * [Api set: Mailbox Preview] * @@ -9189,10 +9304,10 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, - * which is an {@link Office.AsyncResult} object. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an Office.AsyncResult object. + * The `value` property of the result is message's from value, as an EmailAddressDetails object. */ - getAsync(callback?: (result: AsyncResult) => void): void; + getAsync(callback?: (result: AsyncResult) => void): void; } /** @@ -9222,8 +9337,9 @@ declare namespace Office { * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * The `value` property of the result is message's organizer value, as an EmailAddressDetails object. */ - getAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } /** @@ -9483,7 +9599,7 @@ declare namespace Office { * * `addFileAttachmentAsync(uri: string, attachmentName: string, options: Office.AsyncContextOptions): void;` * - * `addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void;` + * `addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void;` * * @param uri The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. @@ -9494,7 +9610,7 @@ declare namespace Office { * On success, the attachment identifier will be provided in the asyncResult.value property. * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. * @@ -9560,7 +9676,7 @@ declare namespace Office { * On success, the attachment identifier will be provided in the asyncResult.value property. * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. * @@ -9582,9 +9698,11 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. + * On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ - addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an event handler for a supported event. * @@ -9600,7 +9718,7 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -9608,11 +9726,11 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ - addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; /** * Adds an event handler for a supported event. * @@ -9631,11 +9749,11 @@ declare namespace Office { * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ - addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -9664,17 +9782,17 @@ declare namespace Office { * * `addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void;` * - * `addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void;` + * `addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void;` * * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * On success, the attachment identifier will be provided in the asyncResult.value property. * If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -9753,11 +9871,11 @@ declare namespace Office { * * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * On success, the attachment identifier will be provided in the asyncResult.value property. * If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ - addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void; /** * Closes the current item that is being composed * @@ -9795,15 +9913,13 @@ declare namespace Office { * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult.} + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property - * set to 9020 and its name property set to GenericResponseError. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * @@ -9830,7 +9946,7 @@ declare namespace Office { * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. */ - getSelectedDataAsync(coerciontype: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; + getSelectedDataAsync(coerciontype: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * @@ -9854,9 +9970,9 @@ declare namespace Office { * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. * If HTML, the method returns the selected text, whether it is plaintext or HTML. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ - getSelectedDataAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; + getSelectedDataAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; /** * Asynchronously loads custom properties for this add-in on the selected item. * @@ -9877,11 +9993,11 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * @param userContext Optional. Developers can provide any object they wish to access in the callback function. * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ - loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; + loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; /** * Removes an attachment from a message or appointment. * @@ -9907,16 +10023,15 @@ declare namespace Office { * * `removeAttachmentAsync(attachmentIndex: string, options: Office.AsyncContextOptions): void;` * - * `removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void;` + * `removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void;` * * @param attachmentIndex The identifier of the attachment to remove. The maximum length of the string is 100 characters. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentIndex: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + removeAttachmentAsync(attachmentIndex: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * @@ -9985,10 +10100,10 @@ declare namespace Office { * * @param attachmentIndex The identifier of the attachment to remove. The maximum length of the string is 100 characters. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void; + removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void; /** * Removes an event handler for a supported event. * @@ -10005,7 +10120,7 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -10013,11 +10128,11 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ - removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; /** * Removes an event handler for a supported event. * @@ -10035,11 +10150,11 @@ declare namespace Office { * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ - removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * @@ -10077,15 +10192,13 @@ declare namespace Office { * * `saveAsync(options: Office.AsyncContextOptions): void;` * - * `saveAsync(callback: (result: AsyncResult) => void): void;` + * `saveAsync(callback: (result: AsyncResult) => void): void;` * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. */ - saveAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + saveAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * @@ -10184,11 +10297,9 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. */ - saveAsync(callback: (result: AsyncResult) => void): void; + saveAsync(callback: (result: AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -10212,7 +10323,7 @@ declare namespace Office { * * `setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` * - * `setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;` + * `setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;` * * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. @@ -10226,10 +10337,9 @@ declare namespace Office { * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; * if the field is text, then plain text is used. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * type Office.AsyncResult. */ - setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -10300,10 +10410,9 @@ declare namespace Office { * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * type Office.AsyncResult. */ - setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; } /** @@ -10634,7 +10743,7 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * `addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -10642,11 +10751,11 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ - addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; /** * Adds an event handler for a supported event. @@ -10666,11 +10775,11 @@ declare namespace Office { * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ - addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Displays a reply form that includes the sender and all recipients of the selected message or the organizer and all attendees of the * selected appointment. @@ -10739,19 +10848,19 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `getInitializationContextAsync(callback?: (result: AsyncResult) => void): void;` + * `getInitializationContextAsync(callback?: (result: AsyncResult) => void): void;` * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * On success, the initialization data is provided in the asyncResult.value property as a string. * If there is no initialization context, the asyncResult object will contain an Error object with its code property * set to 9020 and its name property set to GenericResponseError. * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. * @@ -10766,14 +10875,14 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * On success, the initialization data is provided in the asyncResult.value property as a string. * If there is no initialization context, the asyncResult object will contain an Error object with its code property * set to 9020 and its name property set to GenericResponseError. * * @beta */ - getInitializationContextAsync(callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(callback?: (result: AsyncResult) => void): void; /** * Gets the entities found in the selected item's body. * @@ -10997,11 +11106,11 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * @param userContext Optional. Developers can provide any object they wish to access in the callback function. * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ - loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; + loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; /** * Removes an event handler for a supported event. @@ -11019,7 +11128,7 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -11027,11 +11136,11 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ - removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; /** * Removes an event handler for a supported event. * @@ -11050,11 +11159,11 @@ declare namespace Office { * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ - removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; } /** @@ -11201,7 +11310,7 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * `addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -11209,11 +11318,11 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ - addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; /** * Adds an event handler for a supported event. @@ -11232,11 +11341,11 @@ declare namespace Office { * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ - addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Asynchronously loads custom properties for this add-in on the selected item. @@ -11258,11 +11367,11 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * @param userContext Optional. Developers can provide any object they wish to access in the callback function. * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ - loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; + loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; /** * Removes an event handler for a supported event. @@ -11280,7 +11389,7 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `removeHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * `removeHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -11288,11 +11397,11 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ - removeHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; /** * Removes an event handler for a supported event. @@ -11312,11 +11421,11 @@ declare namespace Office { * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ - removeHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void; } /** * The compose mode of {@link Office.Item | Office.context.mailbox.item}. @@ -11363,7 +11472,7 @@ declare namespace Office { * * `addFileAttachmentAsync(uri: string, attachmentName: string, options: Office.AsyncContextOptions): void;` * - * `addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void;` + * `addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void;` * * @param uri The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. @@ -11376,7 +11485,7 @@ declare namespace Office { * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of * the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. * @@ -11440,11 +11549,11 @@ declare namespace Office { * @param uri The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * type Office.AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of * the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. @@ -11467,9 +11576,11 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. + * On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ - addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. @@ -11499,18 +11610,18 @@ declare namespace Office { * * `addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void;` * - * `addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void;` + * `addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void;` * * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * type Office.AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. * If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of * the error. */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -11590,11 +11701,11 @@ declare namespace Office { * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * type Office.AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. * If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of * the error. */ - addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void; /** * Closes the current item that is being composed @@ -11634,14 +11745,14 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * On success, the initialization data is provided in the asyncResult.value property as a string. * If there is no initialization context, the asyncResult object will contain an Error object with its code property * set to 9020 and its name property set to GenericResponseError. * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * @@ -11665,9 +11776,9 @@ declare namespace Office { * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. * If HTML, the method returns the selected text, whether it is plaintext or HTML. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ - getSelectedDataAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; + getSelectedDataAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * @@ -11693,9 +11804,9 @@ declare namespace Office { * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ - getSelectedDataAsync(coerciontype: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; + getSelectedDataAsync(coerciontype: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * @@ -11721,16 +11832,16 @@ declare namespace Office { * * `removeAttachmentAsync(attachmentIndex: string, options: Office.AsyncContextOptions): void;` * - * `removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void;` + * `removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void;` * * @param attachmentIndex The identifier of the attachment to remove. The maximum length of the string is 100 characters. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentIndex: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + removeAttachmentAsync(attachmentIndex: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * @@ -11801,7 +11912,7 @@ declare namespace Office { * type {@link Offfice.AsyncResult}. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void; + removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. @@ -11840,15 +11951,15 @@ declare namespace Office { * * `saveAsync(options: Office.AsyncContextOptions): void;` * - * `saveAsync(callback: (result: AsyncResult) => void): void;` + * `saveAsync(callback: (result: AsyncResult) => void): void;` * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - saveAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + saveAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * @@ -11949,10 +12060,10 @@ declare namespace Office { * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - saveAsync(callback: (result: AsyncResult) => void): void; + saveAsync(callback: (result: AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -11976,7 +12087,7 @@ declare namespace Office { * * `setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` * - * `setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;` + * `setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;` * * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. @@ -11990,10 +12101,9 @@ declare namespace Office { * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; * if the field is text, then plain text is used. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * type Office.AsyncResult. */ - setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -12065,10 +12175,9 @@ declare namespace Office { * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * type Office.AsyncResult. */ - setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; } /** * The read mode of {@link Office.Item | Office.context.mailbox.item}. @@ -12250,19 +12359,19 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `getInitializationContextAsync(callback?: (result: AsyncResult) => void): void;` + * `getInitializationContextAsync(callback?: (result: AsyncResult) => void): void;` * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * On success, the initialization data is provided in the asyncResult.value property as a string. * If there is no initialization context, the asyncResult object will contain an Error object with its code property * set to 9020 and its name property set to GenericResponseError. * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. * @@ -12278,14 +12387,14 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read * * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * On success, the initialization data is provided in the asyncResult.value property as a string. * If there is no initialization context, the asyncResult object will contain an Error object with its code property * set to 9020 and its name property set to GenericResponseError. * * @beta */ - getInitializationContextAsync(callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(callback?: (result: AsyncResult) => void): void; /** * Gets the entities found in the selected item's body. * @@ -12758,7 +12867,7 @@ declare namespace Office { * * `addFileAttachmentAsync(uri: string, attachmentName: string, options: AsyncContextOptions): void;` * - * `addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void;` + * `addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void;` * * @param uri The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. @@ -12767,11 +12876,11 @@ declare namespace Office { * isInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the * attachment list. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.asyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * type Office.AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of * the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. * @@ -12834,11 +12943,11 @@ declare namespace Office { * @param uri The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * type Office.AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of * the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. * @@ -12860,9 +12969,11 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. + * On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ - addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an event handler for a supported event. * @@ -12878,7 +12989,7 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -12886,11 +12997,11 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ - addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; /** * Adds an event handler for a supported event. * @@ -12909,11 +13020,11 @@ declare namespace Office { * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ - addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -12942,7 +13053,7 @@ declare namespace Office { * * `addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void;` * - * `addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void;` + * `addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void;` * * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. @@ -12953,7 +13064,7 @@ declare namespace Office { * If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of * the error. */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -13033,11 +13144,11 @@ declare namespace Office { * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * type Office.AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. * If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of * the error. */ - addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void; /** * Closes the current item that is being composed * @@ -13077,14 +13188,14 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * On success, the initialization data is provided in the asyncResult.value property as a string. * If there is no initialization context, the asyncResult object will contain an Error object with its code property * set to 9020 and its name property set to GenericResponseError. * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * @@ -13108,9 +13219,9 @@ declare namespace Office { * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string, removing any HTML tags present. * If HTML, the method returns the selected text, whether it is plaintext or HTML. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ - getSelectedDataAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; + getSelectedDataAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * @@ -13136,9 +13247,9 @@ declare namespace Office { * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ - getSelectedDataAsync(coerciontype: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; + getSelectedDataAsync(coerciontype: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** * Asynchronously loads custom properties for this add-in on the selected item. * @@ -13159,11 +13270,11 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * @param userContext Optional. Developers can provide any object they wish to access in the callback function. * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ - loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; + loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; /** * Removes an attachment from a message or appointment. * @@ -13189,16 +13300,16 @@ declare namespace Office { * * `removeAttachmentAsync(attachmentIndex: string, options: Office.AsyncContextOptions): void;` * - * `removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void;` + * `removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void;` * * @param attachmentIndex The identifier of the attachment to remove. The maximum length of the string is 100 characters. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentIndex: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + removeAttachmentAsync(attachmentIndex: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * @@ -13266,10 +13377,10 @@ declare namespace Office { * * @param attachmentIndex The identifier of the attachment to remove. The maximum length of the string is 100 characters. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void; + removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void; /** * Removes an event handler for a supported event. * @@ -13286,7 +13397,7 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -13294,11 +13405,11 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ - removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; /** * Removes an event handler for a supported event. * @@ -13317,11 +13428,11 @@ declare namespace Office { * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ - removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * @@ -13359,15 +13470,14 @@ declare namespace Office { * * `saveAsync(options: Office.AsyncContextOptions): void;` * - * `saveAsync(callback: (result: AsyncResult) => void): void;` + * `saveAsync(callback: (result: AsyncResult) => void): void;` * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * type Office.AsyncResult. */ - saveAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + saveAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * @@ -13467,10 +13577,9 @@ declare namespace Office { * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * type Office.AsyncResult. */ - saveAsync(callback: (result: AsyncResult) => void): void; + saveAsync(callback: (result: AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -13494,7 +13603,7 @@ declare namespace Office { * * `setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` * - * `setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;` + * `setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;` * * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. @@ -13507,10 +13616,9 @@ declare namespace Office { * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; * if the field is text, then plain text is used. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * type Office.AsyncResult. */ - setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -13581,10 +13689,9 @@ declare namespace Office { * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type{@link Office.AsyncResult}. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * typeOffice.AsyncResult. */ - setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; } /** * The message read mode of {@link Office.Item | Office.context.mailbox.item}. @@ -13930,7 +14037,7 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -13938,11 +14045,11 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ - addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; /** * Adds an event handler for a supported event. @@ -13962,11 +14069,11 @@ declare namespace Office { * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ - addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Displays a reply form that includes the sender and all recipients of the selected message or the organizer and all attendees of the * selected appointment. @@ -14036,19 +14143,19 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `getInitializationContextAsync(callback?: (result: AsyncResult) => void): void;` + * `getInitializationContextAsync(callback?: (result: AsyncResult) => void): void;` * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * On success, the initialization data is provided in the asyncResult.value property as a string. * If there is no initialization context, the asyncResult object will contain an Error object with its code property * set to 9020 and its name property set to GenericResponseError. * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets initialization data passed when the add-in is * {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. @@ -14065,14 +14172,14 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read * * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * On success, the initialization data is provided in the asyncResult.value property as a string. * If there is no initialization context, the asyncResult object will contain an Error object with its code property * set to 9020 and its name property set to GenericResponseError. * * @beta */ - getInitializationContextAsync(callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(callback?: (result: AsyncResult) => void): void; /** * Gets the entities found in the selected item's body. * @@ -14298,11 +14405,11 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * @param userContext Optional. Developers can provide any object they wish to access in the callback function. * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ - loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; + loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; /** * Removes an event handler for a supported event. * @@ -14319,7 +14426,7 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -14327,11 +14434,11 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ - removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; /** * Removes an event handler for a supported event. * @@ -14350,11 +14457,11 @@ declare namespace Office { * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ - removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; } /** @@ -14422,7 +14529,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * * [Api set: Mailbox 1.1] * @@ -14433,10 +14540,10 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `getAsync(callback: (result: AsyncResult) => void): void;` + * `getAsync(callback: (result: AsyncResult) => void): void;` * */ - getAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets the location of an appointment. * @@ -14444,7 +14551,7 @@ declare namespace Office { * The location of the appointment is provided as a string in the asyncResult.value property. * * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * * [Api set: Mailbox 1.1] * @@ -14453,7 +14560,7 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose */ - getAsync(callback: (result: AsyncResult) => void): void; + getAsync(callback: (result: AsyncResult) => void): void; /** * Sets the location of an appointment. * @@ -14464,7 +14571,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. If setting the location fails, the asyncResult.error property will contain an error code. + * type Office.AsyncResult. If setting the location fails, the asyncResult.error property will contain an error code. * * [Api set: Mailbox 1.1] * @@ -14481,9 +14588,9 @@ declare namespace Office { * * `setAsync(location: string, options: Office.AsyncContextOptions): void;` * - * `setAsync(location: string, callback: (result: AsyncResult) => void): void;` + * `setAsync(location: string, callback: (result: AsyncResult) => void): void;` */ - setAsync(location: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setAsync(location: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets the location of an appointment. * @@ -14530,7 +14637,7 @@ declare namespace Office { * * @param location The location of the appointment. The string is limited to 255 characters. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. If setting the location fails, the asyncResult.error property will contain an error code. + * type Office.AsyncResult. If setting the location fails, the asyncResult.error property will contain an error code. * * [Api set: Mailbox 1.1] * @@ -14541,7 +14648,7 @@ declare namespace Office { * * ErrorsDataExceedsMaximumSize - The location parameter is longer than 255 characters. */ - setAsync(location: string, callback: (result: AsyncResult) => void): void; + setAsync(location: string, callback: (result: AsyncResult) => void): void; } /** * Provides access to the Outlook Add-in object model for Microsoft Outlook and Microsoft Outlook on the web. @@ -14662,9 +14769,9 @@ declare namespace Office { * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param options Optional. Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ - addHandlerAsync(eventType: Office.EventType, handler: (type: EventType) => void, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: (type: EventType) => void, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Converts an item ID formatted for REST into EWS format. * @@ -14912,17 +15019,17 @@ declare namespace Office { * * In addition to this signature, the method has the following signatures: * - * `getCallbackTokenAsync(callback: (result: AsyncResult) => void): void;` + * `getCallbackTokenAsync(callback: (result: AsyncResult) => void): void;` * - * `getCallbackTokenAsync(callback: (result: AsyncResult) => void, userContext?: any): void;` + * `getCallbackTokenAsync(callback: (result: AsyncResult) => void, userContext?: any): void;` * * @param options An object literal that contains one or more of the following properties. * isRest: Determines if the token provided will be used for the Outlook REST APIs or Exchange Web Services. Default value is false. * asyncContext: Any state data that is passed to the asynchronous method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. The token is provided as a string in the asyncResult.value property. + * type Office.AsyncResult. The token is provided as a string in the asyncResult.value property. */ - getCallbackTokenAsync(options: Office.AsyncContextOptions & { isRest?: boolean }, callback: (result: AsyncResult) => void): void; + getCallbackTokenAsync(options: Office.AsyncContextOptions & { isRest?: boolean }, callback: (result: AsyncResult) => void): void; /** * Gets a string that contains a token used to get an attachment or item from an Exchange Server. * @@ -14947,9 +15054,9 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * The token is provided as a string in the asyncResult.value property. + * The token is provided as a string in the asyncResult.value property. */ - getCallbackTokenAsync(callback: (result: AsyncResult) => void): void; + getCallbackTokenAsync(callback: (result: AsyncResult) => void): void; /** * Gets a string that contains a token used to get an attachment or item from an Exchange Server. * @@ -14974,10 +15081,10 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. The token is provided as a string in the asyncResult.value property. + * type Office.AsyncResult. The token is provided as a string in the asyncResult.value property. * @param userContext Optional. Any state data that is passed to the asynchronous method. */ - getCallbackTokenAsync(callback: (result: AsyncResult) => void, userContext?: any): void; + getCallbackTokenAsync(callback: (result: AsyncResult) => void, userContext?: any): void; /** * Gets a token identifying the user and the Office Add-in. * @@ -14995,10 +15102,11 @@ declare namespace Office { * {@link https://msdn.microsoft.com/library/office/fp179828.aspx | authenticate the add-in and user with a third-party system}. * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. + * The token is provided as a string in the asyncResult.value property. * @param userContext Optional. Any state data that is passed to the asynchronous method.| */ - getUserIdentityTokenAsync(callback: (result: AsyncResult) => void, userContext?: any): void; + getUserIdentityTokenAsync(callback: (result: AsyncResult) => void, userContext?: any): void; /** * Makes an asynchronous request to an Exchange Web Services (EWS) service on the Exchange server that hosts the user's mailbox. * @@ -15046,11 +15154,12 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read * * @param data The EWS request. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * The `value` property of the result is the XML of the EWS request provided as a string. + * If the result exceeds 1 MB in size, an error message is returned instead. * @param userContext Optional. Any state data that is passed to the asynchronous method. */ - makeEwsRequestAsync(data: any, callback: (result: AsyncResult) => void, userContext?: any): void; + makeEwsRequestAsync(data: any, callback: (result: AsyncResult) => void, userContext?: any): void; } /** @@ -15159,7 +15268,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * * [Api set: Mailbox 1.3] * @@ -15174,10 +15283,10 @@ declare namespace Office { * * `addAsync(key: string, JSONmessage: NotificationMessageDetails, options: Office.AsyncContextOptions): void;` * - * `addAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void;` + * `addAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void;` * */ - addAsync(key: string, JSONmessage: NotificationMessageDetails, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addAsync(key: string, JSONmessage: NotificationMessageDetails, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds a notification to an item. * @@ -15226,7 +15335,7 @@ declare namespace Office { * @param JSONmessage A JSON object that contains the notification message to be added to the item. * It contains a NotificationMessageDetails object. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * * [Api set: Mailbox 1.3] * @@ -15235,7 +15344,7 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ - addAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void; + addAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void; /** * Returns all keys and messages for an item. * @@ -15248,14 +15357,14 @@ declare namespace Office { * * In addition to the main signature, this method also has this signature: * - * `getAllAsync(callback: (result: AsyncResult) => void): void;` + * `getAllAsync(callback: (result: AsyncResult) => void): void;` * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * The `value` property of the result is an array of NotificationMessageDetails objects. */ - getAllAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAllAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Returns all keys and messages for an item. * @@ -15266,10 +15375,10 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * The `value` property of the result is an array of NotificationMessageDetails objects. */ - getAllAsync(callback: (result: AsyncResult) => void): void; + getAllAsync(callback: (result: AsyncResult) => void): void; /** * Removes a notification message for an item. * @@ -15286,15 +15395,15 @@ declare namespace Office { * * `removeAsync(key: string, options: Office.AsyncContextOptions): void;` * - * `removeAsync(key: string, callback: (result: AsyncResult) => void): void;` + * `removeAsync(key: string, callback: (result: AsyncResult) => void): void;` * * @param key The key for the notification message to remove. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ - removeAsync(key: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + removeAsync(key: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes a notification message for an item. * @@ -15335,9 +15444,9 @@ declare namespace Office { * * @param key The key for the notification message to remove. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ - removeAsync(key: string, callback: (result: AsyncResult) => void): void; + removeAsync(key: string, callback: (result: AsyncResult) => void): void; /** * Replaces a notification message that has a given key with another message. * @@ -15356,7 +15465,7 @@ declare namespace Office { * * `replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options: Office.AsyncContextOptions): void;` * - * `replaceAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void;` + * `replaceAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void;` * * @param key The key for the notification message to replace. It can't be longer than 32 characters. * @param JSONmessage A JSON object that contains the new notification message to replace the existing message. @@ -15364,9 +15473,9 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ - replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Replaces a notification message that has a given key with another message. * @@ -15419,9 +15528,9 @@ declare namespace Office { * @param JSONmessage A JSON object that contains the new notification message to replace the existing message. * It contains a NotificationMessageDetails object. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ - replaceAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void; + replaceAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void; } /** * Represents a phone number identified in an item. Read mode only. @@ -15485,15 +15594,15 @@ declare namespace Office { * * `addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: Office.AsyncContextOptions): void;` * - * `addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void;` + * `addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void;` * * @param recipients The recipients to add to the recipients list. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. If adding the recipients fails, the asyncResult.error property will contain an error code. + * type Office.AsyncResult. If adding the recipients fails, the asyncResult.error property will contain an error code. */ - addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds a recipient list to the existing recipients for an appointment or message. * @@ -15564,13 +15673,13 @@ declare namespace Office { * * @param recipients The recipients to add to the recipients list. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. If adding the recipients fails, the asyncResult.error property will contain an error code. + * type Office.AsyncResult. If adding the recipients fails, the asyncResult.error property will contain an error code. */ - addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void; + addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void; /** * Gets a recipient list for an appointment or message. * - * When the call completes, the asyncResult.value property will contain an array of{@link Office.EmailAddressDetails} objects. + * When the call completes, the asyncResult.value property will contain an array of {@link Office.EmailAddressDetails} objects. * * [Api set: Mailbox 1.1] * @@ -15581,14 +15690,15 @@ declare namespace Office { * * In addition to the main signature, this method also has this signature: * - * `getAsync(callback: (result: AsyncResult) => void): void;` + * `getAsync(callback: (result: AsyncResult) => void): void;` * * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. + * The `value` property of the result is an array of EmailAddressDetails objects. */ - getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** * Gets a recipient list for an appointment or message. * @@ -15602,9 +15712,10 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. + * The `value` property of the result is an array of EmailAddressDetails objects. */ - getAsync(callback: (result: AsyncResult) => void): void; + getAsync(callback: (result: AsyncResult) => void): void; /** * Sets a recipient list for an appointment or message. * @@ -15633,17 +15744,17 @@ declare namespace Office { * * `setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: Office.AsyncContextOptions): void;` * - * `setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void;` + * `setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void;` * * @param recipients The recipients to add to the recipients list. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * If setting the recipients fails the asyncResult.error property will contain a code that indicates any error that occurred * while adding the data. */ - setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets a recipient list for an appointment or message. * @@ -15720,11 +15831,11 @@ declare namespace Office { * * @param recipients The recipients to add to the recipients list. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * If setting the recipients fails the asyncResult.error property will contain a code that indicates any error that occurred * while adding the data. */ - setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void; + setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void; } @@ -15852,14 +15963,15 @@ declare namespace Office { * * In addition to the main signature, this method also has this signature: * - * `getAsync(callback?: (result: AsyncResult) => void): void;` + * `getAsync(callback?: (result: AsyncResult) => void): void;` * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. + * The `value` property of the result is a Recurrence object. */ - getAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Returns the current recurrence object of an appointment series. @@ -15875,9 +15987,10 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. + * The `value` property of the result is a Recurrence object. */ - getAsync(callback?: (result: AsyncResult) => void): void; + getAsync(callback?: (result: AsyncResult) => void): void; /** * Sets the recurrence pattern of an appointment series. @@ -15896,15 +16009,15 @@ declare namespace Office { * * In addition to the main signature, this method also has this signature: * - * `setAsync(recurrencePattern: Recurrence, callback?: (result: AsyncResult) => void): void;` + * `setAsync(recurrencePattern: Recurrence, callback?: (result: AsyncResult) => void): void;` * * @param recurrencePattern A recurrence object. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. */ - setAsync(recurrencePattern: Recurrence, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setAsync(recurrencePattern: Recurrence, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets the recurrence pattern of an appointment series. @@ -15923,9 +16036,9 @@ declare namespace Office { * * @param recurrencePattern A recurrence object. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. */ - setAsync(recurrencePattern: Recurrence, callback?: (result: AsyncResult) => void): void; + setAsync(recurrencePattern: Recurrence, callback?: (result: AsyncResult) => void): void; } /** @@ -16014,9 +16127,9 @@ declare namespace Office { attachments?: ReplyFormAttachment[]; /** * When the reply display call completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. */ - callback?: (result: AsyncResult) => void; + callback?: (result: AsyncResult) => void; } /** * The settings created by using the methods of the RoamingSettings object are saved per add-in and per user. @@ -16085,9 +16198,9 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ - saveAsync(callback?: (result: AsyncResult) => void): void; + saveAsync(callback?: (result: AsyncResult) => void): void; /** * Sets or creates the specified setting. * @@ -16342,16 +16455,18 @@ declare namespace Office { * * In addition to the main signature, this method also has this signature: * - * `getAsync(callback: (result: AsyncResult) => void): void;` + * `getAsync(callback: (result: AsyncResult) => void): void;` * * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. + * The `value` property of the result is the subject of the item. */ - getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** * Gets the subject of an appointment or message. + * * The getAsync method starts an asynchronous call to the Exchange server to get the subject of an appointment or message. * * [Api set: Mailbox 1.1] @@ -16362,8 +16477,9 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * The `value` property of the result is the subject of the item. */ - getAsync(callback: (result: AsyncResult) => void): void; + getAsync(callback: (result: AsyncResult) => void): void; /** * Sets the subject of an appointment or message. * @@ -16385,15 +16501,15 @@ declare namespace Office { * * `setAsync(subject: string, options: Office.AsyncContextOptions): void;` * - * `setAsync(subject: string, callback: (result: AsyncResult) => void): void;` + * `setAsync(subject: string, callback: (result: AsyncResult) => void): void;` * * @param subject The subject of the appointment or message. The string is limited to 255 characters. * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. If setting the subject fails, the asyncResult.error property will contain an error code. + * type Office.AsyncResult. If setting the subject fails, the asyncResult.error property will contain an error code. */ - setAsync(subject: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setAsync(subject: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets the subject of an appointment or message. * @@ -16449,9 +16565,9 @@ declare namespace Office { * * @param subject The subject of the appointment or message. The string is limited to 255 characters. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. If setting the subject fails, the asyncResult.error property will contain an error code. + * type Office.AsyncResult. If setting the subject fails, the asyncResult.error property will contain an error code. */ - setAsync(data: string, callback: (result: AsyncResult) => void): void; + setAsync(data: string, callback: (result: AsyncResult) => void): void; } /** @@ -16503,13 +16619,14 @@ declare namespace Office { * * In addition to the main signature, this method also has this signature: * - * `getAsync(callback: (result: AsyncResult) => void): void;` + * `getAsync(callback: (result: AsyncResult) => void): void;` * * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * The `value` property of the result is a Date object. */ - getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** * Gets the start or end time of an appointment. * @@ -16524,8 +16641,9 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * The `value` property of the result is a Date object. */ - getAsync(callback: (result: AsyncResult) => void): void; + getAsync(callback: (result: AsyncResult) => void): void; /** * Sets the start or end time of an appointment. * @@ -16549,16 +16667,16 @@ declare namespace Office { * * `setAsync(dateTime: Date, options: Office.AsyncContextOptions): void;` * - * `setAsync(dateTime: Date, callback: (result: AsyncResult) => void): void;` + * `setAsync(dateTime: Date, callback: (result: AsyncResult) => void): void;` * * @param dateTime A date-time object in Coordinated Universal Time (UTC). * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * If setting the date and time fails, the asyncResult.error property will contain an error code. */ - setAsync(dateTime: Date, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setAsync(dateTime: Date, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets the start or end time of an appointment. * @@ -16620,10 +16738,10 @@ declare namespace Office { * * @param dateTime A date-time object in Coordinated Universal Time (UTC). * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * If setting the date and time fails, the asyncResult.error property will contain an error code. */ - setAsync(dateTime: Date, callback: (result: AsyncResult) => void): void; + setAsync(dateTime: Date, callback: (result: AsyncResult) => void): void; } /** diff --git a/types/oja/index.d.ts b/types/oja/index.d.ts new file mode 100644 index 0000000000..f1d123d3f0 --- /dev/null +++ b/types/oja/index.d.ts @@ -0,0 +1,90 @@ +// Type definitions for oja 1.1 +// Project: https://github.com/dimichgh/oja#readme +// Definitions by: Laurens Stötzel +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +import { Readable } from "stream"; +import { EventEmitter } from "events"; +export type ConsumerCallback = (payload: any, runtime: Flow) => void; + +export type Primitive = + | boolean + | number + | string + | symbol + | null + | undefined; + +export interface State { + queue: string[]; + pending: string[]; +} + +export type DefinitionFunction = (publisher: StageContext, runtime: Flow) => any; + +export type AddableFunction = (runtime: Flow) => void; +export type AddableToAction = Action | AddableFunction; + +export class EventContext { + new(context: EventContext | object): this; + stageContext(topics: string | ReadonlyArray): StageContext; + state(): State; + repub(type: string, handler: (event: any) => void): void; + on(type: string, handler: (event: any) => void): this; + once(type: string, handler: (event: any) => void): this; + emit(name: string, value: any): this; + get(name: string): any; +} + +export class StageContext extends EventContext { + pub(data: any): void; +} + +export class ReadableStream extends Readable { + new(topic: string, emitter: EventEmitter): this; + push(data: any): boolean; +} + +export class Flow { + constructor(baseFlow?: Flow); + consume(topic: string | ReadonlyArray, callback: ConsumerCallback): this; + consume(topic: string): Promise; + consume( + topics: ReadonlyArray + ): Promise<{ + [key: string]: string; + }>; + consumeStream( + topic: string, + callback: (stream: ReadableStream) => void + ): this; + consumeStream(topic: string): ReadableStream; + getReader( + topic: string + ): { + next(): Promise; + }; + define(topics: string | ReadonlyArray): StageContext; + define( + topic: string, + data: Promise | DefinitionFunction | object | Primitive + ): this; + catch(callback: (err: any) => void): this; + timeout(topics: string | ReadonlyArray, ms: number): this; + state(): State; +} + +export class Action extends Flow { + constructor(); + activate(): this; + execute(): void; + add(...child: AddableToAction[]): this; +} + +export class FunctionAction extends Action { + constructor(callback: (runtime: FunctionAction) => any); + execute(): any; +} diff --git a/types/oja/oja-tests.ts b/types/oja/oja-tests.ts new file mode 100644 index 0000000000..9ee12587af --- /dev/null +++ b/types/oja/oja-tests.ts @@ -0,0 +1,278 @@ +import { Action, Flow, StageContext } from "oja"; + +new Action().activate(); + +class MyAction extends Action { + execute() { + this.define('foo', 'bar'); + } +} + +new MyAction() + .activate() + .consume('foo', data => console.log(data)); + +class Greet extends Action { + execute() { + this.define('greet', 'Hello'); + } +} + +// demonstrate generic function instead of action object +function who(flow: Flow) { + // demonstrate re-mapping + flow.consume('name', name => { + flow.define('who', name); + }); +} + +class Greeting extends Action { + execute() { + this.consume(['greet', 'who'], data => { + this.define('greeting', `${data.greet} ${data.who}`); + }); + } +} + +const helloAction = new Greeting(); +helloAction + .add(new Greet()) + .add(who) + .activate() + .define('name', 'World') + .consume('greeting', console.log); // prints Hello World + +// create consumer component +const flow = new Flow(); +const consumer = flow.consume('foo'); +consumer.then(foo => { + console.log(foo); // prints 'bar' +}); + +// define producer component +const producer = flow.define('foo'); +// publish +producer.pub('bar'); + +flow + .consume('foo', foo => { + console.log(foo); // prints 'bar' + }) + .define('foo', 'bar'); + +// Consuming multiple events for the given topic +// create consumer component +flow + .consume('foo', foo => { + console.log(foo); // prints 'bar1' and 'bar2' + }) + // generate events + .define('foo', 'bar1') + .define('foo', 'bar2'); + +// Consuming events as a stream +const buffer: any[] = []; +// create consumer stream +const stream = flow.consumeStream('foo'); +stream.on('data', data => buffer.push(data)); +stream.on('end', () => { + console.log(buffer); // prints one, two, three +}); +// generate some data +flow.define('foo', 'one'); +flow.define('foo', 'two'); +flow.define('foo', 'three'); +flow.define('foo', null); + +// create consumer stream +const reader = flow.getReader('foo'); +// generate some data +flow.define('foo', 'one'); +flow.define('foo', 'two'); +flow.define('foo', 'three'); +flow.define('foo', null); + +async function read() { + while (true) { + const data = await reader.next(); + if (data === undefined) { + break; + } + console.log(data); + } +} + +read(); + +// Consuming multiple topics in one short +// consume multiple topics +flow.consume(['foo', 'qoo'], input => { + console.log(input.foo); // prints faa + console.log(input.qoo); // prints qaa +}); +flow.define('foo', 'faa'); +flow.define('qoo', 'qaa'); + +// Using promise +// create consumer component +flow + .consume('foo', foo => { + console.log(foo); // prints 'bar' + }) + .define('foo', new Promise(resolve => { + resolve('bar'); + })); + +// Multiple consumers, single producer +// create consumer component +flow + .consume('foo', foo => { + console.log(foo); // prints 'bar' + }) + .consume('foo', foo => { + console.log(foo); // prints 'bar' + }) + .define('foo', 'bar'); + +// NOTE: the order of consume/define does not matter +// create consumer component +flow + .consume('foo', (foo, runtime) => { + console.log(foo); // prints 'faa' + runtime.define('qoo', 'qaa'); // can consume and produce new data + }) + .consume('qoo', (qoo, runtime) => { + console.log(qoo); // prints 'qaa' + runtime.define('woo', Promise.resolve('waa')); // can use async promise + }) + // start chain reaction here + .define('foo', 'faa') + // lets produce multiple events via event emitter + .consume('woo', (woo, runtime) => { + console.log(woo); // prints waa + // define as event emitter + const roo = runtime.define('roo'); + // simulate async flow with two event emitted + setImmediate(() => { + // generate multiple events + roo.pub('raa1'); + roo.pub('raa2'); + }); + }) + // validate + .consume('roo', roo => { + console.log(roo); // prints raa1 and raa2 + }) + // consume multiple topics + .consume(['foo', 'qoo'], input => { + console.log(input.foo); // prints faa + console.log(input.qoo); // prints qaa + }) + // can consume inside consume + .consume('foo', (foo, runtime) => { + console.log(foo); // prints faa + runtime.consume('qoo', qoo => { + console.log(qoo); // prints qaa + }); + // or + flow.consume('qoo', qoo => { + console.log(qoo); // prints qaa + }); + }) + // can generate multiple events using pub + .define('doo', (publisher: StageContext) => { + publisher.pub('daa1'); + publisher.pub('daa2'); + publisher.pub('daa3'); + publisher.pub(null); + }) + .consume('doo', doo => { + console.log(doo); // prints daa1, daa2, daa3, null + }) + .consumeStream('doo', stream => { + stream.on('data', console.log); // prints daa1, daa2, daa3 + stream.on('end', () => console.log('end of "doo"')); + }) + // NOTE: we can consume first event via promise if we are not interested in the rest + .consume('doo').then(doo => { + console.log(doo); // prints daa1 +}); + +// for debug you can listen to all events +flow.consume('*', evt => { + console.log(`Event type: ${evt.name}, data: ${evt.data}`); +}); + +// Join flows together +const base = new Flow(); +base.define('foo', 'bar'); +let subFlow = new Flow(base); +subFlow.consume('foo', foo => { + console.log(foo); // prints bar +}); + +base.consume('shared', (_, rt) => { + rt.define('foo', 'bar'); +}); +subFlow = new Flow(base); +flow.consume('foo', foo => { + console.log(foo); // prints bar +}); +flow.define('shared', ''); // trigger the chain + +// Timeouts +flow + .timeout(['foo', 'bar'], 300) // 300 ms + .define('bar', 'boo') + .catch(err => { + console.log(err.message); // prints "Topic/s (foo) timed out, pending topics (too)" + }); + +// Querying for state +console.log(flow.state()); // prints [foo, too] + +// Throwing error +flow.define('error', new Error('Boom')); +// or +flow.define('error', Promise.reject(new Error('Boom'))); +// or +flow.define('data', () => { + return new Error('Boom'); +}); +// or +flow.define('data', (runtime: StageContext) => { + runtime.pub(new Error('Boom')); +}); + +// Catching error +flow.catch(err => { + console.log(err); // prints Boom if linked to the above flow +}); +// Or +flow.consume('error', err => { + console.log(err); // prints Boom if linked to the above flow +}); + +// Error stops flow +flow + .define('foo', 'faa') + .define('boo', 'baa') + .define('error', new Error('Boom')) + .define('too', 'taa') + .consume('foo', foo => { + console.log(foo); // prints faa + }) + .consume('boo', foo => { + console.log(foo); // prints baa + }) + .consume('too', too => { + // will never happen + throw new Error('Should never happen'); + }) + .catch(err => { // catch error + console.log(err); // print Boom + }); + +// Composing complex flows +const baseFlow = new Flow(); +new Flow(baseFlow); diff --git a/types/delay/tsconfig.json b/types/oja/tsconfig.json similarity index 94% rename from types/delay/tsconfig.json rename to types/oja/tsconfig.json index cb0da53652..6fac615aaa 100644 --- a/types/delay/tsconfig.json +++ b/types/oja/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "delay-tests.ts" + "oja-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/oja/tslint.json b/types/oja/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/oja/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/p-cancelable/index.d.ts b/types/p-cancelable/index.d.ts index 4f26cd17ca..775400bca8 100644 --- a/types/p-cancelable/index.d.ts +++ b/types/p-cancelable/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for p-cancelable 0.3 +// Type definitions for p-cancelable 0.5 // Project: https://github.com/sindresorhus/p-cancelable#readme // Definitions by: BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -11,20 +11,21 @@ interface PCancelableConstructor extends PromiseConstructor { readonly prototype: PCancelable.PCancelable; readonly CancelError: PCancelable.CancelErrorConstructor; fn(wrapper: (onCancel: (fn?: () => void) => void, input: T) => PromiseLike): (input: T) => PCancelable.PCancelable; - new(executor: (onCancel: (fn?: () => void) => void, resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): PCancelable.PCancelable; + new(executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void, onCancel: (fn?: () => void) => void) => void): PCancelable.PCancelable; } declare namespace PCancelable { interface PCancelable extends Promise { - readonly canceled: boolean; - cancel(): void; + readonly isCanceled: boolean; + cancel(reason?: string): void; } interface CancelErrorConstructor extends ErrorConstructor { - new (): CancelError; + new (reason?: string): CancelError; } interface CancelError extends Error { readonly name: 'CancelError'; + readonly isCanceled: boolean; } } diff --git a/types/p-cancelable/p-cancelable-tests.ts b/types/p-cancelable/p-cancelable-tests.ts index ca5f728e18..8bd3790e08 100644 --- a/types/p-cancelable/p-cancelable-tests.ts +++ b/types/p-cancelable/p-cancelable-tests.ts @@ -3,7 +3,7 @@ import PCancelableCtor = require('p-cancelable'); import { EventEmitter } from "events"; -const cancelablePromise: PCancelableCtor.PCancelable<{}> = new PCancelableCtor((onCancel, resolve, reject) => { +const cancelablePromise: PCancelableCtor.PCancelable<{}> = new PCancelableCtor((resolve, reject, onCancel) => { class Worker extends EventEmitter { close() { } @@ -24,7 +24,7 @@ cancelablePromise console.log('Operation finished successfully:', value); }) .catch(reason => { - if (cancelablePromise.canceled) { + if (cancelablePromise.isCanceled) { // Handle the cancelation here console.log('Operation was canceled'); return; @@ -56,7 +56,7 @@ const fn = PCancelableCtor.fn((onCancel: (fn?: () => void) => void, input: strin const promise = fn('input'); let num: number; promise.then(innum => num = innum); -if (!promise.canceled) { +if (!promise.isCanceled) { promise.cancel(); } diff --git a/types/p-progress/index.d.ts b/types/p-progress/index.d.ts new file mode 100644 index 0000000000..8eb745683c --- /dev/null +++ b/types/p-progress/index.d.ts @@ -0,0 +1,175 @@ +// Type definitions for p-progress 0.2 +// Project: https://github.com/sindresorhus/p-progress#readme +// Definitions by: icopp +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +declare namespace pProgress { + interface Options { + /** + * Number of concurrently pending promises. + * + * To run the promises in series, set it to 1. + * + * When this option is set, the first argument must be an array of + * promise-returning functions. + * + * Minimum 1. + * + * @default {Infinity} + */ + concurrency?: number; + } +} + +type PromiseFactory = () => Promise | PromiseLike; + +declare class PProgress extends Promise { + /** + * The current progress percentage of the promise as a number between 0 and + * 1. + */ + progress: number; + + /** + * Convenience method to run multiple promises and get a total progress of + * all of them. It counts normal promises with progress `0` when pending and + * progress `1` when resolved. For PProgress type promises, it listens to + * their onProgress() method for more fine grained progress reporting. You + * can mix and match normal promises and PProgress promises. + * + * @param promises Array of promises or promise-returning functions. + * @throws {TypeError} + */ + static all( + promises: [ + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory + ], + options?: pProgress.Options + ): PProgress<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + static all( + promises: [ + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory + ], + options?: pProgress.Options + ): PProgress<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; + static all( + promises: [ + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory + ], + options?: pProgress.Options + ): PProgress<[T1, T2, T3, T4, T5, T6, T7, T8]>; + static all( + promises: [ + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory + ], + options?: pProgress.Options + ): PProgress<[T1, T2, T3, T4, T5, T6, T7]>; + static all( + promises: [ + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory + ], + options?: pProgress.Options + ): PProgress<[T1, T2, T3, T4, T5, T6]>; + static all( + promises: [ + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory + ], + options?: pProgress.Options + ): PProgress<[T1, T2, T3, T4, T5]>; + static all( + promises: [ + PromiseFactory, + PromiseFactory, + PromiseFactory, + PromiseFactory + ], + options?: pProgress.Options + ): PProgress<[T1, T2, T3, T4]>; + static all( + promises: [PromiseFactory, PromiseFactory, PromiseFactory], + options?: pProgress.Options + ): PProgress<[T1, T2, T3]>; + static all( + promises: [PromiseFactory, PromiseFactory], + options?: pProgress.Options + ): PProgress<[T1, T2]>; + static all( + promises: [PromiseFactory], + options?: pProgress.Options + ): PProgress<[T1]>; + static all( + promises: Array>, + options?: pProgress.Options + ): PProgress; + + /** + * Same as the Promise constructor, but with an appended `progress` + * parameter in `executor`. + * + * @param progress + * Call this with progress updates. It expects a number between 0 and 1. + * + * Multiple calls with the same number will result in only one + * `onProgress()` event. + * + * Progress percentage `1` is reported for you when the promise resolves. + * If you set it yourself, it will simply be ignored. + */ + constructor( + executor: ( + resolve: (value?: T | PromiseLike) => void, + reject: (reason?: any) => void, + progress: (progress: number) => void + ) => void + ); + + /** + * Accepts a function that gets `instance.progress` as an argument and is + * called for every progress event. + * + * @throws {TypeError} + */ + onProgress(cb: (progress: number) => void): void; +} + +export = PProgress; diff --git a/types/p-progress/p-progress-tests.ts b/types/p-progress/p-progress-tests.ts new file mode 100644 index 0000000000..eb70dec355 --- /dev/null +++ b/types/p-progress/p-progress-tests.ts @@ -0,0 +1,31 @@ +import PProgress = require("p-progress"); + +new PProgress(async (resolve, reject, progress) => { + try { + await Promise.resolve("sindresorhus.com"); + progress(0.5); + + await Promise.resolve("ava.li"); + progress(1); + + resolve(); + } catch (e) { + reject(e); + } +}).onProgress(progress => { + progress; +}); + +PProgress.all( + [ + () => Promise.resolve("sindresorhus.com"), + () => Promise.resolve("ava.li"), + () => Promise.resolve(), + () => Promise.resolve(1) + ], + { concurrency: 2 } +).then(result => { + const str: string = result[0]; + const str2: string = result[1]; + const num: number = result[3]; +}); diff --git a/types/p-progress/tsconfig.json b/types/p-progress/tsconfig.json new file mode 100644 index 0000000000..1cd7ff1976 --- /dev/null +++ b/types/p-progress/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", + "p-progress-tests.ts" + ] +} diff --git a/types/p-progress/tslint.json b/types/p-progress/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/p-progress/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/page/index.d.ts b/types/page/index.d.ts index ef56afdc9b..afd42e0f43 100644 --- a/types/page/index.d.ts +++ b/types/page/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for page v1.5.0 +// Type definitions for page v1.8.6 // Project: http://visionmedia.github.io/page.js/ // Definitions by: Alan Norbauer // James Garbutt @@ -285,8 +285,8 @@ declare namespace PageJS { } declare module "page" { - var page: PageJS.Static; - export = page; + const page: PageJS.Static; + export default page; } declare var page: PageJS.Static; diff --git a/types/page/page-tests.ts b/types/page/page-tests.ts index 5d5b421d7e..cf22ecfc64 100644 --- a/types/page/page-tests.ts +++ b/types/page/page-tests.ts @@ -1,6 +1,4 @@ - - -import page = require("page"); +import page from 'page'; //*********************************************************************** // Basic Example diff --git a/types/papaparse/index.d.ts b/types/papaparse/index.d.ts index bbd75e9e61..de820c771f 100644 --- a/types/papaparse/index.d.ts +++ b/types/papaparse/index.d.ts @@ -6,6 +6,7 @@ // John Reilly // Alberto Restifo // Behind The Math +// 3af // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -93,6 +94,7 @@ export interface ParseConfig { newline?: string; // default: "\r\n" quoteChar?: string; // default: '"' header?: boolean; // default: false + trimHeaders?: boolean; // default: false dynamicTyping?: boolean; // default: false preview?: number; // default: 0 encoding?: string; // default: "" @@ -109,6 +111,7 @@ export interface ParseConfig { error?(error: ParseError, file?: File): void; // default: undefined chunk?(results: ParseResult, parser: Parser): void; // default: undefined beforeFirstChunk?(chunk: string): string | void; // default: undefined + transform?(value: string, field: string | number): any; // default: undefined } export interface UnparseConfig { @@ -138,6 +141,7 @@ export interface ParseMeta { aborted: boolean; // Whether process was aborted fields: Array; // Array of field names truncated: boolean; // Whether preview consumed all input + cursor: number; } /** diff --git a/types/papaparse/papaparse-tests.ts b/types/papaparse/papaparse-tests.ts index 5edcf9a251..5db22091ca 100644 --- a/types/papaparse/papaparse-tests.ts +++ b/types/papaparse/papaparse-tests.ts @@ -20,6 +20,7 @@ res.errors[0].code; Papa.parse("3,3,3", { delimiter: ';', comments: false, + trimHeaders: false, step: function (results, p) { p.abort(); @@ -30,6 +31,9 @@ Papa.parse("3,3,3", { var file = new File(null, null, null); Papa.parse(file, { + transform: function(value, field) { + + }, complete: function (a, b) { a.meta.fields; b.name; diff --git a/types/passport-cognito/index.d.ts b/types/passport-cognito/index.d.ts new file mode 100644 index 0000000000..d9dcbe38db --- /dev/null +++ b/types/passport-cognito/index.d.ts @@ -0,0 +1,29 @@ +// Type definitions for passport-cognito 0.1 +// Project: https://github.com/kndt84/passport-cognito +// Definitions by: Maksym Butsykin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import passport = require('passport'); +import express = require('express'); + +export interface CognitoStrategyOptions { + userPoolId: string; + clientId: string; + region: string; +} + +export type CognitoVerifyFunction = ( + accessToken: string, + idToken: string, + refreshToken: string, + user: object, + done: (error: any, user?: any) => void, +) => any; + +export class Strategy extends passport.Strategy { + constructor(options: CognitoStrategyOptions, verify: CognitoVerifyFunction); + + name: string; + authenticate(req: express.Request, options?: object): void; +} diff --git a/types/passport-cognito/passport-cognito-tests.ts b/types/passport-cognito/passport-cognito-tests.ts new file mode 100644 index 0000000000..02c80e8734 --- /dev/null +++ b/types/passport-cognito/passport-cognito-tests.ts @@ -0,0 +1,23 @@ +/** + * Created by Maksym Butsykin + */ + +import passport = require("passport"); +import cognito = require("passport-cognito"); + +passport.use( + new cognito.Strategy( + { + clientId: "clientId", + region: "region", + userPoolId: "userPoolId" + }, + ( + accessToken: string, + idToken: string, + refreshToken: string, + user: object, + cb: (err: Error | null, user?: object | false) => void + ) => {} + ) +); diff --git a/types/passport-cognito/tsconfig.json b/types/passport-cognito/tsconfig.json new file mode 100644 index 0000000000..eedb7f9a0f --- /dev/null +++ b/types/passport-cognito/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "passport-cognito-tests.ts" + ] +} diff --git a/types/passport-cognito/tslint.json b/types/passport-cognito/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/passport-cognito/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/pbkdf2/index.d.ts b/types/pbkdf2/index.d.ts new file mode 100644 index 0000000000..80e3678dc6 --- /dev/null +++ b/types/pbkdf2/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for pbkdf2 3.0 +// Project: https://github.com/crypto-browserify/pbkdf2 +// Definitions by: Timon Engelke +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + +export function pbkdf2(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, callback: (err: Error, derivedKey: Buffer) => void): void; +export function pbkdf2(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string, callback: (err: Error, derivedKey: Buffer) => void): void; +export function pbkdf2Sync(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest?: string): Buffer; diff --git a/types/pbkdf2/pbkdf2-tests.ts b/types/pbkdf2/pbkdf2-tests.ts new file mode 100644 index 0000000000..cf1a30c4bb --- /dev/null +++ b/types/pbkdf2/pbkdf2-tests.ts @@ -0,0 +1,6 @@ +import * as pbkdf2 from "pbkdf2"; + +pbkdf2.pbkdf2("password", "salt", 1000, 32, "sha1", (err, derivedKey) => {}); // $ExpectType void +pbkdf2.pbkdf2("password", "salt", 1000, 32, (err, derivedKey) => {}); // $ExpectType void +pbkdf2.pbkdf2Sync("password", "salt", 1000, 32, "sha1"); // $ExpectType Buffer +pbkdf2.pbkdf2Sync("password", "salt", 1000, 32); // $ExpectType Buffer diff --git a/types/pbkdf2/tsconfig.json b/types/pbkdf2/tsconfig.json new file mode 100644 index 0000000000..955d8232ec --- /dev/null +++ b/types/pbkdf2/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", + "pbkdf2-tests.ts" + ] +} diff --git a/types/pbkdf2/tslint.json b/types/pbkdf2/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pbkdf2/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/pg-large-object/index.d.ts b/types/pg-large-object/index.d.ts new file mode 100644 index 0000000000..64a450d545 --- /dev/null +++ b/types/pg-large-object/index.d.ts @@ -0,0 +1,59 @@ +// Type definitions for pg-large-object 2.0 +// Project: https://github.com/Joris-van-der-Wel/node-pg-large-object#readme +// Definitions by: Mateusz Krupa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +import stream = require("stream"); +import pg = require("pg"); + +export class LargeObject { + static readonly SEEK_SET: number; + static readonly SEEK_CUR: number; + static readonly SEEK_END: number; + constructor(query: any, oid: number, fd: any); + close(callback: (error: Error) => void): void; + closeAsync(): Promise; + read(length: number, callback: (error: Error, data: Buffer) => void): void; + readAsync(length: number): Promise; + write(buffer: Buffer, callback?: (error: Error) => void): void; + writeAsync(buffer: Buffer): Promise; + seek(position: number, ref: number, callback?: (error: Error, position: number) => void): void; + seekAsync(position: number, ref: number): Promise; + tell(callback: (error: Error, position: number) => void): void; + tellAsync(): Promise; + size(callback: (error: Error, size: number) => void): void; + sizeAsync(): Promise; + truncate(length: number, callback?: (error: Error) => void): void; + truncateAsync(length: number): Promise; + getReadableStream(bufferSize?: number): ReadStream; + getWritableStream(bufferSize?: number): WriteStream; +} + +export interface LargeObjectManagerSettings { + pg?: pg.Client; + pgPromise?: object; // module: pg-promise/Task +} + +export class LargeObjectManager { + static readonly WRITE: number; + static readonly READ: number; + static readonly READWRITE: number; + constructor(options: LargeObjectManagerSettings|object); + open(oid: number, mode: number, callback: (error: Error, result: LargeObject) => void): void; + openAsync(oid: number, mode: number): Promise; + create(callback: (error: Error, oid: number) => void): void; + createAsync(): Promise; + openAndReadableStream(oid: number, bufferSize: number, callback: (error: Error, size: number, stream: ReadStream) => void): void; + openAndReadableStreamAsync(oid: number, bufferSize?: number): Promise<[number, ReadStream]>; + createAndWritableStream(bufferSize?: number, callback?: (error: Error, oid: number, stream: WriteStream) => void): void; + createAndWritableStreamAsync(bufferSize?: number): Promise<[number, WriteStream]>; + unlink(oid: number, callback?: (error: Error) => void): void; + unlinkAsync(oid: number): Promise; +} + +export class ReadStream extends stream.Readable {} + +export class WriteStream extends stream.Writable {} diff --git a/types/pg-large-object/pg-large-object-tests.ts b/types/pg-large-object/pg-large-object-tests.ts new file mode 100644 index 0000000000..42a939572b --- /dev/null +++ b/types/pg-large-object/pg-large-object-tests.ts @@ -0,0 +1,56 @@ +import { + LargeObject, + LargeObjectManager, + LargeObjectManagerSettings, + ReadStream, + WriteStream +} from "pg-large-object"; +import { Buffer } from "buffer"; +import pg = require("pg"); + +const buffer = new Buffer(""); +const bufferSize = 16384; +const length = 16384; +const oid = 1; +const seekSetConst = LargeObject.SEEK_SET; // $ExpectType number +const seekCurConst = LargeObject.SEEK_CUR; // $ExpectType number +const seekEndConst = LargeObject.SEEK_END; // $ExpectType number + +const lo = new LargeObject({}, oid, {}); +lo.close((error: Error) => {}); // $ExpectType void +lo.closeAsync(); // $ExpectType Promise +lo.read(length, (error: Error, data: Buffer) => {}); // $ExpectType void +lo.readAsync(length); // $ExpectType Promise +lo.write(buffer, (error: Error) => {}); // $ExpectType void +lo.writeAsync(buffer); // $ExpectType Promise +lo.seek(0, LargeObject.SEEK_CUR, (error: Error, position: number) => {}); // $ExpectType void +lo.seekAsync(0, LargeObject.SEEK_CUR); // $ExpectType Promise +lo.tell((error: Error, position: number) => {}); // $ExpectType void +lo.tellAsync(); // $ExpectType Promise +lo.size((error: Error, size: number) => {}); // $ExpectType void +lo.sizeAsync(); //// $ExpectType Promise +lo.truncate(length, (error: Error) => {}); // $ExpectType void +lo.truncateAsync(length); // $ExpectType Promise +lo.getReadableStream(bufferSize); // $ExpectType ReadStream +lo.getWritableStream(bufferSize); // $ExpectType WriteStream + +const writeConst = LargeObjectManager.WRITE; // $ExpectType number +const readConst = LargeObjectManager.READ; // $ExpectType number +const readWriteConst = LargeObjectManager.READWRITE; // $ExpectType number +const config: LargeObjectManagerSettings = { + pg: new pg.Client(), + pgPromise: {} +}; + +const lom = new LargeObjectManager(config); +lom.open(oid, LargeObjectManager.READWRITE, (error: Error, result: LargeObject) => {}); // $ExpectType void +lom.openAsync(oid, LargeObjectManager.READWRITE); // $ExpectType Promise +lom.create((error: Error, oid: number) => {}); // $ExpectType void +lom.createAsync(); // $ExpectType Promise +lom.unlink(oid, (error: Error) => {}); // $ExpectType void +lom.unlinkAsync(oid); // $ExpectType Promise +lom.openAndReadableStream(oid, bufferSize, (error: Error, size: number, stream: ReadStream) => {}); // $ExpectType void +lom.openAndReadableStreamAsync(oid, bufferSize); // $ExpectType Promise<[number, ReadStream]> +lom.createAndWritableStream(bufferSize, (error: Error, oid: number, stream: WriteStream) => {}); // $ExpectType void +lom.createAndWritableStreamAsync(bufferSize); // $ExpectType Promise<[number, WriteStream]> +lom.unlinkAsync(oid); // $ExpectType Promise diff --git a/types/pg-large-object/tsconfig.json b/types/pg-large-object/tsconfig.json new file mode 100644 index 0000000000..6a23534d14 --- /dev/null +++ b/types/pg-large-object/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", + "pg-large-object-tests.ts" + ] +} diff --git a/types/pg-large-object/tslint.json b/types/pg-large-object/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pg-large-object/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/pidusage/index.d.ts b/types/pidusage/index.d.ts index fbe98309b7..b16dada0ef 100644 --- a/types/pidusage/index.d.ts +++ b/types/pidusage/index.d.ts @@ -1,12 +1,50 @@ -// Type definitions for pidusage 1.1 +// Type definitions for pidusage 2.0 // Project: https://github.com/soyuka/pidusage // Definitions by: Cyril Schumacher +// wujingtao // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +declare function pidusage(pid: number | string, callback: (err: Error | null, stats: Stat) => void): void; +declare function pidusage(pids: Array, callback: (err: Error | null, stats: { [key: string]: Stat }) => void): void; +declare function pidusage(pid: number | string): Promise; +declare function pidusage(pids: Array): Promise<{ [key: string]: Stat }>; + +export default pidusage; export interface Stat { - cpu: number; - memory: number; -} + /** + * percentage (from 0 to 100*vcore) + */ + cpu: number; -export function stat(pid: number, callback: (error: Error, stat: Stat) => void): void; -export function unmonitor(pid: number): void; + /** + * bytes + */ + memory: number; + + /** + * PPID + */ + ppid: number; + + /** + * PID + */ + pid: number; + + /** + * ms user + system time + */ + ctime: number; + + /** + * ms since the start of the process + */ + elapsed: number; + + /** + * ms since epoch + */ + timestamp: number; + } diff --git a/types/pidusage/pidusage-tests.ts b/types/pidusage/pidusage-tests.ts index b1d16cbc16..614569dfa3 100644 --- a/types/pidusage/pidusage-tests.ts +++ b/types/pidusage/pidusage-tests.ts @@ -1,8 +1,38 @@ -import pusage = require("pidusage"); +import pidusage, { Stat } from 'pidusage'; -pusage.stat(0, (err: Error, stat: pusage.Stat) => { - const cpu = stat.cpu; - const memory = stat.memory; +let cpu: number; +let memory: number; +let ppid: number; +let pid: number; +let ctime: number; +let elapsed: number; +let timestamp: number; + +pidusage(1, (err: Error | null, stats: Stat) => { + cpu = stats.cpu; + memory = stats.memory; + ppid = stats.ppid; + pid = stats.pid; + ctime = stats.ctime; + elapsed = stats.elapsed; + timestamp = stats.timestamp; }); -pusage.unmonitor(0); +pidusage('two', (err: Error | null, stats: Stat) => { + cpu = stats.cpu; + memory = stats.memory; + ppid = stats.ppid; + pid = stats.pid; + ctime = stats.ctime; + elapsed = stats.elapsed; + timestamp = stats.timestamp; +}); + +pidusage([1, 'two'], (err: Error | null, stats: { [key: string]: Stat }) => { + const one: Stat = stats[1]; + const two: Stat = stats.two; +}); + +const stats_1: Promise = pidusage(1); +const stats_two: Promise = pidusage('two'); +const stats_obj: Promise<{ [key: string]: Stat }> = pidusage([1, 'two']); diff --git a/types/plotly.js/index.d.ts b/types/plotly.js/index.d.ts index 7bdf862ea2..fa312dbb0f 100644 --- a/types/plotly.js/index.d.ts +++ b/types/plotly.js/index.d.ts @@ -9,6 +9,7 @@ // Drew Diamantoukos // Sooraj Pudiyadath // Jon Freedman +// Megan Riel-Mehan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -29,7 +30,7 @@ export interface Point { export interface PlotScatterDataPoint { curveNumber: number; - data: ScatterData; + data: PlotData; pointIndex: number; pointNumber: number; x: number; @@ -49,8 +50,17 @@ export interface PlotCoordinate { pointNumber: number; } +export interface SelectionRange { + x: number[]; + y: number[]; +} + +export type PlotSelectedData = Partial; + export interface PlotSelectionEvent { - points: PlotCoordinate[]; + points: PlotScatterDataPoint[]; + range?: SelectionRange; + lassoPoints?: SelectionRange; } export type PlotRestyleEvent = [ @@ -141,10 +151,10 @@ export interface PlotlyHTMLElement extends HTMLElement { on(event: 'plotly_sliderend', callback: (event: SliderEndEvent) => void): void; on(event: 'plotly_sliderstart', callback: (event: SliderStartEvent) => void): void; on(event: 'plotly_event', callback: (data: any) => void): void; - on(event: 'plotly_beforeplot' , callback: (event: BeforePlotEvent) => boolean): void; + on(event: 'plotly_beforeplot', callback: (event: BeforePlotEvent) => boolean): void; on(event: 'plotly_afterexport' | 'plotly_afterplot' | 'plotly_animated' | 'plotly_animationinterrupted' | 'plotly_autosize' | 'plotly_beforeexport' | 'plotly_deselect' | 'plotly_doubleclick' | 'plotly_framework' | 'plotly_redraw' | - 'plotly_transitioning' | 'plotly_transitioninterrupted' , callback: () => void): void; + 'plotly_transitioning' | 'plotly_transitioninterrupted', callback: () => void): void; } export interface ToImgopts { @@ -192,6 +202,14 @@ export interface Layout { separators: string; hidesources: boolean; xaxis: Partial; + xaxis2: Partial; + xaxis3: Partial; + xaxis4: Partial; + xaxis5: Partial; + xaxis6: Partial; + xaxis7: Partial; + xaxis8: Partial; + xaxis9: Partial; yaxis: Partial; yaxis2: Partial; yaxis3: Partial; @@ -418,12 +436,13 @@ export type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int export type Dash = 'solid' | 'dot' | 'dash' | 'longdash' | 'dashdot' | 'longdashdot'; -export type Data = Partial; +export type Data = Partial; export type Color = string | Array | Array>; - +export type DataTransform = Partial; +export type ScatterData = PlotData; // Bar Scatter -export interface ScatterData { - type: 'bar' | 'pointcloud' | 'scatter' | 'scattergl' | 'scatter3d' |'surface'; +export interface PlotData { + type: 'bar' | 'histogram' | 'pointcloud' | 'scatter' | 'scattergl' | 'scatter3d' | 'surface'; x: Datum[] | Datum[][] | TypedArray; y: Datum[] | Datum[][] | TypedArray; z: Datum[] | Datum[][] | Datum[][][] | TypedArray; @@ -438,7 +457,7 @@ export interface ScatterData { 'line.shape': 'linear' | 'spline' | 'hv' | 'vh' | 'hvh' | 'vhv'; 'line.smoothing': number; 'line.simplify': boolean; - marker: Partial; + marker: Partial; 'marker.symbol': string | string[]; // Drawing.symbolList 'marker.color': Color; 'marker.opacity': number | number[]; @@ -454,15 +473,15 @@ export interface ScatterData { mode: 'lines' | 'markers' | 'text' | 'lines+markers' | 'text+markers' | 'text+lines' | 'text+lines+markers' | 'none'; hoveron: 'points' | 'fills'; hoverinfo: 'all' | 'name' | 'none' | 'skip' | 'text' | - 'x' | 'x+text' | 'x+name' | - 'x+y' | 'x+y+text' | 'x+y+name' | - 'x+y+z' | 'x+y+z+text' | 'x+y+z+name' | - 'y+x' | 'y+x+text' | 'y+x+name' | - 'y+z' | 'y+z+text' | 'y+z+name' | - 'y+x+z' | 'y+x+z+text' | 'y+x+z+name' | - 'z+x' | 'z+x+text' | 'z+x+name' | - 'z+y+x' | 'z+y+x+text' | 'z+y+x+name' | - 'z+x+y' | 'z+x+y+text' | 'z+x+y+name'; + 'x' | 'x+text' | 'x+name' | + 'x+y' | 'x+y+text' | 'x+y+name' | + 'x+y+z' | 'x+y+z+text' | 'x+y+z+name' | + 'y+x' | 'y+x+text' | 'y+x+name' | + 'y+z' | 'y+z+text' | 'y+z+name' | + 'y+x+z' | 'y+x+z+text' | 'y+x+z+name' | + 'z+x' | 'z+x+text' | 'z+x+name' | + 'z+y+x' | 'z+y+x+text' | 'z+y+x+name' | + 'z+x+y' | 'z+x+y+text' | 'z+x+y+name'; hoverlabel: Partial